【发布时间】:2011-02-16 16:35:02
【问题描述】:
我正在使用 ym4r_gm 在我的网站上创建标记图。我创建了 1 个标记,可以使用以下代码。
@map = GMap.new("locations_map")
@map.control_init(:large_map => true,:map_type => true)
geocode = GMap::Geocoding.get("G12 8BZ")
@map.record_init @map.add_overlay(GMarker.new([geocode.first.latitude,geocode.first.longitude], :title => "Hillhead, Glasgow", :info_window =>"Hillhead, Glasgow"))
如何让一组标记显示在地图上?我有一组邮政编码(邮政编码),如下所示:
postcodes = ["G11 6PR", "G1 T3R", "G12 8BZ"]
我注意到 ym4r_gm 中的 MarkerGroup 类,但我无法弄清楚:-S
如果有人能给我一个很棒的帮助,这里还有一个文档链接。
http://ym4r.rubyforge.org/ym4r_gm-doc/
任何帮助将不胜感激。
干杯
伊夫
【问题讨论】:
-
为此干杯。不幸的是,我仅限于 Rails 2,因为它是一个旧站点,现在无法升级到 Rails 3。
标签: ruby-on-rails ruby google-maps geocode