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);
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) {
30 $('.start-mapping').addClass('loading');
32 // handle firefox's weird implementation
33 // https://bugzilla.mozilla.org/show_bug.cgi?id=675533
34 window.setTimeout(manualEdit, 4000);
36 if (navigator.geolocation) {
37 navigator.geolocation.getCurrentPosition(geoSuccess, manualEdit);
42 function manualEdit() {
43 window.location = '/?edit_help=1';