-
Notifications
You must be signed in to change notification settings - Fork 10
/
mode-changeset.js
34 lines (30 loc) · 1.06 KB
/
mode-changeset.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var inspectedChangesetId;
var inspectedChangesetBounds;
var inspectedChangesetRectangle;
function initChangesetMode() {
}
function enableMode_Changeset() {
var changeset = getChangeset(inspectedChangesetId);
if (!changeset) { return; }
activateChangeset(inspectedChangesetId);
updateStatusbar(templates.statusbar_changeset(changeset));
inspectedChangesetBounds = [[changeset.bbox[1], changeset.bbox[0]], [changeset.bbox[3], changeset.bbox[2]]];
map.fitBounds(inspectedChangesetBounds);
inspectedChangesetRectangle = L.rectangle(inspectedChangesetBounds, {
color: 'black',
opacity: 1,
weight: 1,
fillColor: 'blue',
fillOpacity: 0.25}).addTo(map);
}
function disableMode_Changeset() {
deactivateChangeset(inspectedChangesetId);
inspectedChangesetRectangle && map.hasLayer(inspectedChangesetRectangle) && map.removeLayer(inspectedChangesetRectangle);
}
function getChangeset(id) {
for (k in changesets) {
if (changesets[k].id == id) {
return changesets[k];
}
}
}