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

Custom Cluster Icon Example doc needs updating #418

Closed ashrocket closed 10 years ago

ashrocket commented 10 years ago

It's hard to know whether https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Markers is still a relavent wiki page for doing things like creating custom cluster icons.

I've tried every way I can think of to inject appropirate marker options into the Coffeescript (I'm using asset pipeline so don't want to generate coffee and then modify it, want to hook into your code in the correct place).

So, it could be user / programmer error, but is trying to add a custom cluster function in this way valid?

Gmaps.map.customClusterer = function() { ....

Or is there a better more appropriate way to set custom images on the clustericons?

apneadiving commented 10 years ago

Actually its easy, go to the wiki page, everything there is about v2.

Click on 'Gmaps4rails before v2' and there is all before v2, including the page you refer to.

To answer your question, see here: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Change-handler-behavior

apneadiving commented 10 years ago

Oops for custom clusterer, look here https://github.com/apneadiving/Google-Maps-for-Rails/blob/master/vendor/assets/javascripts/gmaps/objects/handler.coffee#L7 In other words, do:

handler = Gmaps.build('Google', { markers: { clusterer: your_options } } )
ashrocket commented 10 years ago

No way! Really. I'll try it out right away. Thanks

Ashley Raiteri

e: ashley@raiteri.net p: 206.981.8060 github: ash_rocket t: @ashr l: linkedin.com/in/ashleyraiteri b: http://ashley.raiteri.net

On Jan 10, 2014, at 11:31 PM, Benjamin Roth notifications@github.com wrote:

Oops for custom clusterer, look here https://github.com/apneadiving/Google-Maps-for-Rails/blob/master/vendor/assets/javascripts/gmaps/objects/handler.coffee#L7 In other words, do:

handler = Gmaps.build('Google', { markers: { clusterer: your_options } } ) — Reply to this email directly or view it on GitHub.

ashrocket commented 10 years ago

Totally worked. Should I add to the docs pages to illustrate usage. ?

apneadiving commented 10 years ago

yep feel free to edit the doc to improve it!

ashrocket commented 10 years ago

If you think it's correct, and useful, here it is: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Customized-Cluster-Icons

Maybe you can add it to the getting started page under the > 2.x wiki section

ashrocket commented 10 years ago

Thanks for the quick answer by the way. And for all the working put into the new version of the gem, it's a great improvement. Now we the community of users need to step up provide some good documentation.

davetapley commented 10 years ago

It took me a while to figure out how to simply disable clustering altogether. In the end I rolled with this:

    handler = Gmaps.build("Google", markers: { clusterer: undefined })

Did I do a terrible thing? Is that snippet wiki worthy?

apneadiving commented 10 years ago

Well its correct yes :)

Sent from my iPhone

On 29 janv. 2014, at 04:30, Dave Tapley notifications@github.com wrote:

It took me a while to figure out how to simply disable clustering altogether. In the end I rolled with this:

handler = Gmaps.build("Google", markers: { clusterer: undefined })

Did I do a terrible thing? Is that snippet wiki worthy?

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

apneadiving commented 10 years ago

Thanks for suggesting documentation, every contribution is welcome :)

Sent from my iPhone

On 29 janv. 2014, at 04:30, Dave Tapley notifications@github.com wrote:

It took me a while to figure out how to simply disable clustering altogether. In the end I rolled with this:

handler = Gmaps.build("Google", markers: { clusterer: undefined })

Did I do a terrible thing? Is that snippet wiki worthy?

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

davetapley commented 10 years ago

Cool, I'll add a mention of that to this page.

However, I also noticed a do_clustering option mentioned here, does this exist for > version 2.x?

apneadiving commented 10 years ago

nope it doesnt exist for v2.x, the proper way is what you did :)

apneadiving commented 10 years ago

FYI, I've done http://apneadiving.github.io/ to show live examples

ashrocket commented 10 years ago

Awesome!!! Let us know if you need any help

Ashley Raiteri

e: ashley@raiteri.net p: 206.981.8060 github: ash_rocket t: @ashr l: linkedin.com/in/ashleyraiteri b: http://ashley.raiteri.net

On Feb 3, 2014, at 12:10 AM, Benjamin Roth notifications@github.com wrote:

FYI, I've done http://apneadiving.github.io/ to show live examples

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

apneadiving commented 10 years ago

@ashrocket thank you :) I've done some already, let me know if you think of other interesting one.

Otherwise I'm done with it now :)