Skip to content

Commit

Permalink
Fix center parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenDeDauw committed Dec 23, 2019
1 parent 5e3fcf3 commit eeed585
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ different releases and which versions of PHP and MediaWiki they support, see the
## Maps 7.15.1

* Fixed `geojson` parameter in the Leaflet result format (7.12.0 regression)
* Fixed `center` parameter for Leaflet (7.12.0 regression)

## Maps 7.15.0

Expand Down
11 changes: 6 additions & 5 deletions resources/leaflet/jquery.leaflet.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,17 @@
};

this.centerAndZoomMap = function() {
this.map.fitWorld();
this.fitContent();

if (options.zoom !== false) {
this.map.setZoom(options.zoom);
this.map.setZoom(options.zoom, {animate: false});
}

if (options.centre !== false) {
this.map.setView(
new L.LatLng(options.centre.lat, options.centre.lon),
this.map.getZoom()
this.map.getZoom(),
{animate: false}
);
}
};
Expand All @@ -332,11 +332,12 @@
if (bounds.getNorthEast().equals(bounds.getSouthWest())) {
this.map.setView(
bounds.getCenter(),
options.defzoom
options.defzoom,
{animate: false}
);
}
else {
this.map.fitBounds(bounds);
this.map.fitBounds(bounds, {animate: false});
}
}
};
Expand Down

0 comments on commit eeed585

Please sign in to comment.