-
Notifications
You must be signed in to change notification settings - Fork 651
propsBinder
This function create a binding (either two way or one way). Between properties of a Vue element and a Google Maps object.
For one way binding the implementation is straightforward but for two way there is the problem of circular dependency: The google maps update -> warn the vue element (which change) -> warn the Google Map object. It leads to infinite loops.
To overcome this I use revision number for each value. Each time one of the component receives an update it increase its version number. And if its version number is bigger than the other it warn it.
In order to have only one variable and avoid the fact of having huge version number. I used the difference between the two version number (called stable in the code).
-
vueElementThe vue element to bind -
googleMapsElement: The google map object to bind -
props: a props object (the same signature as the props in the vue components). Be careful to add thetypeattribute to Objects because otherwise deep changes will not be sent.
- Map
- [MapComponent](Extending Components)
- Marker
- Cluster
- InfoWindow
- Polyline
- Circle
- Rectangle
- PlaceInput
... More to come
(for contributors)