Multiple POIs From Custom Field

Home Forums MapPress Support Multiple POIs From Custom Field

This topic contains 5 replies, has 2 voices, and was last updated by  Chris 1 year, 3 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #16926

    mdp8593
    Participant

    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 – Michael

    #16928

    Chris
    Keymaster

    Hi,

    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://wphostreviews.com/mappress-documentation

    #16929

    mdp8593
    Participant

    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)?

    #16930

    Chris
    Keymaster

    Hi,

    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"
    
    #16932

    mdp8593
    Participant

    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?

    #16933

    Chris
    Keymaster

    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.

    #16934

    mdp8593
    Participant

    Okay, I’ll try that. Thanks again.

    #16935

    mdp8593
    Participant

    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.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.