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
28 $('.start-mapping').on('click', function(e) {
34 // handle firefox's weird implementation
35 // https://bugzilla.mozilla.org/show_bug.cgi?id=675533
36 window.setTimeout(manualEdit, 4000);
38 navigator.geolocation.getCurrentPosition(geoSuccess, manualEdit);
44 function manualEdit() {
45 window.location = '/?edit_help=1'