Replace getBounds() with property bounds, defaulting to normal lat/lng bounds

This commit is contained in:
Per Liedman 2013-11-29 14:23:03 +01:00 committed by Vladimir Agafonkin
parent f92dcb3be6
commit ad9449e7cf

View File

@ -34,16 +34,10 @@ L.CRS = {
return L.bounds(min, max);
},
getBounds: function () {
var proj = this.projection,
min = proj.unproject(proj.bounds.min),
max = proj.unproject(proj.bounds.max);
return L.latLngBounds(min, max);
},
bounds: L.latLngBounds([-90, -180], [90, 180]),
wrapLatLng: function (latlng) {
var bounds = this.getBounds(),
var bounds = this.bounds,
lng = this.wrapLng ? L.Util.wrapNum(latlng.lng, bounds.getWest(), bounds.getEast(), true) : latlng.lng,
lat = this.wrapLat ? L.Util.wrapNum(latlng.lat, bounds.getSouth(), bounds.getNorth(), true) : latlng.lat;