我需要工作,如何更改默认的“我的位置”蓝点与图像,这也将在同样的方式作为指向行进的方向指南针。 这可以通过将设备罗盘或通过从GPS检测行进方向被加工出
我做了一些谷歌搜索,但至今只找到了改变iPhone上的点的方法的引用,而我与Android合作...
我很感激在这一些支持和指导
亲切的问候
缺口
在OnCreate中:
LocationManager locman = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locman.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 2, locationListener);
//Adds a current location overlay to the map 'mapView' and turns on the map's compass
MyLocation myLocationOverlay = new MyLocation(this, mapView);
mapView.getOverlays().add(myLocationOverlay);
myLocationOverlay.enableMyLocation();
myLocationOverlay.enableCompass();
mapView.getOverlays().add(myLocationOverlay);
mapView.postInvalidate();
In OnLocationChanged:
dbllatitude = locFromGps.getLatitude();
dbllongitude = locFromGps.getLongitude();
dblaltitude = locFromGps.getAltitude();
bearing = locFromGps.getBearing();
strlatitude = Double.toString(dbllatitude);
strlongitude = Double.toString(dbllongitude);
dblaltitude = (dblaltitude / 0.3048);
LocationText.setText("Your Location: Latitude " + dbllatitude + " Longitude: " +dbllongitude + " Altitude " + dblaltitude);
boolean hasbearing = locFromGps.hasBearing();
if (hasbearing = false) {
Toast.makeText(getApplicationContext(), "No bearing", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getApplicationContext(), "I HAZ bearing: " + bearing, Toast.LENGTH_SHORT).show();
}
MyLocation.mOrientation = bearing;