apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

SSL #60

Closed tgraham closed 13 years ago

tgraham commented 13 years ago

When using this plugin on sites that use SSL the maps are being pulled from non secure resources and it's throwing an error on load, specifically in IE.

Chrome doesn't throw an error, just has a warning in the URL bar, FF removes the color box indicating all content is still from a secure source.

Any clue on if there's a way to make the resources pull from https instead?

apneadiving commented 13 years ago

yep, it has been answered here:

http://stackoverflow.com/questions/6681310/using-gmaps4rails-with-https-ssl

tgraham commented 13 years ago

Doesn't work.

apneadiving commented 13 years ago

:) you then have to inclde manually all the js files needed, that's all. This way you can add the https yourself

tgraham commented 13 years ago

= gmaps("markers" => {"data" => @json}, "map_options" => {"auto_adjust" => true, "auto_zoom" => true}, true, false)

I get errors with that. The problem isn't that the map doesn't show up. Perhaps I'm not specifying things correctly?

apneadiving commented 13 years ago

Yep, you don't read what I write.

the way I told you to call the gmaps function, no js will be included.

So you have to include everything manually.

tgraham commented 13 years ago

Fantastic, I read exactly what you wrote, thanks for not reading what I wrote!

When I add in the true for css and false for the js I get rails errors, nothing to do with the js being loaded.

syntax error, unexpected ',', expecting tASSOC ...ue, "auto_zoom" => true}, true, false)

apneadiving commented 13 years ago

post your question on stackoverflow please.

apneadiving commented 13 years ago

I admit I overlooked.

You're not passing an explicit hash, just replace with:

= gmaps({ "markers" => {"data" => @json}, "map_options" => {"auto_adjust" => true, "auto_zoom" => true}}, true, false)
tgraham commented 13 years ago

Thank you for pointing that out. This gets the maps loading, but the js files are still pulling from external sources that aren't https.

I've copied over the three scripts that you include remotely and changes all http references to https, but even those external scripts that are being pulled in are calling other non secure scripts.

The maps API can be loaded over https, per the API docs. Does gmaps4rails not load the API in a conventional way? Perhaps you could add the option to load maps via https? Seems that if you load the API via https every other script it pulls in would be secure as well. Makes it pointless otherwise to pull the API via https because the end user will still get the security warnings.