我正在使用 omsdroid 创建一个类似 GPS 的应用程序,我成功地显示了一张地图并将其以用户位置为中心,但我找不到在地图上显示“用户图标”的方法。
我是 android 新手(一周前开始),所以请解释所有步骤并添加代码示例,谢谢。
编辑 :
到目前为止,这是我的代码:
edit :
到目前为止,这是我的代码:
public void onLocationChanged(Location location) {
latitude = location.getLatitude();
longitude = location.getLongitude();
altitude = location.getAltitude();
accuracy = location.getAccuracy();
GeoPoint p = new GeoPoint( (latitude ), (longitude ));
myMapController.animateTo(p);
myMapController.setCenter(p);
mylocation = new MyLocationNewOverlay(new GpsMyLocationProvider(getApplicationContext()), mapView);
mylocation.enableMyLocation();
//mylocation.enableFollowLocation();
mapView.getOverlays().add(mylocation);
}