调整缩放Gmaps4Rails [英] Adjust Zoom Gmaps4Rails

查看:123
本文介绍了调整缩放Gmaps4Rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Gmaps4Rails gem,无法弄清如何调整默认缩放设置。

I'm using the Gmaps4Rails gem and cannot figure out how to adjust the default zoom settings. In my view I have the following code:

<%= gmaps({
   "map_options" => {"auto_adjust" => false, "auto_zoom" => false, "zoom" => 15 },
   "markers"     => {"data" => @json }
  })
%>

我知道这个问题已经被提出并回答了很多次,但也许我只是没有看到任何东西。 ..任何建议?我错过了一些完全明显的东西?我很抱歉重新发布这个问题。

I know this has been asked and answered many times, but maybe I'm just not seeing something...any advice? Am i missing something completely obvious? I apologize for reposting this question.

谢谢,凯文

编辑

我没有正确注释gmaps的默认实例,它覆盖了我的自定义设置。感谢所有帮助@apneadiving!

I failed to properly comment out the default instance of gmaps and it overrode my customized settings. Thanks for all the help @apneadiving!

推荐答案

你只是想念整个地图意味着提供一个非常小的数字,而不是一个大的数字!

You're simply missing that seeing the whole map means providing a very small number, not a big one!

<%= gmaps({
  "map_options" => {"auto_adjust" => false, "zoom" => 0 },
  "markers"     => {"data" => @json }
 })
%>

这篇关于调整缩放Gmaps4Rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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