-
Notifications
You must be signed in to change notification settings - Fork 376
Closed
Labels
Description
Steps to Reproduce
I'm only using L.DivIcon in my project and not any IconUrl at all.
<l-marker v-for="location in locations" :key="location.id" :lat-lng="location.coordinates">
<l-icon class-name="marker-div">
<div class="marker-icon>
***marker html code***
</div>
</l-icon>
</l-marker>
Expected Results
marker-icon.png
and marker-shadow.png
not getting loaded in browser and "marker icon fix" not necessary.
Actual Results
marker-icon.png
and marker-shadow.png
are still getting loaded and need to be fixed by
import { Icon } from 'leaflet';
delete Icon.Default.prototype._getIconUrl;
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'),
});
which increased the size of the bundle and all browsers download unnecessarily the icons.
Browsers Affected
- [ x ] Chrome
- [ x ] Firefox
- [ x ] Edge
- [ x ] Safari 9
- [ x ] Safari 8
- [ x ] IE 11
Versions
- Leaflet: v1.6.0
- Vue: v2.6.11
- Vue2Leaflet: v2.5.2