Google-Maps-for-Rails icon indicating copy to clipboard operation
Google-Maps-for-Rails copied to clipboard

Dynamically Cluster handling

Open kashifnaseer opened this issue 9 years ago • 6 comments

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

kashifnaseer avatar Mar 05 '15 07:03 kashifnaseer

its just a boolean right now: enable/disable clustering

apneadiving avatar Mar 05 '15 07:03 apneadiving

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();
});}

kashifnaseer avatar Mar 05 '15 07:03 kashifnaseer

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 } });

apneadiving avatar Mar 05 '15 07:03 apneadiving

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

kashifnaseer avatar Mar 05 '15 08:03 kashifnaseer

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

almozavr avatar Apr 20 '15 00:04 almozavr

Sorry, my fault – everything works well.

almozavr avatar Apr 20 '15 01:04 almozavr