Hi.

You can create a LatLngBounds object:

var myBounds=new google.maps.LatLngBounds();

http://code.google.com/apis/maps/documentation/javascript/reference.html#LatLngBounds

Extend it with all your points:

myBounds.extend(new google.maps.LatLng(20, -80));
myBounds.extend(new google.maps.LatLng(45, -110));

Now use the Map fitBounds() method to pan and zoom the map to contain
myBounds:

myMap.fitBounds(myBounds);

http://code.google.com/apis/maps/documentation/javascript/reference.html#Map

Martin.


On Sep 28, 7:59 pm, la <evolvingt...@gmail.com> wrote:
> I am new to Google Maps, so forgive me if this has already been
> discussed or if this question is a bit naiive.
>
> I am trying to generate a map that is positioned between two pairs of
> lat and lon coordinates. For example, between (20, -80) and (45, -110)
> in degrees. Is there a direct way to use the API to position the view
> displayed in the map to exactly match such a set of coordinates?
>
> Thanks!

-- 
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 google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to