Skip to content

Commit

Permalink
Disable map coordinates control if the map is not interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfdsilva committed Sep 23, 2023
1 parent 1e01580 commit 5ab9743
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/scripts/components/common/mapbox/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ export function SimpleMap(props: SimpleMapProps): ReactElement {

mapRef.current = mbMap;

mapRef.current.addControl(mapCoordsControl, 'bottom-left');

if (onProjectionChange && projection) {
mapRef.current.addControl(mapOptionsControl, 'top-left');
}
Expand All @@ -162,6 +160,8 @@ export function SimpleMap(props: SimpleMapProps): ReactElement {

// Add zoom controls without compass.
if (mapOptions.interactive !== false) {
mapRef.current.addControl(mapCoordsControl, 'bottom-left');

mbMap.addControl(
new NavigationControl({ showCompass: false }),
'top-left'
Expand Down

0 comments on commit 5ab9743

Please sign in to comment.