gMaps v3 - Have InfoWindow visible on map load

984 views
Skip to first unread message

bcbounders

unread,
Jan 24, 2012, 4:11:03 PM1/24/12
to google-map...@googlegroups.com
OK... so I feel really stupid.  All I want is to have the Google Map load with the InfoWindow for the one and only marker on the map to show right when the map loads.

I've searched the forum... and there are lots of questions/answers about how to trigger the display of the InfoWindow from all sorts of other objects (other link on the page, a button, AJAX call, etc)... but none that address how to have the map initially load with the InfoWindow displaying.

Help!

Thanks,

 - John

geoco...@gmail.com

unread,
Jan 24, 2012, 8:57:59 PM1/24/12
to Google Maps JavaScript API v3
On Jan 24, 1:11 pm, bcbounders <bcbound...@myfastmail.com> wrote:
> OK... so I feel really stupid.  All I want is to have the Google Map load
> with the InfoWindow for the one and only marker on the map to show right
> when the map loads.


Does that marker have an infowindow that opens when the user clicks on
it?

If so, use google.maps.event.trigger to activate the click listener at
the very end of your initialization.

-- Larry

bcbounders

unread,
Jan 25, 2012, 2:38:56 AM1/25/12
to google-map...@googlegroups.com
On Tuesday, January 24, 2012 5:57:59 PM UTC-8, geoco...@gmail.com wrote:
Does that marker have an infowindow that opens when the user clicks on
it?

If so, use google.maps.event.trigger to activate the click listener at
the very end of your initialization.

  -- Larry

Larry,

Yes... the marker has the default, click-to-open-the-infoWindow functionality.  Is there anything special that needs to be added to/edited on that "google.maps.event.trigger" line?  Or does that just trigger all associated "events" for the map?

Thanks for your help!

Marcelo

unread,
Jan 25, 2012, 2:42:35 AM1/25/12
to Google Maps JavaScript API v3
On Jan 24, 11:38 pm, bcbounders <bcbound...@myfastmail.com> wrote:

> Is there anything special that needs to be added to/edited
> on that "google.maps.event.trigger" line?  Or does that just trigger all
> associated "events" for the map?

The syntax is described in the documentation:
http://code.google.com/apis/maps/documentation/javascript/reference.html#event


--
Marcelo - http://maps.forum.nu
--

bcbounders

unread,
Jan 25, 2012, 2:59:10 AM1/25/12
to google-map...@googlegroups.com
On Tuesday, January 24, 2012 11:42:35 PM UTC-8, Marcelo wrote:
The syntax is described in the documentation:
http://code.google.com/apis/maps/documentation/javascript/reference.html#event

--
Marcelo - http://maps.forum.nu
--

Thanks, Marcelo.  I'm checking it out now.

 - John
Reply all
Reply to author
Forward
0 new messages