Improvements on maps

This commit is contained in:
Sebastien Riviere
2025-08-31 17:33:18 +02:00
parent e5d90d824e
commit d088253758
13 changed files with 264 additions and 184 deletions

View File

@@ -22,7 +22,7 @@ function latlngEqual(latlng1, latlng2, epsilon = 1e-9) {
/* -------------------------------- Polygon zones -------------------------------- */
const defaultPolygonSettings = { polygons: [], durations: [] };
const defaultPolygonSettings = [];
function polygonZone(points, duration) {
return {
@@ -82,15 +82,9 @@ function mergePolygons(poly1, poly2) {
}
function polygonSettingsToZones(settings) {
const { polygons, durations } = settings;
const reversedPolygons = polygons.slice().reverse();
const reversedDurations = durations.slice().reverse();
const zones = [];
for (let i = 0; i < reversedPolygons.length; i++) {
const polygon =reversedPolygons[i];
const duration = reversedDurations[i];
for (const { polygon, duration } of settings.slice().reverse()) {
const length = zones.length;
if (length == 0) {