1 $(document).ready(function () {
3 var map = L.map("small_map", {
4 attributionControl: false,
6 }).addLayer(new L.OSM.Mapnik());
8 L.control.zoom({position: 'topright'})
11 $("#small_map").on("resized", function () {
15 var params = $("#small_map").data();
17 if (params.type == "changeset") {
18 bbox = L.latLngBounds([params.minlat, params.minlon],
19 [params.maxlat, params.maxlon]);
30 $("#browse_map .geolink").show();
32 $("a[data-editor=remote]").click(function () {
33 return remoteEditHandler(bbox);
36 updatelinks(map.getCenter(), 16, null, [[params.minlat, params.minlon],
37 [params.maxlat, params.maxlon]]);
38 } else if (params.type == "note") {
39 object = {type: params.type, id: params.id};
41 map.setView([params.lat, params.lon], 16);
43 L.marker([params.lat, params.lon], { icon: getUserIcon() }).addTo(map);
45 bbox = map.getBounds();
48 $("#browse_map .geolink").show();
50 $("a[data-editor=remote]").click(function () {
51 return remoteEditHandler(bbox);
54 updatelinks(params, 16, null,
55 bbox.getWest(), bbox.getSouth(),
56 bbox.getEast(), bbox.getNorth(),
59 $("#object_larger_map, #object_edit").hide();
61 object = {type: params.type, id: params.id};
63 if (!params.visible) {
64 object.version = params.version - 1;
67 addObjectToMap(object, map, {
69 callback: function(extent) {
71 $("#browse_map .geolink").show();
74 $("a.bbox[data-editor=remote]").click(function () {
75 return remoteEditHandler(extent);
78 $("a.object[data-editor=remote]").click(function () {
79 return remoteEditHandler(extent, params.type + params.id);
82 $("#object_larger_map").show();
83 $("#object_edit").show();
85 updatelinks(map.getCenter(), 16, null, extent, object);
87 $("#small_map").hide();
93 createMenu("area_edit", "area_edit_menu", "right");
94 createMenu("object_edit", "object_edit_menu", "right");