Brilliant! I have this working just as I wanted now. Thank you, Marcelo!
On Feb 18, 12:31 pm, marcelo <[email protected]> wrote: > Your polylines are assigned to variables, and polylines have > GLatLngBounds which you can use to zoom and center the map. > > You could do something like this: > > function centerAndZoom(line) { > bounds = line.getBounds(); > map.setCenter(bounds.getCenter(map), map.getBoundsZoomLevel > (bounds)); > > } > > ... and then call it with: > > centerAndZoom(epMiddleCreek); > > BUT, that will require that the variables 'map', as well as the > polylines be in scope, and right now you have everything local to the > function load(). > So, either you make those variables global, or you continue to add > code only inside the function load(). > > BTW, check your DOCTYPE declaration! > > -- > Marcelo -http://maps.forum.nu > -- > > On Feb 18, 6:14 pm,mcslain<[email protected]> wrote: > > > I have seen discussion on this board about using zoom and pan > > together, as well as using saved views. However, I am not sure either > > of these can do what I would like to accomplish. > > > I have a map of a multi stage bike > > race:http://allthatisgoodmaps.googlepages.com/gmTdEphrata.html > > > I would like to have a button for each stage of the race that takes > > you directly to a centered and zoomed view of the polyline showing > > that stage of the race. I had problems using zoom and pan together, > > but have read some posts here that have been helpful. However, I > > can't seem to get a pan and a zoom to work that zooms more than one > > level. Saved views would be ideal... but it seems that Google Maps > > only allows you to save one view. it would be ideal if you could name > > multiple saved views and then call them as needed. Could anyone offer > > a suggestion on how this can be done? > > > Thanks > > -mcslain --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
