info window opening on load
simeon.mattes - June 10, 2009 - 19:24
| Project: | GMap Module |
| Version: | 6.x-1.1-rc1 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi everybody,
I'm trying to find, how I'm going to make the info window in google map stay open on load.
Could any one help me?

#1
I am looking for the same thing, but for version 5.X. Any help?
#2
Actually I have found in the Api of Google Maps that wile the page is loading the following function will make the infoWindow to stay open
marker.openInfoWindowTabsHtml(infoTabs);
Though I don't know what to do with drupal!
eg.
window.onload = function load()
{
if (GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.923584,23.752141), 16); // NOTE: coordination
var infoTabs = [new GInfoWindowTab( "Tab #1", " Name
Info
here")]; // NOTE:personal info
var marker = new GMarker(map.getCenter());
GEvent.addListener(marker, "click", function()
{
marker.openInfoWindowTabsHtml(infoTabs);
});
map.addOverlay(marker);
marker.openInfoWindowTabsHtml(infoTabs);
map.addControl(new GLargeMapControl ( ));
map.addControl(new GMapTypeControl ( ));
map.addControl(new GScaleControl ( ));
}
}
#3
This isn't really a solution per say but this worked for me. Keep in mind, I have this module installed on a site and I'm only displaying one map with one marker.
Go to js/marker.js in the gmap module and comment out lines 39 and 41. Basically this checks for the option "autoclick" and, if it's present, automatically displays the marker. By commenting out the line, you're effectively saying "always auto display the info box". I have no idea how this would work with multiple markers so use at your own risk.
I could not find a way to feed the options in via macro. If there is support for it, then I'd assume you could just throw an "options=autoclick" somewhere in your macro for a specific marker and that marker should automatically display.
It looks like the functionality is in place, the macro just needs to be able to handle the "options" option.
#4
I have removed the following lines but i did not get the default info window
#5
Thanks droidenator!!!
Commenting those two lines works fine for me too. I also have only one map with one marker on my site.
It would indeed be better if this could be defined in the macro.
@simeon.mattes: I see this is assigned to you. Are you working on this?
#6
Thanks for your help...Actually, I did what droidenator said, but I don't agree on changing the function of modules...and although it is quite easy to "overide" a function in php, I don't know if it is a way in the api of drupal to do it for a javascript file.
#7
@simeon.mattes: OK, I unassigned you from this feature request. Hopefully somebody knows how to implement this in the macro.