admin管理员组文章数量:1122846
Using component with the custom icon works anyway, but trying to mark the location using the tool in the right side doesn't show the marker image. Thanks in advance.
const MarkerIcon = new L.Icon({
iconUrl: '/images/locationMarker.svg',
iconSize: [40, 40],
});
L.Marker.prototype.options.icon = MarkerIcon;
L.Icon.Default.mergeOptions({
iconRetinaUrl: require('../images/locationMarker.svg'),
iconUrl: require('../images/locationMarker.svg'),
shadowUrl: require('../images/locationMarker.svg'),
});
L.Icon.Default.mergeOptions({
iconRetinaUrl: require('leaflet/dist/images/marker-icon-2x.png'),
iconUrl: require('leaflet/dist/images/marker-icon.png'),
shadowUrl: require('leaflet/dist/images/marker-shadow.png'),
});
All the above snippets didn't work.
本文标签: React Leaflet quotDraw a Markerquot option doesnt show marker iconStack Overflow
版权声明:本文标题:React Leaflet "Draw a Marker" option doesnt show marker icon - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736304890a1932396.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论