通过https / SSL使用gmaps4rails

编程入门 行业动态 更新时间:2024-10-28 18:32:02
本文介绍了通过https / SSL使用gmaps4rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是gmaps4rails的忠实粉丝 - 它让我们的网络应用非常容易添加地图。我现在遇到的唯一问题是,如果您在https页面上使用它,则会收到有关混合内容的安全警告。 google maps api确实支持https,所以我认为这只是一个将脚本引用从http更改为https的问题。不幸的是,我认为它隐藏在acts_as_gmappable语句后面 - 我希望能修改content_for块。

I'm a big fan of gmaps4rails - it's made adding maps to our web app very easy. The only problem I'm hitting now is that if you use it on an https page, then you get security warnings about mixed content. The google maps api does support https, so I think it's just a question of changing the script references from http to https. Unfortunately I think it's hidden behind the "acts_as_gmappable" statement - I was hoping for a content_for block I could modify.

有没有简单的方法可以使用https版本的API?

Is there an easy way to make it use the https version of the API?

code.google/apis/maps/documentation/javascript/basics.html#HTTPS

非常感谢,

Alex

Alex

推荐答案

这不是一个非常明显的标题, 在宝石wiki的杂项部分。

It's not a very obvious title but your solution lies in the Miscellaneous section of the gem's wiki.

只需看一看:

Just have a look:

<%= gmaps( data_hash, enable_css, enable_js) %>

enable_css 和 enable_js 是布尔值。

所以,如果你这样做:

So if you do:

<%= gmaps( data_hash, true, false) %>

它不会加载任何js。他的方式可以添加你想要的任何东西。不要忘记包含 gmaps4rails.js 文件!

It won't load any js. his way you can add whatever you want by yourself. Don't forget to include the gmaps4rails.js file!

更多推荐

通过https / SSL使用gmaps4rails

本文发布于:2023-08-02 00:10:55,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:https   SSL   gmaps4rails

发布评论

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

>www.elefans.com

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