Determine allowed zone from admin boundaries (#359)

This commit is contained in:
Norbert Renner 2021-01-15 22:29:20 +01:00 committed by GitHub
parent 5df0765d51
commit a5f04dd9cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1925 additions and 1171 deletions

View file

@ -321,26 +321,14 @@
nogos.addTo(map);
var circlegoRadius = null;
var lang = i18next.languages.length && i18next.languages[0];
if (lang.startsWith('fr')) {
circlegoRadius = 20000;
}
if (lang.startsWith('de')) {
circlegoRadius = 15000;
}
if (circlegoRadius != null) {
circlego = new BR.CircleGoArea(routing, nogos, pois);
circlego.options.radius = circlegoRadius;
circlego = BR.circleGoArea(routing, nogos, pois);
if (circlego != null) {
pois.circlego = circlego;
circlego.addTo(map);
}
var buttons = [drawButton, reverseRouteButton, nogos.getButton()];
if (circlegoRadius) buttons.push(circlego.getButton());
if (circlego) buttons.push(circlego.getButton());
buttons.push(deletePointButton, deleteRouteButton);
L.easyBar(buttons).addTo(map);
@ -411,8 +399,7 @@
pois.setMarkers(opts.pois);
}
if (circlego && opts.circlego) {
circlego.options.radius = opts.circlego[2];
circlego.setCircle([opts.circlego[0], opts.circlego[1]], opts.polylines != null);
circlego.setOptions(opts);
}
};