diff options
author | Tobrun <tobrun@mapbox.com> | 2016-05-03 08:15:15 +0200 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2016-05-20 12:00:01 +0200 |
commit | 16a2765adcc726feaffbc2e6f7e805d9e5d6cf58 (patch) | |
tree | c8ede33c621b227d77e8ac22617a54cf1631848f /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java | |
parent | 1d912a409a61531cca909d94838c0f177ba1f9e8 (diff) | |
download | qtlocation-mapboxgl-16a2765adcc726feaffbc2e6f7e805d9e5d6cf58.tar.gz |
[android] #3276 - android view annotations adapter approach
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java deleted file mode 100644 index 3e9d120343..0000000000 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.mapbox.mapboxsdk.annotations; - -import android.content.Context; -import android.graphics.PointF; -import android.util.AttributeSet; -import android.util.Log; -import android.view.ViewGroup; -import android.widget.FrameLayout; - -import com.mapbox.mapboxsdk.constants.MapboxConstants; -import com.mapbox.mapboxsdk.geometry.LatLng; -import com.mapbox.mapboxsdk.maps.MapView; -import com.mapbox.mapboxsdk.maps.Projection; - -public class MarkerView extends FrameLayout { - - private LatLng latLng; - private Projection projection; - private Marker marker; - - private float widthOffset; - private float heightOffset; - - public MarkerView(Context context) { - super(context); - init(context); - } - - public MarkerView(Context context, AttributeSet attrs) { - super(context, attrs); - init(context); - } - - public MarkerView(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - init(context); - } - - private void init(Context context){ - setLayoutParams(new MapView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); - } - - public void setProjection(Projection projection) { - this.projection = projection; - } - - public void setLatLng(LatLng latLng) { - this.latLng = latLng; - } - - public void setMarker(Marker marker) { - this.marker = marker; - } - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - widthOffset = getMeasuredWidth() / 2; - heightOffset = getMeasuredHeight() / 2; - - Log.v(MapboxConstants.TAG,"Measure "+widthOffset + heightOffset); - } - - public void update() { - PointF point = projection.toScreenLocation(latLng); - setX(point.x - widthOffset); - setY(point.y - heightOffset); - } -} |