Closed alessandro-lenzi closed 2 years ago
I haven't had a chance to see what's new in the new patch of esri-leaflet or esri-leaflet-geocoder, or how its going to affect this wrapper. I'll take a look when I get a chance.
Thank you @slutske22
This is implemented in version 2, which is currently in a @next version. You can try it out here: https://www.npmjs.com/package/react-esri-leaflet/v/2.0.0, npm i react-esri-leaflet@next
, Will publish as official version soon.
Sorry for the dumb question, but how do I use this option? I'm using react-esri-leaflet
version 2.0.1.
Inside a MapContainer
my code instantiates a BasemapLayer
as follows
<BasemapLayer key={mapType} name={mapType} />
Sorry for the dumb question, but how do I use this option? I'm using
react-esri-leaflet
version 2.0.1.Inside a
MapContainer
my code instantiates aBasemapLayer
as follows<BasemapLayer key={mapType} name={mapType} />
That code should work fine...is there an issue? It should just give you fancy intellisense for the fact that the underlying L.esri.basemapLayer is deprecated.
Sorry, I did a poor job of explaining my question.
How do I enable the ignoreDeprecationWarning
option that is in esri-leaflet? Is it a prop for BasemapLayer
? If so, I can't get it to work.
Sorry, I did a poor job of explaining my question.
How do I enable the
ignoreDeprecationWarning
option that is in esri-leaflet? Is it a prop forBasemapLayer
? If so, I can't get it to work.
Passing it as a prop should work:
<BasemapLayer
ref={basemapLayerRef}
name="DarkGray"
// @ts-expect-error
ignoreDeprecationWarning
/>
When I pass this prop in, the deprecation warning stops showing up in the console. If you are using typescript, you'll see that ignoreDeprecationWarning
is not officially a prop. This is because @types/esri-leaflet (currently v 2.1.9) has not added it as an official prop, at least yet:
This just means that @types/esri-leaflet is not up to date with esri-leaflet. Passing this as a prop seems to work fine for me. What issue are you having?
Sorry, that was the piece I was missing.
This is my lack of familiarity with React... I had the mistaken impression that props were always key/value pairs. I tried ignoreDeprecationWarning={true}
and many other variations thereof to no avail.
Thanks so much for your help.
Added a deprecation warning when using L.esri.BasemapLayer (info). This warning can be disabled by setting the ignoreDeprecationWarning option to true. (https://github.com/Esri/esri-leaflet/pull/1293).
I think it would be interesting to forward that flag on react-esri-leaflet.