Closed priyankagupta34 closed 4 years ago
This was my problem, i should have included the js explicitly for its availability to the react dom
In case anyone is wondering, this is the way i import leaflet, leaflet-esri, and leaflet-draw in CRA, should work on other webpack configuration once you have css-loader set up.
import L from "leaflet"
import "leaflet/dist/leaflet.css"
import * as esri from "esri-leaflet"
import "leaflet-draw"
import "leaflet-draw/dist/leaflet.draw.css"
import marker from "leaflet/dist/images/marker-icon.png"
import marker2x from "leaflet/dist/images/marker-icon-2x.png"
import markerShadow from "leaflet/dist/images/marker-shadow.png"
delete L.Icon.Default.prototype._getIconUrl
L.Icon.Default.mergeOptions({
iconRetinaUrl: marker2x,
iconUrl: marker,
shadowUrl: markerShadow,
})
L.esri = esri
Not sure if this one is bug or nor. `
`
Its throwing with 1.0.4 version of Leaflet.draw