summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMap.java
blob: 96aec573ccb3c70f63c32840de55192bbf08609d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
package com.mapbox.mapboxsdk.maps;

import android.graphics.Bitmap;
import android.graphics.PointF;
import android.graphics.RectF;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.mapbox.geojson.Feature;
import com.mapbox.geojson.Geometry;
import com.mapbox.mapboxsdk.annotations.Marker;
import com.mapbox.mapboxsdk.annotations.Polygon;
import com.mapbox.mapboxsdk.annotations.Polyline;
import com.mapbox.mapboxsdk.camera.CameraPosition;
import com.mapbox.mapboxsdk.geometry.LatLng;
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.light.Light;
import com.mapbox.mapboxsdk.style.sources.Source;

import java.util.HashMap;
import java.util.List;

interface NativeMap {
  void destroy();

  void update();

  void resizeView(int width, int height);

  void setStyleUrl(String url);

  @NonNull
  String getStyleUrl();

  void setStyleJson(String newStyleJson);

  @NonNull
  String getStyleJson();

  void setLatLngBounds(LatLngBounds latLngBounds);

  void cancelTransitions();

  void setGestureInProgress(boolean inProgress);

  void moveBy(double dx, double dy);

  void moveBy(double dx, double dy, long duration);

  void setLatLng(@NonNull LatLng latLng);

  void setLatLng(@NonNull LatLng latLng, long duration);

  LatLng getLatLng();

  CameraPosition getCameraForLatLngBounds(LatLngBounds bounds, int[] padding, double bearing, double tilt);

  CameraPosition getCameraForGeometry(Geometry geometry, int[] padding, double bearing, double tilt);

  void resetPosition();

  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();

  void setMaxZoom(double zoom);

  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 setBearing(double degrees);

  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);

  @NonNull
  long[] addMarkers(@NonNull List<Marker> markers);

  long addPolyline(Polyline polyline);

  @NonNull
  long[] addPolylines(@NonNull List<Polyline> polylines);

  long addPolygon(Polygon polygon);

  @NonNull
  long[] addPolygons(@NonNull List<Polygon> polygons);

  void updateMarker(@NonNull Marker marker);

  void updatePolygon(@NonNull Polygon polygon);

  void updatePolyline(@NonNull Polyline polyline);

  void removeAnnotation(long id);

  void removeAnnotations(long[] ids);

  @NonNull
  long[] queryPointAnnotations(RectF rect);

  @NonNull
  long[] queryShapeAnnotations(RectF rectF);

  void addAnnotationIcon(String symbol, int width, int height, float scale, byte[] pixels);

  void removeAnnotationIcon(String symbol);

  void setVisibleCoordinateBounds(LatLng[] coordinates, RectF padding, double direction, long duration);

  void onLowMemory();

  void setDebug(boolean debug);

  void cycleDebugOptions();

  boolean getDebug();

  boolean isFullyLoaded();

  void setReachability(boolean status);

  double getMetersPerPixelAtLatitude(double lat);

  ProjectedMeters projectedMetersForLatLng(@NonNull LatLng latLng);

  LatLng latLngForProjectedMeters(@NonNull ProjectedMeters projectedMeters);

  @NonNull
  PointF pixelForLatLng(@NonNull LatLng latLng);

  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);

  @NonNull
  CameraPosition getCameraPosition();

  void setPrefetchesTiles(boolean enable);

  boolean getPrefetchesTiles();

  long getTransitionDuration();

  void setTransitionDuration(long duration);

  long getTransitionDelay();

  void setTransitionDelay(long delay);

  @NonNull
  List<Layer> getLayers();

  Layer getLayer(String layerId);

  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);

  boolean removeLayer(@NonNull String layerId);

  boolean removeLayer(@NonNull Layer layer);

  boolean removeLayerAt(@IntRange(from = 0) int index);

  @NonNull
  List<Source> getSources();

  Source getSource(@NonNull String sourceId);

  void addSource(@NonNull Source source);

  boolean removeSource(@NonNull String sourceId);

  boolean removeSource(@NonNull Source source);

  void addImage(@NonNull String name, @NonNull Bitmap image, boolean sdf);

  void addImages(@NonNull HashMap<String, Bitmap> bitmapHashMap);

  void addImages(@NonNull HashMap<String, Bitmap> bitmapHashMap, boolean sdf);

  void removeImage(String name);

  Bitmap getImage(String name);

  @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);

  void setApiBaseUrl(String baseUrl);

  Light getLight();

  float getPixelRatio();

  void setOnFpsChangedListener(@NonNull MapboxMap.OnFpsChangedListener listener);
}