Support » Plugin: Basic Google Maps Placemarks » Default style of marker clustering not working anymore

  • Resolved jadi100

    (@jadi100)



    Hi,

    for a few days the default style of marker clustering is not shown anymore in my maps (before it did). The numbers of clustered markers are still shown, but not the colored broken rim. The other three styles (people, hearts, coversation) work still well. I’ve deactivated all other plugins and custom css and used different browsers, but the problem persists.

    Thanks for a hint.

    https://wordpress.org/plugins/basic-google-maps-placemarks/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Stackoverflow recently reports that the location of the repo and images has changed. The images are now here:
    https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images

    The default icons are in the set m1.png to m5.png

    The stackoverflow poster suggests storing the icons locally rather than retrieving them from an external server, which would avoid the current issue in case of future changes.

    Answering myself again …

    The icons are actually stored locally, here:
    /wp-content/plugins/basic-google-maps-placemarks/includes/marker-clusterer/images/

    That’s it from me – I’ll leave it up to Ian now to solve the case of the missing default icons 🙂

    One more piece of the puzzle. This is one of the Google m*.png URLs which is failing to load:
    http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m1.png

    It looks like the default set of clusterer icons are not loading from the local copy but from the remote server.

    Hi,
    thanks for the info, in particular where to find the lokal icons.
    I added an own marker (with m1 to m5 as icons) by adding some code to ‘core.php’ and ‘settings-marker-clusterer.php’ (I not good in php, but it’s a simple copy-and-paste thing). It works, but that’s of course not the best solution. Indeed, it appears to be a google-problem.

    Plugin Author Ian Dunn

    (@iandunn)

    I’m seeing this problem too, thanks for reporting it.

    IIRC, the markercluster plugin has those values hardcoded, but there may be a hook to override that. I think there are also several forks of the plugin, which may be more recent.

    I’ll try to get a fix released today.

    Plugin Author Ian Dunn

    (@iandunn)

    Version 1.10.6 is now available, and fixes this problem in my testing. Let me know if you notice any problems when you upgrade.

    Many thanks for the quick fix, Ian – all clustering icons are showing up again 🙂

    While I’m here, is there any way to change the font colour of the number which appears on the clusterer icons? I find the black font on the blue and red default icons hard to read, and would like to change the font colour for these two to white.

    Many thanks Ian! Icons work fine again.
    I’ve no idea how to change the font-color.

    Plugin Author Ian Dunn

    (@iandunn)

    Yeah, you can use the bgmp_map-options filter to change the text color. e.g,

    function bgmp_change_cluster_font_color( $options ) {
        $options['clustering']['styles']['default'][0]['textColor'] = '#000000';
        $options['clustering']['styles']['default'][1]['textColor'] = '#FFFFFF';
        // same process for 2, 3 and 4
        return options;
    }
    add_filter( 'bgmp_map-options', 'bgmp_change_cluster_font_color' );

    I haven’t tested that, so it may need some tweaking, but should be fairly close.

    Hi Ian

    Many thanks for the code – I did find one typo (“return options” I believe should be “return $options”, otherwise the map does not load at all).

    This is the code I now have (in my functionality plugin):

    function bgmp_change_cluster_font_color( $options ) {
        $options['clustering']['styles']['default'][0]['color'] = '#000000';
        $options['clustering']['styles']['default'][1]['color'] = '#FFFFFF';
        $options['clustering']['styles']['default'][2]['color'] = '#FFFFFF';
        $options['clustering']['styles']['default'][3]['color'] = '#FFFFFF';
        $options['clustering']['styles']['default'][4]['color'] = '#FFFFFF';
    
        return $options;
    }
    add_filter( 'bgmp_map-options', 'bgmp_change_cluster_font_color' );

    Alas, it doesn’t change the font color on the clusters (I cleared caches etc). I really don’t want to take up more of your time, but a nudge in the right direction as to what tweak the code might need would be very much appreciated.

    Thanks for the quick update Ian!

    Plugin Author Ian Dunn

    (@iandunn)

    At, it looks like the index should be opt_textColor instead of just textColor. So, this should work:

    function bgmp_change_cluster_font_color( $options ) {
        $options['clustering']['styles']['default'][0]['opt_textColor'] = '#000000';
        $options['clustering']['styles']['default'][1]['opt_textColor'] = '#FFFFFF';
        $options['clustering']['styles']['default'][2]['opt_textColor'] = '#FFFFFF';
        $options['clustering']['styles']['default'][3]['opt_textColor'] = '#FFFFFF';
        $options['clustering']['styles']['default'][4]['opt_textColor'] = '#FFFFFF';
    
        return $options;
    }
    add_filter( 'bgmp_map-options', 'bgmp_change_cluster_font_color' );

    Wonderful 🙂 Many thanks, Ian – the different text color is working beautifully now!

    Flushed with that success, I also increased the text size for 0, 1 and 2. In case it helps others, my final code is:

    function bgmp_change_cluster_font_color( $options ) {
        $options['clustering']['styles']['default'][0]['opt_textColor'] = '#FFFFFF';
        $options['clustering']['styles']['default'][0]['opt_textSize'] = '13';
        $options['clustering']['styles']['default'][1]['opt_textColor'] = '#000000';
        $options['clustering']['styles']['default'][1]['opt_textSize'] = '13';
        $options['clustering']['styles']['default'][2]['opt_textColor'] = '#FFFFFF';
        $options['clustering']['styles']['default'][2]['opt_textSize'] = '13';
        $options['clustering']['styles']['default'][3]['opt_textColor'] = '#FFFFFF';
        $options['clustering']['styles']['default'][4]['opt_textColor'] = '#FFFFFF';
    
        return $options;
    }
    add_filter( 'bgmp_map-options', 'bgmp_change_cluster_font_color' );

    Thanks again for going above and beyond.

    Plugin Author Ian Dunn

    (@iandunn)

    Glad to hear it 🙂

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Default style of marker clustering not working anymore’ is closed to new replies.