Mass Marker Support: Custom Color for Clustered Markers

New home Forums Pro Add-on General queries Mass Marker Support: Custom Color for Clustered Markers

This topic contains 8 replies, has 4 voices, and was last updated by  SupportTeam 2 years, 9 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #22796

    lgeis
    Member

    Clustered Markers Image

    Is there a way to change the color of the “clustered Markers” on my map? You can see that my Markers are a different color than the default icon for the clustered Markers…

    • This topic was modified 2 years, 11 months ago by  lgeis.
    #22799

    PatD
    Moderator

    @e do not set the textColor of the marker clustering within the code.

    However, this can be achieved by setting the ‘textColor’ attribute when initializing the marker clustering.

    For more detailed reference on this please have a look here: https://googlemaps.github.io/js-marker-clusterer/docs/reference.html

    I would be more than happy to guide you through the process required, if you’d like. If so, please send me the color your prefer and I will send you the steps involved.

    Thank you for your time.

    • This reply was modified 2 years, 11 months ago by  PatD. Reason: Mistakenly set as Private
    #22815

    lgeis
    Member

    Thank you for your response. I’m not trying to change the color of the text, I’d like to change the color of the icon. In this image you can see that anywhere Markers are clustered they are replaced by a different icon, and that icon has a color:

    Screen Capture...

    In this image most of them are a blue, but one is a yellow. I’d like to know how to change the colors of those icons, please.

    Thanks so much!

    • This reply was modified 2 years, 11 months ago by  lgeis.
    #22832

    PatD
    Moderator

    I’m trying to find an answer for you. Thanks in advance for your patience.

    #22835

    lgeis
    Member

    Thanks, Pat!

    #22948

    PatD
    Moderator

    I apologize for the delay. I’ve brought this up to the devs again. Thanks for your continued patience.

    #22958

    Nick Duncan
    Keymaster

    Hi there
    For now you will have to hard code a few changes in the Pro add-on to achieve this until we can add settings for this early in the new year.

    Please open wp-google-maps-pro/js/core.js and look for the following:

    
    if (typeof wpgm_g_e !== "undefined" && wpgm_g_e === true) {
       var mcOptions = {
           gridSize: 20,
           maxZoom: 15,
           styles: [{
               height: 53,
               url: "//ccplugins.co/markerclusterer/images/m1.png",
               width: 53
           },
           {
               height: 56,
               url: "//ccplugins.co/markerclusterer/images/m2.png",
               width: 56
           },
           {
               height: 66,
               url: "//ccplugins.co/markerclusterer/images/m3.png",
               width: 66
           },
           {
               height: 78,
               url: "//ccplugins.co/markerclusterer/images/m4.png",
               width: 78
           },
           {
               height: 90,
               url: "//ccplugins.co/markerclusterer/images/m5.png",
               width: 90
           }] 
       };
       if (wpgmaps_localize[entry]['mass_marker_support'] === "1" || wpgmaps_localize[entry]['mass_marker_support'] === null) { 
           if (typeof markerClusterer[map_id] !== "undefined") { markerClusterer[map_id].clearMarkers(); }
           markerClusterer[map_id] = new MarkerClusterer(MYMAP[map_id].map, null, mcOptions);
       }
    }
    

    Please change the image locations to the locators of the markers of your choice (for example, change //ccplugins.co/markerclusterer/images/m1.png to the URL of a marker you would like to replace it with)

    Please let me know if this helps?

    Kind regards
    Nick

    #22970

    lgeis
    Member

    Thanks! I’ll give it a try and let you know how she works out!

    #24133

    SupportTeam
    Moderator

    Hi there,

    Thank you for your time and I am glad that everything is working now on your site.

    Please note that in the last update to the Gold (4.02+), you are now able to change the Clustering marker to an image of your choice, so you will no longer have to hardcode the change in the core.js code.

    We thank you for your time and patience and hope you have a great day further.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.