On Feb 9, 2:44 pm, BuckyE <[email protected]> wrote: > Seems not many people want to do this: show a category of markers in a > sidebar, then zoom to fit them. Most people are doing the opposite: > making a sidebar to list the zoomed map, or, just not bothering to > "zoom" at all. So I'm starting a new topic in case others have my > problem in the future. > > For my wonderful new > maphttp://lovebunnies.luckypro.biz/01_stuff/roman_holiday/romanholidayma... > I'd want to do something much like the map > athttp://www.findbiblioteket.dk/checkbox/. > I've looked at that code, but don't want to steal it! I did get the > idea though that I should write a function much like my makesidebar. > > That is, when a check box is clicked, read the new non-hidden array > and use its information to set bounds. Blah. I've tried a dozen > different ways to write the new function "zoommap" and just can't hit > on the Secret Word. Or perhaps that's not really the way to accomplish > the goal?
That is the way I have done it. Create a GLatLngBounds object for each category, then you can do: map.setCenter(bounds.getCenter(),map.getBoundsZoomLevel(bounds)); where bounds is the bounds for the category. If you can have more than one category visible at a time, then you would need to dynamically generate the correct bounds. Start with an empty one, process through all the markers, calling .extend (marker.getLatLng()), then perform the center and zoom as above. -- Larry > > The latest broken effort > ishttp://lovebunnies.luckypro.biz/01_stuff/roman_holiday/romanholidayma.... > Would anyone be willing to help fix the poor old thing? Thank you all > for the kind patience you've shown so far. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
