Skip to content

Commit 068f9d7

Browse files
authored
fix: connect the API changes to the UI to get maps to display in shared notebooks (#3480)
1 parent 799ced9 commit 068f9d7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/visualization/types/Map/view.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ const GeoPlot: FC<Props> = ({result, properties}) => {
5151
})
5252

5353
useEffect(() => {
54-
if (CLOUD) {
54+
const token = properties?.layers?.find(
55+
layer => layer?.tileServerConfiguration?.tileServerUrl
56+
)
57+
if (CLOUD && token) {
58+
setMapServiceError(RemoteDataState.Done)
59+
setMapToken(token.tileServerConfiguration?.tileServerUrl)
60+
}
61+
if (CLOUD && !token) {
5562
const getToken = async () => {
5663
try {
5764
setMapServiceError(RemoteDataState.Loading)
@@ -71,7 +78,7 @@ const GeoPlot: FC<Props> = ({result, properties}) => {
7178
}
7279
getToken()
7380
}
74-
}, [])
81+
}, [properties.layers])
7582

7683
useEffect(() => {
7784
try {
@@ -132,6 +139,7 @@ const GeoPlot: FC<Props> = ({result, properties}) => {
132139
</div>
133140
)
134141
}
142+
135143
const tileServerConfiguration = {
136144
tileServerUrl: getMapboxUrl(),
137145
bingKey: '',

0 commit comments

Comments
 (0)