},
getUrl: function(marker) {
- var center = this.getCenter(),
- zoom = this.getZoom(),
- toZoom = zoomPrecision(zoom),
- params = {
- lat: toZoom(center.lat),
- lon: toZoom(center.lng),
- zoom: zoom,
- layers: this.getLayersCode()
- };
+ var precision = zoomPrecision(this.getZoom()),
+ params = { layers: this.getLayersCode() };
if (marker && this.hasLayer(marker)) {
- params.mlat = toZoom(marker.getLatLng().lat);
- params.mlon = toZoom(marker.getLatLng().lng);
+ params.mlat = marker.getLatLng().lat.toFixed(precision);
+ params.mlon = marker.getLatLng().lng.toFixed(precision);
}
- return 'http://' + OSM.SERVER_URL + '/?' + querystring.stringify(params);
+ return 'http://' + OSM.SERVER_URL + '/?' + querystring.stringify(params) +
+ OSM.formatHash({lat: this.getCenter().lat, lon: this.getCenter().lng, zoom: this.getZoom()});
},
getShortUrl: function(marker) {