Support » Plugin: Basic Google Maps Placemarks » [Plugin: Basic Google Maps Placemarks] Categories feature requests

  • Resolved frizzle


    I’ve been trying to use the BGMP categories and running into all sorts of practical difficulties. Here are some things I had expected I would be able to do with the categories that I was not able to:

    1. Toggle categories on the maps on the fly. I understand this would require changing the way the plugin handles categories, but not being able to do this dynamically (that is, with Javascript) makes the categories almost useless. I understand they are provided in their current incarnation with the idea that you could use them to create multiple maps for a given site, but I think it’s probably much more common to have one map that allows you to filter things on and off.

    2. Have [bgmp-list] also respond to categories. This seems mandatory no matter how you slice it. [bgmp-list] is basically useless if you use categories, because it does not filter by them at all. This means that even if you did use the categories in the way they were imagined (multiple maps for a single site), you would be essentially prohibited from using [bgmp-list] as well, because it can’t be made to recognize what category page it is on.

    One additional feature request unrelated to categories:

    3. There should be an easy, plugin-independent way of specifying a new default image. At the moment I can do this by dropping in a new default-marker.png into my plugin directory, but this gets reset every time the plugin updates. A huge pain. There are also the “featured image” designations but setting each and every one of these manually is a huge pain when you have lots of placemarks, and all you want is a new default.

    What I’d really love is to be able to call some sort of simple function or set a variable in my theme’s functions.php, which would then be checked before a default image was used. That way it would be immune to being broken just because I upgraded my plugin.

    It would also be great if one could set category specific icons in this way, but that’s less mission-critical.

    Thanks for the work on this. I think it’s aaalllllmost there in terms of a really robust WP mapping plugin — these last few thing are all I’d need to be 100% happy. πŸ™‚

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author Ian Dunn


    1) This will be a relatively large amount of work, but I realize that a lot of people would like it. I’ve added it to the TODO list, but I’m not sure when I’ll have time to do it. If you’re interested in submitting a patch I’d be discuss that with you and integrate it into the core.

    2) This is already on the TODO list for a future release, probably 1.5.3. The core category feature was just added in 1.5 and I haven’t had time to complete all the related components yet.

    3) That’s a good idea. I’ll add a filter on the default image location in 1.5.2 for that. It’ll come out right around the time that WordPress 3.3 does (probably around the end of the month).



    i’ve just come across the limitation of the bmp-list when using categories [point 2] πŸ™

    isn’t there a way of inserting the correct category info in the same way the category filter function works for the maps? wouldn’t it be a similar line of code?

    this would be sooooo useful to me right now! because the map uses cats i assumed the list would too

    coders out there, get to it!

    I think a default icon for each category, and an easy way to filter the category from the map, would be two great and very useful upgrades.

    Plugin Author Ian Dunn


    Version 1.6 has a filter that lets you change the default icon. See the FAQ for details on using it.

    Hi Ian,

    I am using 1.6 but couldn’t find any filter option. I want to show map with multiple categories and able to filtering. is it possible?

    Plugin Author Ian Dunn


    aslanov, check the ‘Can I change the default marker icon?’ entry in the FAQ. It’s not an option that you change in the WordPress Admin Panel, but something code that you can put in your theme.

    Hi Ian,
    any news about point 1 and 2 of Frizzle post?
    We really need these features and would like to keep using your plugin.

    Plugin Author Ian Dunn


    #2 will probably be in v1.8. I don’t have any plans for #1 yet, but a lot of people have asked for it, so I may consider it in the future.

    Hi Ian,
    when will be released v.1.8?
    It’s essential to filter placemarks by category, otherwise this plugin it’s useless.
    Meanwhile I’m trying to query placemarks by category with this code:

    query_posts( array(
    'post_type' => 'placemarks',
    'posts_per_page' => 10,
    'orderby' => 'title',
    'order' => 'ASC',
    'category-slug' => 'europe'
    ) );

    It doesn’t work…
    I’ve tried with post_type Placemark, Placemarks, placemark and Placemarks but I don’t get any post on the page.
    It’s quite weird ’cause with every other post type this works.
    Could you help me?

    Plugin Author Ian Dunn


    Version 1.7 will probably be out in about a month, and 1.8 another 1-2 months after that.

    At least one reason why that code isn’t working is that you’re using the wrong post_type. It should be ‘bgmp’.

    You probably won’t be able to use category_slug either, since it’s a custom taxonomy. You should look at the tax_query argument. The category slug is bgmp-category.

    Thanks Ian,
    now it works, so I share the code if someone else need it.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Now I have different pages, each with its own map and its own placemarks list.
    It would be great to set different parameters in the [bgmp-map] shortcode, such as zoom level and map center.
    Another big feature to make this plugin the best one for its kind is to have links in [bgmp-list] open repsective info on map (I’ve seen it’s in your to-do), in the same page.
    I look forward for your updates, meanwhile thanks πŸ˜‰

    Plugin Author Ian Dunn


    [bgmp-map] shortcodes is in the list for 1.7.

    The mods removed the code you pasted because it was too long. Could you put it in a Pastebin and add the link here?

    Here’s the code splitted in two part πŸ˜‰

    $region = get_post_meta($post->ID, 'my_region', true);
    query_posts( array(
       	'post_type' => 'bgmp',
       	'posts_per_page' => -1,
       	'orderby' => 'title',
       	'order' => 'ASC',
       	'bgmp-category' => $region
    ) );


    <?php if ( have_posts() ) : while ( have_posts() ) : the_post();  $address = get_post_meta($post->ID, 'bgmp_address', true );?>
    <li class="list-item">
        	<h3 class="list-placemark-title"><?php the_title(); ?></h3>
        	<div class="list-description"><?php the_content(); ?></div>
        	<p class="list-link"><a href="<?php echo($address) ?>" target="_blank">Map</a></p>
    <?php endwhile; endif; ?>

    hope it works πŸ˜‰

    Hi Ian,

    Can you give me an example of what condition I need to make to set the default placemark by which category the placemark is in?

    if( $placemarkID == 354 )



    Plugin Author Ian Dunn


    aby87, try something like:

    function setBGMPDefaultIcon( $iconURL, $placemarkID )
    	$placemarkCategories = wp_get_object_terms( $placemarkID, 'bgmp-category' );
    	foreach( $placemarkCategories as $pc )
    		if( $pc->slug == 'restaurants' )
    			$iconURL = get_bloginfo( 'stylesheet_directory' ) . '/images/bgmp-default-icon.png';
        return $iconURL;
    add_filter( 'bgmp_default-icon', 'setBGMPDefaultIcon', 10, 2 );

    I haven’t tested that, so you may need to play around with it a bit, but that’d be the general idea.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Plugin: Basic Google Maps Placemarks] Categories feature requests’ is closed to new replies.