diff --git a/examples/src/App.vue b/examples/src/App.vue index b84966f9..b223f7ac 100644 --- a/examples/src/App.vue +++ b/examples/src/App.vue @@ -27,10 +27,14 @@ @click="currentView='custom-url-params'">Custom Url Params
  • - Custom Leaflet Control + Custom Leaflet Control
  • - Set bounds + Set bounds
  • Load Test
  • +
  • + Custom Marker Icons +
  • +
    +
    +

    Custom Marker Icons

    + + + + +
    + + + + + + + + + + + + + + + + + +
    {{ customText }}
    + +
    +
    + +
    +
    + + + + + diff --git a/src/components/LIcon.vue b/src/components/LIcon.vue new file mode 100644 index 00000000..bd9605db --- /dev/null +++ b/src/components/LIcon.vue @@ -0,0 +1,217 @@ + + + diff --git a/src/main.js b/src/main.js index ae15d57b..78bf58c6 100644 --- a/src/main.js +++ b/src/main.js @@ -10,6 +10,7 @@ exports.LControlScale = require('./components/LControlScale').default; exports.LControlZoom = require('./components/LControlZoom').default; exports.LFeatureGroup = require('./components/LFeatureGroup').default; exports.LGeoJson = require('./components/LGeoJson').default; +exports.LIcon = require('./components/LIcon').default; exports.LIconDefault = require('./components/LIconDefault').default; exports.LImageOverlay = require('./components/LImageOverlay').default; exports.LLayerGroup = require('./components/LLayerGroup').default; diff --git a/types/index.d.ts b/types/index.d.ts index ecb73e74..205a4d22 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Matthew Meehan /** - * TODO: + * TODO: * create test cases for types * type parentContainer in components * type findRealParent @@ -452,6 +452,26 @@ declare module "vue2-leaflet" { oldVal?: object | Function | null ): void; } + class LIcon extends Mixins(Options) { + // props + iconUrl: String; + iconRetinaUrl: String; + iconSize: L.Point; + iconAnchor: L.Point; + popupAnchor: L.Point; + tooltipAnchor: L.Point; + shadowUrl: String; + shadowRetinaUrl: String; + shadowSize: L.Point; + shadowAnchor: L.Point; + bgPos: L.Point; + className: String; + + // data + iconObject: L.Icon; + parentContainer: L.Marker; + } + class LIconDefault extends Vue { // props /** @@ -696,6 +716,7 @@ declare module "vue2-leaflet" { LControlZoom, LFeatureGroup, LGeoJson, + LIcon, LIconDefault, LImageOverlay, LLayerGroup,