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,
51 bbox.getWest(), bbox.getSouth(),
52 bbox.getEast(), bbox.getNorth(),
55 $("#object_larger_map, #object_edit").hide();
57 object = {type: params.type, id: params.id};
59 if (!params.visible) {
60 object.version = params.version - 1;
63 addObjectToMap(object, map, {
65 callback: function(extent) {
67 $("#browse_map .geolink").show();
70 $("a.bbox[data-editor=remote]").click(function () {
71 return remoteEditHandler(extent);
74 $("a.object[data-editor=remote]").click(function () {
75 return remoteEditHandler(extent, params.type + params.id);
78 $("#object_larger_map").show();
79 $("#object_edit").show();
81 updatelinks(map.getCenter(), 16, null, extent, object);
83 $("#small_map").hide();
89 createMenu("area_edit", "area_edit_menu", "right");
90 createMenu("object_edit", "object_edit_menu", "right");