调整缩放Gmaps4Rails

编程入门 行业动态 更新时间:2024-10-28 10:24:37
本文介绍了调整缩放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

本文发布于:2023-08-02 00:10:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1272934.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:缩放   Gmaps4Rails

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!