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

How to set randomize in the new version? #445

Closed fluke closed 10 years ago

fluke commented 10 years ago

Looking through the documentation, randomize is set in the view helper <%= gmaps %>. How do I set it with the handler.buildMap function? Or maybe I have to set something while using the addMarker function?

apneadiving commented 10 years ago

view helpers do not exist anymore.

It's only available at the handler level now: https://github.com/apneadiving/Google-Maps-for-Rails/blob/master/vendor/assets/javascripts/gmaps/objects/handler.coffee#L5

Because if you need it only for some markers, I guess your api can arrange it :)

fluke commented 10 years ago

So it's handler.setOptions({ markers: { maxRandomDistance: 10 } });?

apneadiving commented 10 years ago

or directly:

handler = Gmaps.build('Google', { markers: { maxRandomDistance: 10 } })
fluke commented 10 years ago

Ah okay. Thanks a lot. You should a disclaimer on the Wiki to indicate it's out of date. Got quite confused.

apneadiving commented 10 years ago

You checked v1 section, main page tries to make it clear.

Please edit wiki if not.

And clise your issue :)

Sent from my iPhone

On 11 juil. 2014, at 12:26, Kartik Luke Singh notifications@github.com wrote:

Ah okay. Thanks a lot. You should a disclaimer on the Wiki to indicate it's out of date. Got quite confused.

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