Google maps api 3 google maps api v3多段线未显示在visual basic webbrowser控件中

Google maps api 3 google maps api v3多段线未显示在visual basic webbrowser控件中,google-maps-api-3,Google Maps Api 3,Google maps v2中的多段线在visual basic web浏览器中运行良好。现在Google maps v3返回一个错误“无法设置未定义或空引用的属性'lat'。该应用程序作为来自visual basic程序的Javascript html文件运行。当我直接在Internet Explorer中执行脚本时,多段线工作得很好 有人知道问题出在哪里吗 以下是我的HTML代码: <!DOCTYPE html> <html> <head> &

Google maps v2中的多段线在visual basic web浏览器中运行良好。现在Google maps v3返回一个错误“无法设置未定义或空引用的属性'lat'。该应用程序作为来自visual basic程序的Javascript html文件运行。当我直接在Internet Explorer中执行脚本时,多段线工作得很好

有人知道问题出在哪里吗

以下是我的HTML代码:

<!DOCTYPE html>
<html>
  <head>
    <title>Simple Map</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyDGYPgYpwZ4ZQCLCAujetDwArlVBC_S9TI&sensor=false"></script>
    <script>
var map;
function initialize() {
  var mapOptions = {
    zoom: 4,
    center: new google.maps.LatLng(36.70245,-95.7185)
  };
  map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);



 //<!var image = 'http://google.com/mapfiles/ms/micons/wht-circle.png';  
  var image = 'http://google.com/mapfiles/kml/paddle/wht-circle.png';
  var DC = new google.maps.Marker({
      position: new google.maps.LatLng(36.70245,-95.7185),
      map: map,
      icon: image
  });

  var image = "http://labs.google.com/ridefinder/images/mm_20_gray.png";
  var Customer = new google.maps.Marker({
      position: new google.maps.LatLng(31.291982, -95.821856),
      map: map,
      icon: image
  });

 var Customer = new google.maps.Marker({
      position: new google.maps.LatLng(41.291982, -105.821856),
      map: map,
      icon: image
  });

  var polyline = [
    new google.maps.LatLng(36.70245,-95.7185),
    new google.maps.LatLng(31.291982, -95.821856),
  ];
  var polyline_overlay = new google.maps.Polyline({
    path: polyline,
    strokeColor: '#FF0000',
    strokeOpacity: 1.0,
    strokeWeight: 2
  });
  polyline_overlay.setMap(map);

  var polyline = [
    new google.maps.LatLng(36.70245,-95.7185),
    new google.maps.LatLng(41.291982, -105.821856),
  ];
  var polyline_overlay = new google.maps.Polyline({
    path: polyline,
    strokeColor: '#FF0000',
    strokeOpacity: 1.0,
    strokeWeight: 2
  });
  polyline_overlay.setMap(map);

}

google.maps.event.addDomListener(window, 'load', initialize);

    </script>
  </head>
  <body>
    <div id="map-canvas"></div>
  </body>
</html>

简单地图
html,正文,#地图画布{
身高:100%;
边际:0px;
填充:0px
}
var映射;
函数初始化(){
变量映射选项={
缩放:4,
中心:新google.maps.LatLng(36.70245,-95.7185)
};
map=new google.maps.map(document.getElementById('map-canvas'),
地图选项);
//

对于初学者,可以删除最后一个坐标后的逗号: 变量多段线=[ 新google.maps.LatLng(36.70245,-95.7185), 新google.maps.LatLng(41.291982,-105.821856), ])

应该是: 变量多段线=[ 新google.maps.LatLng(36.70245,-95.7185), 新的google.maps.LatLng(41.291982,-105.821856)//删除这里的逗号
];

您的控件模拟的浏览器和版本是什么?您尝试过其中一种吗?有时在实验版本中会出现“中断”。