我在这里按照教程https://code.google.com/p/osmbonuspack/wiki/Tutorial_1但我遇到了一个错误,它没有正确显示正确的路线.它只显示从A点到B点的直线.
我想要实现的是从这些点显示正确的路线.我猜错误是它无法识别任何节点.
还有一个类似的问题也被问到,如果我没有很好地解释我的问题,我假设我有同样的问题.
类似的问题可以在这里找到:OSMDroid跟踪教程时的路由问题
以下是使用RoadManager的代码的一部分
这是代码的一部分.
try {
//get current longlat
gpsLocator.getLocation();
cur_loc_lat =gpsLocator.getLatitude();
cur_loc_long =gpsLocator.getLongitude();
} catch (Exception e) {
// TODO: handle exception
}
//--- Create Another Overlay for multi marker
anotherOverlayItemArray = new ArrayList<OverlayItem>();
anotherOverlayItemArray.add(new OverlayItem(
"UST", "UST", new GeoPoint( testlat, testlong)));
//--- Create Another Overlay for multi marker
anotherOverlayItemArray.add(new OverlayItem(
locDefine[0], "UST", new GeoPoint( sel_latitude, sel_longitude)));
ItemizedIconOverlay<OverlayItem> anotherItemizedIconOverlay
= new ItemizedIconOverlay<OverlayItem>(
TomWalks.this, anotherOverlayItemArray, myOnItemGestureListener);
myOpenMapView.getOverlays().add(anotherItemizedIconOverlay);
//---
//Add Scale Bar
ScaleBarOverlay myScaleBarOverlay = new …Run Code Online (Sandbox Code Playgroud)