From 667509300cb611356a29b2cdb5902fa30777f7e0 Mon Sep 17 00:00:00 2001 From: taystacksattack Date: Thu, 12 Oct 2023 13:27:04 -0400 Subject: [PATCH] fix(map): decreased duration for flyTo functionn, fixing slow load time for maps --- src/Map.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Map.js b/src/Map.js index b600e5e..946fd6d 100644 --- a/src/Map.js +++ b/src/Map.js @@ -524,14 +524,18 @@ export default class Map { const [lon, lat] = JSON.parse(data.zoom_to).coordinates // NOTE do cluster click if (this.moreEffect) { - this.map.flyTo([lat, lon], this.map.getZoom() + 2) + this.map.flyTo([lat, lon], this.map.getZoom() + 2, { + duration: 0.5, + }) } else { this.map.setView([lat, lon], this.map.getZoom() + 2, { animate: false, }) } } else if (this.moreEffect) { - this.map.flyTo([data.lat, data.lon], this.map.getZoom() + 2) + this.map.flyTo([data.lat, data.lon], this.map.getZoom() + 2, { + duration: 0.5, + }) } else { this.map.setView([data.lat, data.lon], this.map.getZoom() + 2, { animate: false, @@ -1254,7 +1258,9 @@ export default class Map { } if (this.moreEffect) { if (zoomLevel) { - this.map.flyTo([lat, lon], zoomLevel) + this.map.flyTo([lat, lon], zoomLevel, { + duration: 0.5, + }) } else { this.map.panTo([lat, lon]) }