@maplibre/maplibre-react-native 11.0.0-alpha.10 → 11.0.0-alpha.11
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/android/src/main/java/org/maplibre/reactnative/MLRNPackage.kt +0 -2
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.kt +28 -4
- package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.kt +6 -0
- package/ios/components/map-view/MLRNMapView.h +1 -2
- package/ios/components/map-view/MLRNMapView.m +22 -11
- package/ios/components/map-view/MLRNMapViewComponentView.mm +15 -0
- package/lib/commonjs/components/map-view/MapView.js +5 -1
- package/lib/commonjs/components/map-view/MapView.js.map +1 -1
- package/lib/commonjs/components/map-view/MapViewNativeComponent.ts +3 -1
- package/lib/commonjs/index.js +0 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/map-view/MapView.js +5 -1
- package/lib/module/components/map-view/MapView.js.map +1 -1
- package/lib/module/components/map-view/MapViewNativeComponent.ts +3 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/components/map-view/MapView.d.ts +10 -2
- package/lib/typescript/commonjs/src/components/map-view/MapView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/map-view/MapViewNativeComponent.d.ts +3 -1
- package/lib/typescript/commonjs/src/components/map-view/MapViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +0 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/map-view/MapView.d.ts +10 -2
- package/lib/typescript/module/src/components/map-view/MapView.d.ts.map +1 -1
- package/lib/typescript/module/src/components/map-view/MapViewNativeComponent.d.ts +3 -1
- package/lib/typescript/module/src/components/map-view/MapViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +0 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/map-view/MapView.tsx +21 -3
- package/src/components/map-view/MapViewNativeComponent.ts +3 -1
- package/src/index.ts +0 -1
- package/android/src/main/java/org/maplibre/reactnative/components/light/MLRNLight.java +0 -56
- package/android/src/main/java/org/maplibre/reactnative/components/light/MLRNLightManager.java +0 -25
- package/ios/components/light/MLRNLight.h +0 -10
- package/ios/components/light/MLRNLight.m +0 -36
- package/ios/components/light/MLRNLightManager.h +0 -5
- package/ios/components/light/MLRNLightManager.m +0 -14
- package/lib/commonjs/components/Light.js +0 -30
- package/lib/commonjs/components/Light.js.map +0 -1
- package/lib/module/components/Light.js +0 -25
- package/lib/module/components/Light.js.map +0 -1
- package/lib/typescript/commonjs/src/components/Light.d.ts +0 -16
- package/lib/typescript/commonjs/src/components/Light.d.ts.map +0 -1
- package/lib/typescript/module/src/components/Light.d.ts +0 -16
- package/lib/typescript/module/src/components/Light.d.ts.map +0 -1
- package/src/components/Light.tsx +0 -38
|
@@ -24,7 +24,6 @@ import org.maplibre.reactnative.components.layers.MLRNHeatmapLayerManager
|
|
|
24
24
|
import org.maplibre.reactnative.components.layers.MLRNLineLayerManager
|
|
25
25
|
import org.maplibre.reactnative.components.layers.MLRNRasterLayerManager
|
|
26
26
|
import org.maplibre.reactnative.components.layers.MLRNSymbolLayerManager
|
|
27
|
-
import org.maplibre.reactnative.components.light.MLRNLightManager
|
|
28
27
|
import org.maplibre.reactnative.components.sources.MLRNImageSourceManager
|
|
29
28
|
import org.maplibre.reactnative.components.sources.MLRNRasterSourceManager
|
|
30
29
|
import org.maplibre.reactnative.components.sources.MLRNShapeSourceManager
|
|
@@ -142,7 +141,6 @@ class MLRNPackage : BaseReactPackage() {
|
|
|
142
141
|
managers.add(MLRNMapViewManager(reactContext))
|
|
143
142
|
managers.add(MLRNMarkerViewManager(reactContext))
|
|
144
143
|
managers.add(MLRNAndroidTextureMapViewManager(reactContext))
|
|
145
|
-
managers.add(MLRNLightManager())
|
|
146
144
|
managers.add(MLRNPointAnnotationManager(reactContext))
|
|
147
145
|
managers.add(MLRNCalloutManager())
|
|
148
146
|
managers.add(MLRNNativeUserLocationManager())
|
|
@@ -61,7 +61,8 @@ import org.maplibre.reactnative.components.location.MLRNNativeUserLocation
|
|
|
61
61
|
import org.maplibre.reactnative.components.mapview.helpers.CameraChangeTracker
|
|
62
62
|
import org.maplibre.reactnative.components.mapview.helpers.LayerSourceInfo
|
|
63
63
|
import org.maplibre.reactnative.components.layers.MLRNLayer
|
|
64
|
-
import org.maplibre.reactnative.components.
|
|
64
|
+
import org.maplibre.reactnative.components.layers.style.MLRNStyle
|
|
65
|
+
import org.maplibre.reactnative.components.layers.style.MLRNStyleFactory
|
|
65
66
|
import org.maplibre.reactnative.components.sources.MLRNSource
|
|
66
67
|
import org.maplibre.reactnative.components.sources.MLRNSource.OnPressEvent
|
|
67
68
|
import org.maplibre.reactnative.events.MapChangeEvent
|
|
@@ -209,7 +210,7 @@ open class MLRNMapView(
|
|
|
209
210
|
MapChild.FeatureChild(childView)
|
|
210
211
|
}
|
|
211
212
|
|
|
212
|
-
is
|
|
213
|
+
is MLRNNativeUserLocation, is MLRNMarkerView, is MLRNLayer<*> -> {
|
|
213
214
|
MapChild.FeatureChild(childView)
|
|
214
215
|
}
|
|
215
216
|
|
|
@@ -688,6 +689,7 @@ open class MLRNMapView(
|
|
|
688
689
|
|
|
689
690
|
override fun onDidFinishLoadingStyle() {
|
|
690
691
|
handleMapChangedEvent("onDidFinishLoadingStyle")
|
|
692
|
+
applyLight()
|
|
691
693
|
}
|
|
692
694
|
|
|
693
695
|
override fun onStyleImageMissing(id: String) {
|
|
@@ -714,14 +716,36 @@ open class MLRNMapView(
|
|
|
714
716
|
if (isJSONValid(mapStyle)) {
|
|
715
717
|
mapLibreMap!!.setStyle(
|
|
716
718
|
Style.Builder().fromJson(mapStyle)
|
|
717
|
-
) {
|
|
719
|
+
) {
|
|
720
|
+
addAllSourcesToMap()
|
|
721
|
+
}
|
|
718
722
|
} else {
|
|
719
|
-
mapLibreMap!!.setStyle(value) {
|
|
723
|
+
mapLibreMap!!.setStyle(value) {
|
|
724
|
+
addAllSourcesToMap()
|
|
725
|
+
}
|
|
720
726
|
}
|
|
721
727
|
}
|
|
722
728
|
}
|
|
723
729
|
}
|
|
724
730
|
|
|
731
|
+
private var reactLight: ReadableMap? = null
|
|
732
|
+
|
|
733
|
+
fun setReactLight(value: ReadableMap?) {
|
|
734
|
+
reactLight = value
|
|
735
|
+
applyLight()
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
private fun applyLight() {
|
|
739
|
+
val reactLightProps = reactLight
|
|
740
|
+
val map = mapLibreMap
|
|
741
|
+
val style = map?.style
|
|
742
|
+
|
|
743
|
+
if (style != null && reactLightProps != null && map != null) {
|
|
744
|
+
val light = style.light
|
|
745
|
+
MLRNStyleFactory.setLightLayerStyle(light, MLRNStyle(context, reactLightProps, map))
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
725
749
|
fun setReactContentInset(value: ReadableMap?) {
|
|
726
750
|
if (value != null) {
|
|
727
751
|
val arr = WritableNativeArray()
|
package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.kt
CHANGED
|
@@ -2,6 +2,7 @@ package org.maplibre.reactnative.components.mapview
|
|
|
2
2
|
|
|
3
3
|
import android.util.Log
|
|
4
4
|
import android.view.View
|
|
5
|
+
import com.facebook.react.bridge.Dynamic
|
|
5
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
7
|
import com.facebook.react.bridge.ReadableMap
|
|
7
8
|
import com.facebook.react.bridge.UiThreadUtil
|
|
@@ -90,6 +91,11 @@ open class MLRNMapViewManager(context: ReactApplicationContext) :
|
|
|
90
91
|
mapView.setReactMapStyle(value)
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
@ReactProp(name = "light")
|
|
95
|
+
override fun setLight(mapView: MLRNMapView, value: Dynamic?) {
|
|
96
|
+
mapView.setReactLight(value?.asMap())
|
|
97
|
+
}
|
|
98
|
+
|
|
93
99
|
@ReactProp(name = "contentInset")
|
|
94
100
|
override fun setContentInset(mapView: MLRNMapView, value: ReadableMap?) {
|
|
95
101
|
mapView.setReactContentInset(value)
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
#import <MapLibre/MapLibre.h>
|
|
4
4
|
|
|
5
|
-
#import "MLRNLight.h"
|
|
6
5
|
#import "MLRNPointAnnotation.h"
|
|
7
6
|
#import "MLRNSource.h"
|
|
8
7
|
|
|
@@ -32,13 +31,13 @@ typedef void (^StyleLoadedBlock)(MLNStyle *__nonnull style);
|
|
|
32
31
|
@property (nonatomic, strong, nonnull) NSMutableArray<MLRNImages *> *images;
|
|
33
32
|
@property (nonatomic, strong, nonnull) NSMutableArray<MLRNLayer *> *layers;
|
|
34
33
|
@property (nonatomic, strong, nonnull) NSMutableArray<MLRNPointAnnotation *> *pointAnnotations;
|
|
35
|
-
@property (nonatomic, strong, nullable) MLRNLight *light;
|
|
36
34
|
|
|
37
35
|
@property (nonatomic, strong, nonnull)
|
|
38
36
|
NSMutableDictionary<NSString *, NSMutableArray<FoundLayerBlock> *> *layerWaiters;
|
|
39
37
|
@property (nonatomic, strong, nonnull) NSMutableArray<StyleLoadedBlock> *styleWaiters;
|
|
40
38
|
|
|
41
39
|
@property (nonatomic, copy, nullable) NSString *reactMapStyle;
|
|
40
|
+
@property (nonatomic, copy, nullable) NSDictionary *reactLight;
|
|
42
41
|
@property (nonatomic, copy, nullable) NSDictionary<NSString *, NSNumber *> *reactContentInset;
|
|
43
42
|
@property (nonatomic, assign) NSInteger reactPreferredFramesPerSecond;
|
|
44
43
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#import "MLRNMapTouchEvent.h"
|
|
9
9
|
#import "MLRNNativeUserLocation.h"
|
|
10
10
|
#import "MLRNShapeSource.h"
|
|
11
|
+
#import "MLRNStyle.h"
|
|
11
12
|
#import "MLRNUserLocation.h"
|
|
12
13
|
#import "MLRNUtils.h"
|
|
13
14
|
|
|
@@ -136,10 +137,6 @@ static double const M2PI = M_PI * 2;
|
|
|
136
137
|
MLRNSource *source = (MLRNSource *)subview;
|
|
137
138
|
source.map = self;
|
|
138
139
|
[_sources addObject:(MLRNSource *)subview];
|
|
139
|
-
} else if ([subview isKindOfClass:[MLRNLight class]]) {
|
|
140
|
-
MLRNLight *light = (MLRNLight *)subview;
|
|
141
|
-
_light = light;
|
|
142
|
-
_light.map = self;
|
|
143
140
|
} else if ([subview isKindOfClass:[MLRNNativeUserLocation class]]) {
|
|
144
141
|
MLRNNativeUserLocation *nativeUserLocation = (MLRNNativeUserLocation *)subview;
|
|
145
142
|
nativeUserLocation.map = self;
|
|
@@ -190,9 +187,6 @@ static double const M2PI = M_PI * 2;
|
|
|
190
187
|
} else if ([subview isKindOfClass:[MLRNNativeUserLocation class]]) {
|
|
191
188
|
MLRNNativeUserLocation *nativeUserLocation = (MLRNNativeUserLocation *)subview;
|
|
192
189
|
nativeUserLocation.map = nil;
|
|
193
|
-
} else if ([subview isKindOfClass:[MLRNLight class]]) {
|
|
194
|
-
MLRNLight *light = (MLRNLight *)subview;
|
|
195
|
-
light.map = nil;
|
|
196
190
|
} else {
|
|
197
191
|
NSArray<UIView *> *childSubViews = [subview subviews];
|
|
198
192
|
|
|
@@ -343,6 +337,26 @@ static double const M2PI = M_PI * 2;
|
|
|
343
337
|
self.styleURL = [self _getStyleURLFromKey:_reactMapStyle];
|
|
344
338
|
}
|
|
345
339
|
|
|
340
|
+
- (void)setReactLight:(NSDictionary *)reactLight {
|
|
341
|
+
_reactLight = reactLight;
|
|
342
|
+
[self _applyLight];
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
- (void)_applyLight {
|
|
346
|
+
if (_reactLight == nil || self.style == nil) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
MLNLight *light = [[MLNLight alloc] init];
|
|
351
|
+
MLRNStyle *style = [[MLRNStyle alloc] init];
|
|
352
|
+
[style lightLayer:light
|
|
353
|
+
withReactStyle:_reactLight
|
|
354
|
+
isValid:^BOOL{
|
|
355
|
+
return self.style != nil;
|
|
356
|
+
}];
|
|
357
|
+
self.style.light = light;
|
|
358
|
+
}
|
|
359
|
+
|
|
346
360
|
- (void)setReactContentInset:(NSArray<NSNumber *> *)reactContentInset {
|
|
347
361
|
NSNumber *top = [reactContentInset valueForKey:@"top"];
|
|
348
362
|
NSNumber *right = [reactContentInset valueForKey:@"right"];
|
|
@@ -729,10 +743,7 @@ static double const M2PI = M_PI * 2;
|
|
|
729
743
|
layer.map = reactMapView;
|
|
730
744
|
}
|
|
731
745
|
|
|
732
|
-
|
|
733
|
-
reactMapView.light.map = reactMapView;
|
|
734
|
-
}
|
|
735
|
-
|
|
746
|
+
[reactMapView _applyLight];
|
|
736
747
|
[reactMapView notifyStyleLoaded];
|
|
737
748
|
|
|
738
749
|
self.reactOnDidFinishLoadingStyle(nil);
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#import "RCTFabricComponentsPlugins.h"
|
|
9
9
|
|
|
10
10
|
#import <React/RCTConversions.h>
|
|
11
|
+
#import <react/utils/FollyConvert.h>
|
|
11
12
|
#import "MLRNMapView.h"
|
|
12
13
|
|
|
13
14
|
using namespace facebook::react;
|
|
@@ -63,6 +64,13 @@ ViewState createViewState(NSDictionary *dict) {
|
|
|
63
64
|
return result;
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
static NSDictionary *convertFollyDynamicToNSDictionary(const folly::dynamic &dyn) {
|
|
68
|
+
if (dyn.isNull() || !dyn.isObject()) {
|
|
69
|
+
return nil;
|
|
70
|
+
}
|
|
71
|
+
return (NSDictionary *)convertFollyDynamicToId(dyn);
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
// MARK: - MLRNMapViewComponentView
|
|
67
75
|
|
|
68
76
|
@interface MLRNMapViewComponentView () <RCTMLRNMapViewViewProtocol>
|
|
@@ -298,6 +306,13 @@ ViewState createViewState(NSDictionary *dict) {
|
|
|
298
306
|
[_view setReactMapStyle:mapStyle];
|
|
299
307
|
}
|
|
300
308
|
|
|
309
|
+
if (oldViewProps.light != newViewProps.light) {
|
|
310
|
+
NSDictionary *reactLight = (!newViewProps.light.isNull() && newViewProps.light.isObject())
|
|
311
|
+
? convertFollyDynamicToNSDictionary(newViewProps.light)
|
|
312
|
+
: nil;
|
|
313
|
+
[_view setReactLight:reactLight];
|
|
314
|
+
}
|
|
315
|
+
|
|
301
316
|
if (oldViewProps.contentInset.top != newViewProps.contentInset.top ||
|
|
302
317
|
oldViewProps.contentInset.right != newViewProps.contentInset.right ||
|
|
303
318
|
oldViewProps.contentInset.bottom != newViewProps.contentInset.bottom ||
|
|
@@ -10,6 +10,7 @@ var _MapViewNativeComponent = _interopRequireDefault(require("./MapViewNativeCom
|
|
|
10
10
|
var _NativeMapViewModule = _interopRequireDefault(require("./NativeMapViewModule.js"));
|
|
11
11
|
var _Logger = require("../../modules/Logger.js");
|
|
12
12
|
var _index = require("../../utils/index.js");
|
|
13
|
+
var _StyleValue = require("../../utils/StyleValue.js");
|
|
13
14
|
var _filterUtils = require("../../utils/filterUtils.js");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -76,6 +77,7 @@ const MapView = exports.MapView = /*#__PURE__*/(0, _react.memo)(/*#__PURE__*/(0,
|
|
|
76
77
|
const nativeProps = (0, _react.useMemo)(() => {
|
|
77
78
|
const {
|
|
78
79
|
mapStyle,
|
|
80
|
+
light,
|
|
79
81
|
...otherProps
|
|
80
82
|
} = props;
|
|
81
83
|
let nativeMapStyle = undefined;
|
|
@@ -86,11 +88,13 @@ const MapView = exports.MapView = /*#__PURE__*/(0, _react.memo)(/*#__PURE__*/(0,
|
|
|
86
88
|
nativeMapStyle = JSON.stringify(mapStyle);
|
|
87
89
|
}
|
|
88
90
|
}
|
|
91
|
+
const transformedLight = props.light ? (0, _StyleValue.transformStyle)(props.light) : undefined;
|
|
89
92
|
return {
|
|
90
93
|
...otherProps,
|
|
91
94
|
ref: nativeRef,
|
|
92
95
|
style: styles.matchParent,
|
|
93
|
-
mapStyle: nativeMapStyle
|
|
96
|
+
mapStyle: nativeMapStyle,
|
|
97
|
+
light: transformedLight
|
|
94
98
|
};
|
|
95
99
|
}, [props]);
|
|
96
100
|
let mapView = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_MapViewNativeComponent","_interopRequireDefault","_NativeMapViewModule","_Logger","_index","_filterUtils","_jsxRuntime","e","__esModule","default","MLRNModule","NativeModules","console","error","NativeAndroidTextureMapViewComponent","isAndroid","requireNativeComponent","undefined","styles","StyleSheet","create","matchParent","flex","findNodeHandle","ref","nodeHandle","rnFindNodeHandle","Error","MapView","exports","memo","forwardRef","androidView","style","testID","props","isReady","setIsReady","useState","nativeRef","useRef","useImperativeHandle","getCenter","NativeMapViewModule","current","getZoom","getBearing","getPitch","getBounds","getViewState","project","coordinate","unproject","point","queryRenderedFeatures","geometryOrOptions","options","queryRenderedFeaturesWithCoordinate","layers","getFilter","filter","Array","isArray","queryRenderedFeaturesWithBounds","takeSnap","writeToDisk","setSourceVisibility","visible","source","sourceLayer","showAttribution","useLayoutEffect","Logger","sharedInstance","start","stop","nativeProps","useMemo","mapStyle","otherProps","nativeMapStyle","JSON","stringify","mapView","jsx","View","onLayout","children"],"sourceRoot":"../../../../src","sources":["components/map-view/MapView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAaA,IAAAC,YAAA,GAAAD,OAAA;AAYA,IAAAE,uBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,oBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_MapViewNativeComponent","_interopRequireDefault","_NativeMapViewModule","_Logger","_index","_StyleValue","_filterUtils","_jsxRuntime","e","__esModule","default","MLRNModule","NativeModules","console","error","NativeAndroidTextureMapViewComponent","isAndroid","requireNativeComponent","undefined","styles","StyleSheet","create","matchParent","flex","findNodeHandle","ref","nodeHandle","rnFindNodeHandle","Error","MapView","exports","memo","forwardRef","androidView","style","testID","props","isReady","setIsReady","useState","nativeRef","useRef","useImperativeHandle","getCenter","NativeMapViewModule","current","getZoom","getBearing","getPitch","getBounds","getViewState","project","coordinate","unproject","point","queryRenderedFeatures","geometryOrOptions","options","queryRenderedFeaturesWithCoordinate","layers","getFilter","filter","Array","isArray","queryRenderedFeaturesWithBounds","takeSnap","writeToDisk","setSourceVisibility","visible","source","sourceLayer","showAttribution","useLayoutEffect","Logger","sharedInstance","start","stop","nativeProps","useMemo","mapStyle","light","otherProps","nativeMapStyle","JSON","stringify","transformedLight","transformStyle","mapView","jsx","View","onLayout","children"],"sourceRoot":"../../../../src","sources":["components/map-view/MapView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAaA,IAAAC,YAAA,GAAAD,OAAA;AAYA,IAAAE,uBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,oBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AASA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAAoD,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAG,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpD,MAAMG,UAAU,GAAGC,0BAAa,CAACD,UAAU;AAC3C,IAAIA,UAAU,IAAI,IAAI,EAAE;EACtBE,OAAO,CAACC,KAAK,CACX,kKACF,CAAC;AACH;AAEA,MAAMC,oCAAoC,GAAG,IAAAC,gBAAS,EAAC,CAAC,GACnD,IAAAC,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KAAK,GAChC,IAAAM,0BAAc,EAAClD,KAAK,CAAC4C,KAAK,CAAC,GAC3B9D,SAAS;IAEb,OAAO;MACL,GAAG+D,UAAU;MACbxD,GAAG,EAAEe,SAAS;MACdN,KAAK,EAAEf,MAAM,CAACG,WAAW;MACzByD,QAAQ,EAAEG,cAAc;MACxBF,KAAK,EAAEK;IACT,CAAC;EACH,CAAC,EAAE,CAACjD,KAAK,CAAC,CAAC;EAEX,IAAImD,OAA4B,GAAG,IAAI;EACvC,IAAIlD,OAAO,EAAE;IACX,IAAItB,oCAAoC,IAAIkB,WAAW,KAAK,SAAS,EAAE;MACrEsD,OAAO,gBAAG,IAAAhF,WAAA,CAAAiF,GAAA,EAACzE,oCAAoC;QAAA,GAAK8D;MAAW,CAAG,CAAC;IACrE,CAAC,MAAM;MACLU,OAAO,gBAAG,IAAAhF,WAAA,CAAAiF,GAAA,EAACxF,uBAAA,CAAAU,OAAsB;QAAA,GAAKmE;MAAW,CAAG,CAAC;IACvD;EACF;EAEA,oBACE,IAAAtE,WAAA,CAAAiF,GAAA,EAACzF,YAAA,CAAA0F,IAAI;IACHC,QAAQ,EAAEA,CAAA,KAAMpD,UAAU,CAAC,IAAI,CAAE;IACjCJ,KAAK,EAAEA,KAAM;IACbC,MAAM,EAAEoD,OAAO,GAAGrE,SAAS,GAAGiB,MAAO;IAAAwD,QAAA,EAEpCJ;EAAO,CACJ,CAAC;AAEX,CACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
codegenNativeComponent,
|
|
3
3
|
type CodegenTypes,
|
|
4
|
-
type ColorValue,
|
|
5
4
|
type HostComponent,
|
|
5
|
+
type ColorValue,
|
|
6
6
|
type ViewProps,
|
|
7
7
|
} from "react-native";
|
|
8
8
|
|
|
9
|
+
import type { LightLayerStyle } from "../../types/MapLibreRNStyles";
|
|
9
10
|
import type { UnsafeMixed } from "../../types/codegen/UnsafeMixed";
|
|
10
11
|
|
|
11
12
|
type NativeViewPadding = {
|
|
@@ -50,6 +51,7 @@ type NativeViewStateEvent = {
|
|
|
50
51
|
|
|
51
52
|
export interface NativeProps extends ViewProps {
|
|
52
53
|
mapStyle?: string;
|
|
54
|
+
light?: UnsafeMixed<LightLayerStyle>;
|
|
53
55
|
contentInset?: NativeViewPadding;
|
|
54
56
|
preferredFramesPerSecond?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
|
|
55
57
|
|
package/lib/commonjs/index.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
Camera: true,
|
|
8
8
|
MapView: true,
|
|
9
|
-
Light: true,
|
|
10
9
|
PointAnnotation: true,
|
|
11
10
|
Annotation: true,
|
|
12
11
|
Callout: true,
|
|
@@ -101,12 +100,6 @@ Object.defineProperty(exports, "Images", {
|
|
|
101
100
|
return _Images.Images;
|
|
102
101
|
}
|
|
103
102
|
});
|
|
104
|
-
Object.defineProperty(exports, "Light", {
|
|
105
|
-
enumerable: true,
|
|
106
|
-
get: function () {
|
|
107
|
-
return _Light.Light;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
103
|
Object.defineProperty(exports, "LineLayer", {
|
|
111
104
|
enumerable: true,
|
|
112
105
|
get: function () {
|
|
@@ -229,7 +222,6 @@ Object.keys(_MLRNModule).forEach(function (key) {
|
|
|
229
222
|
});
|
|
230
223
|
var _Camera = require("./components/camera/Camera.js");
|
|
231
224
|
var _MapView = require("./components/map-view/MapView.js");
|
|
232
|
-
var _Light = require("./components/Light.js");
|
|
233
225
|
var _PointAnnotation = require("./components/annotations/PointAnnotation.js");
|
|
234
226
|
var _Annotation = require("./components/annotations/Annotation.js");
|
|
235
227
|
var _Callout = require("./components/annotations/Callout.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_MLRNModule","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_Camera","_MapView","
|
|
1
|
+
{"version":3,"names":["_MLRNModule","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_Camera","_MapView","_PointAnnotation","_Annotation","_Callout","_requestAndroidLocationPermissions","_UserLocation","_VectorSource","_ShapeSource","_RasterSource","_ImageSource","_Images","_FillLayer","_FillExtrusionLayer","_HeatmapLayer","_LineLayer","_CircleLayer","_SymbolLayer","_RasterLayer","_BackgroundLayer","_MarkerView","_LocationManager","_OfflineManager","_OfflinePack","_OfflineCreatePackOptions","_SnapshotManager","_Animated","_Logger"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAS,OAAA,GAAAb,OAAA;AAiBA,IAAAc,QAAA,GAAAd,OAAA;AAOA,IAAAe,gBAAA,GAAAf,OAAA;AAEA,IAAAgB,WAAA,GAAAhB,OAAA;AACA,IAAAiB,QAAA,GAAAjB,OAAA;AACA,IAAAkB,kCAAA,GAAAlB,OAAA;AACA,IAAAmB,aAAA,GAAAnB,OAAA;AAKA,IAAAoB,aAAA,GAAApB,OAAA;AACA,IAAAqB,YAAA,GAAArB,OAAA;AAEA,IAAAsB,aAAA,GAAAtB,OAAA;AACA,IAAAuB,YAAA,GAAAvB,OAAA;AACA,IAAAwB,OAAA,GAAAxB,OAAA;AACA,IAAAyB,UAAA,GAAAzB,OAAA;AACA,IAAA0B,mBAAA,GAAA1B,OAAA;AACA,IAAA2B,aAAA,GAAA3B,OAAA;AACA,IAAA4B,UAAA,GAAA5B,OAAA;AACA,IAAA6B,YAAA,GAAA7B,OAAA;AACA,IAAA8B,YAAA,GAAA9B,OAAA;AACA,IAAA+B,YAAA,GAAA/B,OAAA;AACA,IAAAgC,gBAAA,GAAAhC,OAAA;AACA,IAAAiC,WAAA,GAAAjC,OAAA;AAEA,IAAAkC,gBAAA,GAAAlC,OAAA;AAIA,IAAAmC,eAAA,GAAAnC,OAAA;AAGA,IAAAoC,YAAA,GAAApC,OAAA;AACA,IAAAqC,yBAAA,GAAArC,OAAA;AACA,IAAAsC,gBAAA,GAAAtC,OAAA;AAoBA,IAAAuC,SAAA,GAAAvC,OAAA;AACA,IAAAwC,OAAA,GAAAxC,OAAA","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ import MapViewNativeComponent from "./MapViewNativeComponent";
|
|
|
6
6
|
import NativeMapViewModule from "./NativeMapViewModule.js";
|
|
7
7
|
import { Logger } from "../../modules/Logger.js";
|
|
8
8
|
import { isAndroid } from "../../utils/index.js";
|
|
9
|
+
import { transformStyle } from "../../utils/StyleValue.js";
|
|
9
10
|
import { getFilter } from "../../utils/filterUtils.js";
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
const MLRNModule = NativeModules.MLRNModule;
|
|
@@ -71,6 +72,7 @@ export const MapView = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
|
71
72
|
const nativeProps = useMemo(() => {
|
|
72
73
|
const {
|
|
73
74
|
mapStyle,
|
|
75
|
+
light,
|
|
74
76
|
...otherProps
|
|
75
77
|
} = props;
|
|
76
78
|
let nativeMapStyle = undefined;
|
|
@@ -81,11 +83,13 @@ export const MapView = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
|
81
83
|
nativeMapStyle = JSON.stringify(mapStyle);
|
|
82
84
|
}
|
|
83
85
|
}
|
|
86
|
+
const transformedLight = props.light ? transformStyle(props.light) : undefined;
|
|
84
87
|
return {
|
|
85
88
|
...otherProps,
|
|
86
89
|
ref: nativeRef,
|
|
87
90
|
style: styles.matchParent,
|
|
88
|
-
mapStyle: nativeMapStyle
|
|
91
|
+
mapStyle: nativeMapStyle,
|
|
92
|
+
light: transformedLight
|
|
89
93
|
};
|
|
90
94
|
}, [props]);
|
|
91
95
|
let mapView = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","memo","useImperativeHandle","useLayoutEffect","useMemo","useRef","useState","findNodeHandle","rnFindNodeHandle","NativeModules","requireNativeComponent","StyleSheet","View","MapViewNativeComponent","NativeMapViewModule","Logger","isAndroid","getFilter","jsx","_jsx","MLRNModule","console","error","NativeAndroidTextureMapViewComponent","undefined","styles","create","matchParent","flex","ref","nodeHandle","Error","MapView","androidView","style","testID","props","isReady","setIsReady","nativeRef","getCenter","current","getZoom","getBearing","getPitch","getBounds","getViewState","project","coordinate","unproject","point","queryRenderedFeatures","geometryOrOptions","options","queryRenderedFeaturesWithCoordinate","layers","filter","Array","isArray","queryRenderedFeaturesWithBounds","takeSnap","writeToDisk","setSourceVisibility","visible","source","sourceLayer","showAttribution","sharedInstance","start","stop","nativeProps","mapStyle","otherProps","nativeMapStyle","JSON","stringify","mapView","onLayout","children"],"sourceRoot":"../../../../src","sources":["components/map-view/MapView.tsx"],"mappings":";;AAAA,SAGEA,UAAU,EACVC,IAAI,EAGJC,mBAAmB,EACnBC,eAAe,EACfC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SACEC,cAAc,IAAIC,gBAAgB,EAGlCC,aAAa,EAEbC,sBAAsB,EACtBC,UAAU,EACVC,IAAI,QAEC,cAAc;AAErB,OAAOC,sBAAsB,MAEtB,0BAA0B;AACjC,OAAOC,mBAAmB,MAAM,0BAAuB;AACvD,SAASC,MAAM,QAAQ,yBAAsB;
|
|
1
|
+
{"version":3,"names":["forwardRef","memo","useImperativeHandle","useLayoutEffect","useMemo","useRef","useState","findNodeHandle","rnFindNodeHandle","NativeModules","requireNativeComponent","StyleSheet","View","MapViewNativeComponent","NativeMapViewModule","Logger","isAndroid","transformStyle","getFilter","jsx","_jsx","MLRNModule","console","error","NativeAndroidTextureMapViewComponent","undefined","styles","create","matchParent","flex","ref","nodeHandle","Error","MapView","androidView","style","testID","props","isReady","setIsReady","nativeRef","getCenter","current","getZoom","getBearing","getPitch","getBounds","getViewState","project","coordinate","unproject","point","queryRenderedFeatures","geometryOrOptions","options","queryRenderedFeaturesWithCoordinate","layers","filter","Array","isArray","queryRenderedFeaturesWithBounds","takeSnap","writeToDisk","setSourceVisibility","visible","source","sourceLayer","showAttribution","sharedInstance","start","stop","nativeProps","mapStyle","light","otherProps","nativeMapStyle","JSON","stringify","transformedLight","mapView","onLayout","children"],"sourceRoot":"../../../../src","sources":["components/map-view/MapView.tsx"],"mappings":";;AAAA,SAGEA,UAAU,EACVC,IAAI,EAGJC,mBAAmB,EACnBC,eAAe,EACfC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SACEC,cAAc,IAAIC,gBAAgB,EAGlCC,aAAa,EAEbC,sBAAsB,EACtBC,UAAU,EACVC,IAAI,QAEC,cAAc;AAErB,OAAOC,sBAAsB,MAEtB,0BAA0B;AACjC,OAAOC,mBAAmB,MAAM,0BAAuB;AACvD,SAASC,MAAM,QAAQ,yBAAsB;AAS7C,SAASC,SAAS,QAAQ,sBAAa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
|
7
7
|
} from "react-native";
|
|
8
8
|
|
|
9
|
+
import type { LightLayerStyle } from "../../types/MapLibreRNStyles";
|
|
9
10
|
import type { UnsafeMixed } from "../../types/codegen/UnsafeMixed";
|
|
10
11
|
|
|
11
12
|
type NativeViewPadding = {
|
|
@@ -50,6 +51,7 @@ type NativeViewStateEvent = {
|
|
|
50
51
|
|
|
51
52
|
export interface NativeProps extends ViewProps {
|
|
52
53
|
mapStyle?: string;
|
|
54
|
+
light?: UnsafeMixed<LightLayerStyle>;
|
|
53
55
|
contentInset?: NativeViewPadding;
|
|
54
56
|
preferredFramesPerSecond?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
|
|
55
57
|
|
package/lib/module/index.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
export * from "./MLRNModule.js";
|
|
4
4
|
export { Camera } from "./components/camera/Camera.js";
|
|
5
5
|
export { MapView } from "./components/map-view/MapView.js";
|
|
6
|
-
export { Light } from "./components/Light.js";
|
|
7
6
|
export { PointAnnotation } from "./components/annotations/PointAnnotation.js";
|
|
8
7
|
export { Annotation } from "./components/annotations/Annotation.js";
|
|
9
8
|
export { Callout } from "./components/annotations/Callout.js";
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Camera","MapView","
|
|
1
|
+
{"version":3,"names":["Camera","MapView","PointAnnotation","Annotation","Callout","requestAndroidLocationPermissions","UserLocation","UserLocationRenderMode","VectorSource","ShapeSource","RasterSource","ImageSource","Images","FillLayer","FillExtrusionLayer","HeatmapLayer","LineLayer","CircleLayer","SymbolLayer","RasterLayer","BackgroundLayer","MarkerView","LocationManager","OfflineManager","OfflinePack","OfflineCreatePackOptions","SnapshotManager","Animated","Logger"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,iBAAc;AAE5B,SAcEA,MAAM,QACD,+BAA4B;AAEnC,SACEC,OAAO,QAIF,kCAA+B;AAEtC,SAASC,eAAe,QAAQ,6CAA0C;AAE1E,SAASC,UAAU,QAAQ,wCAAqC;AAChE,SAASC,OAAO,QAAQ,qCAAkC;AAC1D,SAASC,iCAAiC,QAAQ,wCAAqC;AACvF,SACEC,YAAY,EACZC,sBAAsB,QACjB,4CAAyC;AAEhD,SAASC,YAAY,QAAQ,sCAAmC;AAChE,SAASC,WAAW,QAAQ,qCAAkC;AAE9D,SAASC,YAAY,QAAQ,sCAAmC;AAChE,SAASC,WAAW,QAAQ,qCAAkC;AAC9D,SAASC,MAAM,QAAQ,wBAAqB;AAC5C,SAASC,SAAS,QAAQ,kCAA+B;AACzD,SAASC,kBAAkB,QAAQ,2CAAwC;AAC3E,SAASC,YAAY,QAAQ,qCAAkC;AAC/D,SAASC,SAAS,QAAQ,kCAA+B;AACzD,SAASC,WAAW,QAAQ,oCAAiC;AAC7D,SAASC,WAAW,QAAQ,oCAAiC;AAC7D,SAASC,WAAW,QAAQ,oCAAiC;AAC7D,SAASC,eAAe,QAAQ,wCAAqC;AACrE,SAASC,UAAU,QAAQ,wCAAqC;AAEhE,SACEC,eAAe,QAEV,uCAAoC;AAC3C,SAASC,cAAc,QAAQ,qCAAkC;AAGjE,SAASC,WAAW,QAAQ,kCAA+B;AAC3D,SAASC,wBAAwB,QAAQ,+CAA4C;AACrF,SAASC,eAAe,QAAQ,uCAAoC;AAoBpE,SAASC,QAAQ,QAAQ,8BAA2B;AACpD,SAASC,MAAM,QAAuB,qBAAkB","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import { type NativeSyntheticEvent, type ViewProps } from "react-native";
|
|
3
3
|
import { type BaseProps } from "../../types/BaseProps";
|
|
4
4
|
import type { Bounds } from "../../types/Bounds";
|
|
5
|
-
import { type FilterExpression } from "../../types/MapLibreRNStyles";
|
|
5
|
+
import { type FilterExpression, type LightLayerStyle } from "../../types/MapLibreRNStyles";
|
|
6
6
|
import type { PressEvent } from "../../types/PressEvent";
|
|
7
7
|
import type { ViewPadding } from "../../types/ViewPadding";
|
|
8
8
|
export type OrnamentViewPosition = {
|
|
@@ -173,7 +173,15 @@ interface MapViewProps extends BaseProps {
|
|
|
173
173
|
*/
|
|
174
174
|
mapStyle?: string | object;
|
|
175
175
|
/**
|
|
176
|
-
*
|
|
176
|
+
* Light properties of the style. Must conform to the Light Style Specification.
|
|
177
|
+
* Controls the light source for extruded geometries.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* light={{ position: [1.5, 90, 80], color: "#ffffff", intensity: 0.5 }}
|
|
181
|
+
*/
|
|
182
|
+
light?: LightLayerStyle;
|
|
183
|
+
/**
|
|
184
|
+
* The distance from the edges of the map view's frame to the edges of the map view's logical viewport.
|
|
177
185
|
*/
|
|
178
186
|
contentInset?: ViewPadding;
|
|
179
187
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/map-view/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,oBAAoB,EAIzB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/map-view/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,oBAAoB,EAIzB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,KAAK,gBAA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,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAEtE;;OAEG;IACH,4BAA4B,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAE3E;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACvE;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,gGA6JnB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type CodegenTypes, type
|
|
1
|
+
import { type CodegenTypes, type HostComponent, type ColorValue, type ViewProps } from "react-native";
|
|
2
|
+
import type { LightLayerStyle } from "../../types/MapLibreRNStyles";
|
|
2
3
|
import type { UnsafeMixed } from "../../types/codegen/UnsafeMixed";
|
|
3
4
|
type NativeViewPadding = {
|
|
4
5
|
top?: CodegenTypes.WithDefault<CodegenTypes.Int32, 0>;
|
|
@@ -35,6 +36,7 @@ type NativeViewStateEvent = {
|
|
|
35
36
|
};
|
|
36
37
|
export interface NativeProps extends ViewProps {
|
|
37
38
|
mapStyle?: string;
|
|
39
|
+
light?: UnsafeMixed<LightLayerStyle>;
|
|
38
40
|
contentInset?: NativeViewPadding;
|
|
39
41
|
preferredFramesPerSecond?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
|
|
40
42
|
dragPan?: CodegenTypes.WithDefault<boolean, true>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/map-view/MapViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,
|
|
1
|
+
{"version":3,"file":"MapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/map-view/MapViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,aAAa,EA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CAAC,IAAI,CAAC,CAAC;IAErE,uBAAuB,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;CACjE;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./MLRNModule";
|
|
2
2
|
export { type CameraOptions, type CameraEasing, type CameraAnimationOptions, type CameraCenterOptions, type CameraBoundsOptions, type CameraCenterStop, type CameraBoundsStop, type CameraStop, type InitialViewState, type CameraRef, type TrackUserLocation, type TrackUserLocationChangeEvent, type CameraProps, Camera, } from "./components/camera/Camera";
|
|
3
3
|
export { MapView, type MapViewRef, type ViewState, type ViewStateChangeEvent, } from "./components/map-view/MapView";
|
|
4
|
-
export { Light } from "./components/Light";
|
|
5
4
|
export { PointAnnotation } from "./components/annotations/PointAnnotation";
|
|
6
5
|
export type { PointAnnotationRef } from "./components/annotations/PointAnnotation";
|
|
7
6
|
export { Annotation } from "./components/annotations/Annotation";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACjC,KAAK,WAAW,EAChB,MAAM,GACP,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,OAAO,EACP,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,oBAAoB,GAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.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AAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEzD,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import { type NativeSyntheticEvent, type ViewProps } from "react-native";
|
|
3
3
|
import { type BaseProps } from "../../types/BaseProps";
|
|
4
4
|
import type { Bounds } from "../../types/Bounds";
|
|
5
|
-
import { type FilterExpression } from "../../types/MapLibreRNStyles";
|
|
5
|
+
import { type FilterExpression, type LightLayerStyle } from "../../types/MapLibreRNStyles";
|
|
6
6
|
import type { PressEvent } from "../../types/PressEvent";
|
|
7
7
|
import type { ViewPadding } from "../../types/ViewPadding";
|
|
8
8
|
export type OrnamentViewPosition = {
|
|
@@ -173,7 +173,15 @@ interface MapViewProps extends BaseProps {
|
|
|
173
173
|
*/
|
|
174
174
|
mapStyle?: string | object;
|
|
175
175
|
/**
|
|
176
|
-
*
|
|
176
|
+
* Light properties of the style. Must conform to the Light Style Specification.
|
|
177
|
+
* Controls the light source for extruded geometries.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* light={{ position: [1.5, 90, 80], color: "#ffffff", intensity: 0.5 }}
|
|
181
|
+
*/
|
|
182
|
+
light?: LightLayerStyle;
|
|
183
|
+
/**
|
|
184
|
+
* The distance from the edges of the map view's frame to the edges of the map view's logical viewport.
|
|
177
185
|
*/
|
|
178
186
|
contentInset?: ViewPadding;
|
|
179
187
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/map-view/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,KAAK,oBAAoB,EAIzB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,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CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAExE;;OAEG;IACH,yBAAyB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAExE;;OAEG;IACH,8BAA8B,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAE7E;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAEtE;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAEtE;;OAEG;IACH,4BAA4B,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAE3E;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACvE;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,gGA6JnB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type CodegenTypes, type
|
|
1
|
+
import { type CodegenTypes, type HostComponent, type ColorValue, type ViewProps } from "react-native";
|
|
2
|
+
import type { LightLayerStyle } from "../../types/MapLibreRNStyles";
|
|
2
3
|
import type { UnsafeMixed } from "../../types/codegen/UnsafeMixed";
|
|
3
4
|
type NativeViewPadding = {
|
|
4
5
|
top?: CodegenTypes.WithDefault<CodegenTypes.Int32, 0>;
|
|
@@ -35,6 +36,7 @@ type NativeViewStateEvent = {
|
|
|
35
36
|
};
|
|
36
37
|
export interface NativeProps extends ViewProps {
|
|
37
38
|
mapStyle?: string;
|
|
39
|
+
light?: UnsafeMixed<LightLayerStyle>;
|
|
38
40
|
contentInset?: NativeViewPadding;
|
|
39
41
|
preferredFramesPerSecond?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
|
|
40
42
|
dragPan?: CodegenTypes.WithDefault<boolean, true>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/map-view/MapViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,
|
|
1
|
+
{"version":3,"file":"MapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/map-view/MapViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,KAAK,iBAAiB,GAAG;IACvB,GAAG,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACtD,KAAK,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACxD,MAAM,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACzD,IAAI,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CACxD,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,GAAG,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IACvD,KAAK,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IACzD,MAAM,CAAC,EAAE,Y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,CAAC,CAAC;IAE5D,yBAAyB,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAClE,yBAAyB,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAClE,8BAA8B,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAEvE,uBAAuB,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAChE,uBAAuB,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAChE,4BAA4B,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAErE,uBAAuB,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;CACjE;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./MLRNModule";
|
|
2
2
|
export { type CameraOptions, type CameraEasing, type CameraAnimationOptions, type CameraCenterOptions, type CameraBoundsOptions, type CameraCenterStop, type CameraBoundsStop, type CameraStop, type InitialViewState, type CameraRef, type TrackUserLocation, type TrackUserLocationChangeEvent, type CameraProps, Camera, } from "./components/camera/Camera";
|
|
3
3
|
export { MapView, type MapViewRef, type ViewState, type ViewStateChangeEvent, } from "./components/map-view/MapView";
|
|
4
|
-
export { Light } from "./components/Light";
|
|
5
4
|
export { PointAnnotation } from "./components/annotations/PointAnnotation";
|
|
6
5
|
export type { PointAnnotationRef } from "./components/annotations/PointAnnotation";
|
|
7
6
|
export { Annotation } from "./components/annotations/Annotation";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,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,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,UAAU,GACX,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEzD,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maplibre/maplibre-react-native",
|
|
3
3
|
"description": "React Native library for creating maps with MapLibre Native for Android & iOS",
|
|
4
|
-
"version": "11.0.0-alpha.
|
|
4
|
+
"version": "11.0.0-alpha.11",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": true
|
|
@@ -30,10 +30,14 @@ import NativeMapViewModule from "./NativeMapViewModule";
|
|
|
30
30
|
import { Logger } from "../../modules/Logger";
|
|
31
31
|
import { type BaseProps } from "../../types/BaseProps";
|
|
32
32
|
import type { Bounds } from "../../types/Bounds";
|
|
33
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
type FilterExpression,
|
|
35
|
+
type LightLayerStyle,
|
|
36
|
+
} from "../../types/MapLibreRNStyles";
|
|
34
37
|
import type { PressEvent } from "../../types/PressEvent";
|
|
35
38
|
import type { ViewPadding } from "../../types/ViewPadding";
|
|
36
39
|
import { isAndroid } from "../../utils";
|
|
40
|
+
import { transformStyle } from "../../utils/StyleValue";
|
|
37
41
|
import { getFilter } from "../../utils/filterUtils";
|
|
38
42
|
|
|
39
43
|
const MLRNModule = NativeModules.MLRNModule;
|
|
@@ -247,7 +251,16 @@ interface MapViewProps extends BaseProps {
|
|
|
247
251
|
mapStyle?: string | object;
|
|
248
252
|
|
|
249
253
|
/**
|
|
250
|
-
*
|
|
254
|
+
* Light properties of the style. Must conform to the Light Style Specification.
|
|
255
|
+
* Controls the light source for extruded geometries.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* light={{ position: [1.5, 90, 80], color: "#ffffff", intensity: 0.5 }}
|
|
259
|
+
*/
|
|
260
|
+
light?: LightLayerStyle;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The distance from the edges of the map view's frame to the edges of the map view's logical viewport.
|
|
251
264
|
*/
|
|
252
265
|
contentInset?: ViewPadding;
|
|
253
266
|
|
|
@@ -540,7 +553,7 @@ export const MapView = memo(
|
|
|
540
553
|
}, []);
|
|
541
554
|
|
|
542
555
|
const nativeProps = useMemo(() => {
|
|
543
|
-
const { mapStyle, ...otherProps } = props;
|
|
556
|
+
const { mapStyle, light, ...otherProps } = props;
|
|
544
557
|
|
|
545
558
|
let nativeMapStyle = undefined;
|
|
546
559
|
if (mapStyle) {
|
|
@@ -551,11 +564,16 @@ export const MapView = memo(
|
|
|
551
564
|
}
|
|
552
565
|
}
|
|
553
566
|
|
|
567
|
+
const transformedLight = props.light
|
|
568
|
+
? transformStyle(props.light)
|
|
569
|
+
: undefined;
|
|
570
|
+
|
|
554
571
|
return {
|
|
555
572
|
...otherProps,
|
|
556
573
|
ref: nativeRef,
|
|
557
574
|
style: styles.matchParent,
|
|
558
575
|
mapStyle: nativeMapStyle,
|
|
576
|
+
light: transformedLight,
|
|
559
577
|
};
|
|
560
578
|
}, [props]);
|
|
561
579
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
codegenNativeComponent,
|
|
3
3
|
type CodegenTypes,
|
|
4
|
-
type ColorValue,
|
|
5
4
|
type HostComponent,
|
|
5
|
+
type ColorValue,
|
|
6
6
|
type ViewProps,
|
|
7
7
|
} from "react-native";
|
|
8
8
|
|
|
9
|
+
import type { LightLayerStyle } from "../../types/MapLibreRNStyles";
|
|
9
10
|
import type { UnsafeMixed } from "../../types/codegen/UnsafeMixed";
|
|
10
11
|
|
|
11
12
|
type NativeViewPadding = {
|
|
@@ -50,6 +51,7 @@ type NativeViewStateEvent = {
|
|
|
50
51
|
|
|
51
52
|
export interface NativeProps extends ViewProps {
|
|
52
53
|
mapStyle?: string;
|
|
54
|
+
light?: UnsafeMixed<LightLayerStyle>;
|
|
53
55
|
contentInset?: NativeViewPadding;
|
|
54
56
|
preferredFramesPerSecond?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
|
|
55
57
|
|
package/src/index.ts
CHANGED
|
@@ -24,7 +24,6 @@ export {
|
|
|
24
24
|
type ViewStateChangeEvent,
|
|
25
25
|
} from "./components/map-view/MapView";
|
|
26
26
|
|
|
27
|
-
export { Light } from "./components/Light";
|
|
28
27
|
export { PointAnnotation } from "./components/annotations/PointAnnotation";
|
|
29
28
|
export type { PointAnnotationRef } from "./components/annotations/PointAnnotation";
|
|
30
29
|
export { Annotation } from "./components/annotations/Annotation";
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
package org.maplibre.reactnative.components.light;
|
|
2
|
-
|
|
3
|
-
import android.content.Context;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
6
|
-
import org.maplibre.android.maps.MapLibreMap;
|
|
7
|
-
import org.maplibre.android.maps.Style;
|
|
8
|
-
import org.maplibre.android.style.light.Light;
|
|
9
|
-
import org.maplibre.reactnative.components.AbstractMapFeature;
|
|
10
|
-
import org.maplibre.reactnative.components.mapview.MLRNMapView;
|
|
11
|
-
import org.maplibre.reactnative.components.layers.style.MLRNStyle;
|
|
12
|
-
import org.maplibre.reactnative.components.layers.style.MLRNStyleFactory;
|
|
13
|
-
|
|
14
|
-
public class MLRNLight extends AbstractMapFeature {
|
|
15
|
-
private MapLibreMap mMap;
|
|
16
|
-
private ReadableMap mReactStyle;
|
|
17
|
-
|
|
18
|
-
public MLRNLight(Context context) {
|
|
19
|
-
super(context);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@Override
|
|
23
|
-
public void addToMap(MLRNMapView mapView) {
|
|
24
|
-
mMap = mapView.getMapLibreMap();
|
|
25
|
-
setLight();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@Override
|
|
29
|
-
public void removeFromMap(MLRNMapView mapView) {
|
|
30
|
-
// ignore there's nothing to remove just update the light style
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
public void setReactStyle(ReadableMap reactStyle) {
|
|
34
|
-
mReactStyle = reactStyle;
|
|
35
|
-
|
|
36
|
-
setLight();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
private void setLight(Light light) {
|
|
40
|
-
MLRNStyleFactory.setLightLayerStyle(light, new MLRNStyle(getContext(), mReactStyle, mMap));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
private void setLight() {
|
|
44
|
-
Style style = getStyle();
|
|
45
|
-
if (style != null) {
|
|
46
|
-
setLight(style.getLight());
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
private Style getStyle() {
|
|
51
|
-
if (mMap == null) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
return mMap.getStyle();
|
|
55
|
-
}
|
|
56
|
-
}
|
package/android/src/main/java/org/maplibre/reactnative/components/light/MLRNLightManager.java
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
package org.maplibre.reactnative.components.light;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
4
|
-
import com.facebook.react.uimanager.ThemedReactContext;
|
|
5
|
-
import com.facebook.react.uimanager.ViewGroupManager;
|
|
6
|
-
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
7
|
-
|
|
8
|
-
public class MLRNLightManager extends ViewGroupManager<MLRNLight> {
|
|
9
|
-
public static final String REACT_CLASS = "MLRNLight";
|
|
10
|
-
|
|
11
|
-
@Override
|
|
12
|
-
public String getName() {
|
|
13
|
-
return REACT_CLASS;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@Override
|
|
17
|
-
protected MLRNLight createViewInstance(ThemedReactContext reactContext) {
|
|
18
|
-
return new MLRNLight(reactContext);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@ReactProp(name="reactStyle")
|
|
22
|
-
public void setReactStyle(MLRNLight light, ReadableMap reactStyle) {
|
|
23
|
-
light.setReactStyle(reactStyle);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#import "MLRNLight.h"
|
|
2
|
-
#import "MLRNStyle.h"
|
|
3
|
-
|
|
4
|
-
@implementation MLRNLight {
|
|
5
|
-
MLNLight *internalLight;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
- (void)setReactStyle:(NSDictionary *)reactStyle {
|
|
9
|
-
_reactStyle = reactStyle;
|
|
10
|
-
|
|
11
|
-
if (_map != nil) {
|
|
12
|
-
[self addStyles];
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
- (void)setMap:(MLNMapView *)map {
|
|
17
|
-
_map = map;
|
|
18
|
-
[self addStyles];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
- (BOOL)isAddedToMap {
|
|
22
|
-
return _map != NULL;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
- (void)addStyles {
|
|
26
|
-
MLNLight *light = [[MLNLight alloc] init];
|
|
27
|
-
MLRNStyle *style = [[MLRNStyle alloc] init];
|
|
28
|
-
[style lightLayer:light
|
|
29
|
-
withReactStyle:_reactStyle
|
|
30
|
-
isValid:^{
|
|
31
|
-
return [self isAddedToMap];
|
|
32
|
-
}];
|
|
33
|
-
_map.style.light = light;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NATIVE_MODULE_NAME = exports.Light = void 0;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var _useAbstractLayer = require("../hooks/useAbstractLayer.js");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
const NATIVE_MODULE_NAME = exports.NATIVE_MODULE_NAME = "MLRNLight";
|
|
11
|
-
const MLRNLight = (0, _reactNative.requireNativeComponent)(NATIVE_MODULE_NAME);
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Light represents the light source for extruded geometries
|
|
15
|
-
*/
|
|
16
|
-
const Light = props => {
|
|
17
|
-
const {
|
|
18
|
-
baseProps,
|
|
19
|
-
setNativeLayer
|
|
20
|
-
} = (0, _useAbstractLayer.useAbstractLayer)({
|
|
21
|
-
...props
|
|
22
|
-
});
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MLRNLight, {
|
|
24
|
-
ref: setNativeLayer,
|
|
25
|
-
testID: "mlrnLight",
|
|
26
|
-
...baseProps
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
exports.Light = Light;
|
|
30
|
-
//# sourceMappingURL=Light.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_useAbstractLayer","_jsxRuntime","NATIVE_MODULE_NAME","exports","MLRNLight","requireNativeComponent","Light","props","baseProps","setNativeLayer","useAbstractLayer","jsx","ref","testID"],"sourceRoot":"../../../src","sources":["components/Light.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AAGmC,IAAAE,WAAA,GAAAF,OAAA;AAK5B,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,WAAW;AAa7C,MAAME,SAAS,GAAG,IAAAC,mCAAsB,EAAcH,kBAAkB,CAAC;;AAEzE;AACA;AACA;AACO,MAAMI,KAAK,GAAIC,KAAiB,IAAK;EAC1C,MAAM;IAAEC,SAAS;IAAEC;EAAe,CAAC,GAAG,IAAAC,kCAAgB,EAGpD;IACA,GAAGH;EACL,CAAC,CAAC;EAEF,oBAAO,IAAAN,WAAA,CAAAU,GAAA,EAACP,SAAS;IAACQ,GAAG,EAAEH,cAAe;IAACI,MAAM,EAAC,WAAW;IAAA,GAAKL;EAAS,CAAG,CAAC;AAC7E,CAAC;AAACL,OAAA,CAAAG,KAAA,GAAAA,KAAA","ignoreList":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { requireNativeComponent } from "react-native";
|
|
4
|
-
import { useAbstractLayer } from "../hooks/useAbstractLayer.js";
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
export const NATIVE_MODULE_NAME = "MLRNLight";
|
|
7
|
-
const MLRNLight = requireNativeComponent(NATIVE_MODULE_NAME);
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Light represents the light source for extruded geometries
|
|
11
|
-
*/
|
|
12
|
-
export const Light = props => {
|
|
13
|
-
const {
|
|
14
|
-
baseProps,
|
|
15
|
-
setNativeLayer
|
|
16
|
-
} = useAbstractLayer({
|
|
17
|
-
...props
|
|
18
|
-
});
|
|
19
|
-
return /*#__PURE__*/_jsx(MLRNLight, {
|
|
20
|
-
ref: setNativeLayer,
|
|
21
|
-
testID: "mlrnLight",
|
|
22
|
-
...baseProps
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=Light.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["requireNativeComponent","useAbstractLayer","jsx","_jsx","NATIVE_MODULE_NAME","MLRNLight","Light","props","baseProps","setNativeLayer","ref","testID"],"sourceRoot":"../../../src","sources":["components/Light.tsx"],"mappings":";;AAAA,SAASA,sBAAsB,QAAQ,cAAc;AAErD,SACEC,gBAAgB,QAEX,8BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAKnC,OAAO,MAAMC,kBAAkB,GAAG,WAAW;AAa7C,MAAMC,SAAS,GAAGL,sBAAsB,CAAcI,kBAAkB,CAAC;;AAEzE;AACA;AACA;AACA,OAAO,MAAME,KAAK,GAAIC,KAAiB,IAAK;EAC1C,MAAM;IAAEC,SAAS;IAAEC;EAAe,CAAC,GAAGR,gBAAgB,CAGpD;IACA,GAAGM;EACL,CAAC,CAAC;EAEF,oBAAOJ,IAAA,CAACE,SAAS;IAACK,GAAG,EAAED,cAAe;IAACE,MAAM,EAAC,WAAW;IAAA,GAAKH;EAAS,CAAG,CAAC;AAC7E,CAAC","ignoreList":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type BaseLayerProps } from "../hooks/useAbstractLayer";
|
|
2
|
-
import { type BaseProps } from "../types/BaseProps";
|
|
3
|
-
import { type LightLayerStyle } from "../types/MapLibreRNStyles";
|
|
4
|
-
export declare const NATIVE_MODULE_NAME = "MLRNLight";
|
|
5
|
-
interface LightProps extends BaseProps, BaseLayerProps {
|
|
6
|
-
/**
|
|
7
|
-
* Customizable style attributes
|
|
8
|
-
*/
|
|
9
|
-
style?: LightLayerStyle;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Light represents the light source for extruded geometries
|
|
13
|
-
*/
|
|
14
|
-
export declare const Light: (props: LightProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=Light.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Light.d.ts","sourceRoot":"","sources":["../../../../../src/components/Light.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAGjE,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAE9C,UAAU,UAAW,SAAQ,SAAS,EAAE,cAAc;IACpD;;OAEG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAQD;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,4CAStC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type BaseLayerProps } from "../hooks/useAbstractLayer";
|
|
2
|
-
import { type BaseProps } from "../types/BaseProps";
|
|
3
|
-
import { type LightLayerStyle } from "../types/MapLibreRNStyles";
|
|
4
|
-
export declare const NATIVE_MODULE_NAME = "MLRNLight";
|
|
5
|
-
interface LightProps extends BaseProps, BaseLayerProps {
|
|
6
|
-
/**
|
|
7
|
-
* Customizable style attributes
|
|
8
|
-
*/
|
|
9
|
-
style?: LightLayerStyle;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Light represents the light source for extruded geometries
|
|
13
|
-
*/
|
|
14
|
-
export declare const Light: (props: LightProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=Light.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Light.d.ts","sourceRoot":"","sources":["../../../../../src/components/Light.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAGjE,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAE9C,UAAU,UAAW,SAAQ,SAAS,EAAE,cAAc;IACpD;;OAEG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAQD;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,4CAStC,CAAC"}
|
package/src/components/Light.tsx
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { requireNativeComponent } from "react-native";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
useAbstractLayer,
|
|
5
|
-
type BaseLayerProps,
|
|
6
|
-
} from "../hooks/useAbstractLayer";
|
|
7
|
-
import { type BaseProps } from "../types/BaseProps";
|
|
8
|
-
import { type LightLayerStyle } from "../types/MapLibreRNStyles";
|
|
9
|
-
import { type StyleValue } from "../utils/StyleValue";
|
|
10
|
-
|
|
11
|
-
export const NATIVE_MODULE_NAME = "MLRNLight";
|
|
12
|
-
|
|
13
|
-
interface LightProps extends BaseProps, BaseLayerProps {
|
|
14
|
-
/**
|
|
15
|
-
* Customizable style attributes
|
|
16
|
-
*/
|
|
17
|
-
style?: LightLayerStyle;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface NativeProps extends Omit<LightProps, "style"> {
|
|
21
|
-
reactStyle?: { [key: string]: StyleValue };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const MLRNLight = requireNativeComponent<NativeProps>(NATIVE_MODULE_NAME);
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Light represents the light source for extruded geometries
|
|
28
|
-
*/
|
|
29
|
-
export const Light = (props: LightProps) => {
|
|
30
|
-
const { baseProps, setNativeLayer } = useAbstractLayer<
|
|
31
|
-
LightProps,
|
|
32
|
-
NativeProps
|
|
33
|
-
>({
|
|
34
|
-
...props,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
return <MLRNLight ref={setNativeLayer} testID="mlrnLight" {...baseProps} />;
|
|
38
|
-
};
|