在这里,我有以下代码,但有错误。有人可以帮忙吗?android - 获取lon和lat的当前位置并放入GeoPoint中?
public void onLocationChanged(Location loc) {
// TODO Auto-generated method stub
GeoPoint point = new GeoPoint(loc.getLatitude(),loc.getLongitude());
OverlayItem overlayitem = new OverlayItem(point, "My Current Location", "My Current Location");
overlay.addOverlay(overlayitem);
mapOverlays.add(overlay);
}
提到的错误吗? – jeet 2012-07-25 10:29:27
@jeet GeoPoint需要整数,但loc.getLatitude()返回一个双精度值 – 2012-07-25 10:30:54
至少LogCat ... – overbet13 2012-07-25 10:46:13