Skip to content

Commit ca8f005

Browse files
authored
Update Map.tsx
check if mapbox access token set globally
1 parent 0ae8777 commit ca8f005

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

frontend/src/pages/Map.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ export function Map() {
446446
// fresh container
447447
mapRef.current.innerHTML = "";
448448

449-
mapboxgl.accessToken = mapboxToken!;
449+
if (!mapboxgl.accessToken) {
450+
mapboxgl.accessToken = mapboxToken!;
451+
}
450452

451453
const map = new mapboxgl.Map({
452454
container: mapRef.current,
@@ -1480,3 +1482,4 @@ export function Map() {
14801482
);
14811483
}
14821484

1485+

0 commit comments

Comments
 (0)