Centering of Map

New home Forums Gold Add-on Centering of Map

This topic contains 2 replies, has 2 voices, and was last updated by  KevinBe 3 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #50779

    KevinBe
    Member

    I use the same map in multiple locations on my website. Each time I use the map I use a shortcode block to set the center and zoom level.

    Example #1 – What I want for all maps is like this. Where the infowindow does not open automatically.
    “https://dirtyfreehub.com/adventure/oregon-x/”
    “[*wpgmza id=”1″ marker=”7″ zoom=”7″]”

    Example #2 – The infowindow for the marker that I am centering around opens automatically as the page is renders. I do not want the infowindow to open, only want the map centered about that marker.
    “https://dirtyfreehub.com/adventure/oregon-x/maupin-gravel/”
    “[*wpgmza id=”1″ marker=”143″ zoom=”9″]”

    What do I need to change / do for the infowindow not to open automatically upon the page render?

    (Note – I added “” and * so that the code would render correctly in the forum.)

    Thanks!

    • This topic was modified 3 months, 2 weeks ago by  KevinBe.
    • This topic was modified 3 months, 2 weeks ago by  KevinBe.
    • This topic was modified 3 months, 2 weeks ago by  KevinBe.
    #50798

    AbelC
    Moderator

    Hi There,

    Thank you so much for getting in touch with us, and our sincere apologies for the inconvenience.

    Unfortunately, this is not supported at the moment, however, this can be achieved with Custom JS.

    Could I kindly ask if you could please navigate to Maps -> Settings -> Advanced -> Custom JS -> Please paste the following code:

    jQuery(document).ready(function(){
    var firstInfoWindowClosed = false;
    jQuery(document.body).on(“infowindowopen.wpgmza”, function (event) {
    if(firstInfoWindowClosed)
    return;
    event.target.close();
    firstInfoWindowClosed = true;
    });
    });

    This should now close the InfoWindow on page load.

    I hope this helps clarify, and please do let me know if this is working for you.

    Kind Regards,
    Abel

    #50805

    KevinBe
    Member

    Hmm, I entered the code … but the map is still opening the info window. I cleared all cache’s several times. Thoughts??

    See the following page for the behavior:”https://dirtyfreehub.com/adventure/oregon-x/maupin-gravel/”

    Thanks!

    • This reply was modified 3 months, 2 weeks ago by  KevinBe.
    #50808

    AbelC
    Moderator

    Hi There,

    Thank you so much for letting me know, and my sincere apologies for the inconvenience.

    Could I kindly ask if you could please navigate to Maps -> Settings -> Advanced -> Custom JS -> Please replace the previous code with the following:

    jQuery(document).ready(function(){
    var firstInfoWindowClosed = false;
    jQuery(document.body).on(‘infowindowopen.wpgmza’, function (event) {
    if(firstInfoWindowClosed)
    return;
    event.target.close();
    firstInfoWindowClosed = true;
    });
    });

    Please do let me know if this is working for you?

    If this issue still persists, would you be open at all to submit a support ticket https://www.wpgmaps.com/support/ and please provide us with a temporary admin account so that we can take a closer look as to what is causing this issue.

    If so, would it also perhaps be possible to please mention my name (Abel) in your ticket so that the other agents will assign your ticket to me.

    We look forward to hearing back from you.

    Kind Regards,
    Abel

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

You must be logged in to reply to this topic.