Martin, Thank you, this is very clear and I was able to code it easily. I was looking for something a bit different, though. I originally wanted to force the viewport to exactly match the lat/lon coordinates (so that the map only shows the content within the bounds). I suspect that may not be possible. I am interested if you have any thoughts on the matter. In any case, I am grateful to your response, as it enabled me to get a step closer.
LA On Sep 29, 1:40 am, Martin™ <warwo...@gmail.com> wrote: > Hi. > > You can create a LatLngBounds object: > > var myBounds=new google.maps.LatLngBounds(); > > http://code.google.com/apis/maps/documentation/javascript/reference.h... > > 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.h... > > 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.