Reverse Marker Appearance Logic for Categories (4 posts)

  1. mariostella
    Posted 4 years ago #

    I am trying to reverse the logic that shows posts on a map with a category legend.

    The default is that for posts belonging to multiple categories, they will be shown on the map as long as there is at least one category they belong to checked in the category list.

    I am trying to make so that a post is shown on maps only when all the categories it belongs to are checked, and if even only one is unchecked then the post is not shown on the map anymore.

    I was looking at the JS files, which seem the most suitable place for something like this, but can't seem to find a clear clue.

    So my question is. Is this even possible? If yes I would appreciate a lot a pointer on what files I have to look for to tackle this.

  2. Michael
    Forum Moderator
    Posted 4 years ago #

    i have no idea what you are working with and if the info below wil fir into your code;
    however, info on how wordpress gets posts of categories:


    query_posts( 'cat=4' );
    will get all posts with at least the category and its child cats;

    query_posts( array( 'category__in' => array( 2, 6 ) ) );
    will get post that are in cat2 OR cat6, no child cats;

    query_posts( array( 'category__and' => array( 2, 6 ) ) );
    will get posts that are in cat2 AND cat6 at the same time, no child cats

  3. mariostella
    Posted 4 years ago #

    Hi Alchymyth, thanks for your reply. I was in a rush and forgot to specify in the body of the post that I am working with Geo Mashup, I thought the tag on the side would be more visible. Sorry!

  4. Dylan Kuhn
    Posted 4 years ago #

    You might be better off creating a separate control using your own logic rather than trying to use the Geo Mashup control. Geo Mashup 1.4 has some routines for updating marker visibility that might be helpful for this, but you'd still have to code your logic yourself.

Topic Closed

This topic has been closed to new replies.

About this Topic