I need to work out how to change the default 'my location' blue dot with an image, that will also act in the same fashion as a compass pointing the direction of travel. This can be worked out by the device compass or by detecting direction of travel from GPS
I've done some googling but so far only found a reference for the method of changing the dot on the iPhone, and I am working with Android...
I'd appreciate some support and guidance in this
Kind regards
Nick
In 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;