File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 1
1
<script >
2
2
import propsBinder from ' ../utils/propsBinder.js' ;
3
3
import findRealParent from ' ../utils/findRealParent.js' ;
4
+ import debounce from ' ../utils/debounce.js' ;
4
5
import { optionsMerger } from ' ../utils/optionsUtils.js' ;
5
6
import Layer from ' ../mixins/Layer.js' ;
6
7
import Options from ' ../mixins/Options.js' ;
@@ -48,6 +49,7 @@ export default {
48
49
}, this );
49
50
this .mapObject = L .marker (this .latLng , options);
50
51
L .DomEvent .on (this .mapObject , this .$listeners );
52
+ this .mapObject .on (' move' , debounce (this .latLngSync , 100 ));
51
53
propsBinder (this , this .mapObject , this .$options .props );
52
54
this .parentContainer = findRealParent (this .$parent );
53
55
this .parentContainer .addLayer (this , ! this .visible );
@@ -74,6 +76,9 @@ export default {
74
76
this .mapObject .setLatLng (newLatLng);
75
77
}
76
78
}
79
+ },
80
+ latLngSync (event ) {
81
+ this .$emit (' update:latLng' , event .latlng );
77
82
}
78
83
},
79
84
render : function (h ) {
You can’t perform that action at this time.
0 commit comments