I have read several posts here on stackoverflow like React Leaflet - How to render custom image using Circle Markers and custom marker icon with react-leaflet On how to include custom icons in react leaflet maps. I have tried the below code
const newicon = new L.icon({
iconUrl: require('../assets/Download-Image.png'),
iconSize: [30, 30]
})
but the image does not render on the map.
However, if I use the url of the same icon as below it works and renders. Any advise on what I could be doing wrong?
const newicon = new L.icon({
iconUrl: 'https://www.somewebsite/Download-Image.png',
iconSize: [30, 30]
})