EchtFettigerKeks
EchtFettigerKeks

Reputation: 1893

Ember: Use Google Maps-API in Ember

There are just one or two tutorials outhere about how to use gmaps-API in ember-cli.

See this: http://blog.atmartin.io/google-maps-integration-ember-cli-edition/

Unfortunately there are problems after a few days using this approach. When starting my application, it seems like nothing happens in the gmaps-api. When downloading the JS-File again like described within the tutorial (curl -o vendor/gmaps.js https://maps.googleapis.com/maps/api/js?key=YOUR-KEY-HERE) from above, it works again.

  1. How could that be?

Also I'm wondering about the async-Tag in the general approach from google itself. The GMaps Team shows examples of using GMaps like this:

<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR-KEY-HERE&callback=initMap"> </script>

  1. Is there a difference (maybe not async) in loading the API as downloaded file via Brocfile.js as mentioned in the tutorial from above?

Upvotes: 2

Views: 2132

Answers (2)

TyBourque
TyBourque

Reputation: 628

If your trying to use use the google maps API in a ember app i would highly recommend this Addon:

http://emberobserver.com/addons/ember-google-map

it works very well you can also find a demo here: http://huafu.github.io/ember-google-map/

and here is the wiki: https://github.com/huafu/ember-google-map/wiki

you can install it as an addon via:

ember install ember-google-map 

Upvotes: 3

geocodezip
geocodezip

Reputation: 161404

That tutorials suggestion to copy the Google Maps Javascript API v3 to your local server:

curl -o vendor/gmaps.js https://maps.googleapis.com/maps/api/js?key=YOUR-KEY-HERE

is against the Google Maps Javascript API v3 terms of use and will not work reliably.

Upvotes: 2

Related Questions