Change the boundaries for different coloured clusters

New home Forums Gold Add-on Change the boundaries for different coloured clusters

  • This topic has 1 reply, 2 voices, and was last updated 2 months ago by AbelC.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #60233
    drench
    Participant

    What are the numerical limits for each coloured cluster?

    We have loads of blue clusters, and one yellow cluster (46 items).

    At what number of markers will a cluster go red / pink / purple? Can we change these numbers somehow?

    #60238
    AbelC
    Moderator

    Hi There,

    Thank you so much for getting in touch with us.

    The marker level should increase every 10 markers.

    With that said, you can change these values with Custom JS.

    Could I kindly ask if you could please navigate to Maps -> Settings -> Advanced -> Custom JS -> Please paste the following code below:

    jQuery(function($){
    	WPGMZA.MarkerClusterer.prototype.calculator = function(markers, numStyles)
    	{
    	var counts = [
    		10,
    		20,
    		40,
    		80,
    		160
    	];
    		for(var i = 0; i < counts.length; i++)
    		{
    			if(markers.length < counts[i])
    				break;
    		}
    		return {
    			text: markers.length,
    			index: Math.min(i, numStyles)
    		};
    	}
    
    });

    Please replace the values in the counts array with your preferred value.

    Example:

    var counts = [
    			5,
    			10,
    			15,
    			20,
    			128
    ];
    

    I hope this helps clarify, and I look forward to hearing back from you.

    Kind Regards,
    Abel

    • This reply was modified 2 months ago by AbelC.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.