jcdesign

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Changed API > Need Mashup based on custom fields #19626
    jcdesign
    Participant

    Thanks, I’m exploring both. I’ve been resistant to adding maps to posts, because this is a membership site where businesses submit info, including their address. I don’t want to add to my task list for each time a new business signs up. Perhaps I can auto-generate a Mappress Map as the post gets created, might explore that.

    That said, I tried a mashup, and I still don’t see how it helps me. I don’t think I’ve clearly explained what I’m trying to do — it might help if you can see it in action (with the 2.75.1 version of Mappress Pro).

    Currently on my development site, clicking on a sub-category limits both the listing and the points displayed on the map.

    The whole point (for me) is to be able to filter businesses on the fly and display them on the map. Having a method to interact via JavaScript is really the key to this. If I can do a reload via AJAX and filter my data, fine. But it really needs to update the map in real time, without a reload. For now, I think I need the public API in 2.75.1 more than other recent updates (although you fixed a bug I noticed w/ polygons).

    If I’m missing something, would love to hear it!

    Thanks,
    Jeremy

     

     

    in reply to: Changed API > Need Mashup based on custom fields #19623
    jcdesign
    Participant

    Hi Chris,

    I’m circling back to this, still somewhat stuck. (BTW, my post type is “is”, that may have confused you earlier!)

    I see that the mappress_post_query filter is run via AJAX. That seems like I could then manipulate on the fly from the front end — is that correct? And if so, is there any chance you can supply a short code example showing how to interact with the filter?

    This is a very simplified version of what I have so far:

    class MyMapClass {

    public function __construct() {
    add_filter( ‘mappress_post_query’, array( $this, ‘filter_map’ ), 10, 2 );
    }

    /**
    * @param Mappress_Map $map
    * @param array $args
    *
    * @return Mappress_Map
    */
    public function filter_map( $map, $args ) {

    // Do stuff here
    $map->pois = [ ‘foo’ ]; // TESTING filter  to see if I can break things – no changes

    return $map;
    }

    }

    new MyMapClass();

    I’m not seeing any effect on the maps I’ve generated via PHP. Any guidance would be appreciated — thank you.

    in reply to: Changed API > Need Mashup based on custom fields #19594
    jcdesign
    Participant

    I really don’t want to need a map for each post! Will keep digging. The JSON was auto-generated. I wasn’t trying to enter the JSON, just thought that could help point in the right direction. Thanks!

    in reply to: Changed API > Need Mashup based on custom fields #19592
    jcdesign
    Participant

    Also tried a simpler query, no results

    {
        "post_type": [
            "is"
         ]
    }
Viewing 4 posts - 1 through 4 (of 4 total)