react-map-gl icon indicating copy to clipboard operation
react-map-gl copied to clipboard

reuseMap with different props

Open wmonecke opened this issue 3 years ago • 1 comments

Description

It seems that when reusing a map and you unmount and mount the map somewhere else with different props (e.g. with isInteractive switched to false on re-mount) the map would still be interactive when you actually expect it not to be.

Expected Behavior

No response

Steps to Reproduce

  1. Render map using reuseMaps={true} with isInteractive={true}
  2. Then unmount and remount with the map with isInteractive={false}
  3. The map will be interactive even though it shouldnt.

Environment

  • Framework version: "react": "^17.0.2",
  • Map library: "^7.0.18"
  • Browser: Chrome
  • OS: MacOS

Logs

No response

wmonecke avatar Aug 10 '22 17:08 wmonecke

https://visgl.github.io/react-map-gl/docs/api-reference/map#reusemaps

Note that since some map options cannot be modified after initialization, when reusing maps, only the reactive props and initialViewState of the new component are respected.

Pessimistress avatar Aug 10 '22 18:08 Pessimistress