apneadiving / Google-Maps-for-Rails

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

Does "randomize" option of the Gmap4rails works? #389

Closed shivanibhanwal closed 10 years ago

shivanibhanwal commented 10 years ago

Hi,

In my case I have country level lat-lng. Whereas I have to show multiple markers in the same country. My markers in the json getting created correctly. However lat lng is not different. So everything is overlapping.

I have searched on stackoverflow and I saw on anwser where "randomize: true " worked for him. however that is not working for me. I see same value of the lat lng. This is the setting I have. Also one thing I would like to mention that I am not using auto geocoding. All lat lng are already saved in my table. e.g

"options" => {
          "draggable" => false ,
          "clusterer_gridSize" => 70,
          "do_clustering" => true,
          "randomize" => true,
          "clusterer_maxZoom" => 5,
          "clusterer_minZoom" => 1
   }

It is really urgent, It will be really great if you could guide me. Thanks Shivani

apneadiving commented 10 years ago

See doc: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Markers

Sent from my iPhone

On 29 oct. 2013, at 17:54, Shivani notifications@github.com wrote:

Hi,

In my case I have country level lat-lng. Whereas I have to show multiple markers in the same country. My markers in the json getting created correctly. However lat lng is not different. So everything is overlapping.

I have searched on stackoverflow and I saw on anwser where "randomize: true " worked for him. however that is not working for me. I see same value of the lat lng. This is the setting I have. Also one thing I would like to mention that I am not using auto geocoding. All lat lng are already saved in my table. e.g

"options" => { "draggable" => false , "clusterer_gridSize" => 70, "do_clustering" => true, "randomize" => true, "clusterer_maxZoom" => 5, "clusterer_minZoom" => 1 } It is really urgent, It will be really great if you could guide me. Thanks Shivani

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

shivanibhanwal commented 10 years ago

Hi, Thanks for the response. Actually I have referred that documentation already. However yesterday I was able to figure out the issue. In my case as I have mentioned I have only one lat/lng for a country. Problem was the small number assigned for the "max_random_distance" as I was using 100 or 200. As we have zoom only upto 7 level because of that markers were overlapping even after setting value to 100, to make it work I had to assign a bigger number to the "max_random_distance".

Thanks Shivani