谷歌地图折线不会出现?

时间:2011-11-23 12:19:37

标签: javascript google-maps-api-3

我已经使用以前使用过firebug的工作版本进行了检查 每个线对象都有一个Ec成员,其成员的坐标值为纬度和经度。

但是当我的新版本的代码没有出现时,并且在检查这些值时,我在firebug中获得了无穷大的所有四个具有2个端点的行的坐标

stars[thisMarker.starsref].flightPath.push(new google.maps.Polyline({
                    path: stars[thisMarker.starsref].flightPlanCoordinates,
                    strokeColor: 'white',
                    strokeOpacity: 0.1,
                    strokeWeight: 0.5
                  }));
            stars[thisMarker.starsref].flightPath[stars[thisMarker.starsref].flightPath.length-1].setMap(map);

1 个答案:

答案 0 :(得分:0)

为什么不这样做,而不是调用setMap:

stars[thisMarker.starsref].flightPath.push(new google.maps.Polyline({
                    path: stars[thisMarker.starsref].flightPlanCoordinates,
                    strokeColor: 'white',
                    strokeOpacity: 0.1,
                    strokeWeight: 0.5,
                    map: map
                  }));
相关问题