@maplibre/maplibre-react-native 10.0.0-alpha.7 → 10.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/android/build.gradle +1 -1
- package/android/rctmln/build.gradle +5 -5
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/annotation/MarkerView.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/annotation/MarkerViewManager.java +6 -6
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/annotation/RCTMLNMarkerView.java +5 -5
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/annotation/RCTMLNPointAnnotation.java +9 -8
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/camera/CameraStop.java +14 -12
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/camera/CameraUpdateItem.java +10 -10
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/camera/CameraUpdateQueue.java +1 -1
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/camera/RCTMLNCamera.java +26 -26
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/camera/RCTMLNCameraManager.java +1 -1
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/images/RCTMLNImages.java +12 -12
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/location/LocationComponentManager.java +9 -9
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/location/RCTMLNNativeUserLocation.java +7 -7
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/location/RCTMLNNativeUserLocationManager.java +1 -1
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/mapview/LayerSourceInfo.java +9 -9
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/mapview/RCTMLNAndroidTextureMapView.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/mapview/RCTMLNAndroidTextureMapViewManager.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/mapview/RCTMLNMapView.java +43 -43
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/mapview/RCTMLNMapViewManager.java +6 -6
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/RCTMLNStyle.java +3 -3
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/RCTMLNStyleFactory.java +14 -14
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/RCTMLNStyleFunctionParser.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/RCTMLNStyleValue.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/layers/RCTLayer.java +8 -8
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/layers/RCTMLNBackgroundLayer.java +1 -1
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/layers/RCTMLNCircleLayer.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/layers/RCTMLNFillExtrusionLayer.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/layers/RCTMLNFillLayer.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/layers/RCTMLNHeatmapLayer.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/layers/RCTMLNLineLayer.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/layers/RCTMLNRasterLayer.java +1 -1
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/layers/RCTMLNSymbolLayer.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/light/RCTMLNLight.java +6 -6
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/sources/RCTMLNImageSource.java +3 -3
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/sources/RCTMLNImageSourceManager.java +1 -1
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/sources/RCTMLNRasterSource.java +3 -3
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/sources/RCTMLNShapeSource.java +9 -9
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/sources/RCTMLNShapeSourceManager.java +1 -1
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/sources/RCTMLNTileSource.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/sources/RCTMLNVectorSource.java +4 -4
- package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/sources/RCTSource.java +7 -7
- package/android/rctmln/src/main/java/com/maplibre/rctmln/events/FeatureClickEvent.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/events/MapClickEvent.java +1 -1
- package/android/rctmln/src/main/java/com/maplibre/rctmln/events/PointAnnotationClickEvent.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/events/PointAnnotationDragEvent.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/location/LocationManager.java +6 -6
- package/android/rctmln/src/main/java/com/maplibre/rctmln/location/UserLocation.java +1 -1
- package/android/rctmln/src/main/java/com/maplibre/rctmln/location/UserTrackingMode.java +3 -3
- package/android/rctmln/src/main/java/com/maplibre/rctmln/modules/RCTMLNLocationModule.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/modules/RCTMLNLogging.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/modules/RCTMLNModule.java +8 -8
- package/android/rctmln/src/main/java/com/maplibre/rctmln/modules/RCTMLNOfflineModule.java +11 -11
- package/android/rctmln/src/main/java/com/maplibre/rctmln/modules/RCTMLNSnapshotModule.java +7 -7
- package/android/rctmln/src/main/java/com/maplibre/rctmln/utils/ClusterPropertyEntry.java +1 -1
- package/android/rctmln/src/main/java/com/maplibre/rctmln/utils/DownloadMapImageTask.java +5 -5
- package/android/rctmln/src/main/java/com/maplibre/rctmln/utils/ExpressionParser.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/utils/GeoJSONUtils.java +13 -13
- package/android/rctmln/src/main/java/com/maplibre/rctmln/utils/GeoViewport.java +3 -3
- package/android/rctmln/src/main/java/com/maplibre/rctmln/utils/SimpleEventCallback.java +2 -2
- package/android/rctmln/src/main/java/com/maplibre/rctmln/utils/SphericalMercator.java +1 -1
- package/package.json +1 -1
- package/scripts/templates/RCTMLNStyleFactory.java.ejs +14 -14
package/android/rctmln/src/main/java/com/maplibre/rctmln/components/mapview/RCTMLNMapView.java
CHANGED
|
@@ -17,7 +17,7 @@ import android.view.MotionEvent;
|
|
|
17
17
|
import android.view.View;
|
|
18
18
|
import android.view.ViewGroup;
|
|
19
19
|
import android.widget.FrameLayout;
|
|
20
|
-
import
|
|
20
|
+
import org.maplibre.android.log.Logger;
|
|
21
21
|
|
|
22
22
|
import com.facebook.react.bridge.LifecycleEventListener;
|
|
23
23
|
import com.facebook.react.bridge.ReactContext;
|
|
@@ -28,27 +28,27 @@ import com.facebook.react.bridge.WritableMap;
|
|
|
28
28
|
import com.facebook.react.bridge.WritableNativeArray;
|
|
29
29
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
30
30
|
import com.mapbox.android.gestures.MoveGestureDetector;
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
31
|
+
import org.maplibre.geojson.Feature;
|
|
32
|
+
import org.maplibre.geojson.FeatureCollection;
|
|
33
|
+
import org.maplibre.android.camera.CameraPosition;
|
|
34
|
+
import org.maplibre.android.camera.CameraUpdate;
|
|
35
|
+
import org.maplibre.android.geometry.LatLng;
|
|
36
|
+
import org.maplibre.android.geometry.VisibleRegion;
|
|
37
|
+
import org.maplibre.android.maps.AttributionDialogManager;
|
|
38
|
+
import org.maplibre.android.maps.MapView;
|
|
39
|
+
import org.maplibre.android.maps.MapLibreMap;
|
|
40
|
+
import org.maplibre.android.maps.MapLibreMapOptions;
|
|
41
|
+
import org.maplibre.android.maps.OnMapReadyCallback;
|
|
42
|
+
import org.maplibre.android.maps.Style;
|
|
43
|
+
import org.maplibre.android.maps.UiSettings;
|
|
44
|
+
import org.maplibre.android.plugins.localization.LocalizationPlugin;
|
|
45
|
+
import org.maplibre.android.plugins.annotation.OnSymbolClickListener;
|
|
46
|
+
import org.maplibre.android.plugins.annotation.OnSymbolDragListener;
|
|
47
|
+
import org.maplibre.android.plugins.annotation.Symbol;
|
|
48
|
+
import org.maplibre.android.plugins.annotation.SymbolManager;
|
|
49
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
50
|
+
import org.maplibre.android.style.layers.Layer;
|
|
51
|
+
import org.maplibre.android.style.layers.Property;
|
|
52
52
|
import com.maplibre.rctmln.R;
|
|
53
53
|
import com.maplibre.rctmln.components.AbstractMapFeature;
|
|
54
54
|
import com.maplibre.rctmln.components.annotation.RCTMLNPointAnnotation;
|
|
@@ -84,7 +84,7 @@ import org.json.*;
|
|
|
84
84
|
|
|
85
85
|
import javax.annotation.Nullable;
|
|
86
86
|
|
|
87
|
-
import static
|
|
87
|
+
import static org.maplibre.android.style.layers.PropertyFactory.visibility;
|
|
88
88
|
import static com.maplibre.rctmln.modules.RCTMLNOfflineModule.DEFAULT_STYLE_URL;
|
|
89
89
|
|
|
90
90
|
/**
|
|
@@ -92,11 +92,11 @@ import static com.maplibre.rctmln.modules.RCTMLNOfflineModule.DEFAULT_STYLE_URL;
|
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
94
|
@SuppressWarnings({ "MissingPermission" })
|
|
95
|
-
public class RCTMLNMapView extends MapView implements OnMapReadyCallback,
|
|
96
|
-
|
|
95
|
+
public class RCTMLNMapView extends MapView implements OnMapReadyCallback, MapLibreMap.OnMapClickListener,
|
|
96
|
+
MapLibreMap.OnMapLongClickListener, MapView.OnCameraIsChangingListener, MapView.OnCameraDidChangeListener,
|
|
97
97
|
MapView.OnDidFailLoadingMapListener, MapView.OnDidFinishLoadingMapListener,
|
|
98
|
-
MapView.OnWillStartRenderingFrameListener, MapView.
|
|
99
|
-
MapView.
|
|
98
|
+
MapView.OnWillStartRenderingFrameListener, MapView.OnWillStartRenderingMapListener,
|
|
99
|
+
MapView.OnDidFinishRenderingFrameListener, MapView.OnDidFinishRenderingMapListener,
|
|
100
100
|
MapView.OnDidFinishLoadingStyleListener, MapView.OnStyleImageMissingListener {
|
|
101
101
|
public static final String LOG_TAG = "RCTMLNMapView";
|
|
102
102
|
|
|
@@ -117,7 +117,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
117
117
|
private CameraChangeTracker mCameraChangeTracker = new CameraChangeTracker();
|
|
118
118
|
private List<Pair<Integer, ReadableArray>> mPreRenderMethods = new ArrayList<>();
|
|
119
119
|
|
|
120
|
-
private
|
|
120
|
+
private MapLibreMap mMap;
|
|
121
121
|
|
|
122
122
|
private LocalizationPlugin mLocalizationPlugin;
|
|
123
123
|
|
|
@@ -156,7 +156,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
156
156
|
|
|
157
157
|
private @Nullable Integer mTintColor = null;
|
|
158
158
|
|
|
159
|
-
public RCTMLNMapView(Context context, RCTMLNMapViewManager manager,
|
|
159
|
+
public RCTMLNMapView(Context context, RCTMLNMapViewManager manager, MapLibreMapOptions options) {
|
|
160
160
|
super(context, options);
|
|
161
161
|
|
|
162
162
|
mContext = context;
|
|
@@ -338,11 +338,11 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
338
338
|
return mMap.getCameraPosition();
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
public void animateCamera(CameraUpdate cameraUpdate,
|
|
341
|
+
public void animateCamera(CameraUpdate cameraUpdate, MapLibreMap.CancelableCallback callback) {
|
|
342
342
|
mMap.animateCamera(cameraUpdate, callback);
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
-
public void moveCamera(CameraUpdate cameraUpdate,
|
|
345
|
+
public void moveCamera(CameraUpdate cameraUpdate, MapLibreMap.CancelableCallback callback) {
|
|
346
346
|
mMap.moveCamera(cameraUpdate, callback);
|
|
347
347
|
}
|
|
348
348
|
|
|
@@ -350,7 +350,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
350
350
|
mMap.moveCamera(cameraUpdate);
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
-
public void easeCamera(CameraUpdate cameraUpdate, int duration, boolean easingInterpolator,
|
|
353
|
+
public void easeCamera(CameraUpdate cameraUpdate, int duration, boolean easingInterpolator, MapLibreMap.CancelableCallback callback) {
|
|
354
354
|
mMap.easeCamera(cameraUpdate, duration, easingInterpolator, callback);
|
|
355
355
|
}
|
|
356
356
|
|
|
@@ -386,7 +386,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
386
386
|
return null;
|
|
387
387
|
}
|
|
388
388
|
|
|
389
|
-
public
|
|
389
|
+
public MapLibreMap getMapboxMap() {
|
|
390
390
|
return mMap;
|
|
391
391
|
}
|
|
392
392
|
|
|
@@ -437,7 +437,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
437
437
|
|
|
438
438
|
|
|
439
439
|
@Override
|
|
440
|
-
public void onMapReady(final
|
|
440
|
+
public void onMapReady(final MapLibreMap mapboxMap) {
|
|
441
441
|
mMap = mapboxMap;
|
|
442
442
|
|
|
443
443
|
if (isJSONValid(mStyleURL)) {
|
|
@@ -463,14 +463,14 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
463
463
|
updateInsets();
|
|
464
464
|
updateUISettings();
|
|
465
465
|
|
|
466
|
-
mMap.addOnCameraIdleListener(new
|
|
466
|
+
mMap.addOnCameraIdleListener(new MapLibreMap.OnCameraIdleListener() {
|
|
467
467
|
@Override
|
|
468
468
|
public void onCameraIdle() {
|
|
469
469
|
sendRegionDidChangeEvent();
|
|
470
470
|
}
|
|
471
471
|
});
|
|
472
472
|
|
|
473
|
-
mMap.addOnCameraMoveStartedListener(new
|
|
473
|
+
mMap.addOnCameraMoveStartedListener(new MapLibreMap.OnCameraMoveStartedListener() {
|
|
474
474
|
@Override
|
|
475
475
|
public void onCameraMoveStarted(int reason) {
|
|
476
476
|
mCameraChangeTracker.setReason(reason);
|
|
@@ -478,7 +478,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
478
478
|
}
|
|
479
479
|
});
|
|
480
480
|
|
|
481
|
-
mMap.addOnCameraMoveListener(new
|
|
481
|
+
mMap.addOnCameraMoveListener(new MapLibreMap.OnCameraMoveListener() {
|
|
482
482
|
@Override
|
|
483
483
|
public void onCameraMove() {
|
|
484
484
|
if (markerViewManager != null) {
|
|
@@ -487,7 +487,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
487
487
|
}
|
|
488
488
|
});
|
|
489
489
|
|
|
490
|
-
mMap.addOnMoveListener(new
|
|
490
|
+
mMap.addOnMoveListener(new MapLibreMap.OnMoveListener() {
|
|
491
491
|
@Override
|
|
492
492
|
public void onMoveBegin(MoveGestureDetector detector) {
|
|
493
493
|
mCameraChangeTracker.setReason(CameraChangeTracker.USER_GESTURE);
|
|
@@ -732,7 +732,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
732
732
|
}
|
|
733
733
|
|
|
734
734
|
@Override
|
|
735
|
-
public void onDidFinishRenderingFrame(boolean fully) {
|
|
735
|
+
public void onDidFinishRenderingFrame(boolean fully, double frameEncodingTime, double frameRenderingTime) {
|
|
736
736
|
if (fully) {
|
|
737
737
|
handleMapChangedEvent(EventTypes.DID_FINISH_RENDERING_FRAME_FULLY);
|
|
738
738
|
} else {
|
|
@@ -848,7 +848,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
848
848
|
if (position == null) {
|
|
849
849
|
// reset from explicit to default
|
|
850
850
|
if (mLogoGravity != null) {
|
|
851
|
-
|
|
851
|
+
MapLibreMapOptions defaultOptions = MapLibreMapOptions.createFromAttributes(mContext);
|
|
852
852
|
mLogoGravity = defaultOptions.getLogoGravity();
|
|
853
853
|
mLogoMargins = Arrays.copyOf(defaultOptions.getLogoMargins(), 4);
|
|
854
854
|
updateUISettings();
|
|
@@ -903,7 +903,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
903
903
|
if (position == null) {
|
|
904
904
|
// reset from explicit to default
|
|
905
905
|
if (mAttributionGravity != null) {
|
|
906
|
-
|
|
906
|
+
MapLibreMapOptions defaultOptions = MapLibreMapOptions.createFromAttributes(mContext);
|
|
907
907
|
mAttributionGravity = defaultOptions.getAttributionGravity();
|
|
908
908
|
mAttributionMargin = Arrays.copyOf(defaultOptions.getAttributionMargins(), 4);
|
|
909
909
|
updateUISettings();
|
|
@@ -1016,7 +1016,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
1016
1016
|
throw new Error("takeSnap should only be called after the map has rendered");
|
|
1017
1017
|
}
|
|
1018
1018
|
|
|
1019
|
-
mMap.snapshot(new
|
|
1019
|
+
mMap.snapshot(new MapLibreMap.SnapshotReadyCallback() {
|
|
1020
1020
|
@Override
|
|
1021
1021
|
public void onSnapshotReady(Bitmap snapshot) {
|
|
1022
1022
|
WritableMap payload = new WritableNativeMap();
|
|
@@ -1496,7 +1496,7 @@ public class RCTMLNMapView extends MapView implements OnMapReadyCallback, Mapbox
|
|
|
1496
1496
|
return mOffscreenAnnotationViewContainer;
|
|
1497
1497
|
}
|
|
1498
1498
|
|
|
1499
|
-
public MarkerViewManager getMarkerViewManager(
|
|
1499
|
+
public MarkerViewManager getMarkerViewManager(MapLibreMap map) {
|
|
1500
1500
|
if (markerViewManager == null) {
|
|
1501
1501
|
if (map == null) {
|
|
1502
1502
|
throw new Error("makerViewManager should be called one the map has loaded");
|
|
@@ -11,16 +11,16 @@ import com.facebook.react.common.MapBuilder;
|
|
|
11
11
|
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
12
12
|
import com.facebook.react.uimanager.ThemedReactContext;
|
|
13
13
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
14
|
+
import org.maplibre.android.geometry.LatLngBounds;
|
|
15
|
+
import org.maplibre.android.log.Logger;
|
|
16
|
+
import org.maplibre.android.maps.MapLibreMap;
|
|
17
17
|
import com.maplibre.rctmln.components.AbstractEventEmitter;
|
|
18
18
|
import com.maplibre.rctmln.events.constants.EventKeys;
|
|
19
19
|
import com.maplibre.rctmln.utils.ConvertUtils;
|
|
20
20
|
import com.maplibre.rctmln.utils.ExpressionParser;
|
|
21
21
|
import com.maplibre.rctmln.utils.GeoJSONUtils;
|
|
22
|
-
import
|
|
23
|
-
import
|
|
22
|
+
import org.maplibre.geojson.FeatureCollection;
|
|
23
|
+
import org.maplibre.geojson.Point;
|
|
24
24
|
|
|
25
25
|
import java.util.ArrayList;
|
|
26
26
|
import java.util.HashMap;
|
|
@@ -247,7 +247,7 @@ public class RCTMLNMapViewManager extends AbstractEventEmitter<RCTMLNMapView> {
|
|
|
247
247
|
@Override
|
|
248
248
|
public void receiveCommand(RCTMLNMapView mapView, int commandID, @Nullable ReadableArray args) {
|
|
249
249
|
// allows method calls to work with componentDidMount
|
|
250
|
-
|
|
250
|
+
MapLibreMap mapboxMap = mapView.getMapboxMap();
|
|
251
251
|
if (mapboxMap == null) {
|
|
252
252
|
mapView.enqueuePreRenderMapMethod(commandID, args);
|
|
253
253
|
return;
|
|
@@ -5,7 +5,7 @@ import androidx.annotation.NonNull;
|
|
|
5
5
|
|
|
6
6
|
import com.facebook.react.bridge.ReadableMap;
|
|
7
7
|
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
8
|
-
import
|
|
8
|
+
import org.maplibre.android.maps.MapLibreMap;
|
|
9
9
|
import com.maplibre.rctmln.utils.DownloadMapImageTask;
|
|
10
10
|
import com.maplibre.rctmln.utils.ImageEntry;
|
|
11
11
|
|
|
@@ -21,9 +21,9 @@ import java.util.Map;
|
|
|
21
21
|
public class RCTMLNStyle {
|
|
22
22
|
private Context mContext;
|
|
23
23
|
private ReadableMap mReactStyle;
|
|
24
|
-
private
|
|
24
|
+
private MapLibreMap mMap;
|
|
25
25
|
|
|
26
|
-
public RCTMLNStyle(@NonNull Context context, @NonNull ReadableMap reactStyle, @NonNull
|
|
26
|
+
public RCTMLNStyle(@NonNull Context context, @NonNull ReadableMap reactStyle, @NonNull MapLibreMap map) {
|
|
27
27
|
mContext = context;
|
|
28
28
|
mReactStyle = reactStyle;
|
|
29
29
|
mMap = map;
|
package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/RCTMLNStyleFactory.java
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
|
|
4
4
|
package com.maplibre.rctmln.components.styles;
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
6
|
+
import org.maplibre.android.style.layers.BackgroundLayer;
|
|
7
|
+
import org.maplibre.android.style.layers.CircleLayer;
|
|
8
|
+
import org.maplibre.android.style.layers.FillExtrusionLayer;
|
|
9
|
+
import org.maplibre.android.style.layers.FillLayer;
|
|
10
|
+
import org.maplibre.android.style.layers.LineLayer;
|
|
11
|
+
import org.maplibre.android.style.layers.PropertyFactory;
|
|
12
|
+
import org.maplibre.android.style.layers.PropertyValue;
|
|
13
|
+
import org.maplibre.android.style.layers.RasterLayer;
|
|
14
|
+
import org.maplibre.android.style.layers.SymbolLayer;
|
|
15
|
+
import org.maplibre.android.style.layers.HeatmapLayer;
|
|
16
|
+
import org.maplibre.android.style.layers.HillshadeLayer;
|
|
17
|
+
import org.maplibre.android.style.layers.TransitionOptions;
|
|
18
|
+
import org.maplibre.android.style.light.Light;
|
|
19
|
+
import org.maplibre.android.style.light.Position;
|
|
20
20
|
import com.maplibre.rctmln.utils.DownloadMapImageTask;
|
|
21
21
|
|
|
22
22
|
import java.util.List;
|
|
@@ -9,8 +9,8 @@ import com.facebook.react.bridge.ReadableMap;
|
|
|
9
9
|
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
10
10
|
import com.facebook.react.bridge.ReadableNativeArray;
|
|
11
11
|
import com.facebook.react.bridge.ReadableType;
|
|
12
|
-
import
|
|
13
|
-
import
|
|
12
|
+
import org.maplibre.android.style.expressions.Expression.Stop;
|
|
13
|
+
import org.maplibre.android.style.layers.PropertyValue;
|
|
14
14
|
|
|
15
15
|
import java.text.NumberFormat;
|
|
16
16
|
import java.text.ParseException;
|
package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/RCTMLNStyleValue.java
CHANGED
|
@@ -8,8 +8,8 @@ import com.facebook.react.bridge.ReadableMap;
|
|
|
8
8
|
import com.facebook.react.bridge.ReadableType;
|
|
9
9
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
10
10
|
import com.google.gson.JsonArray;
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
12
|
+
import org.maplibre.android.style.layers.TransitionOptions;
|
|
13
13
|
import com.maplibre.rctmln.utils.ConvertUtils;
|
|
14
14
|
import com.maplibre.rctmln.utils.ExpressionParser;
|
|
15
15
|
import com.maplibre.rctmln.utils.ImageEntry;
|
package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/layers/RCTLayer.java
CHANGED
|
@@ -5,13 +5,13 @@ import android.content.Context;
|
|
|
5
5
|
import com.facebook.react.bridge.ReadableArray;
|
|
6
6
|
import com.facebook.react.bridge.ReadableMap;
|
|
7
7
|
import com.facebook.common.logging.FLog;
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
8
|
+
import org.maplibre.android.location.LocationComponentConstants;
|
|
9
|
+
import org.maplibre.android.maps.MapLibreMap;
|
|
10
|
+
import org.maplibre.android.maps.Style;
|
|
11
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
12
|
+
import org.maplibre.android.style.layers.Layer;
|
|
13
|
+
import org.maplibre.android.style.layers.Property;
|
|
14
|
+
import org.maplibre.android.style.layers.PropertyFactory;
|
|
15
15
|
import com.maplibre.rctmln.components.AbstractMapFeature;
|
|
16
16
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
17
17
|
import com.maplibre.rctmln.utils.ExpressionParser;
|
|
@@ -39,7 +39,7 @@ public abstract class RCTLayer<T extends Layer> extends AbstractMapFeature {
|
|
|
39
39
|
protected ReadableMap mReactStyle;
|
|
40
40
|
protected Expression mFilter;
|
|
41
41
|
|
|
42
|
-
protected
|
|
42
|
+
protected MapLibreMap mMap;
|
|
43
43
|
protected T mLayer;
|
|
44
44
|
|
|
45
45
|
protected Context mContext;
|
|
@@ -2,7 +2,7 @@ package com.maplibre.rctmln.components.styles.layers;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import org.maplibre.android.style.layers.BackgroundLayer;
|
|
6
6
|
import com.maplibre.rctmln.components.styles.RCTMLNStyle;
|
|
7
7
|
import com.maplibre.rctmln.components.styles.RCTMLNStyleFactory;
|
|
8
8
|
|
|
@@ -2,8 +2,8 @@ package com.maplibre.rctmln.components.styles.layers;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
6
|
+
import org.maplibre.android.style.layers.CircleLayer;
|
|
7
7
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
8
8
|
import com.maplibre.rctmln.components.styles.RCTMLNStyle;
|
|
9
9
|
import com.maplibre.rctmln.components.styles.RCTMLNStyleFactory;
|
|
@@ -2,8 +2,8 @@ package com.maplibre.rctmln.components.styles.layers;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
6
|
+
import org.maplibre.android.style.layers.FillExtrusionLayer;
|
|
7
7
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
8
8
|
import com.maplibre.rctmln.components.styles.RCTMLNStyle;
|
|
9
9
|
import com.maplibre.rctmln.components.styles.RCTMLNStyleFactory;
|
|
@@ -2,8 +2,8 @@ package com.maplibre.rctmln.components.styles.layers;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
6
|
+
import org.maplibre.android.style.layers.FillLayer;
|
|
7
7
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
8
8
|
import com.maplibre.rctmln.components.styles.RCTMLNStyle;
|
|
9
9
|
import com.maplibre.rctmln.components.styles.RCTMLNStyleFactory;
|
|
@@ -2,8 +2,8 @@ package com.maplibre.rctmln.components.styles.layers;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
6
|
+
import org.maplibre.android.style.layers.HeatmapLayer;
|
|
7
7
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
8
8
|
import com.maplibre.rctmln.components.styles.RCTMLNStyle;
|
|
9
9
|
import com.maplibre.rctmln.components.styles.RCTMLNStyleFactory;
|
|
@@ -2,8 +2,8 @@ package com.maplibre.rctmln.components.styles.layers;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
6
|
+
import org.maplibre.android.style.layers.LineLayer;
|
|
7
7
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
8
8
|
import com.maplibre.rctmln.components.styles.RCTMLNStyle;
|
|
9
9
|
import com.maplibre.rctmln.components.styles.RCTMLNStyleFactory;
|
|
@@ -2,7 +2,7 @@ package com.maplibre.rctmln.components.styles.layers;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import org.maplibre.android.style.layers.RasterLayer;
|
|
6
6
|
import com.maplibre.rctmln.components.styles.RCTMLNStyle;
|
|
7
7
|
import com.maplibre.rctmln.components.styles.RCTMLNStyleFactory;
|
|
8
8
|
|
|
@@ -2,8 +2,8 @@ package com.maplibre.rctmln.components.styles.layers;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
6
|
+
import org.maplibre.android.style.layers.SymbolLayer;
|
|
7
7
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
8
8
|
import com.maplibre.rctmln.components.styles.RCTMLNStyle;
|
|
9
9
|
import com.maplibre.rctmln.components.styles.RCTMLNStyleFactory;
|
package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/light/RCTMLNLight.java
CHANGED
|
@@ -3,11 +3,11 @@ package com.maplibre.rctmln.components.styles.light;
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
5
|
import com.facebook.react.bridge.ReadableMap;
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
6
|
+
import org.maplibre.android.maps.MapLibreMap;
|
|
7
|
+
import org.maplibre.android.maps.Style;
|
|
8
|
+
import org.maplibre.android.style.layers.TransitionOptions;
|
|
9
|
+
import org.maplibre.android.style.light.Light;
|
|
10
|
+
import org.maplibre.android.style.light.Position;
|
|
11
11
|
import com.maplibre.rctmln.components.AbstractMapFeature;
|
|
12
12
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
13
13
|
import com.maplibre.rctmln.components.styles.RCTMLNStyle;
|
|
@@ -21,7 +21,7 @@ import java.util.Map;
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
public class RCTMLNLight extends AbstractMapFeature {
|
|
24
|
-
private
|
|
24
|
+
private MapLibreMap mMap;
|
|
25
25
|
private ReadableMap mReactStyle;
|
|
26
26
|
|
|
27
27
|
public RCTMLNLight(Context context) {
|
|
@@ -5,9 +5,9 @@ import android.util.Log;
|
|
|
5
5
|
|
|
6
6
|
import com.facebook.drawee.backends.pipeline.Fresco;
|
|
7
7
|
import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper;
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import org.maplibre.geojson.Feature;
|
|
9
|
+
import org.maplibre.android.geometry.LatLngQuad;
|
|
10
|
+
import org.maplibre.android.style.sources.ImageSource;
|
|
11
11
|
|
|
12
12
|
import java.net.MalformedURLException;
|
|
13
13
|
import java.net.URL;
|
|
@@ -8,7 +8,7 @@ import com.facebook.react.uimanager.ThemedReactContext;
|
|
|
8
8
|
import com.facebook.react.uimanager.ViewGroupManager;
|
|
9
9
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
10
10
|
import com.facebook.react.views.imagehelper.ImageSource;
|
|
11
|
-
import
|
|
11
|
+
import org.maplibre.android.geometry.LatLngQuad;
|
|
12
12
|
import com.maplibre.rctmln.utils.ConvertUtils;
|
|
13
13
|
import com.maplibre.rctmln.utils.GeoJSONUtils;
|
|
14
14
|
|
|
@@ -2,10 +2,10 @@ package com.maplibre.rctmln.components.styles.sources;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import org.maplibre.geojson.Feature;
|
|
6
|
+
import org.maplibre.android.style.sources.RasterSource;
|
|
7
7
|
|
|
8
|
-
import static
|
|
8
|
+
import static org.maplibre.android.style.sources.RasterSource.DEFAULT_TILE_SIZE;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Created by nickitaliano on 9/25/17.
|
|
@@ -10,14 +10,14 @@ import androidx.core.content.res.ResourcesCompat;
|
|
|
10
10
|
|
|
11
11
|
import com.facebook.react.bridge.WritableMap;
|
|
12
12
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
13
|
+
import org.maplibre.geojson.Feature;
|
|
14
|
+
import org.maplibre.geojson.FeatureCollection;
|
|
15
|
+
import org.maplibre.android.maps.MapLibreMap;
|
|
16
|
+
import org.maplibre.android.maps.Style;
|
|
17
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
18
|
+
import org.maplibre.android.style.sources.GeoJsonOptions;
|
|
19
|
+
import org.maplibre.android.style.sources.GeoJsonSource;
|
|
20
|
+
import org.maplibre.android.utils.BitmapUtils;
|
|
21
21
|
import com.maplibre.rctmln.R;
|
|
22
22
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
23
23
|
import com.maplibre.rctmln.events.AndroidCallbackEvent;
|
|
@@ -67,7 +67,7 @@ public class RCTMLNShapeSource extends RCTSource<GeoJsonSource> {
|
|
|
67
67
|
mapView.getMapboxMap().getStyle(new Style.OnStyleLoaded() {
|
|
68
68
|
@Override
|
|
69
69
|
public void onStyleLoaded(@NonNull Style style) {
|
|
70
|
-
|
|
70
|
+
MapLibreMap map = mapView.getMapboxMap();
|
|
71
71
|
RCTMLNShapeSource.super.addToMap(mapView);
|
|
72
72
|
}
|
|
73
73
|
});
|
|
@@ -18,7 +18,7 @@ import com.facebook.react.common.MapBuilder;
|
|
|
18
18
|
import com.facebook.react.uimanager.ThemedReactContext;
|
|
19
19
|
import com.facebook.react.uimanager.ViewGroupManager;
|
|
20
20
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
21
|
-
import
|
|
21
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
22
22
|
import com.maplibre.rctmln.components.AbstractEventEmitter;
|
|
23
23
|
import com.maplibre.rctmln.components.annotation.RCTMLNCallout;
|
|
24
24
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
@@ -2,8 +2,8 @@ package com.maplibre.rctmln.components.styles.sources;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import org.maplibre.android.style.sources.Source;
|
|
6
|
+
import org.maplibre.android.style.sources.TileSet;
|
|
7
7
|
|
|
8
8
|
import java.util.Collection;
|
|
9
9
|
|
|
@@ -6,10 +6,10 @@ import androidx.annotation.Size;
|
|
|
6
6
|
|
|
7
7
|
import com.facebook.react.bridge.WritableMap;
|
|
8
8
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
9
|
+
import org.maplibre.geojson.Feature;
|
|
10
|
+
import org.maplibre.geojson.FeatureCollection;
|
|
11
|
+
import org.maplibre.android.style.expressions.Expression;
|
|
12
|
+
import org.maplibre.android.style.sources.VectorSource;
|
|
13
13
|
import com.maplibre.rctmln.events.AndroidCallbackEvent;
|
|
14
14
|
import com.maplibre.rctmln.events.FeatureClickEvent;
|
|
15
15
|
|
package/android/rctmln/src/main/java/com/maplibre/rctmln/components/styles/sources/RCTSource.java
CHANGED
|
@@ -8,12 +8,12 @@ import android.view.View;
|
|
|
8
8
|
|
|
9
9
|
import com.facebook.react.bridge.ReadableMap;
|
|
10
10
|
import com.facebook.react.common.MapBuilder;
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
11
|
+
import org.maplibre.geojson.Feature;
|
|
12
|
+
import org.maplibre.android.geometry.LatLng;
|
|
13
|
+
import org.maplibre.android.log.Logger;
|
|
14
|
+
import org.maplibre.android.maps.MapLibreMap;
|
|
15
|
+
import org.maplibre.android.maps.Style;
|
|
16
|
+
import org.maplibre.android.style.sources.Source;
|
|
17
17
|
import com.maplibre.rctmln.components.AbstractMapFeature;
|
|
18
18
|
import com.maplibre.rctmln.components.mapview.RCTMLNMapView;
|
|
19
19
|
import com.maplibre.rctmln.components.styles.layers.RCTLayer;
|
|
@@ -35,7 +35,7 @@ public abstract class RCTSource<T extends Source> extends AbstractMapFeature {
|
|
|
35
35
|
public static final double DEFAULT_HITBOX_HEIGHT = 44.0;
|
|
36
36
|
|
|
37
37
|
protected RCTMLNMapView mMapView;
|
|
38
|
-
protected
|
|
38
|
+
protected MapLibreMap mMap;
|
|
39
39
|
|
|
40
40
|
protected String mID;
|
|
41
41
|
protected T mSource;
|