google map v3 回调画线问题

lvxianda 2012-04-24 03:19:21
function PlayBack()
{
////////////////////////////////放到回调函数里无法显示
alter(PointsSet[countNum-1]) //这里是可以弹出坐标值得。 path的值没有任何问题
polyline = new google.maps.Polyline({
path:
[PointsSet[countNum-1],PointsSet[countNum]],
geodesic: true,
strokeColor: "#FFFF00",
strokeOpacity: 1,
strokeWeight: 4
//fillOpacity:0.5
});
polyline.setMap(map);
}

function initialize()
{
PointsSet = <%= Points%>;
//////////////////////放在这里可以使用
polyline = new google.maps.Polyline({
path:
[PointsSet[countNum-1],PointsSet[countNum]],
geodesic: true,
strokeColor: "#FFFF00",
strokeOpacity: 1,
strokeWeight: 4
//fillOpacity:0.5
});
polyline.setMap(map);
//////////////////////////////////////////////////
window.setInterval("PlayBack()",500);
...全文
185 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lvxianda 2012-04-24
  • 打赏
  • 举报
回复
polyline.setMap(map)的问题,好像只有initialize 方法里的好用。
求解决方法

6,721

社区成员

发帖
与我相关
我的任务
社区描述
专题开发/技术/项目 Google技术社区
社区管理员
  • Google技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧