summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java231
1 files changed, 124 insertions, 107 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java
index 96aec573cc..cf5961a313 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java
@@ -17,63 +17,67 @@ import com.mapbox.mapboxsdk.geometry.LatLngBounds;
import com.mapbox.mapboxsdk.geometry.ProjectedMeters;
import com.mapbox.mapboxsdk.style.expressions.Expression;
import com.mapbox.mapboxsdk.style.layers.Layer;
+import com.mapbox.mapboxsdk.style.layers.TransitionOptions;
import com.mapbox.mapboxsdk.style.light.Light;
import com.mapbox.mapboxsdk.style.sources.Source;
-import java.util.HashMap;
import java.util.List;
interface NativeMap {
- void destroy();
+
+ //
+ // Lifecycle API
+ //
void update();
void resizeView(int width, int height);
- void setStyleUrl(String url);
+ void onLowMemory();
- @NonNull
- String getStyleUrl();
+ void destroy();
- void setStyleJson(String newStyleJson);
+ boolean isDestroyed();
- @NonNull
- String getStyleJson();
+ //
+ // Camera API
+ //
- void setLatLngBounds(LatLngBounds latLngBounds);
+ void jumpTo(@NonNull LatLng center, double zoom, double pitch, double bearing);
- void cancelTransitions();
+ void easeTo(@NonNull LatLng center, double zoom, double bearing, double pitch, long duration,
+ boolean easingInterpolator);
- void setGestureInProgress(boolean inProgress);
+ void flyTo(@NonNull LatLng center, double zoom, double bearing, double pitch, long duration);
+
+ void moveBy(double deltaX, double deltaY, long duration);
+
+ @NonNull
+ CameraPosition getCameraPosition();
- void moveBy(double dx, double dy);
+ CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds bounds, int[] padding, double bearing, double pitch);
- void moveBy(double dx, double dy, long duration);
+ CameraPosition getCameraForGeometry(@NonNull Geometry geometry, int[] padding, double bearing, double pitch);
- void setLatLng(@NonNull LatLng latLng);
+ void resetPosition();
void setLatLng(@NonNull LatLng latLng, long duration);
LatLng getLatLng();
- CameraPosition getCameraForLatLngBounds(LatLngBounds bounds, int[] padding, double bearing, double tilt);
+ void setLatLngBounds(@NonNull LatLngBounds latLngBounds);
- CameraPosition getCameraForGeometry(Geometry geometry, int[] padding, double bearing, double tilt);
+ void setVisibleCoordinateBounds(@NonNull LatLng[] coordinates, @NonNull RectF padding,
+ double direction, long duration);
- void resetPosition();
+ void setPitch(double pitch, long duration);
double getPitch();
- void setPitch(double pitch);
-
- void setPitch(double pitch, long duration);
-
void setZoom(double zoom, @NonNull PointF focalPoint, long duration);
double getZoom();
- void resetZoom();
-
void setMinZoom(double zoom);
double getMinZoom();
@@ -82,75 +86,104 @@ interface NativeMap {
double getMaxZoom();
- void rotateBy(double sx, double sy, double ex, double ey);
-
- void rotateBy(double sx, double sy, double ex, double ey,
- long duration);
-
- void setContentPadding(float[] padding);
-
- float[] getContentPadding();
+ void resetZoom();
- void setBearing(double degrees);
+ void rotateBy(double sx, double sy, double ex, double ey, long duration);
void setBearing(double degrees, long duration);
- void setBearing(double degrees, double cx, double cy);
-
void setBearing(double degrees, double fx, double fy, long duration);
double getBearing();
void resetNorth();
- long addMarker(Marker marker);
+ void cancelTransitions();
+
+ //
+ // Style API
+ //
+
+ void setStyleUrl(String url);
@NonNull
- long[] addMarkers(@NonNull List<Marker> markers);
+ String getStyleUrl();
- long addPolyline(Polyline polyline);
+ void setStyleJson(String newStyleJson);
@NonNull
- long[] addPolylines(@NonNull List<Polyline> polylines);
+ String getStyleJson();
- long addPolygon(Polygon polygon);
+ boolean isFullyLoaded();
+
+ void addLayer(@NonNull Layer layer);
+
+ void addLayerBelow(@NonNull Layer layer, @NonNull String below);
+
+ void addLayerAbove(@NonNull Layer layer, @NonNull String above);
+
+ void addLayerAt(@NonNull Layer layer, @IntRange(from = 0) int index);
@NonNull
- long[] addPolygons(@NonNull List<Polygon> polygons);
+ List<Layer> getLayers();
- void updateMarker(@NonNull Marker marker);
+ Layer getLayer(String layerId);
- void updatePolygon(@NonNull Polygon polygon);
+ boolean removeLayer(@NonNull String layerId);
- void updatePolyline(@NonNull Polyline polyline);
+ boolean removeLayer(@NonNull Layer layer);
- void removeAnnotation(long id);
+ boolean removeLayerAt(@IntRange(from = 0) int index);
- void removeAnnotations(long[] ids);
+ void addSource(@NonNull Source source);
@NonNull
- long[] queryPointAnnotations(RectF rect);
+ List<Source> getSources();
+
+ Source getSource(@NonNull String sourceId);
+
+ boolean removeSource(@NonNull String sourceId);
+
+ boolean removeSource(@NonNull Source source);
+
+ void setTransitionOptions(@NonNull TransitionOptions transitionOptions);
@NonNull
- long[] queryShapeAnnotations(RectF rectF);
+ TransitionOptions getTransitionOptions();
- void addAnnotationIcon(String symbol, int width, int height, float scale, byte[] pixels);
+ void addImages(Image[] images);
- void removeAnnotationIcon(String symbol);
+ Bitmap getImage(String name);
- void setVisibleCoordinateBounds(LatLng[] coordinates, RectF padding, double direction, long duration);
+ void removeImage(String name);
- void onLowMemory();
+ Light getLight();
- void setDebug(boolean debug);
+ //
+ // Content padding API
+ //
- void cycleDebugOptions();
+ void setContentPadding(float[] padding);
- boolean getDebug();
+ float[] getContentPadding();
- boolean isFullyLoaded();
+ //
+ // Query API
+ //
- void setReachability(boolean status);
+ @NonNull
+ List<Feature> queryRenderedFeatures(@NonNull PointF coordinates,
+ @Nullable String[] layerIds,
+ @Nullable Expression filter);
+
+ @NonNull
+ List<Feature> queryRenderedFeatures(@NonNull RectF coordinates,
+ @Nullable String[] layerIds,
+ @Nullable Expression filter);
+
+ //
+ // Projection API
+ //
double getMetersPerPixelAtLatitude(double lat);
@@ -163,85 +196,69 @@ interface NativeMap {
LatLng latLngForPixel(@NonNull PointF pixel);
- double getTopOffsetPixelsForAnnotationSymbol(String symbolName);
-
- void jumpTo(double angle, @NonNull LatLng center, double pitch, double zoom);
-
- void easeTo(double angle, @NonNull LatLng center, long duration, double pitch, double zoom,
- boolean easingInterpolator);
-
- void flyTo(double angle, @NonNull LatLng center, long duration, double pitch, double zoom);
+ //
+ // Utils API
+ //
- @NonNull
- CameraPosition getCameraPosition();
+ void setOnFpsChangedListener(@NonNull MapboxMap.OnFpsChangedListener listener);
- void setPrefetchesTiles(boolean enable);
+ void setDebug(boolean debug);
- boolean getPrefetchesTiles();
+ boolean getDebug();
- long getTransitionDuration();
+ void cycleDebugOptions();
- void setTransitionDuration(long duration);
+ void setReachability(boolean status);
- long getTransitionDelay();
+ void setApiBaseUrl(String baseUrl);
- void setTransitionDelay(long delay);
+ void setPrefetchTiles(boolean enable);
- @NonNull
- List<Layer> getLayers();
+ boolean getPrefetchTiles();
- Layer getLayer(String layerId);
+ void setGestureInProgress(boolean inProgress);
- void addLayer(@NonNull Layer layer);
+ float getPixelRatio();
- void addLayerBelow(@NonNull Layer layer, @NonNull String below);
+ //
+ // Deprecated Annotations API
+ //
- void addLayerAbove(@NonNull Layer layer, @NonNull String above);
+ long addMarker(Marker marker);
- void addLayerAt(@NonNull Layer layer, @IntRange(from = 0) int index);
+ @NonNull
+ long[] addMarkers(@NonNull List<Marker> markers);
- boolean removeLayer(@NonNull String layerId);
+ long addPolyline(Polyline polyline);
- boolean removeLayer(@NonNull Layer layer);
+ @NonNull
+ long[] addPolylines(@NonNull List<Polyline> polylines);
- boolean removeLayerAt(@IntRange(from = 0) int index);
+ long addPolygon(Polygon polygon);
@NonNull
- List<Source> getSources();
-
- Source getSource(@NonNull String sourceId);
+ long[] addPolygons(@NonNull List<Polygon> polygons);
- void addSource(@NonNull Source source);
+ void updateMarker(@NonNull Marker marker);
- boolean removeSource(@NonNull String sourceId);
+ void updatePolygon(@NonNull Polygon polygon);
- boolean removeSource(@NonNull Source source);
+ void updatePolyline(@NonNull Polyline polyline);
- void addImage(@NonNull String name, @NonNull Bitmap image, boolean sdf);
+ void removeAnnotation(long id);
- void addImages(@NonNull HashMap<String, Bitmap> bitmapHashMap);
+ void removeAnnotations(long[] ids);
- void addImages(@NonNull HashMap<String, Bitmap> bitmapHashMap, boolean sdf);
+ double getTopOffsetPixelsForAnnotationSymbol(String symbolName);
- void removeImage(String name);
+ void addAnnotationIcon(String symbol, int width, int height, float scale, byte[] pixels);
- Bitmap getImage(String name);
+ void removeAnnotationIcon(String symbol);
@NonNull
- List<Feature> queryRenderedFeatures(@NonNull PointF coordinates,
- @Nullable String[] layerIds,
- @Nullable Expression filter);
+ long[] queryPointAnnotations(RectF rectF);
@NonNull
- List<Feature> queryRenderedFeatures(@NonNull RectF coordinates,
- @Nullable String[] layerIds,
- @Nullable Expression filter);
-
- void setApiBaseUrl(String baseUrl);
-
- Light getLight();
-
- float getPixelRatio();
+ long[] queryShapeAnnotations(RectF rectF);
- void setOnFpsChangedListener(@NonNull MapboxMap.OnFpsChangedListener listener);
-}
+} \ No newline at end of file