Using one map but centered on different locations depending on page

New home Forums Pro Add-on Pre-sale questions Using one map but centered on different locations depending on page

This topic contains 8 replies, has 3 voices, and was last updated by  Wales Antiques 4 days, 11 hours ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #51961

    sneakymoose
    Member

    Hi there! I am considering purchasing the pro version but want to be sure I will be able to do what I am hoping. I’d like to be able to maintain one big map with many markers, but have the map centered on a certain marker depending on the page on which I am placing the shortcode. For example, I’d like to have a page on my website dedicated to Location A. On that page I would like my big map to be centered on Marker A, but then the user could interact with the map and zoom out to see other locations. However on my site page dedicated to Location B, I’d like to use that same map with all those markers, but have it centered on Marker B by default when the user arrives on that page.

    Currently I don’t see a way to affect shortcodes in any way to tell the map where to center. I don’t want to have to maintain all my markers across multiple maps, though. Is there a way to do what I’m asking and if so what are the settings I should use? Thank you!

    #51994

    Hi there,

    Thank you for getting in touch with us.

    Yes, this is possible and you can set the marker to focus on depending on the page using GET variables. Here is a link on how to use this: https://www.wpgmaps.com/documentation/using-get-variables-to-control-your-map-linking-to-a-marker-from-another-page/

    In essence, you can set which marker to focus on by adding the ‘markerid’ variable to the link of the page, for example: http://www.example.com/page/markerid=1

    The markerid is the ID of the marker which you can see from the dashboard when editing the map and markers. You can also set the zoom with the ‘zoom’ attribute.

    Please do let me know if this helps and if you have any questions regarding this and I would be happy to help.

    Best regards,
    Dylan

    #52138

    sneakymoose
    Member

    Thank you for the reply!

    So I can see that this is doing what I am looking for, but including the marker ID with a GET variable every time does seem cumbersome. Is there a way to include some sort of variable in the map’s shortcode rather than in the page’s URL that would center the map on a certain location?

    I ask because every time a certain page loads (a page detailing a certain store location, for example) the map should be centered on that store. It seems like if there is a way to do this with the page’s URL, there should also be a way to do it within the shortcode itself?

    Would appreciate any more help you can offer – thank you!

    #52145

    Hi there,

    Thanks for the response and information.

    This is not possible by default, however, I would be happy to assist you with this customization.

    Could I kindly ask if you could please send me a link to your website with the map where you have added a marker ID to the shortcode using the ‘marker’ shortcode and I will prepare the required code to achieve this and then send it to you?

    Thanks for your time.

    Best regards,
    Dylan

    #52179

    sneakymoose
    Member

    Hi Dylan, thank you for your response and your offer to help with the custom code. I’m not quite to that point yet but I will reach back out when I get there. Will I be able to take the code you write and apply it to other maps on other pages? (i.e. will you be adding something to the short code itself or will you be adding custom functionality within the template files of the plugin?) I ask because this is something I am planning to use on many pages …

    Thank you again!

    #52192

    Hi there,

    Thanks for the response.

    This will be created as a custom plugin which will work for all the maps you add and will be completely dynamic.

    I hope this helps and will be looking forward to hearing back from you to assist you further with this.

    Best regards,
    Dylan

    #53924

    Yes, this is similar to my own pre-sales question.

    I have been using (the seemingly defunct) Ready! Google Maps.
    Using that, I have over one hundred markers and only one map.

    The functionality I require is a shortcode (in each post) which identifies the map, the specific marker sets zoom level and determines map size.

    I have another question about importing a CSV from Ready Google but I guess I should open another question.

    #53937

    Hi there,

    Thank you so much for getting in touch with us.

    This is possible with Get variables which allows you to use the same map but center it on a different marker and change the zoom level as well.
    To do this, you can add the following to the end of your URL:
    ?markerid=83&mzoom=12

    Where ‘markerid’ is the ID of the marker you want to center on and ‘mzoom’ is the zoom level you want to use.

    You can find full documentation on using the GET variables from https://www.wpgmaps.com/documentation/using-get-variables-to-control-your-map-linking-to-a-marker-from-another-page/

    Please do let me know if this helps and works as expected.

    Regarding the CSV question, I would be more than happy to help you here, however, you could also create a new ticket here: https://www.wpgmaps.com/contact-us/ and we will assist you as soon as possible.

    I hope this helps and I look forward to hearing from you.

    Best regards,
    Dylan

    #54059

    Thank you, Dylan.
    As I understand it that is creating a map that stands alone.
    I want the map embedded in a post.
    Like this…

    The Keeper’s Pocket Hay on Wye

    #54060

    Hi there,

    This will also work for a map embedded in a post.

    Please do let me know if you experience any issues with this at all and I will be happy to help.

    Best regards,
    Dylan

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

You must be logged in to reply to this topic.