Wow! What a slog! OK, it's fixed. Igloo, I can't apologize enough for not understanding your comments about "declaring bounds" and "reinitializing bounds." I misunderstood you to be speaking of the bounds.extend... , but you meant the "var bounds..." line. That move almost did the trick. See http://lovebunnies.luckypro.biz/01_stuff/roman_holiday/romanholidaymap_igloo.html .
But neither your suggestion of "var point = new GLatLng(gmarkers [i].getLatLng());" not Larry's suggestion of "var point = new GLatLng (gmarkers[i].getGLatLng());" works. The only way to get the bounds from the array !gmarkers[i].isHidden()) is with "var point = new GLatLng(gmarkers[i].mylat,gmarkers[i].mylng);" I have no idea why. But see http://lovebunnies.luckypro.biz/01_stuff/roman_holiday/romanholidaymap_test.html , where everything works. See me shrugging. It's all voodoo to me. I did notice though that at some other point in writing this page, I had to make code more explicit than one of Mike's examples led me to believe it could be. Can't remember where. I've got something else balled up in there, I'm sure. Hooray! igloo saves the day! I know leading we amateurs around by the hand is frustrating. You guys have the patience of saints. And you know what? I can only find one other page that zooms the map to a multiple-choice sidebar. Interesting, eh? Maybe this rigamarole isn't as easy as it seems it should be. Congratulations for hammering this out. Now I'll work on clustering! (There are several instances of markers sharing the exact same point.) Thank you, thank you, thank you! On Feb 10, 4:18 pm, igloo <[email protected]> wrote: > You are still reinitializing the bounds inside the loop and the method > is getLatLng() without the G! Try > > function zoommap() { > // initialise bounds object once only > var bounds=new GLatLngBounds(); > for (var i=0; i<gmarkers.length; i++) { > if (!gmarkers[i].isHidden()) { > // note proper name for getLatLng() function > var point = new GLatLng(gmarkers[i].getLatLng()); > // extend bounds for each displayed marker > bounds.extend(point); > } > } > map.setZoom(map.getBoundsZoomLevel(bounds)); > map.setCenter(bounds.getCenter()); > } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
