Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    I was also wondering about loading marker images via google although they exist in the plugin image folder.
    You can fix this problem by altering the core.php file. Search for public function getMapOptions and add the ‘default’ style. I use this as default style:
    'default' => array(
    array(
    'url' => plugins_url( 'includes/marker-clusterer/images/m1.png', __FILE__ ),
    'height' => 52,
    'width' => 53,
    'opt_anchor' => array( 30, 0 ),
    'opt_textColor' => '#ffffff',
    'opt_textSize' => 11
    ),

    array(
    'url' => plugins_url( 'includes/marker-clusterer/images/m2.png', __FILE__ ),
    'height' => 55,
    'width' => 56,
    'opt_anchor' => array( 32, 0 ),
    'opt_textColor' => '#ff0000',
    'opt_textSize' => 11
    ),

    array(
    'url' => plugins_url( 'includes/marker-clusterer/images/m3.png', __FILE__ ),
    'height' => 65,
    'width' => 66,
    'opt_anchor' => array( 44, 0 ),
    'opt_textColor' => '#ffffff',
    'opt_textSize' => 12
    ),
    array(
    'url' => plugins_url( 'includes/marker-clusterer/images/m4.png', __FILE__ ),
    'height' => 77,
    'width' => 78,
    'opt_anchor' => array( 55, 0 ),
    'opt_textColor' => '#ffffff',
    'opt_textSize' => 12
    ),
    array(
    'url' => plugins_url( 'includes/marker-clusterer/images/m5.png', __FILE__ ),
    'height' => 89,
    'width' => 90,
    'opt_anchor' => array( 66, 0 ),
    'opt_textColor' => '#ffffff',
    'opt_textSize' => 12
    )
    ),

    I also realized that the defined arrays anchor, textColor and textSize will not be used by the markerclusterer_packed.js. A quick search ponited me to the right direction by changing them (put opt_ before) to get it work with th js file.

    Plugin Author Ian Dunn

    (@iandunn)

    @this-is-me: Thanks for the heads up about adding the ‘default’ entry, and setting the correct names for anchor/textColor/textSize. I’ll take a look at that when I get a chance.

    You don’t need to hack core.php to change modify the options, though, you can use the bgmp_map-options filter at the end of that function instead.

    See The Right Way to Customize a WordPress Plugin for more info.

    Hi Ian,

    great and thank you for this information. I did not realized that there is a filter for the options, because I had not read until the end of the function.
    I removed my hacking and it is working fine with the bgmp_map-options filer now, which I would like to share (put this in you functions.php):

    function bgmp_default_style($options) {

    $options['clustering']['styles'] = array(
    'default' => array(
    array(
    'url' => get_bloginfo('stylesheet_directory') . '/images/m1.png', __FILE__ ,
    'height' => 52,
    'width' => 53,
    'opt_anchor' => array( 30, 0 ),
    'opt_textColor' => '#ffffff',
    'opt_textSize' => 11
    ),

    array(
    'url' => get_bloginfo('stylesheet_directory') . '/images/m2.png', __FILE__,
    'height' => 55,
    'width' => 56,
    'opt_anchor' => array( 32, 0 ),
    'opt_textColor' => '#ff0000',
    'opt_textSize' => 11
    ),

    array(
    'url' => get_bloginfo('stylesheet_directory') . '/images/m3.png', __FILE__,
    'height' => 65,
    'width' => 66,
    'opt_anchor' => array( 44, 0 ),
    'opt_textColor' => '#ffffff',
    'opt_textSize' => 12
    ),
    array(
    'url' => get_bloginfo('stylesheet_directory') . '/images/m4.png', __FILE__,
    'height' => 77,
    'width' => 78,
    'opt_anchor' => array( 55, 0 ),
    'opt_textColor' => '#ffffff',
    'opt_textSize' => 12
    ),
    array(
    'url' => get_bloginfo('stylesheet_directory') . '/images/m5.png', __FILE__,
    'height' => 89,
    'width' => 90,
    'opt_anchor' => array( 66, 0 ),
    'opt_textColor' => '#ffffff',
    'opt_textSize' => 12
    )
    )
    );

    return $options;

    }
    add_filter('bgmp_map-options', 'bgmp_default_style' );

    Plugin Author Ian Dunn

    (@iandunn)

    Cool, thanks for sharing 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Default cluster image not taken from includes/marker-clusterer/images’ is closed to new replies.