Comments (2)
As far as I can tell, there doesn't exist such a method even on the underlying L.esri.BasemapLayer to change the type of basemap after it has been defined. So, like many props in react-leaflet, the name
prop is immutable, meaning changing it after it has mounted will not affect anything.
To do what you're trying to do, the stupidest easiest way to do it is to simply assign a key
to the <BasemapLayer />
, which will tell react to force-rerender the layer when mapType
changes.
Working example
Hope that helps!
from react-esri-leaflet.
Great, thanks so much for looking into it and providing an example!
from react-esri-leaflet.
Related Issues (16)
- Warning about Identify in esri-leaflet creating multiple callback scripts HOT 3
- Control (Add and remove) <FeatureLayer> on Checkbox OnChange HOT 5
- this.leafletElement is undefined (v2) HOT 8
- Add support to new flag ignoreDeprecationWarning from esri-leaflet > v3.0.2 HOT 8
- Issue with refs + Typescript (TiledMapLayer) HOT 5
- BasemapLayer is deprecated HOT 1
- Uncaught ReferenceError: y is not defined (Production) HOT 1
- "Suggestions" show different results than the actual "results" HOT 1
- Geosearch Multiple Providers of same type ? HOT 4
- Example of WMTS ? HOT 1
- Could not resolve dependency: [ react-esri-leaflet , esri-leaflet , esri-leaflet-vector ] HOT 8
- "build" command does not transpile output HOT 3
- Question: how to use setWhere or equivalent with a FeatureLayer❓ HOT 8
- Add Support for Esri Leaflet Renderers HOT 8
- Cannot useRef with functional components HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-esri-leaflet.