0
我有我的一些地圖標記,我試圖標記之間畫線,但我希望它走的道路,當我用谷歌地圖我按照這個例子...的OpenLayers捕捉到的道路
http://people.missouristate.edu/chadkillingsworth/mapsexamples/snaptoroad.htm
,並得到這個...
if (shiftPressed || path.getLength() === 0) {
path.push(lineCoordinates[x]);
if(path.getLength() === 1) {
poly.setPath(path);
}
} else {
service.route({ origin: path.getAt(path.getLength() - 1), destination: lineCoordinates[x], travelMode: google.maps.DirectionsTravelMode.DRIVING }, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
for(var i = 0, len = result.routes[0].overview_path.length; i < len; i++) {
path.push(result.routes[0].overview_path[i]);
}
}
});
}
x++;
反正是有做相同的OpenLayers?
如果你只是顯示常規瓷磚,然後OpenLayers不知道任何關於道路。 – OGHaza