Skip to content

Commit be2cac2

Browse files
committed
Merge branch 'master' into unit-tests
2 parents ae0c673 + feba0b0 commit be2cac2

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

docs/faq/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,11 @@ module.exports = {
6767
}
6868
}
6969
```
70+
71+
## How create plugin?
72+
73+
* vue2-leaflet exposes utility that you can leverage findRealParent and propsBinder
74+
* everything should be initialised in the mounted lifecycle hook
75+
* remember to set leaflet as a peerDependecy
76+
* rollup is the best library bundler so you can leverage ESM ( you can check how we do it here in the main repo )
77+
* check this repo or one of the other plugins for inspiration ( for example leaflet-markercluster )

src/components/LControlAttribution.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
mixins: [ControlMixin, Options],
1010
props: {
1111
prefix: {
12-
type: String,
12+
type: [String, Boolean],
1313
default: null
1414
}
1515
},

src/components/LMarker.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export default {
7777
},
7878
latLngSync (event) {
7979
this.$emit('update:latLng', event.latlng);
80+
this.$emit('update:lat-lng', event.latlng);
8081
}
8182
},
8283
render: function (h) {

src/components/LPopup.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ export default {
3030
},
3131
beforeDestroy () {
3232
if (this.parentContainer) {
33-
this.parentContainer.unbindPopup();
33+
if (this.parentContainer.unbindPopup) {
34+
this.parentContainer.unbindPopup();
35+
} else if (this.parentContainer.mapObject && this.parentContainer.mapObject.unbindPopup) {
36+
this.parentContainer.mapObject.unbindPopup();
37+
}
3438
}
3539
}
3640
};

src/components/LTooltip.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ export default {
2121
},
2222
beforeDestroy () {
2323
if (this.parentContainer) {
24-
this.parentContainer.unbindTooltip();
24+
if (this.parentContainer.unbindTooltip) {
25+
this.parentContainer.unbindTooltip();
26+
} else if (this.parentContainer.mapObject && this.parentContainer.mapObject.unbindTooltip) {
27+
this.parentContainer.mapObject.unbindTooltip();
28+
}
2529
}
2630
}
2731
};

0 commit comments

Comments
 (0)