Home › Forums › MapPress Support › MapPress Pro API?
- This topic has 5 replies, 3 voices, and was last updated 8 years, 8 months ago by
Chris.
-
AuthorPosts
-
December 10, 2013 at 2:44 am #13910
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…
December 11, 2013 at 1:40 am #13915Hi,
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!
December 11, 2013 at 6:24 am #13917Hi,
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.
December 12, 2013 at 12:25 am #13923Hi Chris,
many thanx, works like a charme…:)
Greetz from Austria
June 5, 2014 at 1:49 pm #14794Hi 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,
KellyJune 5, 2014 at 2:11 pm #14795Hi 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).
-
AuthorPosts
- You must be logged in to reply to this topic.