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 .secondary-actions").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 .secondary-actions").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 map.addObject(object, {
62 callback: function(extent) {
65 if (extent && extent.isValid()) {
66 $("#browse_map .secondary-actions").show();
68 $("a.bbox[data-editor=remote]").click(function () {
69 return remoteEditHandler(extent);
72 $("a.object[data-editor=remote]").click(function () {
73 return remoteEditHandler(extent, params.type + params.id);
76 $("#object_larger_map").show();
77 $("#object_edit").show();
79 updatelinks(map.getCenter(), 16, null, extent, object);