MashUp -> Link from Post to MashUp

Home Forums MapPress Support MashUp -> Link from Post to MashUp

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #18849
    Unbekannt
    Participant

    Hi,
    We bought your plugin and are very happy with it.
    We are trying to generate a link from a post to the MashUp map.
    One marker is set in the post and when you click on the link you should come to the MashUp Map page and the post should be centered.
    Is that possible?

    #18850
    Chris
    Keymaster

    Hi,

    I’m sorry, but that’s not possible. The mashup has links to the individual post, but not the other way around. You could link back to the mashup page (you can put a link it the POI title or body) but it won’t open a specific marker when displayed.

    #18854
    Unbekannt
    Participant

    Hello,
    I found a small solution with the help of hashtags. For this I need the post title on the mashup page without spaces. I’ve tried it for a few hours now, but it doesn’t work. I would just have to remove the spaces from {{poi.title}}. Do you have a solution? I would be very grateful.

    This is what my code currently looks like:
    <div class=”mapp-title” value=”<?php $str = ‘{{poi.title}}’; echo wordwrap(strtolower($str), 1, ‘-‘, 0); ?>”>{{{poi.title}}}</div>

    #18855
    Chris
    Keymaster

    Hi,

    The template variables are actually output from JavaScript. So it’s not possible to use things like {{poi.title}} in PHP functions.

    However, it is possible to trim spaces from the title using the JavaScript trim() function, like this:
    <div class='mapp-title'><# print(poi.title.trim()); #></div>

    There is some more information in the MapPress documentation, or this page explains more about JavaScript templates in general:
    https://codex.wordpress.org/Javascript_Reference/wp.template

    #18860
    Unbekannt
    Participant

    Thank you very much, it works now.

    Unfortunately I couldn’t find an answer to a little other question. Is it possible to display all items in the items list in the MashUp map?

    #18861
    Chris
    Keymaster

    Hi,

    I’m not sure I understand. The list shows whatever is shown in the mashup, and that can’t be modified.

    To show all posts in the mashup, use this:

    [mashup query="all"]

    Or just:

    [mashup]

    #18862
    Unbekannt
    Participant

    Sorry, I described it badly.

    Currently, only those items are displayed in the list that are also in the mashup map’s field of view.
    Is it possible to select a certain center and zoom and still get all results displayed in the list even if they are not in the field of view?

    Thanks for your support. 🙂

    Best regards

    #18863
    Chris
    Keymaster

    Hi,

    I’m sorry, but the list is always synchronized to what’s visible on the map (similar to Google Maps, etc.)

    The only option to get everything in the list would be to zoom the map out far enough to see all the markers.

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