@mapsindoors/react-native-maps-indoors-mapbox 1.3.1 → 2.0.0
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/README.md +48 -1
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/.idea/compiler.xml +1 -1
- package/android/.idea/gradle.xml +1 -1
- package/android/.idea/misc.xml +2 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/mapsindoorsrn/MapboxMapView.java +12 -2
- package/android/src/main/java/com/mapsindoorsrn/MapsIndoorsViewManager.java +5 -1
- package/android/src/main/java/com/mapsindoorsrn/core/DirectionsRendererModule.java +3 -0
- package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +172 -0
- package/android/src/main/java/com/mapsindoorsrn/core/MapControlModule.java +80 -0
- package/android/src/main/java/com/mapsindoorsrn/core/UtilsModule.java +39 -0
- package/app.plugin.js +280 -0
- package/index.ts +12 -1
- package/ios/MapsIndoorsViewManager.swift +21 -4
- package/ios/core/DirectionsRendererModule.swift +2 -0
- package/ios/core/DirectionsServiceModule.swift +2 -0
- package/ios/core/LabelGraphic.swift +15 -0
- package/ios/core/MPDisplayRuleBridge.m +81 -0
- package/ios/core/MPDisplayRuleModule.swift +191 -0
- package/ios/core/MapControlBridge.m +21 -0
- package/ios/core/MapControlModule.swift +83 -1
- package/ios/core/RCMapView.swift +1 -1
- package/ios/core/UtilsBridge.m +4 -0
- package/ios/core/UtilsModule.swift +21 -0
- package/package.json +3 -2
- package/react-native-maps-indoors-mapbox.podspec +2 -2
- package/src/core/MPCameraViewFitMode.ts +4 -0
- package/src/core/MPDirectionsRenderer.ts +6 -1
- package/src/core/MPDisplayRule.ts +296 -89
- package/src/core/MPFeatureTypes.ts +8 -0
- package/src/core/MPLabelGraphic.ts +24 -0
- package/src/core/MPLabelType.ts +1 -0
- package/src/core/MPLocation.ts +20 -0
- package/src/core/MPLocationSettings.ts +40 -0
- package/src/core/MPMapConfig.ts +36 -0
- package/src/core/MPPOIType.ts +43 -0
- package/src/core/MPPropertyData.ts +10 -1
- package/src/core/MPSelectionMode.ts +4 -0
- package/src/core/MPSolution.ts +9 -0
- package/src/core/MPSolutionConfig.ts +18 -0
- package/src/core/MPUtils.ts +5 -0
- package/src/core/MapControl.ts +54 -0
|
@@ -41,6 +41,10 @@ public class MPDisplayRuleModule: NSObject {
|
|
|
41
41
|
switch(labelType.intValue) {
|
|
42
42
|
case 0:
|
|
43
43
|
return .flat
|
|
44
|
+
case 1:
|
|
45
|
+
return .floating
|
|
46
|
+
case 2:
|
|
47
|
+
return .graphic
|
|
44
48
|
default:
|
|
45
49
|
return .floating
|
|
46
50
|
}
|
|
@@ -1241,6 +1245,37 @@ public class MPDisplayRuleModule: NSObject {
|
|
|
1241
1245
|
|
|
1242
1246
|
return resolve(nil)
|
|
1243
1247
|
}
|
|
1248
|
+
|
|
1249
|
+
@objc public func setLabelStyleGraphic(_ displayRuleId: String, value: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1250
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1251
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
guard let labelGraphic = try? JSONDecoder().decode(LabelGraphic.self, from: value.data(using: .utf8)!) else {
|
|
1255
|
+
return doReject(reject, message: "Could not parse label graphic")
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
displayRule.labelStyleGraphicBackgroundImage = labelGraphic.backgroundImage
|
|
1259
|
+
displayRule.labelStyleGraphicStretchX = labelGraphic.stretchX
|
|
1260
|
+
displayRule.labelStyleGraphicStretchY = labelGraphic.stretchY
|
|
1261
|
+
displayRule.labelStyleGraphicContent = labelGraphic.content
|
|
1262
|
+
|
|
1263
|
+
return resolve(nil)
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
@objc public func getLabelStyleGraphic(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1267
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1268
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
let labelGraphic = LabelGraphic(backgroundImage: displayRule.labelStyleGraphicBackgroundImage, stretchX: displayRule.labelStyleGraphicStretchX, stretchY: displayRule.labelStyleGraphicStretchY, content: displayRule.labelStyleGraphicContent)
|
|
1272
|
+
|
|
1273
|
+
guard let graphicJson = try? JSONEncoder().encode(labelGraphic) else {
|
|
1274
|
+
return doReject(reject, message: "Could not encode label graphic")
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
return resolve(String(data: graphicJson, encoding: String.Encoding.utf8))
|
|
1278
|
+
}
|
|
1244
1279
|
|
|
1245
1280
|
@objc public func getPolygonLightnessFactor(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1246
1281
|
guard let displayRule = getRule(name: displayRuleId) else {
|
|
@@ -1400,6 +1435,162 @@ public class MPDisplayRuleModule: NSObject {
|
|
|
1400
1435
|
return resolve(nil)
|
|
1401
1436
|
}
|
|
1402
1437
|
|
|
1438
|
+
@objc public func getModel3DModel(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1439
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1440
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
return resolve(displayRule.model3DModel)
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
@objc public func setModel3DModel(_ displayRuleId: String, value: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1447
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1448
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
displayRule.model3DModel = value
|
|
1452
|
+
|
|
1453
|
+
return resolve(nil)
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
@objc public func getModel3DRotationX(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1457
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1458
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
return resolve(displayRule.model3DRotationX)
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
@objc public func setModel3DRotationX(_ displayRuleId: String, value: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1465
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1466
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
if (value != -1) {
|
|
1470
|
+
displayRule.model3DRotationX = value.doubleValue
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
return resolve(nil)
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
@objc public func getModel3DRotationY(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1477
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1478
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
return resolve(displayRule.model3DRotationY)
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
@objc public func setModel3DRotationY(_ displayRuleId: String, value: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1485
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1486
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
if (value != -1) {
|
|
1490
|
+
displayRule.model3DRotationY = value.doubleValue
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
return resolve(nil)
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
@objc public func getModel3DRotationZ(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1497
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1498
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
return resolve(displayRule.model3DRotationZ)
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
@objc public func setModel3DRotationZ(_ displayRuleId: String, value: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1505
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1506
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
if (value != -1) {
|
|
1510
|
+
displayRule.model3DRotationZ = value.doubleValue
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
return resolve(nil)
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
@objc public func isModel3DVisible(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1517
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1518
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
return resolve(displayRule.model3DVisible)
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
@objc public func setModel3DVisible(_ displayRuleId: String, value: Bool, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1525
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1526
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
displayRule.model3DVisible = value
|
|
1530
|
+
|
|
1531
|
+
return resolve(nil)
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
@objc public func getModel3DZoomFrom(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1535
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1536
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
return resolve(displayRule.model3DZoomFrom)
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
@objc public func setModel3DZoomFrom(_ displayRuleId: String, value: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1543
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1544
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
if (value != -1) {
|
|
1548
|
+
displayRule.model3DZoomFrom = value.doubleValue
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
return resolve(nil)
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
@objc public func getModel3DZoomTo(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1555
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1556
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
return resolve(displayRule.model3DZoomTo)
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
@objc public func setModel3DZoomTo(_ displayRuleId: String, value: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1563
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1564
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
if (value != -1) {
|
|
1568
|
+
displayRule.model3DZoomTo = value.doubleValue
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
return resolve(nil)
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
@objc public func getModel3DScale(_ displayRuleId: String, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1575
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1576
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
return resolve(displayRule.model3DScale)
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
@objc public func setModel3DScale(_ displayRuleId: String, value: NSNumber, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
1583
|
+
guard let displayRule = getRule(name: displayRuleId) else {
|
|
1584
|
+
return doReject(reject, displayRuleId: displayRuleId)
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
if (value != -1) {
|
|
1588
|
+
displayRule.model3DScale = value.doubleValue
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
return resolve(nil)
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1403
1594
|
// Start of tail
|
|
1404
1595
|
|
|
1405
1596
|
@objc public func reset(_ displayRuleId: String,resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
@@ -189,4 +189,25 @@
|
|
|
189
189
|
resolver:(RCTPromiseResolveBlock) resolve
|
|
190
190
|
rejecter:(RCTPromiseRejectBlock) reject)
|
|
191
191
|
|
|
192
|
+
RCT_EXTERN_METHOD(setBuildingSelectionMode:(nonnull NSNumber *) setBuildingSelectionMode
|
|
193
|
+
resolver:(RCTPromiseResolveBlock) resolve
|
|
194
|
+
rejecter:(RCTPromiseRejectBlock) reject)
|
|
195
|
+
|
|
196
|
+
RCT_EXTERN_METHOD(getBuildingSelectionMode: (RCTPromiseResolveBlock) resolve
|
|
197
|
+
rejecter:(RCTPromiseRejectBlock) reject)
|
|
198
|
+
|
|
199
|
+
RCT_EXTERN_METHOD(setFloorSelectionMode:(nonnull NSNumber *) setFloorSelectionMode
|
|
200
|
+
resolver:(RCTPromiseResolveBlock) resolve
|
|
201
|
+
rejecter:(RCTPromiseRejectBlock) reject)
|
|
202
|
+
|
|
203
|
+
RCT_EXTERN_METHOD(getFloorSelectionMode: (RCTPromiseResolveBlock) resolve
|
|
204
|
+
rejecter:(RCTPromiseRejectBlock) reject)
|
|
205
|
+
|
|
206
|
+
RCT_EXTERN_METHOD(setHiddenFeatures: (NSString) hiddenFeatures
|
|
207
|
+
resolver:(RCTPromiseResolveBlock) resolve
|
|
208
|
+
rejecter:(RCTPromiseRejectBlock) reject)
|
|
209
|
+
|
|
210
|
+
RCT_EXTERN_METHOD(getHiddenFeatures: (RCTPromiseResolveBlock) resolve
|
|
211
|
+
rejecter:(RCTPromiseRejectBlock) reject)
|
|
212
|
+
|
|
192
213
|
@end
|
|
@@ -41,7 +41,7 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
41
41
|
return doReject(reject, message: "Mapview not available")
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
self.mapConfig = mapView.getConfig()
|
|
44
|
+
self.mapConfig = mapView.getConfig(config: config)
|
|
45
45
|
|
|
46
46
|
guard let mapControl = MPMapsIndoors.createMapControl(mapConfig: self.mapConfig!) else {
|
|
47
47
|
return doReject(reject, message: "Unable to initialize Map Control")
|
|
@@ -587,4 +587,86 @@ public class MapControlModule: RCTEventEmitter {
|
|
|
587
587
|
return doReject(reject, error: error)
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
|
+
|
|
591
|
+
@objc public func setBuildingSelectionMode(_ selectionMode: NSNumber,
|
|
592
|
+
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
593
|
+
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
594
|
+
let mapsIndoorsData = MapsIndoorsData.sharedInstance
|
|
595
|
+
guard let mapControl = mapsIndoorsData.mapControl else {
|
|
596
|
+
return doReject(reject, message: "mapControl is not available")
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
mapControl.buildingSelectionMode = MPSelectionMode(rawValue: selectionMode.intValue) ?? .automatic
|
|
600
|
+
return resolve(nil)
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
@objc public func getBuildingSelectionMode(_ resolve: RCTPromiseResolveBlock,
|
|
604
|
+
rejecter reject: RCTPromiseRejectBlock) {
|
|
605
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapControl else {
|
|
606
|
+
return doReject(reject, message: "mapControl is not available")
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return resolve(mapControl.buildingSelectionMode.rawValue)
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
@objc public func setFloorSelectionMode(_ selectionMode: NSNumber,
|
|
613
|
+
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
614
|
+
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
615
|
+
let mapsIndoorsData = MapsIndoorsData.sharedInstance
|
|
616
|
+
guard let mapControl = mapsIndoorsData.mapControl else {
|
|
617
|
+
return doReject(reject, message: "mapControl is not available")
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
mapControl.floorSelectionMode = MPSelectionMode(rawValue: selectionMode.intValue) ?? .automatic
|
|
621
|
+
return resolve(nil)
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
@objc public func getFloorSelectionMode(_ resolve: RCTPromiseResolveBlock,
|
|
625
|
+
rejecter reject: RCTPromiseRejectBlock) {
|
|
626
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapControl else {
|
|
627
|
+
return doReject(reject, message: "mapControl is not available")
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
return resolve(mapControl.floorSelectionMode.rawValue)
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
@objc public func setHiddenFeatures(_ features: String,
|
|
634
|
+
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
635
|
+
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
636
|
+
let mapsIndoorsData = MapsIndoorsData.sharedInstance
|
|
637
|
+
guard let mapControl = mapsIndoorsData.mapControl else {
|
|
638
|
+
return doReject(reject, message: "mapControl is not available")
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
guard let features = try? JSONDecoder().decode([Int].self, from: features.data(using: .utf8)!) else {
|
|
642
|
+
return doReject(reject, message: "Features could not be parsed")
|
|
643
|
+
}
|
|
644
|
+
var featureTypes = [MPFeatureType]()
|
|
645
|
+
|
|
646
|
+
for feature in features {
|
|
647
|
+
guard let featureType = MPFeatureType(rawValue: feature) else {
|
|
648
|
+
return doReject(reject, message: "Could not parse featureType")
|
|
649
|
+
}
|
|
650
|
+
featureTypes.append(featureType)
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
mapControl.hiddenFeatures = featureTypes.map({$0.rawValue})
|
|
654
|
+
|
|
655
|
+
return resolve(nil)
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
@objc public func getHiddenFeatures(_ resolve: RCTPromiseResolveBlock,
|
|
659
|
+
rejecter reject: RCTPromiseRejectBlock) {
|
|
660
|
+
guard let mapControl = MapsIndoorsData.sharedInstance.mapControl else {
|
|
661
|
+
return doReject(reject, message: "mapControl is not available")
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
var features = [String]()
|
|
665
|
+
|
|
666
|
+
guard let hiddenFeatures = try? JSONEncoder().encode(mapControl.hiddenFeatures) else {
|
|
667
|
+
return doReject(reject, message: "something went wrong encoding hiddenfeatures")
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
return resolve(String(data: hiddenFeatures, encoding: String.Encoding.utf8))
|
|
671
|
+
}
|
|
590
672
|
}
|
package/ios/core/RCMapView.swift
CHANGED
package/ios/core/UtilsBridge.m
CHANGED
|
@@ -64,4 +64,8 @@
|
|
|
64
64
|
resolver:(RCTPromiseResolveBlock) resolve
|
|
65
65
|
rejecter:(RCTPromiseRejectBlock) reject)
|
|
66
66
|
|
|
67
|
+
RCT_EXTERN_METHOD(setSelectable: (NSString *) settingsId
|
|
68
|
+
value: (BOOL) value
|
|
69
|
+
resolver:(RCTPromiseResolveBlock) resolve
|
|
70
|
+
rejecter:(RCTPromiseRejectBlock) reject)
|
|
67
71
|
@end
|
|
@@ -148,4 +148,25 @@ public class UtilsModule: NSObject {
|
|
|
148
148
|
MPMapsIndoors.shared.solution?.config.newSelection = isNewSelection
|
|
149
149
|
return resolve(nil)
|
|
150
150
|
}
|
|
151
|
+
|
|
152
|
+
@objc public func setSelectable(_ settingsId: String, value: Bool, resolver resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) {
|
|
153
|
+
if (settingsId == "solution") {
|
|
154
|
+
MPMapsIndoors.shared.solution?.config.locationSettings.selectable = value
|
|
155
|
+
} else {
|
|
156
|
+
if let location = MPMapsIndoors.shared.locationWith(locationId: settingsId) {
|
|
157
|
+
if location.locationSettings == nil {
|
|
158
|
+
location.locationSettings = MPLocationSettings()
|
|
159
|
+
}
|
|
160
|
+
location.locationSettings?.selectable = value
|
|
161
|
+
} else {
|
|
162
|
+
if let type = MPMapsIndoors.shared.solution?.types.first(where: {$0.name == settingsId}) {
|
|
163
|
+
if type.locationSettings == nil {
|
|
164
|
+
type.locationSettings = MPLocationSettings()
|
|
165
|
+
}
|
|
166
|
+
type.locationSettings?.selectable = value
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return resolve(nil)
|
|
171
|
+
}
|
|
151
172
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapsindoors/react-native-maps-indoors-mapbox",
|
|
3
3
|
"title": "React Native MapsIndoors Mapbox",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"description": "React Native MapsIndoors component with mapbox",
|
|
6
6
|
"react-native": "index.ts",
|
|
7
7
|
"files": [
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"index.ts",
|
|
12
12
|
"ios",
|
|
13
13
|
"react-native-maps-indoors-mapbox.podspec",
|
|
14
|
-
"!android/build"
|
|
14
|
+
"!android/build",
|
|
15
|
+
"app.plugin.js"
|
|
15
16
|
],
|
|
16
17
|
"scripts": {
|
|
17
18
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -24,7 +24,7 @@ Pod::Spec.new do |s|
|
|
|
24
24
|
s.requires_arc = true
|
|
25
25
|
|
|
26
26
|
s.dependency "React"
|
|
27
|
-
s.dependency "
|
|
28
|
-
s.dependency "MapsIndoorsCodable", "4.
|
|
27
|
+
s.dependency "MapsIndoorsMapbox11", "4.5.5"
|
|
28
|
+
s.dependency "MapsIndoorsCodable", "4.5.5"
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -205,8 +205,13 @@ export default class MPDirectionsRenderer {
|
|
|
205
205
|
cameraFitMode = 2;
|
|
206
206
|
break;
|
|
207
207
|
}
|
|
208
|
+
case MPCameraViewFitMode.none: {
|
|
209
|
+
cameraFitMode = 3;
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
208
212
|
}
|
|
209
|
-
|
|
213
|
+
|
|
214
|
+
return await DirectionsRenderer.setCameraViewFitMode(cameraFitMode);
|
|
210
215
|
}
|
|
211
216
|
|
|
212
217
|
/**
|