Commit d4b67489 authored by Michael Underwood's avatar Michael Underwood
Browse files

Only convert defined props to Leaflet options

parent 1bb4a71f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -3,11 +3,6 @@ import { pathProps, setupPath } from "./path";

export const polylineProps = {
  ...pathProps,
  latLngs: {
    type: Array,
    required: true,
    custom: true,
  },
  smoothFactor: {
    type: Number,
  },
@@ -15,6 +10,11 @@ export const polylineProps = {
    type: Boolean,
    default: undefined,
  },
  latLngs: {
    type: Array,
    required: true,
    custom: true,
  },
};

export const setupPolyline = (props, leafletRef, context) => {
+3 −1
Original line number Diff line number Diff line
@@ -56,7 +56,9 @@ export const propsToLeafletOptions = (
    const defn = propDefinitions[prop];
    const val = propValues[prop];

    // Custom vue-leaflet props should not be passed to Leaflet
    // Unexpected props should not be converted to Leaflet options.
    if (!defn) continue;
    // Custom vue-leaflet props should not be passed to Leaflet.
    if (defn && defn.custom === true) continue;
    // Vue defaults Boolean properties to `false` instead of omitting them,
    // so they must be given explicit defaults of `undefined` and then dropped