On Oct 3, 5:07 pm, jjon <[email protected]> wrote:
> There might be a simple way to do this?
>
> markers are hidden/shown in response to scroll events elsewhere. If
> the marker to be shown is outside the bounds of the map I use this:
>
> if (!map.getBounds().containsLatLng(LatLng)) map.panTo(LatLng);
>
> but panTo() centers the marker. Is there a way to pan only just so far
> that it lies within map.getBounds()

Sure.  You just have to calculate the correct amount to pan the map
(where you want the new center to be).  You might be able to keep
track of all the markers that are shown, add them plus the new one to
a GLatLngBounds object then use the GLatLngBounds.getCenter() method.
I have no idea whether that will work or not.

  -- Larry
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to