@rnmapbox/maps 10.1.37 → 10.1.38
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/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +7 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt +3 -3
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerDelegate.java +3 -0
- package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerInterface.java +1 -0
- package/ios/RNMBX/RNMBXLocationModule.swift +17 -3
- package/ios/RNMBX/RNMBXMapView.swift +152 -132
- package/ios/RNMBX/RNMBXMapViewComponentView.mm +9 -4
- package/ios/RNMBX/RNMBXMapViewManager.m +1 -0
- package/ios/RNMBX/RNMBXStyleImport.swift +19 -12
- package/ios/RNMBX/RNMBXStyleImportComponentView.mm +52 -12
- package/lib/commonjs/specs/RNMBXMapViewNativeComponent.js.map +1 -1
- package/lib/module/specs/RNMBXMapViewNativeComponent.js.map +1 -1
- package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts +1 -0
- package/lib/typescript/src/specs/RNMBXMapViewNativeComponent.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/specs/RNMBXMapViewNativeComponent.ts +1 -0
|
@@ -235,6 +235,7 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
235
235
|
private val mFeatures = mutableListOf<FeatureEntry>()
|
|
236
236
|
private var mQueuedFeatures: MutableList<AbstractMapFeature>? = ArrayList()
|
|
237
237
|
private val mCameraChangeTracker = CameraChangeTracker()
|
|
238
|
+
private var mPreferredFrameRate: Int? = null
|
|
238
239
|
private lateinit var mMap: MapboxMap
|
|
239
240
|
|
|
240
241
|
private lateinit var mMapView: MapView
|
|
@@ -651,6 +652,12 @@ open class RNMBXMapView(private val mContext: Context, var mManager: RNMBXMapVie
|
|
|
651
652
|
changes.add(Property.LOCALIZE_LABELS)
|
|
652
653
|
}
|
|
653
654
|
|
|
655
|
+
fun setReactPreferredFramesPerSecond(preferredFramesPerSecond: Int) {
|
|
656
|
+
if (this::mMapView.isInitialized) {
|
|
657
|
+
mMapView.setMaximumFps(preferredFramesPerSecond)
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
654
661
|
fun setReactStyleURL(styleURL: String) {
|
|
655
662
|
mStyleURL = styleURL
|
|
656
663
|
changes.add(Property.STYLE_URL)
|
|
@@ -210,9 +210,9 @@ open class RNMBXMapViewManager(context: ReactApplicationContext, val viewTagReso
|
|
|
210
210
|
mapView.setReactStyleURL(styleURL.asString())
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
@ReactProp(name = "preferredFramesPerSecond")
|
|
214
|
-
fun setPreferredFramesPerSecond(mapView: RNMBXMapView, preferredFramesPerSecond:
|
|
215
|
-
|
|
213
|
+
@ReactProp(name = "preferredFramesPerSecond")
|
|
214
|
+
override fun setPreferredFramesPerSecond(mapView: RNMBXMapView, preferredFramesPerSecond: Dynamic) {
|
|
215
|
+
mapView.setReactPreferredFramesPerSecond(preferredFramesPerSecond.asInt())
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
@ReactProp(name = "zoomEnabled")
|
package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerDelegate.java
CHANGED
|
@@ -103,6 +103,9 @@ public class RNMBXMapViewManagerDelegate<T extends View, U extends BaseViewManag
|
|
|
103
103
|
case "mapViewImpl":
|
|
104
104
|
mViewManager.setMapViewImpl(view, new DynamicFromObject(value));
|
|
105
105
|
break;
|
|
106
|
+
case "preferredFramesPerSecond":
|
|
107
|
+
mViewManager.setPreferredFramesPerSecond(view, new DynamicFromObject(value));
|
|
108
|
+
break;
|
|
106
109
|
default:
|
|
107
110
|
super.setProperty(view, propName, value);
|
|
108
111
|
}
|
package/android/src/main/old-arch/com/facebook/react/viewmanagers/RNMBXMapViewManagerInterface.java
CHANGED
|
@@ -40,4 +40,5 @@ public interface RNMBXMapViewManagerInterface<T extends View> {
|
|
|
40
40
|
void setAttributionViewPosition(T view, Dynamic value);
|
|
41
41
|
void setCompassImage(T view, Dynamic value);
|
|
42
42
|
void setMapViewImpl(T view, Dynamic value);
|
|
43
|
+
void setPreferredFramesPerSecond(T view, Dynamic value);
|
|
43
44
|
}
|
|
@@ -11,7 +11,7 @@ class RNMBXLocation: NSObject {
|
|
|
11
11
|
|
|
12
12
|
var timestamp: Date? = nil
|
|
13
13
|
|
|
14
|
-
func toJSON() ->
|
|
14
|
+
func toJSON() -> NSDictionary {
|
|
15
15
|
return [
|
|
16
16
|
"coords": [
|
|
17
17
|
"longitude": location.coordinate.longitude,
|
|
@@ -512,8 +512,22 @@ class RNMBXLocationModule: RCTEventEmitter, LocationProviderRNMBXDelegate {
|
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
-
@objc func getLastKnownLocation() ->
|
|
516
|
-
|
|
515
|
+
@objc func getLastKnownLocation() -> NSDictionary? {
|
|
516
|
+
let result = RNMBXLocation()
|
|
517
|
+
if let locationProvider = locationProvider as? LocationProviderRNMBX {
|
|
518
|
+
if let location = locationProvider.lastKnownLocation {
|
|
519
|
+
result.location = location
|
|
520
|
+
result.timestamp = location.timestamp
|
|
521
|
+
}
|
|
522
|
+
if let heading = locationProvider.lastKnownHeading {
|
|
523
|
+
result.heading = heading
|
|
524
|
+
if result.timestamp == nil ||
|
|
525
|
+
heading.timestamp.compare(result.timestamp!) == .orderedAscending {
|
|
526
|
+
result.timestamp = heading.timestamp
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
return result.toJSON()
|
|
517
531
|
}
|
|
518
532
|
|
|
519
533
|
@objc func setMinDisplacement(_ minDisplacement: CLLocationDistance) {
|
|
@@ -21,11 +21,11 @@ class InitWaiter<Type> {
|
|
|
21
21
|
waiters.append(callback)
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
func hasInited() -> Bool {
|
|
26
26
|
return object != nil
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
/// call whan the object has inited, queued calls will be executed
|
|
30
30
|
func onInit(_ object: Type) {
|
|
31
31
|
self.object = object
|
|
@@ -33,7 +33,7 @@ class InitWaiter<Type> {
|
|
|
33
33
|
waiters = []
|
|
34
34
|
oldWaiters.forEach { $0(object) }
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
/// reset, calls will be queued again
|
|
38
38
|
func reset() {
|
|
39
39
|
self.object = nil
|
|
@@ -46,14 +46,14 @@ class InitWaiter<Type> {
|
|
|
46
46
|
*/
|
|
47
47
|
public class RNMBXMapViewFactory {
|
|
48
48
|
private static var factories: [String: RNMBXMapViewFactoryFunc] = [:];
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
static func get(_ id: String) -> RNMBXMapViewFactoryFunc? {
|
|
51
51
|
if let id = id.split(separator: ":", maxSplits: 1).first {
|
|
52
52
|
return factories[String(id)]
|
|
53
53
|
}
|
|
54
54
|
return nil
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
|
|
57
57
|
public static func register(_ id: String, factory: @escaping RNMBXMapViewFactoryFunc) {
|
|
58
58
|
factories.updateValue(factory, forKey: id)
|
|
59
59
|
}
|
|
@@ -174,33 +174,33 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
174
174
|
var imageManager: ImageManager = ImageManager()
|
|
175
175
|
|
|
176
176
|
var tapDelegate: IgnoreRNMBXMakerViewGestureDelegate? = nil
|
|
177
|
-
|
|
177
|
+
|
|
178
178
|
var eventDispatcher: RCTEventDispatcherProtocol
|
|
179
|
-
|
|
179
|
+
|
|
180
180
|
var reactOnPress : RCTBubblingEventBlock?
|
|
181
181
|
var reactOnLongPress : RCTBubblingEventBlock?
|
|
182
182
|
var reactOnMapChange : RCTBubblingEventBlock?
|
|
183
|
-
|
|
183
|
+
|
|
184
184
|
@objc
|
|
185
185
|
var onCameraChanged: RCTDirectEventBlock?
|
|
186
|
-
|
|
186
|
+
|
|
187
187
|
var styleLoadWaiters = InitWaiter<MapboxMap>()
|
|
188
188
|
var cameraWaiters = InitWaiter<MapView>()
|
|
189
|
-
|
|
189
|
+
|
|
190
190
|
var features: [FeatureEntry] = []
|
|
191
|
-
|
|
191
|
+
|
|
192
192
|
weak var reactCamera : RNMBXCamera?
|
|
193
193
|
var images : [RNMBXImages] = []
|
|
194
194
|
var sources : [RNMBXInteractiveElement] = []
|
|
195
|
-
|
|
195
|
+
|
|
196
196
|
var handleMapChangedEvents = Set<RNMBXEvent.EventType>()
|
|
197
|
-
|
|
197
|
+
|
|
198
198
|
var eventListeners : [Cancelable] = []
|
|
199
|
-
|
|
199
|
+
|
|
200
200
|
private var isPendingInitialLayout = true
|
|
201
201
|
private var wasGestureActive = false
|
|
202
202
|
private var isGestureActive = false
|
|
203
|
-
|
|
203
|
+
|
|
204
204
|
var layerWaiters : [String:[(String) -> Void]] = [:]
|
|
205
205
|
|
|
206
206
|
@objc
|
|
@@ -208,21 +208,21 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
208
208
|
|
|
209
209
|
@objc
|
|
210
210
|
public var mapViewImpl : String? = nil
|
|
211
|
-
|
|
211
|
+
|
|
212
212
|
#if RNMBX_11
|
|
213
213
|
var cancelables = Set<AnyCancelable>()
|
|
214
214
|
#endif
|
|
215
|
-
|
|
215
|
+
|
|
216
216
|
lazy var pointAnnotationManager : RNMBXPointAnnotationManager = {
|
|
217
217
|
let result = RNMBXPointAnnotationManager(annotations: mapView.annotations, mapView: mapView)
|
|
218
218
|
self._removeMapboxLongPressGestureRecognizer()
|
|
219
219
|
return result
|
|
220
220
|
}()
|
|
221
|
-
|
|
221
|
+
|
|
222
222
|
lazy var calloutAnnotationManager : MapboxMaps.PointAnnotationManager = {
|
|
223
223
|
return mapView.annotations.makePointAnnotationManager(id: "RNMBX-mapview-callouts")
|
|
224
224
|
}()
|
|
225
|
-
|
|
225
|
+
|
|
226
226
|
var _mapView: MapView! = nil
|
|
227
227
|
func createMapView() -> MapView {
|
|
228
228
|
if let mapViewImpl = mapViewImpl, let mapViewInstance = createAndAddMapViewImpl(mapViewImpl, self) {
|
|
@@ -241,7 +241,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
241
241
|
_mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
242
242
|
addSubview(_mapView)
|
|
243
243
|
}
|
|
244
|
-
|
|
244
|
+
|
|
245
245
|
_mapView.gestures.delegate = self
|
|
246
246
|
setupEvents()
|
|
247
247
|
afterMapViewAdded()
|
|
@@ -261,7 +261,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
261
261
|
public var mapView : MapView! {
|
|
262
262
|
get { return _mapView }
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
|
|
265
265
|
@available(*, deprecated, renamed: "withMapboxMap", message: "mapboxMap can be nil if the map initialization has not finished, use withMapboxMap instead")
|
|
266
266
|
var mapboxMap: MapboxMap! {
|
|
267
267
|
get { _mapView?.mapboxMap }
|
|
@@ -279,7 +279,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
279
279
|
} else {
|
|
280
280
|
addToMap = true
|
|
281
281
|
}
|
|
282
|
-
|
|
282
|
+
|
|
283
283
|
let entry = FeatureEntry(feature: mapComponent, view: subview, addedToMap: false)
|
|
284
284
|
if (addToMap) {
|
|
285
285
|
mapComponent.addToMap(self, style: style)
|
|
@@ -294,7 +294,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
|
|
297
|
+
|
|
298
298
|
@objc public func removeFromMap(_ subview: UIView) {
|
|
299
299
|
if let mapComponent = subview as? RNMBXMapComponent {
|
|
300
300
|
var entryIndex = features.firstIndex { $0.view == subview }
|
|
@@ -318,7 +318,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
318
318
|
addToMap(subview)
|
|
319
319
|
super.insertReactSubview(subview, at: atIndex)
|
|
320
320
|
}
|
|
321
|
-
|
|
321
|
+
|
|
322
322
|
@objc open override func removeReactSubview(_ subview: UIView!) {
|
|
323
323
|
removeFromMap(subview)
|
|
324
324
|
super.removeReactSubview(subview)
|
|
@@ -328,15 +328,15 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
328
328
|
self.eventDispatcher = eventDispatcher
|
|
329
329
|
super.init(frame: frame)
|
|
330
330
|
}
|
|
331
|
-
|
|
331
|
+
|
|
332
332
|
public required init (coder: NSCoder) {
|
|
333
333
|
fatalError("not implemented")
|
|
334
334
|
}
|
|
335
|
-
|
|
335
|
+
|
|
336
336
|
func layerAdded (_ layer: Layer) {
|
|
337
337
|
// TODO
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
|
|
340
340
|
func waitForLayerWithID(_ layerId: String, _ callback: @escaping (_ layerId: String) -> Void) {
|
|
341
341
|
let style = mapView.mapboxMap.style;
|
|
342
342
|
if style.layerExists(withId: layerId) {
|
|
@@ -345,23 +345,23 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
345
345
|
layerWaiters[layerId, default: []].append(callback)
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
|
|
348
|
+
|
|
349
349
|
@objc public override func layoutSubviews() {
|
|
350
350
|
super.layoutSubviews()
|
|
351
351
|
if let camera = reactCamera {
|
|
352
352
|
if (isPendingInitialLayout) {
|
|
353
353
|
isPendingInitialLayout = false;
|
|
354
|
-
|
|
354
|
+
|
|
355
355
|
camera.initialLayout()
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
|
|
360
|
+
|
|
361
361
|
// MARK: - React Native properties
|
|
362
362
|
let changes : PropertyChanges<RNMBXMapView> = PropertyChanges()
|
|
363
363
|
var mapViewWaiters = InitWaiter<MapView>()
|
|
364
|
-
|
|
364
|
+
|
|
365
365
|
enum Property : String {
|
|
366
366
|
case projection
|
|
367
367
|
case localizeLabels
|
|
@@ -378,7 +378,8 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
378
378
|
case onMapChange
|
|
379
379
|
case styleURL
|
|
380
380
|
case gestureSettings
|
|
381
|
-
|
|
381
|
+
case preferredFramesPerSecond
|
|
382
|
+
|
|
382
383
|
func apply(_ map: RNMBXMapView) -> Void {
|
|
383
384
|
switch self {
|
|
384
385
|
case .projection:
|
|
@@ -412,18 +413,20 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
412
413
|
map.applyPitchEnabled()
|
|
413
414
|
case .gestureSettings:
|
|
414
415
|
map.applyGestureSettings()
|
|
416
|
+
case .preferredFramesPerSecond:
|
|
417
|
+
map.applyPreferredFramesPerSecond()
|
|
415
418
|
}
|
|
416
419
|
}
|
|
417
420
|
}
|
|
418
|
-
|
|
421
|
+
|
|
419
422
|
func changed(_ property: Property) {
|
|
420
423
|
changes.add(name: property.rawValue, update: property.apply)
|
|
421
424
|
}
|
|
422
|
-
|
|
425
|
+
|
|
423
426
|
func withMapView(callback: @escaping (_: MapView) -> Void) {
|
|
424
427
|
mapViewWaiters.callOrWait(callback)
|
|
425
428
|
}
|
|
426
|
-
|
|
429
|
+
|
|
427
430
|
func withMapboxMap(callback: @escaping (_: MapboxMap) -> Void) {
|
|
428
431
|
if let mapboxMap = _mapView?.mapboxMap {
|
|
429
432
|
callback(mapboxMap)
|
|
@@ -433,9 +436,9 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
433
436
|
}
|
|
434
437
|
}
|
|
435
438
|
}
|
|
436
|
-
|
|
439
|
+
|
|
437
440
|
var projection: StyleProjection?
|
|
438
|
-
|
|
441
|
+
|
|
439
442
|
@objc public func setReactProjection(_ value: String?) {
|
|
440
443
|
if let value = value {
|
|
441
444
|
projection = StyleProjection(name: value == "globe" ? .globe : .mercator)
|
|
@@ -444,7 +447,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
444
447
|
}
|
|
445
448
|
changed(.projection)
|
|
446
449
|
}
|
|
447
|
-
|
|
450
|
+
|
|
448
451
|
func applyProjection() {
|
|
449
452
|
logged("RNMBXMapView.setReactProjection") {
|
|
450
453
|
if let projection = projection {
|
|
@@ -452,9 +455,26 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
452
455
|
}
|
|
453
456
|
}
|
|
454
457
|
}
|
|
455
|
-
|
|
458
|
+
|
|
459
|
+
var preferredFramesPerSecond: Int? = nil
|
|
460
|
+
|
|
461
|
+
@objc public func setReactPreferredFramesPerSecond(_ value: Int) {
|
|
462
|
+
self.preferredFramesPerSecond = value
|
|
463
|
+
changed(.preferredFramesPerSecond)
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
func applyPreferredFramesPerSecond() {
|
|
467
|
+
if let value = preferredFramesPerSecond {
|
|
468
|
+
if #available(iOS 15.0, *) {
|
|
469
|
+
self.mapView.preferredFrameRateRange = CAFrameRateRange(minimum: 1, maximum: Float(value))
|
|
470
|
+
} else {
|
|
471
|
+
self.mapView.preferredFramesPerSecond = value
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
456
476
|
var locale: (layerIds: [String]?, locale: Locale)? = nil
|
|
457
|
-
|
|
477
|
+
|
|
458
478
|
@objc public func setReactLocalizeLabels(_ value: NSDictionary?) {
|
|
459
479
|
if let value = value {
|
|
460
480
|
let localeString = value["locale"] as! String
|
|
@@ -464,7 +484,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
464
484
|
}
|
|
465
485
|
changed(.localizeLabels)
|
|
466
486
|
}
|
|
467
|
-
|
|
487
|
+
|
|
468
488
|
func applyLocalizeLabels() {
|
|
469
489
|
onMapStyleLoaded { _ in
|
|
470
490
|
logged("RNMBXMapView.\(#function)") {
|
|
@@ -474,7 +494,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
474
494
|
}
|
|
475
495
|
}
|
|
476
496
|
}
|
|
477
|
-
|
|
497
|
+
|
|
478
498
|
struct GestureSettings {
|
|
479
499
|
var doubleTapToZoomInEnabled: Bool? = nil;
|
|
480
500
|
var doubleTouchToZoomOutEnabled: Bool? = nil;
|
|
@@ -489,9 +509,9 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
489
509
|
var simultaneousRotateAndPinchZoomEnabled: Bool? = nil;
|
|
490
510
|
#endif
|
|
491
511
|
}
|
|
492
|
-
|
|
512
|
+
|
|
493
513
|
var gestureSettings = GestureSettings()
|
|
494
|
-
|
|
514
|
+
|
|
495
515
|
@objc
|
|
496
516
|
public func setReactGestureSettings(_ value: NSDictionary?) {
|
|
497
517
|
if let value = value {
|
|
@@ -542,11 +562,11 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
542
562
|
options.zoomAnimationAmount = zoomAnimationAmount.CGFloat
|
|
543
563
|
}*/
|
|
544
564
|
gestureSettings = options
|
|
545
|
-
|
|
565
|
+
|
|
546
566
|
changed(.gestureSettings)
|
|
547
567
|
}
|
|
548
568
|
}
|
|
549
|
-
|
|
569
|
+
|
|
550
570
|
func applyGestureSettings() {
|
|
551
571
|
if let gestures = self.mapView?.gestures {
|
|
552
572
|
var options = gestures.options
|
|
@@ -596,15 +616,15 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
596
616
|
}
|
|
597
617
|
}
|
|
598
618
|
}
|
|
599
|
-
|
|
619
|
+
|
|
600
620
|
var attributionEnabled: OrnamentVisibility? = nil
|
|
601
621
|
var attributionOptions: (position: OrnamentPosition, margins: CGPoint)? = nil
|
|
602
|
-
|
|
622
|
+
|
|
603
623
|
@objc public func setReactAttributionEnabled(_ value: Bool) {
|
|
604
624
|
attributionEnabled = value ? .visible : .hidden
|
|
605
625
|
changed(.attribution)
|
|
606
626
|
}
|
|
607
|
-
|
|
627
|
+
|
|
608
628
|
func applyAttribution() {
|
|
609
629
|
if let visibility = attributionEnabled {
|
|
610
630
|
mapView.ornaments.options.attributionButton.visibility = visibility
|
|
@@ -614,25 +634,25 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
614
634
|
mapView.ornaments.options.attributionButton.margins = options.margins
|
|
615
635
|
}
|
|
616
636
|
}
|
|
617
|
-
|
|
637
|
+
|
|
618
638
|
@objc public func setReactAttributionPosition(_ position: [String: NSNumber]) {
|
|
619
639
|
attributionOptions = self.getOrnamentOptionsFromPosition(position)
|
|
620
640
|
changed(.attribution)
|
|
621
641
|
}
|
|
622
|
-
|
|
642
|
+
|
|
623
643
|
var logoEnabled: OrnamentVisibility? = nil
|
|
624
644
|
var logoOptions: (position: OrnamentPosition, margins: CGPoint)? = nil
|
|
625
|
-
|
|
645
|
+
|
|
626
646
|
@objc public func setReactLogoEnabled(_ value: Bool) {
|
|
627
647
|
logoEnabled = value ? .visible : .hidden
|
|
628
648
|
changed(.logo)
|
|
629
649
|
}
|
|
630
|
-
|
|
650
|
+
|
|
631
651
|
@objc public func setReactLogoPosition(_ position: [String: NSNumber]) {
|
|
632
652
|
logoOptions = self.getOrnamentOptionsFromPosition(position)
|
|
633
653
|
changed(.logo)
|
|
634
654
|
}
|
|
635
|
-
|
|
655
|
+
|
|
636
656
|
func applyLogo() {
|
|
637
657
|
if let visibility = logoEnabled {
|
|
638
658
|
mapView.ornaments.options.logo.visibility = visibility
|
|
@@ -642,7 +662,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
642
662
|
mapView.ornaments.options.logo.margins = options.margins
|
|
643
663
|
}
|
|
644
664
|
}
|
|
645
|
-
|
|
665
|
+
|
|
646
666
|
var compassEnabled: Bool = false
|
|
647
667
|
var compassPosition: OrnamentPosition? = nil
|
|
648
668
|
var compassMargins: CGPoint? = nil
|
|
@@ -658,7 +678,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
658
678
|
compassFadeWhenNorth = value
|
|
659
679
|
changed(.compass)
|
|
660
680
|
}
|
|
661
|
-
|
|
681
|
+
|
|
662
682
|
@objc public func setReactCompassPosition(_ position: [String: NSNumber]) {
|
|
663
683
|
if let compassOptions = self.getOrnamentOptionsFromPosition(position) {
|
|
664
684
|
compassPosition = compassOptions.position
|
|
@@ -671,7 +691,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
671
691
|
compassPosition = toOrnamentPositon(Int(truncating: NSNumber(value: position)))
|
|
672
692
|
changed(.compass)
|
|
673
693
|
}
|
|
674
|
-
|
|
694
|
+
|
|
675
695
|
@objc public func setReactCompassViewMargins(_ margins: CGPoint) {
|
|
676
696
|
compassMargins = margins
|
|
677
697
|
changed(.compass)
|
|
@@ -681,21 +701,21 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
681
701
|
compassImage = image.isEmpty ? nil : image
|
|
682
702
|
changed(.compass)
|
|
683
703
|
}
|
|
684
|
-
|
|
704
|
+
|
|
685
705
|
func applyCompass() {
|
|
686
706
|
var visibility: OrnamentVisibility = .hidden
|
|
687
707
|
if compassEnabled {
|
|
688
708
|
visibility = compassFadeWhenNorth ? .adaptive : .visible
|
|
689
709
|
}
|
|
690
710
|
mapView.ornaments.options.compass.visibility = visibility
|
|
691
|
-
|
|
711
|
+
|
|
692
712
|
if let position = compassPosition {
|
|
693
713
|
mapView.ornaments.options.compass.position = position
|
|
694
714
|
}
|
|
695
715
|
if let margina = compassMargins {
|
|
696
716
|
mapView.ornaments.options.compass.margins = margina
|
|
697
717
|
}
|
|
698
|
-
|
|
718
|
+
|
|
699
719
|
if let compassImage = compassImage {
|
|
700
720
|
onMapStyleLoaded { map in
|
|
701
721
|
let img = map.style.image(withId: compassImage)
|
|
@@ -707,7 +727,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
707
727
|
self.mapView.ornaments.options.compass.image = nil
|
|
708
728
|
}
|
|
709
729
|
}
|
|
710
|
-
|
|
730
|
+
|
|
711
731
|
func toOrnamentPositon(_ position: Int) -> OrnamentPosition {
|
|
712
732
|
enum MapboxGLPosition : Int {
|
|
713
733
|
case topLeft = 0
|
|
@@ -715,7 +735,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
715
735
|
case bottomLeft = 2
|
|
716
736
|
case bottomRight = 3
|
|
717
737
|
};
|
|
718
|
-
|
|
738
|
+
|
|
719
739
|
let glPosition = MapboxGLPosition(rawValue: position)
|
|
720
740
|
switch glPosition {
|
|
721
741
|
case .topLeft:
|
|
@@ -734,19 +754,19 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
734
754
|
var scaleBarEnabled: Bool? = nil
|
|
735
755
|
var scaleBarPosition: OrnamentPosition? = nil
|
|
736
756
|
var scaleBarMargins: CGPoint? = nil
|
|
737
|
-
|
|
757
|
+
|
|
738
758
|
@objc public func setReactScaleBarEnabled(_ value: Bool) {
|
|
739
759
|
scaleBarEnabled = value
|
|
740
760
|
changed(.scaleBar)
|
|
741
761
|
}
|
|
742
|
-
|
|
762
|
+
|
|
743
763
|
@objc public func setReactScaleBarPosition(_ position: [String: NSNumber]) {
|
|
744
764
|
if let ornamentOptions = self.getOrnamentOptionsFromPosition(position) {
|
|
745
765
|
scaleBarPosition = ornamentOptions.position
|
|
746
766
|
scaleBarMargins = ornamentOptions.margins
|
|
747
767
|
}
|
|
748
768
|
}
|
|
749
|
-
|
|
769
|
+
|
|
750
770
|
func applyScaleBar() {
|
|
751
771
|
if let enabled = scaleBarEnabled {
|
|
752
772
|
mapView.ornaments.options.scaleBar.visibility = enabled ? .visible : .hidden
|
|
@@ -762,7 +782,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
762
782
|
@objc override public func didSetProps(_ props: [String]) {
|
|
763
783
|
if (_mapView == nil) {
|
|
764
784
|
let view = createMapView()
|
|
765
|
-
|
|
785
|
+
|
|
766
786
|
mapViewWaiters.onInit(view)
|
|
767
787
|
}
|
|
768
788
|
changes.apply(self)
|
|
@@ -787,7 +807,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
787
807
|
self.scrollEnabled = value
|
|
788
808
|
changed(.scrollEnabled)
|
|
789
809
|
}
|
|
790
|
-
|
|
810
|
+
|
|
791
811
|
func applyScrollEnabled() {
|
|
792
812
|
if let value = scrollEnabled {
|
|
793
813
|
self.mapView.gestures.options.panEnabled = value
|
|
@@ -800,14 +820,14 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
800
820
|
rotateEnabled = value
|
|
801
821
|
changed(.rotateEnabled)
|
|
802
822
|
}
|
|
803
|
-
|
|
823
|
+
|
|
804
824
|
func applyRotateEnabled() {
|
|
805
825
|
if let value = rotateEnabled {
|
|
806
826
|
self.mapView.gestures.options.rotateEnabled = value
|
|
807
827
|
}
|
|
808
828
|
}
|
|
809
829
|
|
|
810
|
-
|
|
830
|
+
|
|
811
831
|
var pitchEnabled: Bool? = nil
|
|
812
832
|
@objc public func setReactPitchEnabled(_ value: Bool) {
|
|
813
833
|
self.pitchEnabled = value
|
|
@@ -836,21 +856,21 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
836
856
|
}
|
|
837
857
|
}
|
|
838
858
|
}
|
|
839
|
-
|
|
859
|
+
|
|
840
860
|
func refreshComponentsBeforeStyleChange() {
|
|
841
861
|
removeAllFeaturesFromMap(reason: .StyleChange)
|
|
842
862
|
}
|
|
843
|
-
|
|
863
|
+
|
|
844
864
|
func refreshComponentsAfterStyleChange(style: Style) {
|
|
845
865
|
addFeaturesToMap(style: style)
|
|
846
866
|
}
|
|
847
|
-
|
|
867
|
+
|
|
848
868
|
var reactStyleURL: String? = nil
|
|
849
869
|
@objc public func setReactStyleURL(_ value: String?) {
|
|
850
870
|
self.reactStyleURL = value
|
|
851
871
|
changed(.styleURL)
|
|
852
872
|
}
|
|
853
|
-
|
|
873
|
+
|
|
854
874
|
public func applyStyleURL() {
|
|
855
875
|
var initialLoad = !self.styleLoadWaiters.hasInited()
|
|
856
876
|
if !initialLoad { refreshComponentsBeforeStyleChange() }
|
|
@@ -884,7 +904,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
884
904
|
let right = position["right"]
|
|
885
905
|
let top = position["top"]
|
|
886
906
|
let bottom = position["bottom"]
|
|
887
|
-
|
|
907
|
+
|
|
888
908
|
if let left = left, let top = top {
|
|
889
909
|
return (OrnamentPosition.topLeading, CGPoint(x: Int(truncating: left), y: Int(truncating: top)))
|
|
890
910
|
} else if let right = right, let top = top {
|
|
@@ -894,7 +914,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
894
914
|
} else if let bottom = bottom, let left = left {
|
|
895
915
|
return (OrnamentPosition.bottomLeading, CGPoint(x: Int(truncating: left), y: Int(truncating: bottom)))
|
|
896
916
|
}
|
|
897
|
-
|
|
917
|
+
|
|
898
918
|
return nil
|
|
899
919
|
}
|
|
900
920
|
|
|
@@ -905,7 +925,7 @@ open class RNMBXMapView: UIView, RCTInvalidating {
|
|
|
905
925
|
}
|
|
906
926
|
}
|
|
907
927
|
}
|
|
908
|
-
|
|
928
|
+
|
|
909
929
|
// MARK: - hooks for subclasses
|
|
910
930
|
open func afterMapViewAdded() {}
|
|
911
931
|
}
|
|
@@ -922,7 +942,7 @@ extension RNMBXMapView {
|
|
|
922
942
|
handler(self, mapEvent)
|
|
923
943
|
}.store(in: &cancelables)
|
|
924
944
|
}
|
|
925
|
-
|
|
945
|
+
|
|
926
946
|
private func onNext<T>(event: MapEventType<T>, handler: @escaping (RNMBXMapView, T) -> Void) {
|
|
927
947
|
let signal = event.method(self.mapView.mapboxMap)
|
|
928
948
|
signal.observeNext { [weak self] (mapEvent) in
|
|
@@ -978,7 +998,7 @@ extension RNMBXMapView {
|
|
|
978
998
|
let event = RNMBXEvent(type:.mapIdle, payload: self.buildStateObject());
|
|
979
999
|
self.fireEvent(event: event, callback: self.reactOnMapChange)
|
|
980
1000
|
}
|
|
981
|
-
|
|
1001
|
+
|
|
982
1002
|
self.wasGestureActive = false
|
|
983
1003
|
})
|
|
984
1004
|
}
|
|
@@ -994,11 +1014,11 @@ extension RNMBXMapView {
|
|
|
994
1014
|
private func fireEvent(event: RNMBXEvent, callback: @escaping RCTBubblingEventBlock) {
|
|
995
1015
|
callback(event.toJSON())
|
|
996
1016
|
}
|
|
997
|
-
|
|
1017
|
+
|
|
998
1018
|
private func buildStateObject() -> [String: Any] {
|
|
999
1019
|
let cameraOptions = CameraOptions(cameraState: mapView.cameraState)
|
|
1000
1020
|
let bounds = mapView.mapboxMap.coordinateBounds(for: cameraOptions)
|
|
1001
|
-
|
|
1021
|
+
|
|
1002
1022
|
return [
|
|
1003
1023
|
"properties": [
|
|
1004
1024
|
"center": Point(mapView.cameraState.center).coordinates.toArray(),
|
|
@@ -1016,7 +1036,7 @@ extension RNMBXMapView {
|
|
|
1016
1036
|
"timestamp": timestamp()
|
|
1017
1037
|
]
|
|
1018
1038
|
}
|
|
1019
|
-
|
|
1039
|
+
|
|
1020
1040
|
private func timestamp(date: Date? = nil) -> Double {
|
|
1021
1041
|
return (date ?? Date()).timeIntervalSince1970 * 1000
|
|
1022
1042
|
}
|
|
@@ -1044,7 +1064,7 @@ extension RNMBXMapView {
|
|
|
1044
1064
|
try result.toJSON()
|
|
1045
1065
|
}
|
|
1046
1066
|
}
|
|
1047
|
-
|
|
1067
|
+
|
|
1048
1068
|
public func setupEvents() {
|
|
1049
1069
|
self.onEvery(event: .mapLoadingError, handler: { (self, event) in
|
|
1050
1070
|
let eventPayload : MapLoadingErrorPayload = event.payload
|
|
@@ -1071,10 +1091,10 @@ extension RNMBXMapView {
|
|
|
1071
1091
|
Logger.log(level: .error, message: "MapLoad error \(event)")
|
|
1072
1092
|
}
|
|
1073
1093
|
})
|
|
1074
|
-
|
|
1094
|
+
|
|
1075
1095
|
self.onEvery(event: .styleImageMissing) { (self, event) in
|
|
1076
1096
|
let imageName = event.payload.id
|
|
1077
|
-
|
|
1097
|
+
|
|
1078
1098
|
self.images.forEach {
|
|
1079
1099
|
if $0.addMissingImageToStyle(style: self.mapboxMap.style, imageName: imageName) {
|
|
1080
1100
|
return
|
|
@@ -1104,10 +1124,10 @@ extension RNMBXMapView {
|
|
|
1104
1124
|
let event = RNMBXEvent(type:.didFinishLoadingMap, payload: nil);
|
|
1105
1125
|
self.fireEvent(event: event, callback: self.reactOnMapChange)
|
|
1106
1126
|
})
|
|
1107
|
-
|
|
1127
|
+
|
|
1108
1128
|
self.onEvery(event: .styleLoaded, handler: { (self, event) in
|
|
1109
1129
|
self.addFeaturesToMap(style: self.mapboxMap.style)
|
|
1110
|
-
|
|
1130
|
+
|
|
1111
1131
|
if !self.styleLoadWaiters.hasInited(), let mapboxMap = self.mapboxMap {
|
|
1112
1132
|
self.styleLoadWaiters.onInit(mapboxMap)
|
|
1113
1133
|
}
|
|
@@ -1126,7 +1146,7 @@ class IgnoreRNMBXMakerViewGestureDelegate : NSObject, UIGestureRecognizerDelegat
|
|
|
1126
1146
|
init(originalDelegate: UIGestureRecognizerDelegate?) {
|
|
1127
1147
|
self.originalDelegate = originalDelegate
|
|
1128
1148
|
}
|
|
1129
|
-
|
|
1149
|
+
|
|
1130
1150
|
func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
|
|
1131
1151
|
return originalDelegate?.gestureRecognizerShouldBegin?(gestureRecognizer) ?? true
|
|
1132
1152
|
}
|
|
@@ -1134,7 +1154,7 @@ class IgnoreRNMBXMakerViewGestureDelegate : NSObject, UIGestureRecognizerDelegat
|
|
|
1134
1154
|
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
|
1135
1155
|
return originalDelegate?.gestureRecognizer?(gestureRecognizer,shouldRecognizeSimultaneouslyWith: otherGestureRecognizer) ?? false
|
|
1136
1156
|
}
|
|
1137
|
-
|
|
1157
|
+
|
|
1138
1158
|
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
|
1139
1159
|
return originalDelegate?.gestureRecognizer?(gestureRecognizer,shouldRequireFailureOf: otherGestureRecognizer) ?? false
|
|
1140
1160
|
}
|
|
@@ -1153,19 +1173,19 @@ class IgnoreRNMBXMakerViewGestureDelegate : NSObject, UIGestureRecognizerDelegat
|
|
|
1153
1173
|
}
|
|
1154
1174
|
return false
|
|
1155
1175
|
}
|
|
1156
|
-
|
|
1176
|
+
|
|
1157
1177
|
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
|
|
1158
1178
|
if let view = touch.view, isMarkerViewSubview(view) {
|
|
1159
1179
|
return false
|
|
1160
1180
|
}
|
|
1161
1181
|
return originalDelegate?.gestureRecognizer?(gestureRecognizer,shouldReceive: touch) ?? true
|
|
1162
1182
|
}
|
|
1163
|
-
|
|
1183
|
+
|
|
1164
1184
|
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive press: UIPress) -> Bool {
|
|
1165
1185
|
return originalDelegate?.gestureRecognizer?(gestureRecognizer,shouldReceive: press) ?? true
|
|
1166
1186
|
}
|
|
1167
1187
|
|
|
1168
|
-
|
|
1188
|
+
|
|
1169
1189
|
@available(iOS 13.4, *)
|
|
1170
1190
|
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive event: UIEvent) -> Bool {
|
|
1171
1191
|
return originalDelegate?.gestureRecognizer?(gestureRecognizer,shouldReceive: event) ?? true
|
|
@@ -1173,12 +1193,12 @@ class IgnoreRNMBXMakerViewGestureDelegate : NSObject, UIGestureRecognizerDelegat
|
|
|
1173
1193
|
}
|
|
1174
1194
|
|
|
1175
1195
|
extension RNMBXMapView {
|
|
1176
|
-
|
|
1196
|
+
|
|
1177
1197
|
@objc public func setReactOnPress(_ value: @escaping RCTBubblingEventBlock) {
|
|
1178
1198
|
self.reactOnPress = value
|
|
1179
1199
|
changed(.onPress)
|
|
1180
1200
|
}
|
|
1181
|
-
|
|
1201
|
+
|
|
1182
1202
|
func applyOnPress() {
|
|
1183
1203
|
let singleTapGestureRecognizer = self.mapView.gestures.singleTapGestureRecognizer
|
|
1184
1204
|
|
|
@@ -1193,7 +1213,7 @@ extension RNMBXMapView {
|
|
|
1193
1213
|
self.reactOnLongPress = value
|
|
1194
1214
|
changed(.onLongPress)
|
|
1195
1215
|
}
|
|
1196
|
-
|
|
1216
|
+
|
|
1197
1217
|
func applyOnLongPress() {
|
|
1198
1218
|
if (reactOnLongPress != nil) {
|
|
1199
1219
|
let longPressGestureRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(doHandleLongPress(_:)))
|
|
@@ -1224,13 +1244,13 @@ extension RNMBXMapView: GestureManagerDelegate {
|
|
|
1224
1244
|
DispatchQueue.main.async {
|
|
1225
1245
|
if let source = sources.first {
|
|
1226
1246
|
let hitbox = source.hitbox;
|
|
1227
|
-
|
|
1247
|
+
|
|
1228
1248
|
let halfWidth = (hitbox["width"]?.doubleValue ?? RNMBXInteractiveElement.hitboxDefault) / 2.0;
|
|
1229
1249
|
let halfHeight = (hitbox["height"]?.doubleValue ?? RNMBXInteractiveElement.hitboxDefault) / 2.0;
|
|
1230
1250
|
|
|
1231
1251
|
let top = tapPoint.y - halfHeight;
|
|
1232
1252
|
let left = tapPoint.x - halfWidth;
|
|
1233
|
-
|
|
1253
|
+
|
|
1234
1254
|
let hitboxRect = CGRect(x: left, y: top, width: halfWidth * 2.0, height: halfHeight * 2.0)
|
|
1235
1255
|
|
|
1236
1256
|
let options = RenderedQueryOptions(
|
|
@@ -1238,7 +1258,7 @@ extension RNMBXMapView: GestureManagerDelegate {
|
|
|
1238
1258
|
)
|
|
1239
1259
|
self.mapboxMap.queryRenderedFeatures(with: hitboxRect, options: options) {
|
|
1240
1260
|
result in
|
|
1241
|
-
|
|
1261
|
+
|
|
1242
1262
|
var newHits = hits
|
|
1243
1263
|
var newTouchedSources = touchedSources;
|
|
1244
1264
|
switch result {
|
|
@@ -1260,10 +1280,10 @@ extension RNMBXMapView: GestureManagerDelegate {
|
|
|
1260
1280
|
}
|
|
1261
1281
|
}
|
|
1262
1282
|
}
|
|
1263
|
-
|
|
1283
|
+
|
|
1264
1284
|
func highestZIndex(sources: [RNMBXInteractiveElement]) -> RNMBXInteractiveElement? {
|
|
1265
1285
|
var layersToSource : [String:RNMBXInteractiveElement] = [:]
|
|
1266
|
-
|
|
1286
|
+
|
|
1267
1287
|
sources.forEach { source in
|
|
1268
1288
|
source.getLayerIDs().forEach { layerId in
|
|
1269
1289
|
if layersToSource[layerId] == nil {
|
|
@@ -1274,9 +1294,9 @@ extension RNMBXMapView: GestureManagerDelegate {
|
|
|
1274
1294
|
let orderedLayers = mapboxMap.style.allLayerIdentifiers
|
|
1275
1295
|
return orderedLayers.lazy.reversed().compactMap { layersToSource[$0.id] }.first ?? sources.first
|
|
1276
1296
|
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
|
|
1280
1300
|
func _tapEvent(_ tapPoint: CGPoint) -> RNMBXEvent {
|
|
1281
1301
|
let location = self.mapboxMap.coordinate(for: tapPoint)
|
|
1282
1302
|
var geojson = Feature(geometry: .point(Point(location)));
|
|
@@ -1287,7 +1307,7 @@ extension RNMBXMapView: GestureManagerDelegate {
|
|
|
1287
1307
|
let event = RNMBXEvent(type:.tap, payload: logged("reactOnPress") { try geojson.toJSON() })
|
|
1288
1308
|
return event
|
|
1289
1309
|
}
|
|
1290
|
-
|
|
1310
|
+
|
|
1291
1311
|
@objc
|
|
1292
1312
|
func doHandleTap(_ sender: UITapGestureRecognizer) {
|
|
1293
1313
|
let tapPoint = sender.location(in: self)
|
|
@@ -1300,7 +1320,7 @@ extension RNMBXMapView: GestureManagerDelegate {
|
|
|
1300
1320
|
}
|
|
1301
1321
|
let touchableSources = self.touchableSources()
|
|
1302
1322
|
self.doHandleTapInSources(sources: touchableSources, tapPoint: tapPoint, hits: [:], touchedSources: []) { (hits, touchedSources) in
|
|
1303
|
-
|
|
1323
|
+
|
|
1304
1324
|
if let source = self.highestZIndex(sources: touchedSources),
|
|
1305
1325
|
source.hasPressListener,
|
|
1306
1326
|
let onPress = source.onPress {
|
|
@@ -1326,7 +1346,7 @@ extension RNMBXMapView: GestureManagerDelegate {
|
|
|
1326
1346
|
]
|
|
1327
1347
|
)
|
|
1328
1348
|
self.fireEvent(event: event, callback: onPress)
|
|
1329
|
-
|
|
1349
|
+
|
|
1330
1350
|
} else {
|
|
1331
1351
|
if let reactOnPress = self.reactOnPress {
|
|
1332
1352
|
self.fireEvent(event: self._tapEvent(tapPoint), callback: reactOnPress)
|
|
@@ -1336,7 +1356,7 @@ extension RNMBXMapView: GestureManagerDelegate {
|
|
|
1336
1356
|
}
|
|
1337
1357
|
}
|
|
1338
1358
|
}
|
|
1339
|
-
|
|
1359
|
+
|
|
1340
1360
|
@objc
|
|
1341
1361
|
func doHandleLongPress(_ sender: UILongPressGestureRecognizer) {
|
|
1342
1362
|
let position = sender.location(in: self)
|
|
@@ -1389,13 +1409,13 @@ extension RNMBXMapView: GestureManagerDelegate {
|
|
|
1389
1409
|
public func gestureManager(_ gestureManager: GestureManager, didBegin gestureType: GestureType) {
|
|
1390
1410
|
isGestureActive = true
|
|
1391
1411
|
}
|
|
1392
|
-
|
|
1412
|
+
|
|
1393
1413
|
public func gestureManager(_ gestureManager: GestureManager, didEnd gestureType: GestureType, willAnimate: Bool) {
|
|
1394
1414
|
if !willAnimate {
|
|
1395
1415
|
isGestureActive = false;
|
|
1396
1416
|
}
|
|
1397
1417
|
}
|
|
1398
|
-
|
|
1418
|
+
|
|
1399
1419
|
public func gestureManager(_ gestureManager: GestureManager, didEndAnimatingFor gestureType: GestureType) {
|
|
1400
1420
|
isGestureActive = false;
|
|
1401
1421
|
}
|
|
@@ -1427,7 +1447,7 @@ extension RNMBXMapView {
|
|
|
1427
1447
|
guard let mapboxMap = mapboxMap else {
|
|
1428
1448
|
fatalError("mapboxMap is null")
|
|
1429
1449
|
}
|
|
1430
|
-
|
|
1450
|
+
|
|
1431
1451
|
styleLoadWaiters.callOrWait(block)
|
|
1432
1452
|
}
|
|
1433
1453
|
}
|
|
@@ -1461,7 +1481,7 @@ func getLayerSourceDetails(layer: (any Layer)?) -> LayerSourceDetails? {
|
|
|
1461
1481
|
extension RNMBXMapView {
|
|
1462
1482
|
func setSourceVisibility(_ visible: Bool, sourceId: String, sourceLayerId: String?) -> Void {
|
|
1463
1483
|
let style = self.mapboxMap.style
|
|
1464
|
-
|
|
1484
|
+
|
|
1465
1485
|
style.allLayerIdentifiers.forEach { layerInfo in
|
|
1466
1486
|
let layer = logged("setSourceVisibility.layer", info: { "\(layerInfo.id)" }) {
|
|
1467
1487
|
try style.layer(withId: layerInfo.id)
|
|
@@ -1497,12 +1517,12 @@ extension RNMBXMapView {
|
|
|
1497
1517
|
class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
1498
1518
|
weak var selected : RNMBXPointAnnotation? = nil
|
|
1499
1519
|
private var draggedAnnotation: PointAnnotation?
|
|
1500
|
-
|
|
1520
|
+
|
|
1501
1521
|
func annotationManager(_ manager: AnnotationManager, didDetectTappedAnnotations annotations: [Annotation]) {
|
|
1502
1522
|
// We handle taps ourselfs
|
|
1503
1523
|
// onTap(annotations: annotations)
|
|
1504
1524
|
}
|
|
1505
|
-
|
|
1525
|
+
|
|
1506
1526
|
func deselectCurrentlySelected(deselectAnnotationOnTap: Bool = false) -> Bool {
|
|
1507
1527
|
if let selected = selected {
|
|
1508
1528
|
selected.doDeselect(deselectAnnotationOnMapTap: deselectAnnotationOnTap)
|
|
@@ -1511,15 +1531,15 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1511
1531
|
}
|
|
1512
1532
|
return false
|
|
1513
1533
|
}
|
|
1514
|
-
|
|
1534
|
+
|
|
1515
1535
|
func onAnnotationClick(pointAnnotation: RNMBXPointAnnotation) {
|
|
1516
1536
|
let oldSelected = selected
|
|
1517
1537
|
var newSelected: RNMBXPointAnnotation? = pointAnnotation
|
|
1518
|
-
|
|
1538
|
+
|
|
1519
1539
|
if (newSelected == oldSelected) {
|
|
1520
1540
|
newSelected = nil
|
|
1521
1541
|
}
|
|
1522
|
-
|
|
1542
|
+
|
|
1523
1543
|
deselectCurrentlySelected()
|
|
1524
1544
|
|
|
1525
1545
|
if let newSelected = newSelected {
|
|
@@ -1527,7 +1547,7 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1527
1547
|
selected = newSelected
|
|
1528
1548
|
}
|
|
1529
1549
|
}
|
|
1530
|
-
|
|
1550
|
+
|
|
1531
1551
|
func lookup(_ annotation: PointAnnotation) -> RNMBXPointAnnotation? {
|
|
1532
1552
|
guard let userInfo = annotation.userInfo else {
|
|
1533
1553
|
return nil
|
|
@@ -1545,13 +1565,13 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1545
1565
|
#endif
|
|
1546
1566
|
return nil
|
|
1547
1567
|
}
|
|
1548
|
-
|
|
1568
|
+
|
|
1549
1569
|
|
|
1550
1570
|
func onTap(annotations: [Annotation]) {
|
|
1551
1571
|
guard annotations.count > 0 else {
|
|
1552
1572
|
fatalError("didDetectTappedAnnotations: No annotations found")
|
|
1553
1573
|
}
|
|
1554
|
-
|
|
1574
|
+
|
|
1555
1575
|
for annotation in annotations {
|
|
1556
1576
|
if let annotation = annotation as? PointAnnotation {
|
|
1557
1577
|
if let pointAnnotation = lookup(annotation) {
|
|
@@ -1560,7 +1580,7 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1560
1580
|
}
|
|
1561
1581
|
}
|
|
1562
1582
|
}
|
|
1563
|
-
|
|
1583
|
+
|
|
1564
1584
|
func handleTap(_ tap: UITapGestureRecognizer, noAnnotationFound: @escaping (UITapGestureRecognizer) -> Void) {
|
|
1565
1585
|
let layerId = manager.layerId
|
|
1566
1586
|
guard let mapFeatureQueryable = mapView?.mapboxMap else {
|
|
@@ -1602,10 +1622,10 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1602
1622
|
}
|
|
1603
1623
|
}
|
|
1604
1624
|
}
|
|
1605
|
-
|
|
1625
|
+
|
|
1606
1626
|
var manager : MapboxMaps.PointAnnotationManager
|
|
1607
1627
|
weak var mapView : MapView? = nil
|
|
1608
|
-
|
|
1628
|
+
|
|
1609
1629
|
init(annotations: AnnotationOrchestrator, mapView: MapView) {
|
|
1610
1630
|
manager = annotations.makePointAnnotationManager(id: "RNMBX-mapview-point-annotations")
|
|
1611
1631
|
manager.delegate = self
|
|
@@ -1616,7 +1636,7 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1616
1636
|
guard annotations.count > 0 else {
|
|
1617
1637
|
fatalError("didDetectDraggedAnnotations: No annotations found")
|
|
1618
1638
|
}
|
|
1619
|
-
|
|
1639
|
+
|
|
1620
1640
|
for annotation in annotations {
|
|
1621
1641
|
if let pointAnnotation = annotation as? PointAnnotation,
|
|
1622
1642
|
let pt = lookup(pointAnnotation) {
|
|
@@ -1652,7 +1672,7 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1652
1672
|
}
|
|
1653
1673
|
}
|
|
1654
1674
|
}
|
|
1655
|
-
|
|
1675
|
+
|
|
1656
1676
|
// Used for handling panning to detect annotation dragging
|
|
1657
1677
|
func handleLongPress(_ sender: UILongPressGestureRecognizer, noAnnotationFound: @escaping (UILongPressGestureRecognizer) -> Void) {
|
|
1658
1678
|
let layerId = manager.layerId
|
|
@@ -1669,7 +1689,7 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1669
1689
|
mapFeatureQueryable.queryRenderedFeatures(
|
|
1670
1690
|
with: sender.location(in: sender.view),
|
|
1671
1691
|
options: options) { [weak self] (result) in
|
|
1672
|
-
|
|
1692
|
+
|
|
1673
1693
|
guard let self = self else { return }
|
|
1674
1694
|
switch result {
|
|
1675
1695
|
case .success(let queriedFeatures):
|
|
@@ -1701,7 +1721,7 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1701
1721
|
guard var annotation = self.draggedAnnotation else {
|
|
1702
1722
|
return
|
|
1703
1723
|
}
|
|
1704
|
-
|
|
1724
|
+
|
|
1705
1725
|
self.onDragHandler(self.manager, didDetectDraggedAnnotations: [annotation], dragState: .changed, targetPoint: targetPoint)
|
|
1706
1726
|
|
|
1707
1727
|
let idx = self.manager.annotations.firstIndex { an in return an.id == annotation.id }
|
|
@@ -1721,18 +1741,18 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1721
1741
|
return
|
|
1722
1742
|
}
|
|
1723
1743
|
}
|
|
1724
|
-
|
|
1744
|
+
|
|
1725
1745
|
func remove(_ annotation: PointAnnotation) {
|
|
1726
1746
|
manager.annotations.removeAll(where: {$0.id == annotation.id})
|
|
1727
1747
|
}
|
|
1728
|
-
|
|
1748
|
+
|
|
1729
1749
|
#if RNMBX_11
|
|
1730
1750
|
var annotations = NSMapTable<NSString, RNMBXPointAnnotation>.init(
|
|
1731
1751
|
keyOptions: .copyIn,
|
|
1732
1752
|
valueOptions: .weakMemory
|
|
1733
1753
|
)
|
|
1734
1754
|
#endif
|
|
1735
|
-
|
|
1755
|
+
|
|
1736
1756
|
func add(_ annotation: PointAnnotation, _ rnmbxPointAnnotation: RNMBXPointAnnotation) {
|
|
1737
1757
|
manager.annotations.append(annotation)
|
|
1738
1758
|
manager.refresh()
|
|
@@ -1740,15 +1760,15 @@ class RNMBXPointAnnotationManager : AnnotationInteractionDelegate {
|
|
|
1740
1760
|
annotations.setObject(rnmbxPointAnnotation, forKey: annotation.id as NSString)
|
|
1741
1761
|
#endif
|
|
1742
1762
|
}
|
|
1743
|
-
|
|
1763
|
+
|
|
1744
1764
|
func update(_ annotation: PointAnnotation) {
|
|
1745
1765
|
let index = manager.annotations.firstIndex { $0.id == annotation.id }
|
|
1746
|
-
|
|
1766
|
+
|
|
1747
1767
|
guard let index = index else {
|
|
1748
1768
|
Logger.log(level: .warn, message: "RNMBX - PointAnnotation.refresh: annotation not found")
|
|
1749
1769
|
return
|
|
1750
1770
|
}
|
|
1751
|
-
|
|
1771
|
+
|
|
1752
1772
|
manager.annotations[index] = annotation
|
|
1753
1773
|
manager.refresh()
|
|
1754
1774
|
}
|
|
@@ -67,13 +67,13 @@ using namespace facebook::react;
|
|
|
67
67
|
{
|
|
68
68
|
_eventDispatcher = [[RNMBXMapViewEventDispatcher alloc] initWithComponentView:self];
|
|
69
69
|
_view = [[RNMBXMapView alloc] initWithFrame:_frame eventDispatcher:_eventDispatcher];
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
// just need to pass something, it won't really be used on fabric, but it's used to create events (it won't impact sending them)
|
|
72
72
|
_view.reactTag = @-1;
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
// capture weak self reference to prevent retain cycle
|
|
75
75
|
__weak __typeof__(self) weakSelf = self;
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
[_view setReactOnPress:^(NSDictionary* event) {
|
|
78
78
|
__typeof__(self) strongSelf = weakSelf;
|
|
79
79
|
|
|
@@ -190,6 +190,11 @@ using namespace facebook::react;
|
|
|
190
190
|
|
|
191
191
|
RNMBX_REMAP_OPTIONAL_PROP_BOOL(pitchEnabled, reactPitchEnabled)
|
|
192
192
|
|
|
193
|
+
id preferredFramesPerSecond = RNMBXConvertFollyDynamicToId(newViewProps.preferredFramesPerSecond);
|
|
194
|
+
if (preferredFramesPerSecond != nil) {
|
|
195
|
+
_view.reactPreferredFramesPerSecond = [preferredFramesPerSecond integerValue];
|
|
196
|
+
}
|
|
197
|
+
|
|
193
198
|
id projection = RNMBXConvertFollyDynamicToId(newViewProps.projection);
|
|
194
199
|
if (projection != nil) {
|
|
195
200
|
_view.reactProjection = projection;
|
|
@@ -199,7 +204,7 @@ using namespace facebook::react;
|
|
|
199
204
|
if (localizeLabels != nil) {
|
|
200
205
|
_view.reactLocalizeLabels = localizeLabels;
|
|
201
206
|
}
|
|
202
|
-
|
|
207
|
+
|
|
203
208
|
RNMBX_OPTIONAL_PROP_BOOL(deselectAnnotationOnTap);
|
|
204
209
|
|
|
205
210
|
id styleURL = RNMBXConvertFollyDynamicToId(newViewProps.styleURL);
|
|
@@ -25,6 +25,7 @@ RCT_REMAP_VIEW_PROPERTY(zoomEnabled, reactZoomEnabled, BOOL)
|
|
|
25
25
|
RCT_REMAP_VIEW_PROPERTY(scrollEnabled, reactScrollEnabled, BOOL)
|
|
26
26
|
RCT_REMAP_VIEW_PROPERTY(rotateEnabled, reactRotateEnabled, BOOL)
|
|
27
27
|
RCT_REMAP_VIEW_PROPERTY(pitchEnabled, reactPitchEnabled, BOOL)
|
|
28
|
+
RCT_REMAP_VIEW_PROPERTY(preferredFramesPerSecond, reactPreferredFramesPerSecond, NSInteger)
|
|
28
29
|
RCT_EXPORT_VIEW_PROPERTY(deselectAnnotationOnTap, BOOL)
|
|
29
30
|
|
|
30
31
|
RCT_REMAP_VIEW_PROPERTY(projection, reactProjection, NSString)
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
@_spi(Experimental) import MapboxMaps
|
|
2
2
|
|
|
3
3
|
@objc(RNMBXStyleImport)
|
|
4
|
-
open class RNMBXStyleImport
|
|
4
|
+
open class RNMBXStyleImport: UIView, RNMBXMapComponent {
|
|
5
5
|
var mapView: MapView? = nil
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
// MARK: React properties
|
|
8
8
|
@objc
|
|
9
|
-
var id: String? = nil
|
|
10
|
-
|
|
9
|
+
public var id: String? = nil
|
|
10
|
+
|
|
11
11
|
@objc
|
|
12
|
-
var existing: Bool = false
|
|
13
|
-
|
|
12
|
+
public var existing: Bool = false
|
|
13
|
+
|
|
14
14
|
@objc
|
|
15
|
-
var config: [String: Any]? {
|
|
15
|
+
public var config: [String: Any]? {
|
|
16
16
|
didSet {
|
|
17
17
|
if let mapView = mapView {
|
|
18
18
|
apply(mapView: mapView)
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
public func waitForStyleLoad() -> Bool {
|
|
24
24
|
true
|
|
25
25
|
}
|
|
@@ -37,12 +37,19 @@ open class RNMBXStyleImport : UIView, RNMBXMapComponent {
|
|
|
37
37
|
func apply(mapView: MapView) {
|
|
38
38
|
if let config = config, let id = id {
|
|
39
39
|
#if RNMBX_11
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
logged("RNMBXStyleImport.setStyleImportConfigProperties id=\(id)") {
|
|
41
|
+
try mapView.mapboxMap.setStyleImportConfigProperties(for: id, configs: config)
|
|
42
|
+
}
|
|
43
43
|
#else
|
|
44
|
-
|
|
44
|
+
Logger.error("RNMBXStyleImport.setStyleImportConfigProperties is only implemented on v11")
|
|
45
45
|
#endif
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
@objc
|
|
50
|
+
public override func didSetProps(_ props: [String]) {
|
|
51
|
+
if let mapView = mapView {
|
|
52
|
+
apply(mapView: mapView)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
48
55
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
2
|
|
|
3
3
|
#import "RNMBXStyleImportComponentView.h"
|
|
4
|
+
#import "RNMBXFabricHelpers.h"
|
|
4
5
|
|
|
5
6
|
#import <React/RCTConversions.h>
|
|
6
7
|
#import <React/RCTFabricComponentsPlugins.h>
|
|
@@ -14,32 +15,71 @@
|
|
|
14
15
|
|
|
15
16
|
using namespace facebook::react;
|
|
16
17
|
|
|
18
|
+
@interface RNMBXStyleImportComponentView () <RCTRNMBXStyleImportViewProtocol>
|
|
19
|
+
@end
|
|
20
|
+
|
|
17
21
|
@implementation RNMBXStyleImportComponentView {
|
|
18
|
-
|
|
22
|
+
RNMBXStyleImport *_view;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
// Needed because of this: https://github.com/facebook/react-native/pull/37274
|
|
22
|
-
+ (void)load
|
|
23
|
-
{
|
|
26
|
+
+ (void)load {
|
|
24
27
|
[super load];
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
- (instancetype)initWithFrame:(CGRect)frame
|
|
28
|
-
{
|
|
30
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
29
31
|
if (self = [super initWithFrame:frame]) {
|
|
30
|
-
static const auto defaultProps =
|
|
32
|
+
static const auto defaultProps =
|
|
33
|
+
std::make_shared<const RNMBXStyleImportProps>();
|
|
31
34
|
_props = defaultProps;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
self.contentView = _view;
|
|
35
|
+
[self prepareView];
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
+
|
|
37
38
|
return self;
|
|
38
39
|
}
|
|
40
|
+
|
|
41
|
+
- (void)prepareView {
|
|
42
|
+
_view = [[RNMBXStyleImport alloc] init];
|
|
43
|
+
self.contentView = _view;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#pragma mark - RCTComponentViewProtocol
|
|
47
|
+
|
|
48
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
49
|
+
return concreteComponentDescriptorProvider<
|
|
50
|
+
RNMBXStyleImportComponentDescriptor>();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
- (void)updateProps:(const Props::Shared &)props
|
|
54
|
+
oldProps:(const Props::Shared &)oldProps {
|
|
55
|
+
const auto &newProps = static_cast<const RNMBXStyleImportProps &>(*props);
|
|
56
|
+
|
|
57
|
+
id styleId = RNMBXConvertFollyDynamicToId(newProps.id);
|
|
58
|
+
if (styleId != nil) {
|
|
59
|
+
_view.id = styleId;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
id existing = RNMBXConvertFollyDynamicToId(newProps.existing);
|
|
63
|
+
if (existing != nil) {
|
|
64
|
+
_view.existing = existing;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
id config = RNMBXConvertFollyDynamicToId(newProps.config);
|
|
68
|
+
if (config != nil) {
|
|
69
|
+
_view.config = config;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[super updateProps:props oldProps:oldProps];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
- (void)prepareForRecycle {
|
|
76
|
+
[super prepareForRecycle];
|
|
77
|
+
[self prepareView];
|
|
78
|
+
}
|
|
79
|
+
|
|
39
80
|
@end
|
|
40
81
|
|
|
41
|
-
Class<RCTComponentViewProtocol> RNMBXStyleImportCls(void)
|
|
42
|
-
{
|
|
82
|
+
Class<RCTComponentViewProtocol> RNMBXStyleImportCls(void) {
|
|
43
83
|
return RNMBXStyleImportComponentView.class;
|
|
44
84
|
}
|
|
45
85
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXMapViewNativeComponent.ts"],"mappings":";;;;;;AACA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAS7F;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,
|
|
1
|
+
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXMapViewNativeComponent.ts"],"mappings":";;;;;;AACA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAS7F;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GA0Ee,IAAAG,+BAAsB,EACnC,cACF,CAAC,EAED","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXMapViewNativeComponent.ts"],"mappings":";;AACA,OAAOA,sBAAsB,MAAM,yDAAyD;;AAS5F;;
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/RNMBXMapViewNativeComponent.ts"],"mappings":";;AACA,OAAOA,sBAAsB,MAAM,yDAAyD;;AAS5F;;AA0EA,eAAeA,sBAAsB,CACnC,cACF,CAAC;;AAED","ignoreList":[]}
|
|
@@ -56,6 +56,7 @@ export interface NativeProps extends ViewProps {
|
|
|
56
56
|
onMapChange?: DirectEventHandler<OnMapChangeEventType>;
|
|
57
57
|
onCameraChanged?: DirectEventHandler<OnCameraChangedEventType>;
|
|
58
58
|
mapViewImpl?: OptionalProp<string>;
|
|
59
|
+
preferredFramesPerSecond?: OptionalProp<Int32>;
|
|
59
60
|
}
|
|
60
61
|
declare const _default: HostComponent<NativeProps>;
|
|
61
62
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RNMBXMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/specs/RNMBXMapViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,EACN,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGzD,KAAK,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEtC,KAAK,eAAe,GAAG;IACrB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,8BAA8B,CAAC,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AC5D,GACD,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAC7C,IAAI,CAAC,WAAW,EAAE,iBAAiB,GAAG,aAAa,GAAG,aAAa,CAAC,GAAG;IACrE,eAAe,CAAC,EAAE,kBAAkB,CAAC,8BAA8B,CAAC,CAAC;IACrE,WAAW,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IACzD,OAAO,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,kBAAkB,CAAC,0BAA0B,CAAC,CAAC;CAC9D,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -79,6 +79,7 @@ export interface NativeProps extends ViewProps {
|
|
|
79
79
|
onCameraChanged?: DirectEventHandler<OnCameraChangedEventType>;
|
|
80
80
|
|
|
81
81
|
mapViewImpl?: OptionalProp<string>;
|
|
82
|
+
preferredFramesPerSecond?: OptionalProp<Int32>;
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
export default codegenNativeComponent<NativeProps>(
|