You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-map...@googlegroups.com
I currently set fitBounds for sets of markers so that the map can pan and zoom in or out to fit the set of markers on the map. But in doing that, when the markers are de-selected from the list and the map is zoomed out based on the fitBounds, I noticed that the fitBounds does not zoom back in on one route that is re-selected and shown again. It seems that the fitBound on a map occurs as a one time event to try and fit all markers on a map, but not repeated again on re-showing of markers. Is there a way to make the fitBounds for a map to re-zoom in after the map has zoomed out or make the fitBounds zoom in and out according to the sets of markers that are displayed?
this.m_mapBounds = new google.maps.LatLngBounds();
geoco...@gmail.com
unread,
Nov 15, 2010, 6:55:22 PM11/15/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
I would suggest creating the bounds for each object when it is first
processed, saving that bounds, then doing a union on the bounds of the
objects that are currently visible, using that resulting bounds as the
argument to fitBounds.
-- Larry
dirtHammer
unread,
Apr 24, 2012, 12:52:02 PM4/24/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-map...@googlegroups.com
You can reset m_mapBounds (by setting LatLngBounds to null) before each new call for markers is made: