Force to use HTTPS to retrieve Google Maps elements
authorNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Sat, 14 Dec 2013 19:21:57 +0000 (20:21 +0100)
committerNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Sat, 14 Dec 2013 19:26:11 +0000 (20:26 +0100)
Chromium was complaining about loading HTTP images in an HTTPS page.

Error message was:
The page at 'https://www.polytechnique.org/map' was loaded over HTTPS, but displayed insecure content from 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=|00ff00': this content should also be loaded over HTTPS.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
Makefile
htdocs/javascript/maps.js

index cb92b45..30bf7ce 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -251,9 +251,12 @@ $(JSTREE_PATH):
 ##
 maps: htdocs/javascript/markerclusterer.js
 
-## Try and use taged version asap (from http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/…).
+## Try and use taged version asap (from http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/...).
+## Force to use https to retrieve images
 htdocs/javascript/markerclusterer.js:
-       wget "http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js?r=308" -O htdocs/javascript/markerclusterer.js
+       wget 'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js?r=308' -O $@.tmp -q || ($(RM) $@.tmp; false)
+       sed 's,http\(://google-maps-utility-library-v3.googlecode.com\),https\1,g' < $@.tmp > $@
+       $(RM) $@.tmp
 
 ##
 ## Raven-js
index c31d752..edfd2e9 100644 (file)
@@ -77,7 +77,7 @@ function ColoredIcon(color)
 {
     this.set('starcolor', null);
     this.set('color', color);
-    this.set('icon', 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=|' + color);
+    this.set('icon', 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=|' + color);
 }
 
 ColoredIcon.prototype = new google.maps.MVCObject();