I am try the Google Maps API and run into a little problem. Look at this example below. I want to have a Infobox open when I go to the site (not like in this example from google that it is cloesed and triggered by an click event). How to manage this? Maybe this is a beginners question to a Google Maps Api pro^^
> function initialize() {
> var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
> var myOptions = {
> zoom: 4,
> center: myLatlng,
> mapTypeId: google.maps.MapTypeId.ROADMAP
> }
>
> var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
>
> var contentString = '<div id="content">'+
> '<div id="siteNotice">'+
'hello world</div>'+
> '</div>';
>
> var infowindow = new google.maps.InfoWindow({
> content: contentString
> });
>
> var marker = new google.maps.Marker({
> position: myLatlng,
> map: map,
> title: 'Uluru (Ayers Rock)'
> });
> google.maps.event.addListener(marker, 'click', function() {
> infowindow.open(map,marker);
> }); }
Just add
infowindow.open(map,marker);to the end of yourinitialize()function: