Skip to content

Commit

Permalink
fix(links): Strange sadface appears instead of background map on Chrome
Browse files Browse the repository at this point in the history
StaticMap.reuseMaps() is an experimental feature, and it is crashy.

- http://visgl.github.io/react-map-gl/docs/api-reference/static-map#reusemaps
  • Loading branch information
billyc committed Dec 21, 2021
1 parent 7935a54 commit c502ae8
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 22 deletions.
2 changes: 0 additions & 2 deletions src/layers/FlowMapLayer.tsx
Expand Up @@ -73,9 +73,7 @@ export default function Layer({
/*
// @ts-ignore */
<StaticMap
reuseMaps
mapStyle={dark ? MAP_STYLES.dark : MAP_STYLES.light}
preventStyleDiffing={true}
mapboxApiAccessToken={MAPBOX_TOKEN}
/>
}
Expand Down
7 changes: 1 addition & 6 deletions src/layers/ScatterPlotLayer.tsx
Expand Up @@ -36,12 +36,7 @@ function App({ data = [], initialView = {} as any }) {
{
/*
// @ts-ignore */
<StaticMap
reuseMaps
mapStyle={MAP_STYLES.light}
preventStyleDiffing={true}
mapboxApiAccessToken={MAPBOX_TOKEN}
/>
<StaticMap mapStyle={MAP_STYLES.light} mapboxApiAccessToken={MAPBOX_TOKEN} />
}
</DeckGL>
)
Expand Down
7 changes: 1 addition & 6 deletions src/plugins/carrier-viewer/TourViz.tsx
Expand Up @@ -309,12 +309,7 @@ export default function Component(props: {
{
/*
// @ts-ignore */
<StaticMap
reuseMaps
mapStyle={mapStyle}
preventStyleDiffing={true}
mapboxApiAccessToken={MAPBOX_TOKEN}
/>
<StaticMap mapStyle={mapStyle} mapboxApiAccessToken={MAPBOX_TOKEN} />
}
{renderTooltip({ hoverInfo })}
</DeckGL>
Expand Down
4 changes: 0 additions & 4 deletions src/plugins/links-gl/LinkLayer.tsx
Expand Up @@ -16,7 +16,6 @@ enum COLUMNS {

export default function Component({
geojson = [] as any[],
// viewState = { center: [11.34, 48.3], zoom: 5, bearing: 0, pitch: 0 } as any,
colors = 'viridis',
dark = false,
scaleWidth = 250,
Expand Down Expand Up @@ -196,13 +195,10 @@ export default function Component({
/*
// @ts-ignore */
<StaticMap
reuseMaps
mapStyle={dark ? MAP_STYLES.dark : MAP_STYLES.light}
preventStyleDiffing={true}
mapboxApiAccessToken={MAPBOX_TOKEN}
/>
}
</DeckGL>
)
// {renderTooltip({ hoverInfo })}
}
2 changes: 0 additions & 2 deletions src/plugins/vehicle-animation/TripViz.tsx
Expand Up @@ -223,9 +223,7 @@ export default function Component(props: {
/*
// @ts-ignore */
<StaticMap
reuseMaps
mapStyle={dark ? MAP_STYLES.dark : MAP_STYLES.light}
preventStyleDiffing={true}
mapboxApiAccessToken={MAPBOX_TOKEN}
/>
}
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/xy-hexagons/XyHexLayer.tsx
Expand Up @@ -128,9 +128,7 @@ export default function Layer({
/*
// @ts-ignore */
<StaticMap
reuseMaps
mapStyle={dark ? MAP_STYLES.dark : MAP_STYLES.light}
preventStyleDiffing={true}
mapboxApiAccessToken={MAPBOX_TOKEN}
/>
}
Expand Down

0 comments on commit c502ae8

Please sign in to comment.