1 $(document).ready(function () {
3 var map = L.map("small_map", {
4 attributionControl: false,
6 }).addLayer(new L.OSM.Mapnik());
11 var params = $("#small_map").data();
13 if (params.type == "changeset") {
14 bbox = L.latLngBounds([params.minlat, params.minlon],
15 [params.maxlat, params.maxlon]);
26 $("#browse_map .geolink").show();
28 $("a[data-editor=remote]").click(function () {
29 return remoteEditHandler(bbox);
32 updatelinks(map.getCenter(), 16, null, [[params.minlat, params.minlon],
33 [params.maxlat, params.maxlon]]);
34 } else if (params.type == "note") {
35 object = {type: params.type, id: params.id};
37 map.setView([params.lat, params.lon], 16);
39 L.marker([params.lat, params.lon], { icon: getUserIcon() }).addTo(map);
41 bbox = map.getBounds();
44 $("#browse_map .geolink").show();
46 $("a[data-editor=remote]").click(function () {
47 return remoteEditHandler(bbox);
50 updatelinks(params, 16, null, bbox, object);
52 $("#object_larger_map, #object_edit").hide();
54 object = {type: params.type, id: params.id};
56 if (!params.visible) {
57 object.version = params.version - 1;
60 addObjectToMap(object, map, {
62 callback: function(extent) {
64 $("#browse_map .geolink").show();
67 $("a.bbox[data-editor=remote]").click(function () {
68 return remoteEditHandler(extent);
71 $("a.object[data-editor=remote]").click(function () {
72 return remoteEditHandler(extent, params.type + params.id);
75 $("#object_larger_map").show();
76 $("#object_edit").show();
78 updatelinks(map.getCenter(), 16, null, extent, object);
80 $("#small_map").hide();
86 createMenu("area_edit", "area_edit_menu", "right");
87 createMenu("object_edit", "object_edit_menu", "right");