huafu / ember-google-map

An Ember addon to include a google-map Ember friendly component in your apps.
http://huafu.github.io/#/ember?name=ember-google-map
MIT License
87 stars 34 forks source link

Fix suggestion for index.js (making sure map api JS loaded from http://) #88

Closed rakabali78 closed 9 years ago

rakabali78 commented 9 years ago

Hi,

In index.js, please change this line:

src = "//maps.googleapis.com/maps/api/js";

to...

src = "http://maps.googleapis.com/maps/api/js";

This ensures that this plugin will work on ember-app packaged as Cordova application. Otherwise you'll be getting this error: GET file://maps.googleapis.com/maps/api/js net::ERR_FILE_NOT_FOUND (you see, it's using the file:// scheme in absence of http://)

I did it and it works now in my cordova-packaged ember-app.

Thanks, Raka

huafu commented 9 years ago

You can change that URL in the settings (environment.js). The // here is to use the same protocol as the webpage, so http if not secure and https for secure ones. Since cordova is a special case, you should change it in the settings as explained in the wiki.

On Sat, Aug 22, 2015 at 9:51 AM, rakabali78 notifications@github.com wrote:

Hi,

In index.js, please change this line:

src = "//maps.googleapis.com/maps/api/js";

to...

src = "http://maps.googleapis.com/maps/api/js";

This ensures that this plugin will work on ember-app packaged as Cordova application. Otherwise you'll be getting this error: GET file:// maps.googleapis.com/maps/api/js net::ERR_FILE_NOT_FOUND (you see, it's using the file:// scheme in absence of http://)

I did it and it works now in my cordova-packaged ember-app.

Thanks, Raka

— Reply to this email directly or view it on GitHub https://github.com/huafu/ember-google-map/issues/88.

gnazarkin commented 9 years ago

Came across this as well and have been trying to overwrite in on config. What property is it supposed to pick up on/if any? Looked at the index.html file and it seems it doesn't grab it from config.

Thanks

huafu commented 9 years ago

Added in 0.0.24 which is on its way. I added a protocol option to be set in the googleMap config section of your environment, like the other options. If not set, it'll act as before, else you can specify http or https and it'll add it with : in front of the URL