Please see this code...

<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title></title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?
sensor=false&sfgdata=
+sfgRmluamFuX1R5cGU9amF2YV9zY3JpcHQmRmluamFuX0xhbmc9dGV4dC9qYXZhc2NyaXB0+a"></
script>

<script type="text/javascript">
  var geocoder;
  var map;
  function initialize() {
    geocoder = new google.maps.Geocoder();
    var opzioni = {
      zoom: 8,

            mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById("map_canvas"),
opzioni);

var indirizzo = new Array();
var descr = new Array();
indirizzo[0]="Milano, Italy";
descr[0]='Milano';
indirizzo[1]="Piacenza, Italy";
descr[1]="Piacenza";
indirizzo[2]="Brescia";
descr[2]="Brescia";
indirizzo[3]="Arcore, Italia";
descr[3]="Arcore";

var i = 0;
for (i=0; i<4; i++)


{

       geocoder.geocode({ 'address': indirizzo[i]}, function(results,
status) {

          map.setCenter(results[0].geometry.location);

              var marker = new google.maps.Marker({     map: map,
                                            position: 
results[0].geometry.location,
                                            title: descr[i]        });



                                     });

                                                                                
                   }



  }


</script>
</head>
<body style="margin:0px; padding:0px;" onload="initialize()">
  <div>

  </div>
<div id="map_canvas" style="width:100%; height:90%"></div>
</body>
</html>


I can't visualize the string included in the array named descr[i].
If instead of title: descr[i],  i put a fixed string, so the code
become

     var marker = new google.maps.Marker({     map: map,
                                            position: 
results[0].geometry.location,
                                            title: 'Hello World'           });


the visualization works!!! I'm, going mad. Could you help me please?
Thanx


-- 
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.

Reply via email to