I'm new to Maps API so this might be a simple mistake. The code below
works fine in Firefox 3.6.8. It draws the triangle on the map.
In IE 8 however, the following error occurs(when I click on View in
Browser from Visual Studio 2008 Visual Web Developer Express): "Line:
35 Error: 'undefined' is null or not an object". If I allow the
debuger to start I get: "....main.js line 35 character 326"
Website is just local to me so cant link to it.
Thanks:
code is:
function initialize() {
    var latlng = new google.maps.LatLng(26, -80);
    var myOptions = {
      zoom: 8,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var mymap = new
google.maps.Map(document.getElementById("map_canvas"),
        myOptions);

    test_poly(mymap);

}
function test_poly(mymap)
{
   var myLatlng = new google.maps.LatLng(26.001, -80.001);
   var marker = new google.maps.Marker
   (
       {
        position: myLatlng,
        title: "Map Test"
       }
    );
    marker.setMap(mymap);


    var triangleCoords = [
    new google.maps.LatLng(26.774252, -80.190262),
    new google.maps.LatLng(26.466465, -80.118292),
    new google.maps.LatLng(26.321384, -80.75737),
  ];
    var myTriangle = new google.maps.Polygon({
        paths: triangleCoords,
        strokeColor: "#FF0000",
        strokeOpacity: 0.8,
        strokeWeight: 2,
        fillColor: "#FF0000",
        fillOpacity: 0.35,
        map:mymap
    });


 };

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