Search code examples
ruby-on-railsgmaps4rails

Prevent marker clustering with gmaps4rails


I am displaying 10 or so markers on google maps using gmaps4rails. When the markers are close together, I get clustering. I have set "do_clustering" to false, and I still get clustering. Ideally, I would like to see every marker, no matter how close it is to another marker. What is the easiest way to force this? Cheers, Tom

Update: I am using rails 2.3.11. gmaps4rails is 1.3.2. I used the 2.3 instructions and overrode the gmaps4rails view. I don't use gmappable, I just generate the json directly. The map options are:

@map_info = {
      :map_options => {
        :type => "ROADMAP",
        :center_longitude => 180,
        :zoom => 2,
        :auto_adjust => false,
        :do_clustering => false,
  }
}

Solution

  • As per https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Markers , clustering options should be passed in the marker's options hash.

    Simply :)