},
getUrl: function(marker) {
- var center = this.getCenter(),
- zoom = this.getZoom(),
- precision = zoomPrecision(zoom),
- params = {
- lat: center.lat.toFixed(precision),
- lon: center.lng.toFixed(precision),
- zoom: zoom,
- layers: this.getLayersCode()
- };
+ var precision = zoomPrecision(this.getZoom()),
+ params = {};
if (marker && this.hasLayer(marker)) {
params.mlat = marker.getLatLng().lat.toFixed(precision);
params.mlon = marker.getLatLng().lng.toFixed(precision);
}
- return 'http://' + OSM.SERVER_URL + '/?' + querystring.stringify(params);
+ var url = 'http://' + OSM.SERVER_URL + '/',
+ query = querystring.stringify(params),
+ hash = OSM.formatHash(this);
+
+ if (query) url += '?' + query;
+ if (hash) url += hash;
+
+ return url;
},
getShortUrl: function(marker) {
});
L.Icon.Default.imagePath = <%= "#{asset_prefix}/images".to_json %>;
+
+L.Hash.prototype.parseHash = OSM.parseHash;
+L.Hash.prototype.formatHash = OSM.formatHash;