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]);
27 $("a[data-editor=remote]").click(function () {
28 return remoteEditHandler(bbox);
31 updatelinks(map.getCenter(), 16, null, [[params.minlat, params.minlon],
32 [params.maxlat, params.maxlon]]);
33 } else if (params.type == "note") {
34 object = {type: params.type, id: params.id};
36 map.setView([params.lat, params.lon], 16);
38 L.marker([params.lat, params.lon], { icon: getUserIcon() }).addTo(map);
40 bbox = map.getBounds();
44 $("a[data-editor=remote]").click(function () {
45 return remoteEditHandler(bbox);
48 updatelinks(params, 16, null, bbox, object);
50 $("#object_larger_map, #object_edit").hide();
52 object = {type: params.type, id: params.id};
54 if (!params.visible) {
55 object.version = params.version - 1;
58 map.addObject(object, {
60 callback: function(extent) {
63 if (extent && extent.isValid()) {
64 $("#browse_map .secondary-actions").show();
66 $("a.bbox[data-editor=remote]").click(function () {
67 return remoteEditHandler(extent);
70 $("a.object[data-editor=remote]").click(function () {
71 return remoteEditHandler(extent, params.type + params.id);
74 $("#object_larger_map").show();
75 $("#object_edit").show();
77 updatelinks(map.getCenter(), 16, null, extent, object);