Skip to content

Commit

Permalink
Only pan on move when moving to a different cell, so as to fix bug in…
Browse files Browse the repository at this point in the history
… which the map will instantly pan away from an open popup.
  • Loading branch information
blujai831 committed Nov 14, 2024
1 parent 670b882 commit 98e2d8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ function moveUserMarkerToLatLng(
const fromCell =
getGridCell(state, uiOut, state.userMarker.getLatLng()).latLng;
state.userMarker.setLatLng(latLng);
state.map.panTo(latLng);
const toCell = getGridCell(state, uiOut, latLng).latLng;
if (toCell.toString() != fromCell.toString()) {
state.map.panTo(latLng);
state.gridLayer.redraw();
}
state.locationHistory.push(latLng);
Expand Down

0 comments on commit 98e2d8e

Please sign in to comment.