@@ -69,13 +69,6 @@ import { focus } from "../../../utilities/directives";
69
69
import SfIcon from " ../../atoms/SfIcon/SfIcon.vue" ;
70
70
import SfLoader from " ../../atoms/SfLoader/SfLoader.vue" ;
71
71
import SfStore from " ./_internal/SfStore.vue" ;
72
- import { Icon } from " leaflet" ;
73
- delete Icon .Default .prototype ._getIconUrl ;
74
- Icon .Default .mergeOptions ({
75
- iconRetinaUrl: require (" leaflet/dist/images/marker-icon-2x.png" ),
76
- iconUrl: require (" leaflet/dist/images/marker-icon.png" ),
77
- shadowUrl: require (" leaflet/dist/images/marker-shadow.png" ),
78
- });
79
72
80
73
Vue .component (" SfStore" , SfStore);
81
74
export default {
@@ -178,7 +171,16 @@ export default {
178
171
},
179
172
},
180
173
},
181
- mounted () {
174
+ async mounted () {
175
+ // Fix lack of marker icons
176
+ const { Icon } = await import (' leaflet' );
177
+ delete Icon .Default .prototype ._getIconUrl ;
178
+ Icon .Default .mergeOptions ({
179
+ iconRetinaUrl: require (" leaflet/dist/images/marker-icon-2x.png" ),
180
+ iconUrl: require (" leaflet/dist/images/marker-icon.png" ),
181
+ shadowUrl: require (" leaflet/dist/images/marker-shadow.png" ),
182
+ });
183
+
182
184
import (" leaflet/dist/leaflet.css" );
183
185
import (" vue2-leaflet" ).then (
184
186
({ LMap, LTileLayer, LMarker, LIcon, LControl, LControlZoom }) => {
0 commit comments