Spaces

Info windows

html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}

// This example displays a marker at the center of Australia.
// When the user clicks the marker, an info window opens.

function initialize() {
var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var mapOptions = {
zoom: 4,
center: myLatlng
};

var map = new google.maps.Map(document.getElementById(‘map-canvas’), mapOptions);

var contentString = ‘

‘+

‘+

‘+

Uluru

‘+

‘+

Uluru, also referred to as Ayers Rock, is a large ‘ +
‘sandstone rock formation in the southern part of the ‘+
‘Northern Territory, central Australia. It lies 335 km (208 mi) ‘+
‘south west of the nearest large town, Alice Springs; 450 km ‘+
‘(280 mi) by road. Kata Tjuta and Uluru are the two major ‘+
‘features of the Uluru – Kata Tjuta National Park. Uluru is ‘+
‘sacred to the Pitjantjatjara and Yankunytjatjara, the ‘+
‘Aboriginal people of the area. It has many springs, waterholes, ‘+
‘rock caves and ancient paintings. Uluru is listed as a World ‘+
‘Heritage Site.

‘+

Attribution: Uluru, ‘+
‘http://en.wikipedia.org/w/index.php?title=Uluru
‘+
‘(last visited June 22, 2009).

‘+

‘+

‘;

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);
});
}

google.maps.event.addDomListener(window, ‘load’, initialize);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: