0
如何繪製路徑並計算移動距離。下面的代碼不計算onLocationChanged方法的距離?繪製路徑和計算距離
public void onLocationChanged(Location location) {
// TODO Auto-generated method stub
String text = String.format("Lat:\t %f\nLong:\t %f\nAlt:\t %f\nBearing:\t %f\nDistance:\t %f",
location.getLatitude() *1E6, location.getLongitude() *1E6,
location.getAltitude() *1E6, location.getBearing() *1E6, location.distanceTo(location));
textOut.setText(text);
lat = (int) (location.getLatitude() *1E6);
longi = (int) (location.getLongitude() *1E6);
GeoPoint myLocation = new GeoPoint(lat, longi);
OverlayItem overlayItem = new OverlayItem(myLocation, "WHATZ UP", "2nd String");
StagePoint custom = new StagePoint(d, Start.this);
custom.insertPinpoint(overlayItem);
overlayList.add(custom);
}
非常感謝達拉爾, 「FindList。」得到了一個錯誤.plz灑了一些光,我會非常感激。其他人給了我一個前進的方向 –