MapPress Pro API?

Home Forums MapPress Support MapPress Pro API?

Tagged: , , ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13910
    edei
    Participant

    Hi Chris,

    is there a way to extract the datas for a POI (e.g. lat/lan, Adress) of a map of a post?

    I need to create a custom xml feed and have to deliver those informations in a certain format. So I need to extract those infos.

    But how?

    Thanx for any hint…

    #13915
    edei
    Participant

    Hi,

    ok, maybe I didn’t make it clear enough what I need:

    In my custom XML Feed I need to insert the adress, the lat and the long for each POI of the map of the post.

    The feed should look like that:

    <poi>
                <id>xxx</id>
                <title>xxx</title>
                <updated>xxx</updated>
                <coordinate>
                    <latitude>xxx</latitude>
                    <longitude>xxx</longitude>
                </coordinate>
                <seaLevel>xxx</seaLevel>
                <address>
                    <street>xxx</street>
                    <zipCode>xxx</zipCode>
                    <city>xxx</city>
                </address>
                <region>xxx</region>
                <province>xxx</province>
    </poi>

    And the ‘xxx’ has to be filled up with the datas from the map.

    So, how can I do this? I have really no clue! I’m currently running 2.40.7 pro

    Thank you in advance for your help!

    #13917
    Chris
    Keymaster

    Hi,

    If you’re using PHP you can get an array of all the maps for a post like this (1234 is the post ID):

    Mappress_Map::get_post_map_list(1234);

    Each map will have a ‘pois’ array of POI objects. And each POI object will have a ‘point’ array with members ‘lat’ and ‘lng’. For example to print all the POIs:

    
    $maps = Mappress_Map::get_post_map_list(1234);
    foreach ($maps as $map) {
      foreach ($map->pois as $poi) {
        echo "Lat: " . $poi->point['lat'] . " Lng: " . $poi->point['lng'];
      }
    }
    

    If you want every map in the system instead of every map for one post, you can use:
    $maps = Mappress_Map::get_list();

    I hope that helps.

    #13923
    edei
    Participant

    Hi Chris,

    many thanx, works like a charme…:)

    Greetz from Austria

    #14794
    Rainmaster
    Participant

    Hi Chris,

    Is it possible to show maps from one site on a second site via a feed?

    I have custom posts (business) with a map connected to each. I don’t care to load the posts or maps to the second site but just be able to show the taxonomy mashups. Both sites would have the same types, taxonomies, fields etc. Possibly show original maps on the second site and add maps to that site from the first site?

    Thank you so much for all of your kind help,
    Kelly

    #14795
    Chris
    Keymaster

    Hi Kelly,

    Sorry, but no, that’s not a feature of the plugin. You could possibly show pages from another site in an iframe, but to show just only the map in the iframe you would need a custom template page for that purpose (i.e. without a menu, header, etc).

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.