Support » Plugin: Basic Google Maps Placemarks » Icon sizes

  • Resolved steacha


    Hi there,

    This is an swesome plugin, Ian, great job!

    I have a little problem, however. I used my own icons as place markers, and for some reasons, they are getting resized to a size bigger than their original size that makes them look pixelated.

    I’ve read the FAQ and did a search here, but couldn’t find a support answer that fixed my problem. Is there a parameter I can pass to the shortcode so that it keeps the original size of the icon I use as Featured Image? Right now, it’s loading the 150×150 pixels version of my marker. How do I prevent this from happening?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter steacha


    I did read this thread, actually.

    And, the icon links look like this for me:

    <path to uploads directory>/marker-image.png-150×150.png

    No resize is in the URL. I am not using JetPack or Photon.

    Thread Starter steacha


    Ok, well I solved my problem.

    In line 2517 in core.php, the custom marker is extracted with the following function call:

    $icon = wp_get_attachment_image_src( get_post_thumbnail_id( $postID ));

    This will return the ‘thumbnail’ size that is configured within WordPress (in Settings > Media). This ‘thumbnail’ dimension applies to ALL thumbnails that WP automatically generates for all uploaded images. It can be anything and NOT necessarily match the size of the custom markers.

    The fix is easy, though. Just change the line to the following:

    $icon = wp_get_attachment_image_src( get_post_thumbnail_id( $postID ), “full” );

    This way, WP is forced to send the ORIGINAL size of the image. I think you should consider adding this fix to the plugin, Ian. Or, at least, a parameter to the shortcode to instruct the plugin to use custom sizes or WP-generated ‘thumbnail’ dimensions.

    Plugin Author Ian Dunn


    I think thumbnail is the most sensible default for most users, and changing it would break backwards-compatibility.

    I’ve added a new filter in r829103, though, so you can change it without modifying the plugin’s files.

    It’s in trunk now, and will be in the next release.

    function set_bgmp_icon_size( $size ) {
    	return 'full';
    add_filter( 'bgmp_featured-icon-size', 'set_bgmp_icon_size' );
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Icon sizes’ is closed to new replies.