From 3a747b2b1d2a802d96316740cbf623c467d2ecf9 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 5 Mar 2026 17:40:28 +0000 Subject: [PATCH] Don't animate aggregate map, just jump there. --- html/static/js/map-aggregate.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/html/static/js/map-aggregate.js b/html/static/js/map-aggregate.js index 1e681903..eb0bc782 100644 --- a/html/static/js/map-aggregate.js +++ b/html/static/js/map-aggregate.js @@ -1,4 +1,3 @@ -var map = null; // A map that can be used to locate a single point by setting its location explicitly // or by allowing the user to move a marker. class MapAggregate extends HTMLElement { @@ -42,9 +41,11 @@ class MapAggregate extends HTMLElement { center: centroid.coordinates, container: mapElement, style: "https://tiles.stadiamaps.com/styles/alidade_smooth.json", - }).fitBounds(bounds, { - padding: { top: 10, bottom: 10, left: 10, right: 10 }, }); + let camera_transform = this._map.cameraForBounds(bounds, { + padding: 10, + }); + this._map.setZoom(camera_transform.zoom); this._map.on("load", () => { this._map.addSource("tegola", { type: "vector",