• Resolved alessandrobarbetti

    (@alessandrobarbetti)


    Hi I have a Pro version of your plugin.
    I use your plugin to display a full width map of my posts on homepage.
    I’d like to add a button in post reading with “show in map” functionality.

    this is the website: https://itinerari.barbettihotels.it/

    I cannot find a way to center map to post position and open the info window from javascript.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @alessandrobarbetti,

    You simply should insert the map’s shortcode into the post with the attribute: defaultpost=”<post id>”. The attribute: defaultpost with the post’s id, indicates what should be the infowindow to display by default, and where to center the map, for exmple:

    [codepeople-post-map defaultpost="396"]

    Best regards.

    Thread Starter alessandrobarbetti

    (@alessandrobarbetti)

    Sorry I wasn’t clear in explanation of the problem…
    The map is already loaded in every page on an absolute layer with all the points loaded, activable via a map icon located on top right corner of the page.

    the way that u suggest could be implemented reloading the page, passing the post id via get variable and after load fade in the map with defaultpost.

    I’d prefer not reload the page cause data are already there and I just need to set map position on the right location and trigger the infowindow via javascript.

    is there a way to tell the map “scrollToPosition” and “openInfoWindow” via javascript?

    Plugin Author codepeople

    (@codepeople)

    Hello,

    In reality your page is being reloaded every time a post is visited, so, you can generate the shortcode depending of the post active. A different solution would require customize your copy of the plugin to expose the list of points and make them accessible from outside the plugin.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show in map button’ is closed to new replies.