Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix(CollectionMapDialog): update prefetch bounds padding to use ratio for Leaflet

Aswin Asok9fb927279a89
diff --git a/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx b/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx
index e9af8143b0..89cc82c72d 100644
--- a/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx
@@ -266,8 +266,9 @@ type SuperclusterConstructor = new (options?: MapClusterOptions) => MapIndex;
const MAP_INDEX_KEY_PREFIX = "photos-map-index-v1";
//OpenStreetMap only supports clustering till this zoom level and this tell the supercluster what the max limit is for the zoom.
const MAX_MAP_ZOOM = 19;
-//Instead of loading just the tiles which are in view, we're actually loading the 15% of the surrounding zone as well for smoother experience
-const PREFETCH_BOUNDS_PADDING = 15;
+//Instead of loading just the tiles which are in view, we're actually loading the 15% of the surrounding zone as well for smoother experience.
+//Leaflet LatLngBounds.pad expects a ratio (0.15 = 15%).
+const PREFETCH_BOUNDS_PADDING = 0.15;
//This count controls how many thumbnails are fetched in each batch when loading images for the markers
const THUMBNAIL_BATCH_SIZE = 40;