@mapsindoors/react-native-maps-indoors-mapbox 1.0.9 → 1.2.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.
Files changed (60) hide show
  1. package/README.md +14 -2
  2. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  3. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
  6. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  8. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  9. package/android/.gradle/file-system.probe +0 -0
  10. package/android/.idea/misc.xml +0 -1
  11. package/android/.idea/vcs.xml +1 -0
  12. package/android/build.gradle +2 -2
  13. package/android/libs/core-4.3.0.aar +0 -0
  14. package/android/libs/mapbox-4.3.0.aar +0 -0
  15. package/android/src/main/AndroidManifest.xml +1 -1
  16. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/MapboxMapView.java +4 -4
  17. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/MapsIndoorsPackage.java +7 -7
  18. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/MapsIndoorsViewManager.java +1 -1
  19. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/DirectionsRendererModule.java +2 -2
  20. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/DirectionsServiceModule.java +24 -2
  21. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +1486 -0
  22. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/MapControlModule.java +32 -5
  23. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/MapsIndoorsModule.java +68 -12
  24. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/RCMapView.java +3 -3
  25. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/UtilsModule.java +11 -2
  26. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/Bounds.java +1 -1
  27. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/Filter.java +1 -1
  28. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/Location.java +1 -1
  29. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/MPCameraPosition.java +1 -1
  30. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/MPCameraUpdate.java +1 -1
  31. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/MPError.java +1 -1
  32. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/PositionProvider.java +1 -1
  33. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/PositionResult.java +1 -1
  34. package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/models/Query.java +1 -1
  35. package/index.ts +10 -0
  36. package/ios/core/DirectionsServiceBridge.m +9 -0
  37. package/ios/core/DirectionsServiceModule.swift +25 -0
  38. package/ios/core/MPDisplayRuleBridge.m +198 -1
  39. package/ios/core/MPDisplayRuleModule.swift +603 -33
  40. package/ios/core/MapControlBridge.m +8 -0
  41. package/ios/core/MapControlModule.swift +24 -0
  42. package/ios/core/MapsIndoorsBridge.m +16 -3
  43. package/ios/core/MapsIndoorsModule.swift +37 -6
  44. package/ios/core/UtilsBridge.m +4 -0
  45. package/ios/core/UtilsModule.swift +5 -0
  46. package/package.json +1 -1
  47. package/react-native-maps-indoors-mapbox.podspec +2 -2
  48. package/src/core/MPBadgePosition.ts +12 -0
  49. package/src/core/MPDirectionsService.ts +25 -0
  50. package/src/core/MPDisplayRule.ts +574 -7
  51. package/src/core/MPHighlightBehavior.ts +95 -0
  52. package/src/core/MPIconPlacement.ts +13 -0
  53. package/src/core/MPLabelType.ts +10 -0
  54. package/src/core/MPSolutionConfig.ts +17 -0
  55. package/src/core/MPSolutionDisplayRule.ts +2 -0
  56. package/src/core/MPUtils.ts +12 -0
  57. package/src/core/MapControl.ts +23 -1
  58. package/src/core/MapsIndoors.ts +20 -2
  59. package/android/src/main/java/com/reactlibrary/core/MPDisplayRuleModule.java +0 -816
  60. /package/android/src/main/java/com/{reactlibrary → mapsindoorsrn}/core/README.md +0 -0
@@ -1,5 +1,8 @@
1
1
  import { NativeModules } from 'react-native';
2
2
  import { MPError, MPIconSize } from "../../index";
3
+ import { MPIconPlacement } from './MPIconPlacement';
4
+ import { MPLabelType } from './MPLabelType';
5
+ import { MPBadgePosition } from './MPBadgePosition';
3
6
  const { DisplayRule } = NativeModules;
4
7
 
5
8
 
@@ -58,7 +61,7 @@ export default class MPDisplayRule {
58
61
  * @returns {Promise<void>}
59
62
  */
60
63
  public async setVisible(visible: boolean): Promise<void> {
61
- return DisplayRule.setVisible(this.id, visible).catch((err: Error) => {
64
+ return DisplayRule.setVisible(this.id, JSON.stringify(visible)).catch((err: Error) => {
62
65
  return Promise.reject(MPError.create(JSON.parse(err.message)));
63
66
  });
64
67
  }
@@ -85,7 +88,7 @@ export default class MPDisplayRule {
85
88
  * @returns {Promise<void>}
86
89
  */
87
90
  public async setIconVisible(iconVisible: boolean): Promise<void> {
88
- return DisplayRule.setIconVisible(this.id, iconVisible).catch((err: Error) => {
91
+ return DisplayRule.setIconVisible(this.id, JSON.stringify(iconVisible)).catch((err: Error) => {
89
92
  return Promise.reject(MPError.create(JSON.parse(err.message)));
90
93
  });
91
94
  }
@@ -112,7 +115,7 @@ export default class MPDisplayRule {
112
115
  * @returns {Promise<void>}
113
116
  */
114
117
  public async setPolygonVisible(polygonVisible: boolean): Promise<void> {
115
- return DisplayRule.setPolygonVisible(this.id, polygonVisible).catch((err: Error) => {
118
+ return DisplayRule.setPolygonVisible(this.id, JSON.stringify(polygonVisible)).catch((err: Error) => {
116
119
  return Promise.reject(MPError.create(JSON.parse(err.message)));
117
120
  });
118
121
  }
@@ -139,7 +142,7 @@ export default class MPDisplayRule {
139
142
  * @returns {Promise<void>}
140
143
  */
141
144
  public async setLabelVisible(labelVisible: boolean): Promise<void> {
142
- return DisplayRule.setLabelVisible(this.id, labelVisible).catch((err: Error) => {
145
+ return DisplayRule.setLabelVisible(this.id, JSON.stringify(labelVisible)).catch((err: Error) => {
143
146
  return Promise.reject(MPError.create(JSON.parse(err.message)));
144
147
  });
145
148
  }
@@ -166,7 +169,7 @@ export default class MPDisplayRule {
166
169
  * @returns {Promise<void>}
167
170
  */
168
171
  public async setModel2DVisible(model2DVisible: boolean): Promise<void> {
169
- return DisplayRule.setModel2DVisible(this.id, model2DVisible).catch((err: Error) => {
172
+ return DisplayRule.setModel2DVisible(this.id, JSON.stringify(model2DVisible)).catch((err: Error) => {
170
173
  return Promise.reject(MPError.create(JSON.parse(err.message)));
171
174
  });
172
175
  }
@@ -193,7 +196,7 @@ export default class MPDisplayRule {
193
196
  * @returns {Promise<void>}
194
197
  */
195
198
  public async setWallVisible(wallVisible: boolean): Promise<void> {
196
- return DisplayRule.setWallVisible(this.id, wallVisible).catch((err: Error) => {
199
+ return DisplayRule.setWallVisible(this.id, JSON.stringify(wallVisible)).catch((err: Error) => {
197
200
  return Promise.reject(MPError.create(JSON.parse(err.message)));
198
201
  });
199
202
  }
@@ -220,7 +223,7 @@ export default class MPDisplayRule {
220
223
  * @returns {Promise<void>}
221
224
  */
222
225
  public async setExtrusionVisible(extrusionVisible: boolean): Promise<void> {
223
- return DisplayRule.setExtrusionVisible(this.id, extrusionVisible).catch((err: Error) => {
226
+ return DisplayRule.setExtrusionVisible(this.id, JSON.stringify(extrusionVisible)).catch((err: Error) => {
224
227
  return Promise.reject(MPError.create(JSON.parse(err.message)));
225
228
  });
226
229
  }
@@ -247,6 +250,9 @@ export default class MPDisplayRule {
247
250
  * @returns {Promise<void>}
248
251
  */
249
252
  public async setZoomFrom(zoomFrom: number): Promise<void> {
253
+ if (zoomFrom == null) {
254
+ zoomFrom = -1;
255
+ }
250
256
  return DisplayRule.setZoomFrom(this.id, zoomFrom).catch((err: Error) => {
251
257
  return Promise.reject(MPError.create(JSON.parse(err.message)));
252
258
  });
@@ -274,6 +280,9 @@ export default class MPDisplayRule {
274
280
  * @returns {Promise<void>}
275
281
  */
276
282
  public async setZoomTo(zoomTo: number): Promise<void> {
283
+ if (zoomTo == null) {
284
+ zoomTo = -1;
285
+ }
277
286
  return DisplayRule.setZoomTo(this.id, zoomTo).catch((err: Error) => {
278
287
  return Promise.reject(MPError.create(JSON.parse(err.message)));
279
288
  });
@@ -386,6 +395,9 @@ export default class MPDisplayRule {
386
395
  * @returns {Promise<void>}
387
396
  */
388
397
  public async setLabelZoomFrom(zoomFrom: number): Promise<void> {
398
+ if (zoomFrom == null) {
399
+ zoomFrom = -1;
400
+ }
389
401
  return DisplayRule.setLabelZoomFrom(this.id, zoomFrom).catch((err: Error) => {
390
402
  return Promise.reject(MPError.create(JSON.parse(err.message)));
391
403
  });
@@ -413,6 +425,9 @@ export default class MPDisplayRule {
413
425
  * @returns {Promise<void>}
414
426
  */
415
427
  public async setLabelZoomTo(zoomTo: number): Promise<void> {
428
+ if (zoomTo == null) {
429
+ zoomTo = -1;
430
+ }
416
431
  return DisplayRule.setLabelZoomTo(this.id, zoomTo).catch((err: Error) => {
417
432
  return Promise.reject(MPError.create(JSON.parse(err.message)));
418
433
  });
@@ -440,6 +455,9 @@ export default class MPDisplayRule {
440
455
  * @returns {Promise<void>}
441
456
  */
442
457
  public async setLabelMaxWidth(labelMaxWidth: number): Promise<void> {
458
+ if (labelMaxWidth == null) {
459
+ labelMaxWidth = -1;
460
+ }
443
461
  return DisplayRule.setLabelMaxWidth(this.id, labelMaxWidth).catch((err: Error) => {
444
462
  return Promise.reject(MPError.create(JSON.parse(err.message)));
445
463
  });
@@ -467,6 +485,9 @@ export default class MPDisplayRule {
467
485
  * @returns {Promise<void>}
468
486
  */
469
487
  public async setPolygonZoomFrom(polygonZoomFrom: number): Promise<void> {
488
+ if (polygonZoomFrom == null) {
489
+ polygonZoomFrom = -1;
490
+ }
470
491
  return DisplayRule.setPolygonZoomFrom(this.id, polygonZoomFrom).catch((err: Error) => {
471
492
  return Promise.reject(MPError.create(JSON.parse(err.message)));
472
493
  });
@@ -494,6 +515,9 @@ export default class MPDisplayRule {
494
515
  * @returns {Promise<void>}
495
516
  */
496
517
  public async setPolygonZoomTo(polygonZoomTo: number): Promise<void> {
518
+ if (polygonZoomTo == null) {
519
+ polygonZoomTo = -1;
520
+ }
497
521
  return DisplayRule.setPolygonZoomFrom(this.id, polygonZoomTo).catch((err: Error) => {
498
522
  return Promise.reject(MPError.create(JSON.parse(err.message)));
499
523
  });
@@ -521,6 +545,9 @@ export default class MPDisplayRule {
521
545
  * @returns {Promise<void>}
522
546
  */
523
547
  public async setPolygonStrokeWidth(strokeWidth: number): Promise<void> {
548
+ if (strokeWidth == null) {
549
+ strokeWidth = -1;
550
+ }
524
551
  return DisplayRule.setPolygonStrokeWidth(this.id, strokeWidth).catch((err: Error) => {
525
552
  return Promise.reject(MPError.create(JSON.parse(err.message)));
526
553
  });
@@ -575,6 +602,9 @@ export default class MPDisplayRule {
575
602
  * @returns {Promise<void>}
576
603
  */
577
604
  public async setPolygonStrokeOpacity(strokeOpacity: number): Promise<void> {
605
+ if (strokeOpacity == null) {
606
+ strokeOpacity = -1;
607
+ }
578
608
  return DisplayRule.setPolygonStrokeOpacity(this.id, strokeOpacity).catch((err: Error) => {
579
609
  return Promise.reject(MPError.create(JSON.parse(err.message)));
580
610
  });
@@ -602,6 +632,9 @@ export default class MPDisplayRule {
602
632
  * @returns {Promise<void>}
603
633
  */
604
634
  public async setPolygonFillOpacity(fillOpacity: number): Promise<void> {
635
+ if (fillOpacity == null) {
636
+ fillOpacity = -1;
637
+ }
605
638
  return DisplayRule.setPolygonFillOpacity(this.id, fillOpacity).catch((err: Error) => {
606
639
  return Promise.reject(MPError.create(JSON.parse(err.message)));
607
640
  });
@@ -683,6 +716,9 @@ export default class MPDisplayRule {
683
716
  * @returns {Promise<void>}
684
717
  */
685
718
  public async setWallHeight(wallHeight: number): Promise<void> {
719
+ if (wallHeight == null) {
720
+ wallHeight = -1;
721
+ }
686
722
  return DisplayRule.setWallHeight(this.id, wallHeight).catch((err: Error) => {
687
723
  return Promise.reject(MPError.create(JSON.parse(err.message)));
688
724
  });
@@ -710,6 +746,9 @@ export default class MPDisplayRule {
710
746
  * @returns {Promise<void>}
711
747
  */
712
748
  public async setWallZoomFrom(wallZoomFrom: number): Promise<void> {
749
+ if (wallZoomFrom == null) {
750
+ wallZoomFrom = -1;
751
+ }
713
752
  return DisplayRule.setWallZoomFrom(this.id, wallZoomFrom).catch((err: Error) => {
714
753
  return Promise.reject(MPError.create(JSON.parse(err.message)));
715
754
  });
@@ -737,6 +776,9 @@ export default class MPDisplayRule {
737
776
  * @returns {Promise<void>}
738
777
  */
739
778
  public async setWallZoomTo(wallZoomTo: number): Promise<void> {
779
+ if (wallZoomTo == null) {
780
+ wallZoomTo = -1;
781
+ }
740
782
  return DisplayRule.setWallZoomTo(this.id, wallZoomTo).catch((err: Error) => {
741
783
  return Promise.reject(MPError.create(JSON.parse(err.message)));
742
784
  });
@@ -791,6 +833,9 @@ export default class MPDisplayRule {
791
833
  * @returns {Promise<void>}
792
834
  */
793
835
  public async setExtrusionHeight(extrusionHeight: number): Promise<void> {
836
+ if (extrusionHeight == null) {
837
+ extrusionHeight = -1;
838
+ }
794
839
  return DisplayRule.setExtrusionHeight(this.id, extrusionHeight).catch((err: Error) => {
795
840
  return Promise.reject(MPError.create(JSON.parse(err.message)));
796
841
  });
@@ -818,6 +863,9 @@ export default class MPDisplayRule {
818
863
  * @returns {Promise<void>}
819
864
  */
820
865
  public async setExtrusionZoomFrom(extrusionZoomFrom: number): Promise<void> {
866
+ if (extrusionZoomFrom == null) {
867
+ extrusionZoomFrom = -1;
868
+ }
821
869
  return DisplayRule.setExtrusionZoomFrom(this.id, extrusionZoomFrom).catch((err: Error) => {
822
870
  return Promise.reject(MPError.create(JSON.parse(err.message)));
823
871
  });
@@ -845,6 +893,9 @@ export default class MPDisplayRule {
845
893
  * @returns {Promise<void>}
846
894
  */
847
895
  public async setExtrusionZoomTo(extrusionZoomTo: number): Promise<void> {
896
+ if (extrusionZoomTo == null) {
897
+ extrusionZoomTo = -1;
898
+ }
848
899
  return DisplayRule.setExtrusionZoomTo(this.id, extrusionZoomTo).catch((err: Error) => {
849
900
  return Promise.reject(MPError.create(JSON.parse(err.message)));
850
901
  });
@@ -872,6 +923,9 @@ export default class MPDisplayRule {
872
923
  * @returns {Promise<void>}
873
924
  */
874
925
  public async setModel2DZoomFrom(zoomFrom: number): Promise<void> {
926
+ if (zoomFrom == null) {
927
+ zoomFrom = -1;
928
+ }
875
929
  return DisplayRule.setModel2DZoomFrom(this.id, zoomFrom).catch((err: Error) => {
876
930
  return Promise.reject(MPError.create(JSON.parse(err.message)));
877
931
  });
@@ -899,6 +953,9 @@ export default class MPDisplayRule {
899
953
  * @returns {Promise<void>}
900
954
  */
901
955
  public async setModel2DZoomTo(zoomTo: number): Promise<void> {
956
+ if (zoomTo == null) {
957
+ zoomTo = -1;
958
+ }
902
959
  return DisplayRule.setModel2DZoomTo(this.id, zoomTo).catch((err: Error) => {
903
960
  return Promise.reject(MPError.create(JSON.parse(err.message)));
904
961
  });
@@ -953,6 +1010,9 @@ export default class MPDisplayRule {
953
1010
  * @returns {Promise<void>}
954
1011
  */
955
1012
  public async setModel2DWidthMeters(width: number): Promise<void> {
1013
+ if (width == null) {
1014
+ width = -1;
1015
+ }
956
1016
  return DisplayRule.setModel2DWidthMeters(this.id, width).catch((err: Error) => {
957
1017
  return Promise.reject(MPError.create(JSON.parse(err.message)));
958
1018
  });
@@ -980,6 +1040,9 @@ export default class MPDisplayRule {
980
1040
  * @returns {Promise<void>}
981
1041
  */
982
1042
  public async setModel2DHeightMeters(height: number): Promise<void> {
1043
+ if (height == null) {
1044
+ height = -1;
1045
+ }
983
1046
  return DisplayRule.setModel2DHeightMeters(this.id, height).catch((err: Error) => {
984
1047
  return Promise.reject(MPError.create(JSON.parse(err.message)));
985
1048
  });
@@ -1007,11 +1070,515 @@ export default class MPDisplayRule {
1007
1070
  * @returns {Promise<void>}
1008
1071
  */
1009
1072
  public async setModel2DBearing(bearing: number): Promise<void> {
1073
+ if (bearing == null) {
1074
+ bearing = -1;
1075
+ }
1010
1076
  return DisplayRule.setModel2DBearing(this.id, bearing).catch((err: Error) => {
1011
1077
  return Promise.reject(MPError.create(JSON.parse(err.message)));
1012
1078
  });
1013
1079
  }
1014
1080
 
1081
+ /**
1082
+ *
1083
+ * @returns
1084
+ */
1085
+ public async getIconScale(): Promise<number> {
1086
+ return DisplayRule.getIconScale(this.id).catch((err: Error) => {
1087
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1088
+ });
1089
+ }
1090
+
1091
+ /**
1092
+ *
1093
+ * @returns
1094
+ */
1095
+ public async setIconScale(iconScale: number): Promise<void> {
1096
+ if (iconScale == null) {
1097
+ iconScale = -1;
1098
+ }
1099
+ return DisplayRule.setIconScale(this.id, iconScale).catch((err: Error) => {
1100
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1101
+ });
1102
+ }
1103
+
1104
+ /**
1105
+ *
1106
+ * @returns
1107
+ */
1108
+ public async getIconPlacement(): Promise<MPIconPlacement> {
1109
+ return DisplayRule.getIconPlacement(this.id).catch((err: Error) => {
1110
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1111
+ });
1112
+ }
1113
+
1114
+ /**
1115
+ *
1116
+ * @returns
1117
+ */
1118
+ public async setIconPlacement(iconPlacement: MPIconPlacement): Promise<void> {
1119
+ if (iconPlacement == null) {
1120
+ return DisplayRule.setIconPlacement(this.id, -1).catch((err: Error) => {
1121
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1122
+ });
1123
+ }else {
1124
+ return DisplayRule.setIconPlacement(this.id, iconPlacement.valueOf()).catch((err: Error) => {
1125
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1126
+ });
1127
+ }
1128
+ }
1129
+
1130
+ /**
1131
+ *
1132
+ * @returns
1133
+ */
1134
+ public async getLabelType(): Promise<MPLabelType> {
1135
+ return DisplayRule.getLabelType(this.id).catch((err: Error) => {
1136
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1137
+ });
1138
+ }
1139
+
1140
+ /**
1141
+ *
1142
+ * @returns
1143
+ */
1144
+ public async setLabelType(labelType: MPLabelType): Promise<void> {
1145
+ if (labelType == null) {
1146
+ return DisplayRule.setLabelType(this.id, -1).catch((err: Error) => {
1147
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1148
+ });
1149
+ }else {
1150
+ return DisplayRule.setLabelType(this.id, labelType.valueOf()).catch((err: Error) => {
1151
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1152
+ });
1153
+
1154
+ }
1155
+ }
1156
+
1157
+ /**
1158
+ *
1159
+ * @returns
1160
+ */
1161
+ public async getLabelStyleTextSize(): Promise<number> {
1162
+ return DisplayRule.getLabelStyleTextSize(this.id).catch((err: Error) => {
1163
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1164
+ });
1165
+ }
1166
+
1167
+ /**
1168
+ *
1169
+ * @returns
1170
+ */
1171
+ public async setLabelStyleTextSize(textSize: number): Promise<void> {
1172
+ if (textSize == null) {
1173
+ textSize = -1;
1174
+ }
1175
+ return DisplayRule.setLabelStyleTextSize(this.id, textSize).catch((err: Error) => {
1176
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1177
+ });
1178
+ }
1179
+
1180
+ /**
1181
+ *
1182
+ * @returns
1183
+ */
1184
+ public async getLabelStyleTextColor(): Promise<string> {
1185
+ return DisplayRule.getLabelStyleTextColor(this.id).catch((err: Error) => {
1186
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1187
+ });
1188
+ }
1189
+
1190
+ /**
1191
+ *
1192
+ * @returns
1193
+ */
1194
+ public async setLabelStyleTextColor(textColor: String): Promise<void> {
1195
+ return DisplayRule.setLabelStyleTextColor(this.id, textColor).catch((err: Error) => {
1196
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1197
+ });
1198
+ }
1199
+
1200
+ /**
1201
+ *
1202
+ * @returns
1203
+ */
1204
+ public async getLabelStyleTextOpacity(): Promise<number> {
1205
+ return DisplayRule.getLabelStyleTextOpacity(this.id).catch((err: Error) => {
1206
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1207
+ });
1208
+ }
1209
+
1210
+ /**
1211
+ *
1212
+ * @returns
1213
+ */
1214
+ public async setLabelStyleTextOpacity(textOpacity: number): Promise<void> {
1215
+ if (textOpacity == null) {
1216
+ textOpacity = -1;
1217
+ }
1218
+ return DisplayRule.setLabelStyleTextOpacity(this.id, textOpacity).catch((err: Error) => {
1219
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1220
+ });
1221
+ }
1222
+
1223
+ /**
1224
+ *
1225
+ * @returns
1226
+ */
1227
+ public async getLabelStyleHaloColor(): Promise<string> {
1228
+ return DisplayRule.getLabelStyleHaloColor(this.id).catch((err: Error) => {
1229
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1230
+ });
1231
+ }
1232
+
1233
+ /**
1234
+ *
1235
+ * @returns
1236
+ */
1237
+ public async setLabelStyleHaloColor(color: string): Promise<void> {
1238
+ return DisplayRule.setLabelStyleHaloColor(this.id, color).catch((err: Error) => {
1239
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1240
+ });
1241
+ }
1242
+
1243
+ /**
1244
+ *
1245
+ * @returns
1246
+ */
1247
+ public async getLabelStyleHaloWidth(): Promise<number> {
1248
+ return DisplayRule.getLabelStyleHaloWidth(this.id).catch((err: Error) => {
1249
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1250
+ });
1251
+ }
1252
+
1253
+ /**
1254
+ *
1255
+ * @returns
1256
+ */
1257
+ public async setLabelStyleHaloWidth(haloWidth: number): Promise<void> {
1258
+ if (haloWidth == null) {
1259
+ haloWidth = -1;
1260
+ }
1261
+ return DisplayRule.setLabelStyleHaloWidth(this.id, haloWidth).catch((err: Error) => {
1262
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1263
+ });
1264
+ }
1265
+
1266
+ /**
1267
+ *
1268
+ * @returns
1269
+ */
1270
+ public async getLabelStyleHaloBlur(): Promise<number> {
1271
+ return DisplayRule.getLabelStyleHaloBlur(this.id).catch((err: Error) => {
1272
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1273
+ });
1274
+ }
1275
+
1276
+ /**
1277
+ *
1278
+ * @returns
1279
+ */
1280
+ public async setLabelStyleHaloBlur(haloBlur: number): Promise<void> {
1281
+ if (haloBlur == null) {
1282
+ haloBlur = -1;
1283
+ }
1284
+ return DisplayRule.setLabelStyleHaloBlur(this.id, haloBlur).catch((err: Error) => {
1285
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1286
+ });
1287
+ }
1288
+
1289
+ /**
1290
+ *
1291
+ * @returns
1292
+ */
1293
+ public async getLabelStyleBearing(): Promise<number> {
1294
+ return DisplayRule.getLabelStyleBearing(this.id).catch((err: Error) => {
1295
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1296
+ });
1297
+ }
1298
+
1299
+ /**
1300
+ *
1301
+ * @returns
1302
+ */
1303
+ public async setLabelStyleBearing(bearing: number): Promise<void> {
1304
+ if (bearing == null) {
1305
+ bearing = -1;
1306
+ }
1307
+ return DisplayRule.setLabelStyleBearing(this.id, bearing).catch((err: Error) => {
1308
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1309
+ });
1310
+ }
1311
+
1312
+ /**
1313
+ *
1314
+ * @returns
1315
+ */
1316
+ public async getPolygonLightnessFactor(): Promise<number> {
1317
+ return DisplayRule.getPolygonLightnessFactor(this.id).catch((err: Error) => {
1318
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1319
+ });
1320
+ }
1321
+
1322
+ /**
1323
+ *
1324
+ * @returns
1325
+ */
1326
+ public async setPolygonLightnessFactor(lightnessFactor: number): Promise<void> {
1327
+ if (lightnessFactor == null) {
1328
+ lightnessFactor = -2;
1329
+ }
1330
+ return DisplayRule.setPolygonLightnessFactor(this.id, lightnessFactor).catch((err: Error) => {
1331
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1332
+ });
1333
+ }
1334
+
1335
+ /**
1336
+ *
1337
+ * @returns
1338
+ */
1339
+ public async getWallLightnessFactor(): Promise<number> {
1340
+ return DisplayRule.getWallLightnessFactor(this.id).catch((err: Error) => {
1341
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1342
+ });
1343
+ }
1344
+
1345
+ /**
1346
+ *
1347
+ * @returns
1348
+ */
1349
+ public async setWallLightnessFactor(lightnessFactor: number): Promise<void> {
1350
+ if (lightnessFactor == null) {
1351
+ lightnessFactor = -2;
1352
+ }
1353
+ return DisplayRule.setWallLightnessFactor(this.id, lightnessFactor).catch((err: Error) => {
1354
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1355
+ });
1356
+ }
1357
+
1358
+ /**
1359
+ *
1360
+ * @returns
1361
+ */
1362
+ public async getExtrusionLightnessFactor(): Promise<number> {
1363
+ return DisplayRule.getExtrusionLightnessFactor(this.id).catch((err: Error) => {
1364
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1365
+ });
1366
+ }
1367
+
1368
+ /**
1369
+ *
1370
+ * @returns
1371
+ */
1372
+ public async setExtrusionLightnessFactor(lightnessFactor: number): Promise<void> {
1373
+ if (lightnessFactor == null) {
1374
+ lightnessFactor = -2;
1375
+ }
1376
+ return DisplayRule.setExtrusionLightnessFactor(this.id, lightnessFactor).catch((err: Error) => {
1377
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1378
+ });
1379
+ }
1380
+
1381
+ /**
1382
+ *
1383
+ * @returns
1384
+ */
1385
+ public async isBadgeVisible(): Promise<boolean> {
1386
+ return DisplayRule.isBadgeVisible(this.id).catch((err: Error) => {
1387
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1388
+ });
1389
+ }
1390
+
1391
+ /**
1392
+ *
1393
+ * @returns
1394
+ */
1395
+ public async setBadgeVisible(visible: boolean): Promise<void> {
1396
+ return DisplayRule.setBadgeVisible(this.id, JSON.stringify(visible)).catch((err: Error) => {
1397
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1398
+ });
1399
+ }
1400
+
1401
+ /**
1402
+ *
1403
+ * @returns
1404
+ */
1405
+ public async getBadgeZoomFrom(): Promise<number> {
1406
+ return DisplayRule.getBadgeZoomFrom(this.id).catch((err: Error) => {
1407
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1408
+ });
1409
+ }
1410
+
1411
+ /**
1412
+ *
1413
+ * @returns
1414
+ */
1415
+ public async setBadgeZoomFrom(zoomFrom: number): Promise<void> {
1416
+ if (zoomFrom == null) {
1417
+ zoomFrom = -1;
1418
+ }
1419
+ return DisplayRule.setBadgeZoomFrom(this.id, zoomFrom).catch((err: Error) => {
1420
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1421
+ });
1422
+ }
1423
+
1424
+ /**
1425
+ *
1426
+ * @returns
1427
+ */
1428
+ public async getBadgeZoomTo(): Promise<number> {
1429
+ return DisplayRule.getBadgeZoomTo(this.id).catch((err: Error) => {
1430
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1431
+ });
1432
+ }
1433
+
1434
+ /**
1435
+ *
1436
+ * @returns
1437
+ */
1438
+ public async setBadgeZoomTo(zoomTo: number): Promise<void> {
1439
+ if (zoomTo == null) {
1440
+ zoomTo = -1;
1441
+ }
1442
+ return DisplayRule.setBadgeZoomTo(this.id, zoomTo).catch((err: Error) => {
1443
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1444
+ });
1445
+ }
1446
+
1447
+ /**
1448
+ *
1449
+ * @returns
1450
+ */
1451
+ public async getBadgeRadius(): Promise<number> {
1452
+ return DisplayRule.getBadgeRadius(this.id).catch((err: Error) => {
1453
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1454
+ });
1455
+ }
1456
+
1457
+ /**
1458
+ *
1459
+ * @returns
1460
+ */
1461
+ public async setBadgeRadius(radius: number): Promise<void> {
1462
+ if (radius == null) {
1463
+ radius = -1;
1464
+ }
1465
+ return DisplayRule.setBadgeRadius(this.id, radius).catch((err: Error) => {
1466
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1467
+ });
1468
+ }
1469
+
1470
+ /**
1471
+ *
1472
+ * @returns
1473
+ */
1474
+ public async getBadgeStrokeWidth(): Promise<number> {
1475
+ return DisplayRule.getBadgeStrokeWidth(this.id).catch((err: Error) => {
1476
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1477
+ });
1478
+ }
1479
+
1480
+ /**
1481
+ *
1482
+ * @returns
1483
+ */
1484
+ public async setBadgeStrokeWidth(strokeWidth: number): Promise<void> {
1485
+ if (strokeWidth == null) {
1486
+ strokeWidth = -1;
1487
+ }
1488
+ return DisplayRule.setBadgeStrokeWidth(this.id, strokeWidth).catch((err: Error) => {
1489
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1490
+ });
1491
+ }
1492
+
1493
+ /**
1494
+ *
1495
+ * @returns
1496
+ */
1497
+ public async getBadgeStrokeColor(): Promise<string> {
1498
+ return DisplayRule.getBadgeStrokeColor(this.id).catch((err: Error) => {
1499
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1500
+ });
1501
+ }
1502
+
1503
+ /**
1504
+ *
1505
+ * @returns
1506
+ */
1507
+ public async setBadgeStrokeColor(strokeColor: string): Promise<void> {
1508
+ return DisplayRule.setBadgeStrokeColor(this.id, strokeColor).catch((err: Error) => {
1509
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1510
+ });
1511
+ }
1512
+
1513
+ /**
1514
+ *
1515
+ * @returns
1516
+ */
1517
+ public async getBadgeFillColor(): Promise<string> {
1518
+ return DisplayRule.getBadgeFillColor(this.id).catch((err: Error) => {
1519
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1520
+ });
1521
+ }
1522
+
1523
+ /**
1524
+ *
1525
+ * @returns
1526
+ */
1527
+ public async setBadgeFillColor(fillColor: string): Promise<void> {
1528
+ return DisplayRule.setBadgeFillColor(this.id, fillColor).catch((err: Error) => {
1529
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1530
+ });
1531
+ }
1532
+
1533
+ /**
1534
+ *
1535
+ * @returns
1536
+ */
1537
+ public async getBadgeScale(): Promise<number> {
1538
+ return DisplayRule.getBadgeScale(this.id).catch((err: Error) => {
1539
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1540
+ });
1541
+ }
1542
+
1543
+ /**
1544
+ *
1545
+ * @returns
1546
+ */
1547
+ public async setBadgeScale(badgeScale: number): Promise<void> {
1548
+ if (badgeScale == null) {
1549
+ badgeScale = -1;
1550
+ }
1551
+ return DisplayRule.setBadgeScale(this.id, badgeScale).catch((err: Error) => {
1552
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1553
+ });
1554
+ }
1555
+
1556
+ /**
1557
+ *
1558
+ * @returns
1559
+ */
1560
+ public async getBadgePosition(): Promise<MPBadgePosition> {
1561
+ return DisplayRule.getBadgePosition(this.id).catch((err: Error) => {
1562
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1563
+ });
1564
+ }
1565
+
1566
+ /**
1567
+ *
1568
+ * @returns
1569
+ */
1570
+ public async setBadgePosition(badgePosition: MPBadgePosition): Promise<void> {
1571
+ if (badgePosition == null) {
1572
+ return DisplayRule.setBadgePosition(this.id, -1).catch((err: Error) => {
1573
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1574
+ });
1575
+ }else {
1576
+ return DisplayRule.setBadgePosition(this.id, badgePosition.valueOf()).catch((err: Error) => {
1577
+ return Promise.reject(MPError.create(JSON.parse(err.message)));
1578
+ });
1579
+ }
1580
+ }
1581
+
1015
1582
  /**
1016
1583
  * Resets the display rule to its default state.
1017
1584
  *