File tree Expand file tree Collapse file tree 5 files changed +20
-3
lines changed Expand file tree Collapse file tree 5 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -67,3 +67,11 @@ module.exports = {
67
67
}
68
68
}
69
69
```
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 )
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export default {
9
9
mixins: [ControlMixin, Options],
10
10
props: {
11
11
prefix: {
12
- type: String ,
12
+ type: [ String , Boolean ] ,
13
13
default: null
14
14
}
15
15
},
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ export default {
77
77
},
78
78
latLngSync (event ) {
79
79
this .$emit (' update:latLng' , event .latlng );
80
+ this .$emit (' update:lat-lng' , event .latlng );
80
81
}
81
82
},
82
83
render : function (h ) {
Original file line number Diff line number Diff line change @@ -30,7 +30,11 @@ export default {
30
30
},
31
31
beforeDestroy () {
32
32
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
+ }
34
38
}
35
39
}
36
40
};
Original file line number Diff line number Diff line change @@ -21,7 +21,11 @@ export default {
21
21
},
22
22
beforeDestroy () {
23
23
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
+ }
25
29
}
26
30
}
27
31
};
You can’t perform that action at this time.
0 commit comments