Hi,I'm sorry to post this, as I'm sure the solution is obvious, but I
everytime I run this i am getting "this.overlays is undefined" for
each array item.

Can anyone point out what it is I'm missing. I'm new to these
prototype functions..


<script src="http://maps.google.com/maps?
file=api&v=2&key=ABQIAAAAXkQi8ZGE7TEjAKdyHQt6xxRC9NM_r8JUgI6OaaAhykgLGa55bhRDE3NmL6SsJYtUKYAGDS6jpKPRVQ&sensor=false"
type="text/javascript"></script>

<script type="text/javascript">
function initialize() {

var map;
map = new GMap(document.getElementById("map_canvas"));

map.setCenter( new GLatLng( 0, 0 ), 0 );

GMap.prototype.addOverlays=function(a){
        var b=this;
        for (i=0;i<a.length;i++) {
                try {
                        this.overlays.push(a[i]);
                        a[i].initialize(this);
                        a[i].redraw(true);
                } catch(ex) {
                        alert('err: ' + i + ', ' + ex.toString());
                }
        }
        this.reOrderOverlays();
};


var latlng1 = [ new GLatLng( 48.1234, -120.1234 ), new GLatLng
( 48.5678, -120.5678 ), new GLatLng( 48.9101, -120.9112 )];

map.addOverlays(latlng1);

  // Set center using the calculated values
  map.setCenter(new GLatLng( 48.1121, -120.1314 ), 10 );
}
</script>
</head>

<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 500px"></div>
</body>
body>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to