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 var geoSuccess = function (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 if (navigator.geolocation) {
33 // handle firefox's weird implementation
34 // https://bugzilla.mozilla.org/show_bug.cgi?id=675533
35 window.setTimeout(manualEdit, 4000);
37 navigator.geolocation.getCurrentPosition(geoSuccess, manualEdit);
44 function manualEdit() {
45 window.location = "/?edit_help=1";