henrichen / zkgmapsz

Automatically exported from code.google.com/p/zkgmapsz
0 stars 0 forks source link

Using GMap in HTTPS application #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

Refer to forum post:
http://www.zkoss.org/forum/listComment/16858-Using-GMap-in-HTTPS-application

Original issue reported on code.google.com by benbai...@gmail.com on 19 Jul 2011 at 1:12

GoogleCodeExporter commented 9 years ago
currently has a work around,
override the load method to use https before gmaps bind

[code]
<window id="me" title="Test Modal Dialog" border="none" 
xmlns:w="http://www.zkoss.org/2005/zk/client">
        <script type="text/javascript">
                function overrideLoadMethod(wgt) {
            zk.gapi.loadAPIs = function(wgt, callback, msg, timeout) {
                    var opts = {};
                    opts['condition'] = function() {return window.google && window.google.load};
                    opts['callback'] = function() {callback(); delete zk.gapi.LOADING;}
                    opts['message'] = msg;
                    if (!opts.condition()) {
                            zk.gapi.waitUntil(wgt, opts);
                            if (!zk.gapi.LOADING) { //avoid double loading Google Ajax APIs
                                    zk.gapi.LOADING = true;
                                    if (!opts.condition()) {
                                            if (!zk.googleAPIkey) {
                                                    zk.loadScript('https://www.google.com/jsapi');
                                            }
                                            else 
                                                    zk.loadScript('https://www.google.com/jsapi?key='+zk.googleAPIkey);
                                    }
                            }
                    } else {
                            callback();
                    }
            };
                }
        </script>
        <gmaps id="mymap" width="500px" height="300px" showSmallCtrl="true">
                <attribute w:name="bind_">
                        function(dt, skipper, after) {
                                overrideLoadMethod(this);
                                this.$bind_(dt, skipper, after);
                        }
                </attribute>
        </gmaps>
</window>
[code]

Original comment by benbai...@gmail.com on 19 Jul 2011 at 2:40

GoogleCodeExporter commented 9 years ago
It would be nice if the GMap class has a method that let the user choose to use 
https

Original comment by dariusco...@gmail.com on 27 Jul 2011 at 4:10

GoogleCodeExporter commented 9 years ago

Original comment by benbai...@gmail.com on 24 Feb 2012 at 7:14

GoogleCodeExporter commented 9 years ago
Ready since 2012-03-03.

Original comment by benbai...@gmail.com on 3 Mar 2012 at 2:52