Skip to content

Commit 019fb15

Browse files
committed
Merge remote-tracking branch 'upstream/master' into dev
2 parents ed4d65b + b34f885 commit 019fb15

File tree

7 files changed

+300
-250
lines changed

7 files changed

+300
-250
lines changed

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,6 @@ <h4 class="modal-title" data-i18n="loadNogos.title">Load no-go areas</h4>
713713
</button>
714714
</div>
715715
<div class="modal-body">
716-
<p id="nogoError" class="invalid-feedback" style="display: none"></p>
717716
<form name="loadNogosForm" id="loadNogosForm">
718717
<fieldset>
719718
<legend data-i18n="loadNogos.source">Source</legend>
@@ -797,6 +796,8 @@ <h4 class="modal-title" data-i18n="loadNogos.title">Load no-go areas</h4>
797796
</form>
798797
</div>
799798
<div class="modal-footer">
799+
<p id="nogoError" class="invalid-feedback" style="display: none"></p>
800+
800801
<button type="button" class="btn btn-secondary" data-i18n="modal.close" data-dismiss="modal">
801802
Close
802803
</button>

js/plugin/NogoAreas.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ BR.NogoAreas = L.Control.extend({
5555
e.layer.toggleEdit();
5656
});
5757

58-
var editTools = (this.editTools = map.editTools = new BR.Editable(map, {
59-
circleEditorClass: BR.DeletableCircleEditor,
60-
// FeatureGroup instead of LayerGroup to propagate events to members
61-
editLayer: new L.FeatureGroup().addTo(map),
62-
featuresLayer: this.drawnItems,
63-
}));
58+
var editTools =
59+
(this.editTools =
60+
map.editTools =
61+
new BR.Editable(map, {
62+
circleEditorClass: BR.DeletableCircleEditor,
63+
// FeatureGroup instead of LayerGroup to propagate events to members
64+
editLayer: new L.FeatureGroup().addTo(map),
65+
featuresLayer: this.drawnItems,
66+
}));
6467

6568
this.startDrawing = function (control) {
6669
// initial radius of 0 to detect click, see DeletableCircleEditor.onDrawingMouseUp
@@ -290,6 +293,11 @@ BR.NogoAreas = L.Control.extend({
290293
} else {
291294
self.displayUploadError(i18next.t('loadNogos.error.loading-file-unexpected'));
292295
}
296+
// fire a fake empty nogos before removing layers from map
297+
// because it will automatically refresh the URL, and that will
298+
// fail if we do not empty nogos first
299+
self.fire('update', { options: { nogos: [], polygons: [], polylines: [] } });
300+
self._clear();
293301
}
294302
});
295303
return false;

js/plugin/POIMarkers.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,37 @@ BR.PoiMarkers = L.Control.extend({
9797
markerColor: BR.conf.markerColors.poi,
9898
});
9999

100-
var content = '<p>' + BR.Util.sanitizeHTMLContent(name) + '</p>';
101-
content += "<button id='remove-poi-marker' class='btn btn-secondary'><i class='fa fa-trash'></i></button>";
100+
var content = BR.Util.sanitizeHTMLContent(name);
101+
var contentWithAction =
102+
'<p>' +
103+
content +
104+
'</p>' +
105+
'<p><button id="remove-poi-marker" class="btn btn-secondary"><i class="fa fa-trash"></i></button></p>';
102106

103107
var self = this;
104108
var marker = L.marker(latlng, { icon: icon, draggable: true, name: name })
105-
.bindPopup(content)
109+
.bindPopup(contentWithAction)
106110
.on('dragend', function () {
107111
self.fire('update');
108112
})
109113
.on('popupopen', function () {
114+
this.unbindTooltip();
110115
$('#remove-poi-marker').on('click', function (e) {
111116
self.markersLayer.removeLayer(marker);
112117
e.preventDefault();
113118
self.fire('update');
114119
});
115120
})
121+
.on('popupclose', function () {
122+
if (false === BR.Browser.touch) {
123+
this.bindTooltip(content);
124+
}
125+
})
116126
.addTo(this.markersLayer);
127+
128+
if (false === BR.Browser.touch) {
129+
marker.bindTooltip(content);
130+
}
117131
},
118132

119133
clear: function () {

layers/config/tree.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ BR.confLayers.tree = {
146146
'health_food',
147147
'ice_cream_shop',
148148
'organic',
149+
'supermarket',
149150
]
150151
},
151152
'tourism': [
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"geometry": null,
3+
"properties": {
4+
"name": "Supermarket",
5+
"id": "supermarket",
6+
"overlay": true,
7+
"dataSource": "OverpassAPI",
8+
"icon": "fas-shopping-cart",
9+
"query": "nwr[shop=supermarket];"
10+
},
11+
"type": "Feature"
12+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"bootstrap": "4.3.1",
4949
"bootstrap-select": "1.13.18",
5050
"bootstrap-slider": "^9.8.1",
51-
"codemirror": "^5.35.0",
51+
"codemirror": "^5.61.0",
5252
"core-js-bundle": "^3.8.3",
5353
"datatables": "~1.10.18",
5454
"font-awesome": "^4.7.0",
@@ -351,6 +351,7 @@
351351
"@fortawesome/fontawesome-free": {
352352
"main": [
353353
"svgs/solid/shopping-basket.svg",
354+
"svgs/solid/shopping-cart.svg",
354355
"svgs/solid/ice-cream.svg",
355356
"svgs/solid/carrot.svg",
356357
"svgs/solid/cheese.svg",

0 commit comments

Comments
 (0)