在谷歌地图上设置一个标志- Ruby 1.9



我是RoR新手。
我被困在设置一个标志(图像)在谷歌地图上从数据库(纬度和经度)加载的点。
请帮忙!

您可以使用来自Google Maps的嵌入代码,并添加带有变量的lat/long。例如,假设您的纬度在变量@latitude中,经度在变量@longitude中:

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q="+<%= @latitude %>+",+"+<%= @longitude >+"+(You+can+insert+your+text+here)&amp;hl=en&amp;ie=UTF8&amp;t=m&amp;z=14&amp;iwloc=A&amp;output=embed">
</iframe>
<br />
<small>
  <a href="https://maps.google.com/maps?q="+<%= @latitude %>+",+"+<%= @longitude %>+"+(You+can+insert+your+text+here)&amp;hl=en&amp;ie=UTF8&amp;t=m&amp;z=14&amp;iwloc=A&amp;source=embed" style="color:#0000FF;text-align:left">
    View Larger Map
  </a>
</small>

最新更新