Commit 0d3364ee authored by Evan W. Patton's avatar Evan W. Patton Committed by Jeffrey Schiller

Apply AnchorHorizontal and AnchorVertical values to Marker

Change-Id: I7720bb0df1e312769dfed12819a56ebb45e44e65
parent b2844911
...@@ -115,6 +115,9 @@ class NativeOpenStreetMapController implements MapController, MapListener { ...@@ -115,6 +115,9 @@ class NativeOpenStreetMapController implements MapController, MapListener {
private float lastAzimuth = Float.NaN; private float lastAzimuth = Float.NaN;
private ScaleBarOverlay scaleBar; private ScaleBarOverlay scaleBar;
private static final float[] ANCHOR_HORIZONTAL = { Float.NaN, 0.0f, 1.0f, 0.5f };
private static final float[] ANCHOR_VERTICAL = { Float.NaN, 0.0f, 0.5f, 1.0f };
private static class AppInventorLocationSensorAdapter implements IMyLocationProvider, private static class AppInventorLocationSensorAdapter implements IMyLocationProvider,
LocationSensor.LocationSensorListener { LocationSensor.LocationSensorListener {
private LocationSensor source; private LocationSensor source;
...@@ -720,6 +723,8 @@ class NativeOpenStreetMapController implements MapController, MapListener { ...@@ -720,6 +723,8 @@ class NativeOpenStreetMapController implements MapController, MapListener {
public void updateFeaturePosition(MapMarker aiMarker) { public void updateFeaturePosition(MapMarker aiMarker) {
Marker marker = (Marker)featureOverlays.get(aiMarker); Marker marker = (Marker)featureOverlays.get(aiMarker);
if (marker != null) { if (marker != null) {
marker.setAnchor(ANCHOR_HORIZONTAL[aiMarker.AnchorHorizontal()],
ANCHOR_VERTICAL[aiMarker.AnchorVertical()]);
marker.setPosition(new GeoPoint(aiMarker.Latitude(), aiMarker.Longitude())); marker.setPosition(new GeoPoint(aiMarker.Latitude(), aiMarker.Longitude()));
view.invalidate(); view.invalidate();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment