proj4 is not defined in TiledMapLayerSee original GitHub issue
- Browser and version: Any browser you like
- Version of Leaflet (
- Version of esri Leaflet (
- Steps to reproduce the error:
proj4leaflethas a dependency of
proj4leafletAMD style without importing
proj4manually anywhere else since
proj4leafletwill pick it up from dependencies and will work fine
What happens is that when doing this I will get an error on this line https://github.com/Esri/esri-leaflet/blob/master/src/Layers/TiledMapLayer.js#L141 saying
Uncaught ReferenceError: proj4 is not defined.
I was expecting for this to work fine, since only the
proj4leaflet library is dependant on
esri-leaflet is not.
It is quite hard to replicate this problem using
jsbin, since I use
- Optional: I’m not using the CDN, I’m loading/bundling the library using: Webpack
Adding this as a workaround helps to get it work and no errors are shown, but I think that should not be required for
esri-leaflet to work without issues.
import * as proj4 from 'proj4'; window['proj4'] = proj4;
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
thanks for the report. i’ll have to think about how we might make this check more friendly for bundlers.
luckily the issue is pretty benign (ie: we’re just logging an irrelevant error in the console in some situations where
proj4 is available).
Yeap, you are right, we did use dynamicMapLayer and had issues…not sure if it was performance I have notified the data provider, thank you.