Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #932071

    I followed this thread (and others) on how to close one Marker Tooltip when opening another…

    … I edited the child theme to enqueue the revised shortcode.js in functions.php and copied/edited the shortcode.js per the above link. I also made sure permissions were the same in the initial dir/file structure from the default shortcode.js and the one in the child theme.

    But still when I click on a marker and then click on another, both remain open. Could you look (Appearance > Editor) at the codes to see why this still isn’t working?

    Thank you!


    the trick is that the code of ismael is absolutely right : but he has forgotten to mention that the one thing has to put globaly on top:

    look on top of the google maps function on shortcodes.js:

    // -------------------------------------------------------------------------------------------
    // AVIA MAPS API - loads the google maps api asynchronously 
    // afterwards applies the map to the container
    // -------------------------------------------------------------------------------------------
        "use strict";
          var openedInfoWindow = null;

    under the use strict that line: var openedInfoWindow = null; is missing in the info of ismael !

    so :

    on top of the avia map function

    "use strict";

    replace with:

    "use strict";
    var openedInfoWindow = null;


    google.maps.event.addListener(marker, 'click', function() {

    replace with:

    google.maps.event.addListener(marker, 'click', function() {
                        if (openedInfoWindow != null)
                        openedInfoWindow = infowindow;
                        google.maps.event.addListener(infowindow, 'closeclick', function() {
                            openedInfoWindow = null;
                        google.maps.event.addListener(map, 'click', function() {

    see here working example: https://webers-testseite.de/weber/google-map-only-one-marker-open/


    @Guenni007 thank you! I’m all set and this ticket can be closed. @Guenni007 I am interested to know how you centered the logo on your Enfold site: https://webers-testseite.de/weber/google-map-only-one-marker-open/

    I’ve had customers inquire about this, but never undertook the challenge.

    Thank you again!


    this is the header option: logo top menu under logo.
    in this case the menu is not part of av-logo-container so it can be set to display: none

    the logo is part of the menu – as a custom link – and than put in navigation-label html code like:
    <img src="url-to-logo.png" alt="Logo" />

    for resposive case you must set this “menu-logo” to display none – and reactivate the av-logo-container.

    The shrinking option is much more complicate. If you like to know it exactly – please open a new topic.
    Tomorrow i have more time to explain it.


    Very cool… and clever! I’ll give this a go on my sandbox server next week. Thank you and have a great weekend!


    Hi lzevon,

    Let us know how that worked for you.

    thank you for your great input!

    Best regards,


    by the way Josues Code is brilliant – because if you click elsewhere on the map canvas the marker closes too.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘one Google map marker tooltip at a time’ is closed to new replies.