Hi this is my problem. I make a kml layer (called "gino.kml") whith 35
clickable polygons named from "1" to "35". I load it in html page and
when I click one polygon, the default infowindow trigger me the name
of the polygon I clicked.
The problem is that I want add and edit html text on the infowindow of
every polygon and I can't know how. I try to find
instruction on others post on this group and I wrote this code but it
doesn't work.
This is the code, can anyone help me???
function initialize() {
var chicago = new google.maps.LatLng(44.2419, 8.7919);
var myOptions = {zoom: 9, center: chicago, mapTypeId:
google.maps.MapTypeId.ROADMAP };
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
var nyLayer = new google.maps.KmlLayer("http://sima.liguriainrete.it/
LaRaf/icone/gino.kmz", {suppressInfoWindows:true, preserveViewport:
true,map: map});
google.maps.event.addListener(nyLayer, 'click', function(kmlEvent)
{
var text = kmlEvent.featureData.name;
var desc = kmlEvent.featureData.description;
showInContentWindow(text,desc);
var infowindow = new google.map.InfoWindow();
infowindow.close();
infowindow.setOptions({content: kmlEvent.featureData.name, position:
kmlEvent.position});
infowindow.open(map);
});
function showInContentWindow(text,description)
{
document.forms.Parametri.Capannina.value=text;
document.forms.Parametri.Data_inizio.value=description;
}}
</script>
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
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.