WordPress.org

Ready to get started?Download WordPress

Forums

Basic Google Maps Placemarks
[resolved] Categories feature requests (21 posts)

  1. frizzle
    Member
    Posted 2 years ago #

    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. :-)

    http://wordpress.org/extend/plugins/basic-google-maps-placemarks/

  2. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    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).

  3. chemboy
    Member
    Posted 2 years ago #

    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!

  4. Stefano De Prophetis
    Member
    Posted 2 years ago #

    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.

  5. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

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

  6. aslanov
    Member
    Posted 2 years ago #

    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?

  7. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  8. Dademaru
    Member
    Posted 2 years ago #

    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.

  9. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    #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.

  10. Dademaru
    Member
    Posted 2 years ago #

    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:

    <?php
    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?
    Thanks

  11. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  12. Dademaru
    Member
    Posted 2 years ago #

    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 ;-)

  13. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    [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?

  14. Dademaru
    Member
    Posted 2 years ago #

    Here's the code splitted in two part ;-)

    <?php
    $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
    ) );
    ?>

    and

    <?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="http://google.com/maps?q=<?php echo($address) ?>" target="_blank">Map</a></p>
    </li>
    <?php endwhile; endif; ?>

    hope it works ;-)

  15. aby87
    Member
    Posted 2 years ago #

    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 )

    Regards,

    Aby87

  16. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  17. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    Version 1.7 will support categories in the [bgmp-list] shortcode. It's almost ready for release, but I'd like to get some feedback and additional testing from other users. If you're interested you can download the release candidate and give feedback.

  18. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    1.7 is available now.

  19. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #


  20. Dademaru
    Member
    Posted 2 years ago #

    Thanks Ian, good job.
    I've installed the 1.7 and used the [bgmp-list] with categories and the [bgmp-map] with different parameters.
    I'm looking forward for your next update with (from your toDo) “have links in [bgmp-list] open repsective info on map”. This would be great.

  21. chemboy
    Member
    Posted 2 years ago #

    +1 for "have links in [bgmp-list] open repsective info on map”

    [don't stop now]

    :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic