apneadiving / Google-Maps-for-Rails

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

Where to specify API key for google maps? #438

Closed samsondav closed 10 years ago

samsondav commented 10 years ago

I want to use an API key with Google Maps.

Where should I specify this in gmaps4rails?

apneadiving commented 10 years ago

which version do you use?

samsondav commented 10 years ago

Latest published gem, 2.1.2 I think.

apneadiving commented 10 years ago

Ok, the api key is supposed to be added in the script url right?

Whats the issue then?

Sent from my iPhone

On 27 mai 2014, at 18:33, Sam Philip notifications@github.com wrote:

Latest published gem, 2.1.2 I think.

— Reply to this email directly or view it on GitHub.

samsondav commented 10 years ago

Aaah.

So I put it in this script line:

<script src="//maps.google.com/maps/api/js?v=3.13&amp;sensor=false&amp;libraries=geometry" type="text/javascript"></script>

e.g.

<script src="//maps.google.com/maps/api/js?key=XXXX&amp;v=3.13&amp;sensor=false&amp;libraries=geometry" type="text/javascript"></script>

?

apneadiving commented 10 years ago

Did you read google maps doc? https://developers.google.com/maps/documentation/javascript/tutorial?hl=fr#Loading_the_Maps_API

<script src="https://maps.googleapis.com/maps/api/js?key=API_KEY&sensor=SET_TO_TRUE_OR_FALSE" type="text/javascript">

On 27 May 2014, at 19:11, Sam Philip notifications@github.com wrote:

Aaah.

So I put it in this script line:

e.g.

?

— Reply to this email directly or view it on GitHub.

samsondav commented 10 years ago

OK, thanks for clearing that up. It works great now. Thanks again for the gem!