eschwartz / backbone.googlemaps

A Backbone JS extension for interacting with the Google Maps API (v3.10)
MIT License
139 stars 55 forks source link

Added refreshOverlay and listener to re-position markerviews in case lat/lng change #5

Closed Lordnibbler closed 11 years ago

Lordnibbler commented 11 years ago

Solves: https://github.com/eschwartz/backbone.googlemaps/issues/4

eschwartz commented 11 years ago

Thanks for the pull request @Lordnibbler -- sorry it took me so long to merge it. It's been a busy couple of months....

FYI -- 63761375af22f6a0e10933063b78e3f9664991cc does the inverse of this: it updates the model when the overlay changes (eg, on a drag-n-drop). In order to prevent an endless syncing loop, I added logic to your commit that checks whether the model and overlay are already in sync before updating the markerview position.

Lordnibbler commented 11 years ago

@eschwartz great thanks for merging! It's a good fix.