Hello all,
I'm having an issue getting a infowindow to open on a marker with
the MarkerClusterer Google Map V3 API. Below is my code so far. Can anyone
help?
<script type="text/javascript">
>
> function initialize() {
>
> var center = new google.maps.LatLng(54.385756, -4.465256);
>
> var map = new google.maps.Map(document.getElementById('map'), {
>
> zoom: 5,
>
> center: center,
>
> mapTypeId: google.maps.MapTypeId.ROADMAP
>
> });
>
> var markers = [];
>
> for (var i = 0; i < 100; i++) {
>
> var dataPhoto = data.posts[i];
>
> var latLng = new google.maps.LatLng(dataPhoto.latitude,
>
> dataPhoto.longitude);
>
> var marker = new google.maps.Marker({
>
> position: latLng
>
> });
>
> markers.push(marker);
>
> }
>
> var markerCluster = new MarkerClusterer(map, markers);
>
> var contentString = '<div id="content">'+
>
> '<div id="siteNotice">'+
>
> '</div>'+
>
> '<h1 id="firstHeading" class="firstHeading">Uluru</h1>'+
>
> '<div id="bodyContent">'+
>
> '<p><b>Uluru</b>, also referred to as <b>Ayers Rock</b>, 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.</p>'+
>
> '<p>Attribution: Uluru, <a
>> href="http://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
>
> 'http://en.wikipedia.org/w/index.php?title=Uluru</a> '+
>
> '(last visited June 22, 2009).</p>'+
>
> '</div>'+
>
> '</div>';
>
>
>
> var infowindow = new google.maps.InfoWindow({
>
> content: contentString
>
> });
>
> google.maps.event.addDomListener(marker, 'click', function() {
>
> infowindow.open(map,marker);
>
> });
>
> }
>
>
>> google.maps.event.addDomListener(window, 'load', initialize);
>
>
>> </script>
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-maps-js-api-v3/-/dHvt2sVhFzYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.