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

Dynamically Cluster handling #477

Open kashifnaseer opened 9 years ago

kashifnaseer commented 9 years ago

can we send a configuration to the "Google-Maps-for-Rails" plugin to tell is when to trigger the "cluster" mode ?

I want to Dynamically on/off the cluster mode

apneadiving commented 9 years ago

its just a boolean right now: enable/disable clustering

kashifnaseer commented 9 years ago

Thanks for quick feedback. what is the exact command where i can set it. here is my sample code:

 function pinProjectLocations(coordinates){
   var handler = Gmaps.build('Google');
   handler.buildMap({ internal: {id: 'project_map'}}, function(){
  var markers = handler.addMarkers(coordinates);
  handler.bounds.extendWith(markers);
 handler.fitMapToBounds();
});}
apneadiving commented 9 years ago

its in the handler options (https://github.com/apneadiving/Google-Maps-for-Rails/blob/master/vendor/assets/javascripts/gmaps/objects/handler.coffee#L3-L11)

var handler = Gmaps.build('Google', { markers: { clusterer: null } });
kashifnaseer commented 9 years ago

it worked ... I'm enjoying this plugin implementation...Thanks man.

almozavr commented 9 years ago

@apneadiving Tried that but all my points are drawn with display: none style. Also setIgnore(true) gives the same result (

almozavr commented 9 years ago

Sorry, my fault – everything works well.