Simon Wilkinson
2007-Oct-17 15:07 UTC
[Ym4r-user] GMarkerGroup center_and_zoom_on_markers problem
Hi, I found the funcitoned mentioned in title (center_and_zoom_on_markers) but am having troubles getting it working. I have several markers being added to an array (@gmap_markers = []) in the following manner: marker = GMarker.new(latlng, :info_window => infoString, :icon => my_icon) @gmap_markers << marker I am then trying to do the following: group = GMarkerGroup.new(true, @gmap_markers) @map.overlay_global_init(group,"NOI") @map.record_init group.center_and_zoom_on_markers But I get the following error: this.v has no properties (on line 611 of main.js, according to Firebug). If I replace the line "@map.record_init group.center_and_zoom_on_markers" with "@map.center_zoom_init(bounding_box_center(@gmap_markers), 9)" everything works as expected. bounding_box_center is just a function I wrote quickly to get the center point of the group of markers. Has anybody else used the center_and_zoom_on_markers method successfully? I''m not sure what the problem is, as I think I am using it correctly. Any help would be appreciated. Thanks, Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ym4r-user/attachments/20071017/fc7fd87e/attachment.html