L.Icon.Default errors using vue-loader and webpack | Duplicated Marker
See original GitHub issueSystem Information | Affected Versions
leaflet: 1.0.3
vue2-leaflet: 0.0.47
vue: 2.2.6
chrome: 58.0.3029.81 (64-bit)
Description
In v.0.0.47
, I have noticed an issue with the Marker
component being duplicated/shadowed when rendered in the map.
Code
<v-map :zoom=15 :center="[organization.latitude, organization.longitude]">
<v-tilelayer :token="mapboxAPIKey" url="https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token={token}"></v-tilelayer>
<v-marker :lat-lng="{'lat': organization.latitude, 'lng': organization.longitude}">
<v-popup :content="organization.name"></v-popup>
</v-marker>
</v-map>
edit: fixed code copy paste error
Fix
If I remove the transform: translate3d(395px, 200px, 0px)
style from the img.leaflet-marker-icon
, then the issue is resolved.
Edit: This change seems to move the “clickable” marker out of the pane, so it cannot be used as the trigger for a popup. The incorrect “fat” marker is the one that remains. I will look into other possible “full” resolutions.
Attachments

Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
L.Icon.Default errors using vue-loader and webpack | Duplicated ...
L.Icon.Default errors using vue-loader and webpack | Duplicated Marker.
Read more >How to fix default marker-icon.png not found in vue 2 leaflet ...
One answer I found was to modify the mounted() method to be: async mounted() { delete L.Icon.Default.prototype._getIconUrl; L.Icon.Default.
Read more >[Solved]-error when changing marker in leaflet geosearch-Vue.js
You are simply trying to pass directly options for an Icon, instead of expected options for a Marker (which in particular can receive...
Read more >How to remove a marker from a Leaflet map?
I'm currently making a website where I'm using Leaflet 1.7.1 and ... init du marker marker = new L.marker([lat,lon], { icon: defaultIcon })....
Read more >Migrating from v14 - Vue Loader
We are in the process of upgrading Vue CLI 3 beta to use webpack 4 + Vue ... loader, you'd have to duplicate...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve got it working by deleting the
_getIconUrl
prototype first.Here is my complete working component:
Okay, I found where the
Leaflet
people are discussing this issue with webpack: https://github.com/Leaflet/Leaflet/issues/4968They proposed this solution: