+ for (var i = 0; i < changesets.length; ++i) {
+ var changeset = changesets[i],
+ rect = L.rectangle(changeset.bounds,
+ {weight: 2, color: "#ee9900", fillColor: "#ffff55", fillOpacity: 0});
+ rect.id = changeset.id;
+ rects[changeset.id] = rect;
+ rect.addTo(group);
+ }
+
+ function highlightChangeset(id) {
+ rects[id].setStyle({fillOpacity: 0.5});
+ $("#changeset_" + id).addClass("selected");
+ }
+
+ function unHighlightChangeset(id) {
+ rects[id].setStyle({fillOpacity: 0});
+ $("#changeset_" + id).removeClass("selected");
+ }
+
+ group.on({
+ mouseover: function (e) {
+ highlightChangeset(e.layer.id);
+ },
+ mouseout: function (e) {
+ unHighlightChangeset(e.layer.id);