Unverified Commit 41cabc80 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera Committed by GitHub
Browse files

Merge pull request #131 from vue-leaflet/fix-130

fix: remove icon option when undefined
parents 28f821ea 79dd6c4a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -26,6 +26,12 @@ export default {
      (newIcon) => leafletRef.value.setIcon && leafletRef.value.setIcon(newIcon)
    );
    const { options, methods } = markerSetup(props, leafletRef, context);
    if (options.icon === undefined) {
      // If the options objection has a property named 'icon', then Leaflet will overwrite
      // the default icon with it for the marker, _even if it is undefined_.
      // This leads to the issue discussed in https://github.com/vue-leaflet/vue-leaflet/issues/130
      delete options.icon;
    }

    onMounted(async () => {
      const { marker, DomEvent } = await import("leaflet/dist/leaflet-src.esm");
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ export const props = {
  },
  icon: {
    type: [Object],
    default: () => undefined,
    custom: false,
  },
  zIndexOffset: {