Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1412 from geoadmin/gjn_fix_parameters
Browse files Browse the repository at this point in the history
For emergency branch - PL: fix page failures by faulty Y,X,zoom parameter
  • Loading branch information
gjn committed May 9, 2014
2 parents b14c6d4 + 084f32a commit c9c09ca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/map/MapDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@
if (queryParams.Y !== undefined && queryParams.X !== undefined) {
var eastings = parseFloat(queryParams.Y.replace(/,/g, '.'));
var northings = parseFloat(queryParams.X.replace(/,/g, '.'));
view.setCenter([+eastings, +northings]);
if (isFinite(eastings) && isFinite(northings)) {
view.setCenter([eastings, northings]);
}
}
if (queryParams.zoom !== undefined) {
if (queryParams.zoom !== undefined &&
isFinite(queryParams.zoom)) {
view.setZoom(+queryParams.zoom);
}

Expand Down

0 comments on commit c9c09ca

Please sign in to comment.