POI Titles

Home Forums MapPress Support POI Titles

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #17380
    stevenvh1
    Participant

    Hi

    I’m using Mappress Pro version 2.44.3 to generate a map for for each post of a particular type using a do_shortcode in the template file. The POI latitude and longitude are from custom fields. The code follows:

    <?php $my_post_meta_lat = get_post_meta($post->ID, ‘slat’, true);
    $my_post_meta_long = get_post_meta($post->ID, ‘slong’, true);
    if ( ! empty ( $my_post_meta_lat ) ){
    $shortcode = ‘[mashup mapid="2" height="400" width="500" zoom="9" title="test" ]‘;
    echo do_shortcode(“$shortcode”);
    }
    ?>

    I can’t seem to get it to display anything other than the lat/long as the POI link field in the popup.

    I have another page that call a mashup up all the posts of that type using a query but of course it shows the lat/long for each POI. The query is :

    [mashup mapid="64" query="squad" center="-33.15,146.9" zoom="6"]

    Also, the center tag seems to have no effect.

    I am probably missing something obvious but I haven’t been able to spot it.

    Thanks and regards
    Steven

    #17381
    Chris
    Keymaster

    Hi,

    That seems to just show map #2, if a lat/lng custom field is present, so it would show whatever was saved in map #2.

    Are you also using the ‘geocoding’ settings to generate a map in the post? If so, you can configure a field for lat, lng AND poi title, and the generated map should use that title. If you’re not using this already, please see the documentation for details about setting it up. You can use your existing custom fields and existing posts – just update the posts to generate the maps.

    Mashups autocenter so all the POIs are visible, so the center argument will be ignored.

    #17382
    stevenvh1
    Participant

    Hi Chris

    Wow – that was fast.

    I mustn’t have been clear. I am already using lat/long geocoding from custom fields to position the POI and have read that section of the doco. I had misunderstood the function of title in the geocoding section.

    My only question now is to ask if “meta-name” is the correct option in the title dropdown in the Mappress geocoding fields setup to use the post title as the POI title?

    Thanks and regards
    Steven

    #17383
    Chris
    Keymaster

    Hi,

    That dropdown matches the MapPress fields to the custom fields that already exist in your system (i.e., where one or more posts has those fields). Because ‘meta-name’ is specific to your system I can’t tell you if it’s the right field to use for POI titles – you’ll need to try it.

    Also in case it helps, here are two other things to know about titles:

    1) If you use an address instead of lat/lng in the geocoding fields, the plugin will show the address as the title by default.

    2) In mashups, you can set the plugin to display the post title rather than the POI title.

    #17987
    jaycollier
    Participant

    Newbie here.

    What would be the variable to replace the POI.title with the post title in the Mashup Popup template?

    #17988
    Chris
    Keymaster

    Hi,

    There’s a separate setting for this, ‘POI Content’ in the ‘Mashups’ section.

    There you can select what to show when a POI is clicked: the POI title & body or the Post title & excerpt.

    #18012
    awalker1999
    Participant

    Is there a way to have both the POI.title and post title show up for a mashup?

    #18013
    Chris
    Keymaster

    Hi,

    Sorry, but I haven’t had that request before. It’s currently hard-coded as an either/or (only one of the two titles is sent to the map).

    However – if you know PHP – you could use the filter ‘mappress_query_filter’ to adjust the map data sent to the mashup.

    If you’d like to try that route, please let me know (or have a look at file ‘mappress_query.php’ where you can see both the filter call and the title selection).

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