Skip to content

Commit f8c5c9e

Browse files
committed
check for feature length
1 parent ab33d72 commit f8c5c9e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/lib/components/Map.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
previousSelectedPoints = selectedPoints;
5151
5252
// Change view
53-
if (appState.lastMoved !== currentComponent) {
53+
if (appState.lastMoved !== currentComponent && featuresToSelect.length) {
5454
const bounds = bbox(featureCollection(featuresToSelect)) as LngLatBoundsLike;
5555
const camera = map.cameraForBounds(bounds, { maxZoom, padding: settings.padding });
5656
if (camera) {

src/lib/components/Tabula.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
previousSelectedPoints = selectedPoints;
6666
6767
// Change view
68-
if (appState.lastMoved !== currentComponent) {
68+
if (appState.lastMoved !== currentComponent && featuresToSelect.length) {
6969
const bounds = bbox(featureCollection(featuresToSelect)) as LngLatBoundsLike;
7070
const camera = map.cameraForBounds(bounds, { maxZoom, padding: settings.padding });
7171
if (camera) {

0 commit comments

Comments
 (0)