![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
Tagged: google map
-
AuthorPosts
-
March 23, 2018 at 6:40 pm #932071
I followed this thread (and others) on how to close one Marker Tooltip when opening another…
https://kriesi.at/support/topic/google-maps-tool-tips-query/… 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!
March 23, 2018 at 8:43 pm #932107the 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 // // ------------------------------------------------------------------------------------------- (function($) { "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;
and:
google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); });
replace with:
google.maps.event.addListener(marker, 'click', function() { if (openedInfoWindow != null) openedInfoWindow.close(); infowindow.open(map,marker); openedInfoWindow = infowindow; google.maps.event.addListener(infowindow, 'closeclick', function() { openedInfoWindow = null; }); google.maps.event.addListener(map, 'click', function() { infowindow.close(); }); });
see here working example: https://webers-testseite.de/weber/google-map-only-one-marker-open/
March 23, 2018 at 9:24 pm #932118@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!
March 23, 2018 at 9:59 pm #932124this 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: nonethe 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.March 23, 2018 at 10:25 pm #932125Very cool… and clever! I’ll give this a go on my sandbox server next week. Thank you and have a great weekend!
March 24, 2018 at 9:31 am #932268Hi lzevon,
Let us know how that worked for you.
@Guenni007 thank you for your great input!Best regards,
VictoriaMarch 24, 2018 at 7:27 pm #932459by the way Josues Code is brilliant – because if you click elsewhere on the map canvas the marker closes too.
-
AuthorPosts
- The topic ‘one Google map marker tooltip at a time’ is closed to new replies.