I did not understand why there is a drawable and a circle possible at the same
time, hence i just delegated the original constructor to the new one with the
paints. Also, the get*Paint* functions should probably be renamed if this gets
merged.
.../android/maps/overlay/MyLocationOverlay.java | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/mapsforge-map/src/main/java/org/mapsforge/android/maps/overlay/MyLocationOverlay.java b/mapsforge-map/src/main/java/org/mapsforge/android/maps/overlay/MyLocationOverlay.java
index 6fd9080..b277ce8 100644
--- a/mapsforge-map/src/main/java/org/mapsforge/android/maps/overlay/MyLocationOverlay.java
+++ b/mapsforge-map/src/main/java/org/mapsforge/android/maps/overlay/MyLocationOverlay.java
@@ -85,11 +85,27 @@ public class MyLocationOverlay implements LocationListener, Overlay {
* @param drawable
* a drawable to display at the current location (might be null).
*/
- public MyLocationOverlay(Context context, MapView mapView, Drawable drawable) {
+ public MyLocationOverlay(Context context, MapView mapView, Drawable drawable){
+ this(context, mapView, drawable, getCirclePaintFill(), getCirclePaintStroke());
+ }
+
+ /**
+ * @param context
+ * a reference to the application context.
+ * @param mapView
+ * the {@code MapView} on which the location will be displayed.
+ * @param drawable
+ * a drawable to display at the current location (might be null).
+ @param circleFill
+ * the {@code Paint} used to draw the filling of the circle that represents the current location.
+ @param circleStroke
+ * the {@code Paint} used to draw the stroke of the circle that represents the current location.
+ */
+ public MyLocationOverlay(Context context, MapView mapView, Drawable drawable, Paint circleFill, Paint circleStroke) {
this.mapView = mapView;
this.locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
this.marker = new Marker(null, drawable);
- this.circle = new Circle(null, 0, getCirclePaintFill(), getCirclePaintStroke());
+ this.circle = new Circle(null, 0, circleFill, circleStroke);
}
/**