1 $(document).ready(function () {
3 var map = createMap("changeset_list_map");
4 var group = L.featureGroup().addTo(map);
6 $("[data-changeset]").each(function () {
7 var changeset = $(this).data('changeset');
9 var rect = L.rectangle([[changeset.bbox.minlat, changeset.bbox.minlon],
10 [changeset.bbox.maxlat, changeset.bbox.maxlon]],
11 {weight: 2, color: "#ee9900", fillColor: "#ffff55", fillOpacity: 0});
12 rect.id = changeset.id;
13 rects[changeset.id] = rect;
18 function highlightChangeset(id) {
19 rects[id].setStyle({fillOpacity: 0.5});
20 $("#tr-changeset-" + id).addClass("selected");
23 function unHighlightChangeset(id) {
24 rects[id].setStyle({fillOpacity: 0});
25 $("#tr-changeset-" + id).removeClass("selected");
29 mouseover: function (e) {
30 highlightChangeset(e.layer.id);
32 mouseout: function (e) {
33 unHighlightChangeset(e.layer.id);
37 $("[data-changeset]").on({
38 mouseover: function () {
39 highlightChangeset($(this).data("changeset").id);
41 mouseout: function () {
42 unHighlightChangeset($(this).data("changeset").id);
46 var params = OSM.mapParams();
48 map.fitBounds([[params.minlat, params.minlon],
49 [params.maxlat, params.maxlon]]);
51 map.fitBounds(group.getBounds());