Gmaps4rails:设置地图的宽度和高度 [英] Gmaps4rails : Setting map width and height

查看:100
本文介绍了Gmaps4rails:设置地图的宽度和高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读gmaps4rails gem文档,我没有找到任何设置地图宽度和高度的方法。有什么办法可以做到这一点?

解决方案

我应该提供进一步的细节。



我会做一个安装rake任务,在Rails应用程序中复制css和javascript。



好了,现在,简单地覆盖这个 in your css (我假设你没有更改地图ID)。

 #gmaps4rails_map {
width:800px;
height:400px;





$ b

如果你想让它工作,请注意在 yield(:head)

 <%= yield:head%> 
<%= stylesheet_link_tag您的css%>


Reading the gmaps4rails gem documentation, I didn't find any way to set the map width and height. Is there any way to do this ?

解决方案

I should have given further details about this.

I'll make an installation rake task to copy css and javascript in the Rails app.

Well, for now, simply override this in your css (I assume you didn't change the map id).

#gmaps4rails_map {
  width: 800px;
  height: 400px;
}

If you want it to work, beware to include your css after the yield(:head)

<%= yield :head %>
<%= stylesheet_link_tag "your css" %>

这篇关于Gmaps4rails:设置地图的宽度和高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆