【发布时间】:2014-01-22 03:03:09
【问题描述】:
我正在尝试使用谷歌静态地图 api 根据一组经度和纬度点呈现居中的地图视图。
google map api 提供此 URL。
我正在尝试使用数据库中的值并像这样动态插入它们
<%= image_tag ('http://maps.googleapis.com/maps/api/staticmap?center=#{@location.latitude},#{@location.longitude}&zoom=12&size=400x400&maptype=roadmap&sensor=true')%>
但是生成的图像不断损坏
注意:
纬度和经度都是浮点型属性。
【问题讨论】:
标签: ruby-on-rails google-maps-api-3 ruby-on-rails-4