//= require augment
//= require leaflet
//= require leaflet.osm
+//= require leaflet.zoom
//= require leaflet.extend
//= require leaflet.locationfilter
//= require i18n/translations
function getShortUrl(map) {
return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ?
- 'http://osm.org/go/' : '/go/') +
+ 'http://osm.org/go/' : 'http://' + window.location.hostname + '/go/') +
makeShortCode(map);
}
function getUrl(map) {
var center = map.getCenter(),
- zoom = map.getZoom();
+ zoom = map.getZoom(),
+ toZoom = zoomPrecision(zoom);
return (window.location.hostname.match(/^www\.openstreetmap\.org/i) ?
- 'http://openstreetmap.org/?' : '/?') +
+ 'http://openstreetmap.org/?' : 'http://' + window.location.hostname + '/?') +
querystring.stringify({
- lat: center.lat,
- lon: center.lng,
+ lat: toZoom(center.lat),
+ lon: toZoom(center.lng),
zoom: zoom,
layers: map.getLayersCode()
});