我是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
发布评论