Traditional Culture Encyclopedia - Hotel franchise - js new bmap.drivingroute Why doesn’t the route show up?

js new bmap.drivingroute Why doesn’t the route show up?

var transit = new BMap.DrivingRoute(map, {

renderOptions: {

map: map,

panel: "allmap -result"

},

onSearchComplete: function (res) {

if (transit.getStatus() == BMAP_STATUS_SUCCESS) {

< p>var arrPois = res.getPlan(0).getRoute(0).getPath();

map.addOverlay(new BMap.Polyline(arrPois, {strokeColor: '#111'}));

map.setViewport(arrPois);

} else {

alert("Unable to search for relevant information");

}

}

});

transit.search("Juhua Group","Jinfeng International Trade Hotel");