August 17, 2016 at 4:34 am #16926
Hi Chris. I’m using custom fields to automatically generate a map for my Posts. Specifically, I’m using the Address Line 1 to input a custom field with a “lat, long” value.
Is there any possible way I can use multiple “lat, long” values to automatically generate multiple POIs?
I know that I can manually add POIs after the map has been automatically created, but this project involves importing about a thousand Posts from an XML file, and it would be great if I could do the multi-POI maps automatically.
Thanks in advance – MichaelAugust 17, 2016 at 4:36 am #16928
The automatic map generation is really designed to create 1 post per POI. However, you can combine the posts in any combination using a mashup. For example, try assigning the posts to a taxonomy (like categories or tags) to group them. Then it’s possible to do mashups based on the taxonomy terms – there are some examples here:
http://mappresspro.com/mappress-documentationAugust 17, 2016 at 9:15 am #16929
Thanks so much for the response Chris. I do know about mashups, and they are a great feature, but that’s not what I’m talking about here.
I’m talking about a single Post with multiple POIs associated with. Is there any possible way to automatically render multiple lat/long values contained in a single (or multiple) custom field(s)?August 17, 2016 at 9:52 am #16930
I don’t support generating multiple POIs per post and the code will eventually be deprecated. But there is still some older code in the current version that might do what you want if you’re doing a 1-time load.
To try it:
1. Configure a single field for the ‘address’ in the MapPress settings.
2. Edit a post and enter multiple values for that custom field. Use a separate for each POI, and format the rows as a shortcode. For example, for two POIs, enter:
address = "200 el camino real" title = "title 1" body = "body 1" iconid = "blue-dot" address = "300 el camino real" title="title2" body="body 2" iconid="green-dot"
You should also be able to use lat,lng – for example:
address = "-32,22" lat = "-32" lng = "22"August 18, 2016 at 5:14 am #16932
Thanks again Chris. I added this to my custom field:
address="37.611503, -119.01021500000002" address="34.320224, -118.25533399999999"
Unfortunately, the automatic map included only the second POI in the list.
Any other ideas?August 18, 2016 at 5:15 am #16933
To add two custom field values, you must use two separate custom field rows with the same field name (a WordPress requirement).
Entering both addresses in a single field, even with a carriage return between them, won’t work – it’ll be treated as a single value.August 18, 2016 at 7:08 am #16934
Okay, I’ll try that. Thanks again.August 18, 2016 at 7:08 am #16935
FYI, that worked. Now I just have to figure how to get them imported as separate custom field rows.
Thanks again for all your help Chris.
- You must be logged in to reply to this topic.