百度地图 JS API 搜索多个城市连线
只能搜索一个城市,多个城市搜索不了?varPoints=[];varcities=newArray("重庆","九寨沟","成都","乐山","峨眉山");varLS=n...
只能搜索一个城市,多个城市搜索不了?
var Points=[];
var cities = new Array("重庆","九寨沟","成都","乐山","峨眉山");
var LS = new BMap.LocalSearch(map, {
renderOptions:{map: map}
});
LS.search(cities);
LS.setMarkersSetCallback(function(point){
for(var i=0;i<point.length;i++){
Points[i]=point[i];
}
})
var polyline = new BMap.Polyline(Points, {strokeColor:"red", strokeWeight:2, strokeOpacity:0.8});
map.addOverlay(polyline); 展开
var Points=[];
var cities = new Array("重庆","九寨沟","成都","乐山","峨眉山");
var LS = new BMap.LocalSearch(map, {
renderOptions:{map: map}
});
LS.search(cities);
LS.setMarkersSetCallback(function(point){
for(var i=0;i<point.length;i++){
Points[i]=point[i];
}
})
var polyline = new BMap.Polyline(Points, {strokeColor:"red", strokeWeight:2, strokeOpacity:0.8});
map.addOverlay(polyline); 展开
1个回答
广东轻亿云软件
2024-05-14 广告
2024-05-14 广告
广东轻亿云软件科技有限公司是一家数字化服务提供商,致力于专业的数据集成,数据运营,数据分析服务领域, 使繁杂数字化应用从此变得简单,易用,构建万物互联的数字化企业。目前我们已经为100+原厂软件提供了全场景的系统集成能力,为500+客户提供...
点击进入详情页
本回答由广东轻亿云软件提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询