Refactor MapView code to be more maintainable. Implement JavaDocs up to rotation.
This commit is contained in:
@@ -3,6 +3,7 @@ package com.mapbox.mapboxgl.annotations;
|
||||
import android.graphics.Point;
|
||||
import android.view.View;
|
||||
import com.mapbox.mapboxgl.geometry.LatLng;
|
||||
import com.mapbox.mapboxgl.views.InfoWindow;
|
||||
import com.mapbox.mapboxgl.views.R;
|
||||
|
||||
public class Marker extends Annotation {
|
||||
@@ -138,6 +139,10 @@ public class Marker extends Annotation {
|
||||
this.sprite = sprite;
|
||||
}
|
||||
|
||||
public String getSprite() {
|
||||
return sprite;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mapbox.mapboxgl.annotations;
|
||||
package com.mapbox.mapboxgl.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.PointF;
|
||||
@@ -7,8 +7,9 @@ import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mapbox.mapboxgl.annotations.Marker;
|
||||
import com.mapbox.mapboxgl.geometry.LatLng;
|
||||
import com.mapbox.mapboxgl.views.MapView;
|
||||
|
||||
/**
|
||||
* A tooltip view
|
||||
@@ -85,7 +86,7 @@ public class InfoWindow {
|
||||
mView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
|
||||
|
||||
PointF coords = mMapView.toScreenLocation(position);
|
||||
double y = mMapView.getTopOffsetPixelsForAnnotationSymbol(object.sprite);
|
||||
double y = mMapView.getTopOffsetPixelsForAnnotationSymbol(object.getSprite());
|
||||
y = y * mMapView.getScreenDensity();
|
||||
|
||||
// Flip y coordinate as Android view origin is upper left corner
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mapbox.mapboxgl.annotations;
|
||||
package com.mapbox.mapboxgl.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Classes that render a map and the map's UI.
|
||||
*/
|
||||
package com.mapbox.mapboxgl.views;
|
||||
@@ -44,7 +44,7 @@
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.mapbox.mapboxgl.annotations.InfoWindowTipView
|
||||
<com.mapbox.mapboxgl.views.InfoWindowTipView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="10dp"/>
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<item>© OpenStreetMap</item>
|
||||
<item>Improve this map</item>
|
||||
</array>
|
||||
<!-- If editing this array update MapView.ATTRIBUTION_INDEX_IMPROVE_THIS_MAP -->
|
||||
<array name="attribution_links" formatted="false" translatable="false">
|
||||
<item>https://www.mapbox.com/about/maps/</item>
|
||||
<item>http://www.openstreetmap.org/about/</item>
|
||||
|
||||
Reference in New Issue
Block a user