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

Add docs in the README for passing options #428

Closed thenickcox closed 10 years ago

thenickcox commented 10 years ago

This is a great gem, but I almost stopped using it because it didn't seem to support passing API options in the function call. I took one last look before moving on to rolling my own option and realized that in fact it did! Unfortunately, this was undocumented, as far as I can tell.

This pull request adds a step for adding options to the README, so that it's clear that it supports passing options, and documents how to go about making use of that functionality.

apneadiving commented 10 years ago

A link to https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Js-Methods would be great since its the same topic :)

thenickcox commented 10 years ago

Good point. Also, there is an Options section in the README, so this should probably combine them. I'd also like to add some documentation on the primitives, because I struggled a bit with those. Should that be on a separate PR, or would you like me to combine all these?

apneadiving commented 10 years ago

I appreciate you take time for this. For options, I trust you to do it the best way you think.

For primitives, I feel like it should simply be a wiki page, maybe with a mere link in the readme. Few people or even no one will bother with it. Actually I'm wondering why you are interested in these internals :)

One single PR is ok.

apneadiving commented 10 years ago

Did you notice the live examples page? http://apneadiving.github.io/

thenickcox commented 10 years ago

Yeah, actually it was the examples that put me on the right track.

I guess never mind about the primitives. I was interested in them because I was trying to change the MapTypeId, and so I had to access it through handler.primitives.mapTypes('HYBRID'). But I took another look at your examples, and it turns out you can just do google.maps.MapTypeId.HYBRID, which I thought I had tried before, but I'm guessing I was trying google.maps.MapTypeId('HYBRID'), which doesn't work.

So yeah, I guess I'll skip the bits about the primitives.

For now, I'll add the link to the JSMethods page, and we can go from there.

Thanks again for this gem. It makes dealing with Google Maps a dream!

thenickcox commented 10 years ago

Okay. Added those bits and squashed the commits.

apneadiving commented 10 years ago

Thanks Nick!