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 var geoSuccess = function (position) {
20 window.location = "/edit" + OSM.formatHash({
22 lat: position.coords.latitude,
23 lon: position.coords.longitude
27 $(".start-mapping").on("click", function (e) {
29 $(".start-mapping").addClass("loading");
31 if (navigator.geolocation) {
32 // handle firefox's weird implementation
33 // https://bugzilla.mozilla.org/show_bug.cgi?id=675533
34 window.setTimeout(manualEdit, 4000);
36 navigator.geolocation.getCurrentPosition(geoSuccess, manualEdit);
43 function manualEdit() {
44 window.location = "/?edit_help=1";