Add 20km allowed zone icon (#347)

Co-authored-by: Gautier P <gautier_git@damsy.net>
This commit is contained in:
Gautier P 2020-12-01 20:56:14 +01:00 committed by GitHub
parent 1958f55f18
commit 779c720b7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 296 additions and 24 deletions

View file

@ -1,8 +1,8 @@
BR.PoiMarkers = L.Control.extend({
markersLayer: null,
circlego: null,
options: {
routing: null,
shortcut: {
draw: {
enable: 80, // char code for 'p'
@ -10,6 +10,10 @@ BR.PoiMarkers = L.Control.extend({
}
}
},
initialize: function(routing) {
this.routing = routing;
this.circlego = null;
},
onAdd: function(map) {
var self = this;
@ -54,7 +58,8 @@ BR.PoiMarkers = L.Control.extend({
draw: function(enable) {
this.drawButton.state(enable ? 'deactivate-poi' : 'activate-poi');
if (enable) {
this.options.routing.draw(false);
this.routing.draw(false);
this.circlego.draw(false);
this.map.on('click', this.onMapClick, this);
L.DomUtil.addClass(this.map.getContainer(), 'pois-draw-enabled');
} else {
@ -129,7 +134,7 @@ BR.PoiMarkers = L.Control.extend({
getMarkers: function() {
return this.markersLayer.getLayers().map(function(it) {
return {
latlng: it._latlng,
latlng: it.getLatLng(),
name: it.options.name
};
});