This is how I set the bounds on my map so that each user sees his area
specifically.  The bounds will set the center and the zoom automatically.

var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);

// Fetch bounding box via ajax or however you want

var swPoint = new google.maps.LatLng( lat, lng)
var nePoint = new google.maps.LatLng(lat, lng)

var bounds = new google.maps.LatLngBounds(swPoint, nePoint);

map.fitBounds(bounds);

Hope this helps,
George

On Fri, Apr 22, 2011 at 12:01 PM, Bill <[email protected]> wrote:

>
> 2b) Have the map automatically center and zoom in on the chosen
> district
>
> It's this last part I can't figure out. I can use map.setZoom to
> resize to an appropriate fixed zoom level, but I can't figure out how
> to re-orient the center. It looks like fitBounds should do the trick,
> but I can't figure out how to work it or setCenter into the function
> successfully.
>
>
-- 
iGLASS Networks
www.iglass.net

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to