This Meteor package wraps Leaflet in a reactive API.
isDragging()
returns true
or false
and is reactive.
getCenterState()
Treats the maps center lon/lat as a state of the map. Meaning that if you set the center, the new state will be that center, as opposed to calling getCenter()
which would return the instantaneous (visible) position of the map, which might be transitioning between its previous center state and its new center state. Essentially, it detaches the model (which is pure data) from the view (which is a function of the previous data and the new data). It could be considered an alternative to using the map's moveend
event, although the value will be updated at the time of the map's movestart
event.
setCenterState()
This is really just an alias for map.setCenter()
, and provides congruity for getCenterState()
.
getCenter()
This alleviates the need for the map's 'move'
event.
getZoom()
This alleviates the need for the map's 'zoomend'
event.