1 $(document).ready(function() {
2 var params = OSM.params();
4 if (params.lat && params.lon) {
5 params.lat = parseFloat(params.lat);
6 params.lon = parseFloat(params.lon);
7 params.zoom = params.zoom || 17;
12 url += '?editor=' + params.editor;
15 url += OSM.formatHash(params);
17 $('.start-mapping').attr('href', url);
19 } else if (navigator.geolocation) {
20 function geoSuccess(position) {
21 window.location = '/edit' + OSM.formatHash({
23 lat: position.coords.latitude,
24 lon: position.coords.longitude
30 .removeClass('loading')
34 $('.start-mapping').on('click', function(e) {
40 // handle firefox's weird implementation
41 // https://bugzilla.mozilla.org/show_bug.cgi?id=675533
42 window.setTimeout(geoError, 4000);
44 navigator.geolocation.getCurrentPosition(geoSuccess, geoError);