fix incorrect calculation of scale by the scale control, closes #852
This commit is contained in:
parent
3773a30726
commit
e3b2b78558
2
dist/leaflet-src.js
vendored
2
dist/leaflet-src.js
vendored
@ -6716,7 +6716,7 @@ L.Control.Scale = L.Control.extend({
|
||||
_update: function () {
|
||||
var bounds = this._map.getBounds(),
|
||||
centerLat = bounds.getCenter().lat,
|
||||
halfWorldMeters = new L.LatLng(centerLat, 0).distanceTo(new L.LatLng(centerLat, 180)),
|
||||
halfWorldMeters = 6378137 * Math.PI * Math.cos(centerLat * Math.PI / 180),
|
||||
dist = halfWorldMeters * (bounds.getNorthEast().lng - bounds.getSouthWest().lng) / 180,
|
||||
|
||||
size = this._map.getSize(),
|
||||
|
2
dist/leaflet.js
vendored
2
dist/leaflet.js
vendored
File diff suppressed because one or more lines are too long
@ -38,7 +38,7 @@ L.Control.Scale = L.Control.extend({
|
||||
_update: function () {
|
||||
var bounds = this._map.getBounds(),
|
||||
centerLat = bounds.getCenter().lat,
|
||||
halfWorldMeters = new L.LatLng(centerLat, 0).distanceTo(new L.LatLng(centerLat, 180)),
|
||||
halfWorldMeters = 6378137 * Math.PI * Math.cos(centerLat * Math.PI / 180),
|
||||
dist = halfWorldMeters * (bounds.getNorthEast().lng - bounds.getSouthWest().lng) / 180,
|
||||
|
||||
size = this._map.getSize(),
|
||||
|
Loading…
Reference in New Issue
Block a user