@mapsindoors/react-native-maps-indoors-mapbox 2.6.1 → 2.6.2

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 (132) hide show
  1. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsRendererModule.java +322 -0
  2. package/android/src/main/java/com/mapsindoorsrn/core/DirectionsServiceModule.java +166 -0
  3. package/android/src/main/java/com/mapsindoorsrn/core/MPDisplayRuleModule.java +1699 -0
  4. package/android/src/main/java/com/mapsindoorsrn/core/MapControlModule.java +761 -0
  5. package/android/src/main/java/com/mapsindoorsrn/core/MapsIndoorsModule.java +410 -0
  6. package/android/src/main/java/com/mapsindoorsrn/core/RCMapView.java +16 -0
  7. package/android/src/main/java/com/mapsindoorsrn/core/README.md +3 -0
  8. package/android/src/main/java/com/mapsindoorsrn/core/UtilsModule.java +227 -0
  9. package/android/src/main/java/com/mapsindoorsrn/core/models/BitmapStopIconConfig.java +22 -0
  10. package/android/src/main/java/com/mapsindoorsrn/core/models/Bounds.java +19 -0
  11. package/android/src/main/java/com/mapsindoorsrn/core/models/Filter.java +77 -0
  12. package/android/src/main/java/com/mapsindoorsrn/core/models/Location.java +17 -0
  13. package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraPosition.java +34 -0
  14. package/android/src/main/java/com/mapsindoorsrn/core/models/MPCameraUpdate.java +68 -0
  15. package/android/src/main/java/com/mapsindoorsrn/core/models/MPError.java +38 -0
  16. package/android/src/main/java/com/mapsindoorsrn/core/models/PositionProvider.java +46 -0
  17. package/android/src/main/java/com/mapsindoorsrn/core/models/PositionResult.java +117 -0
  18. package/android/src/main/java/com/mapsindoorsrn/core/models/Query.java +30 -0
  19. package/android/src/main/java/com/mapsindoorsrn/core/models/RouteStopIconConfigModel.java +35 -0
  20. package/ios/core/CameraPosition.swift +15 -0
  21. package/ios/core/CameraUpdate.swift +19 -0
  22. package/ios/core/CameraUpdateError.swift +11 -0
  23. package/ios/core/DirectionsRendererBridge.m +59 -0
  24. package/ios/core/DirectionsRendererModule.swift +359 -0
  25. package/ios/core/DirectionsServiceBridge.m +55 -0
  26. package/ios/core/DirectionsServiceModule.swift +186 -0
  27. package/ios/core/IconStopUrl.swift +17 -0
  28. package/ios/core/LabelGraphic.swift +15 -0
  29. package/ios/core/MPDisplayRuleBridge.m +696 -0
  30. package/ios/core/MPDisplayRuleModule.swift +1704 -0
  31. package/ios/core/MapControlBridge.m +213 -0
  32. package/ios/core/MapControlModule.swift +702 -0
  33. package/ios/core/MapsIndoorsBridge.m +128 -0
  34. package/ios/core/MapsIndoorsData.swift +288 -0
  35. package/ios/core/MapsIndoorsModule.swift +363 -0
  36. package/ios/core/RCMapView.swift +16 -0
  37. package/ios/core/README.md +3 -0
  38. package/ios/core/ReactPositionProvider.swift +27 -0
  39. package/ios/core/RouteIcon.swift +34 -0
  40. package/ios/core/UtilsBridge.m +73 -0
  41. package/ios/core/UtilsModule.swift +182 -0
  42. package/ios/core/helpers.swift +57 -0
  43. package/package.json +1 -1
  44. package/src/core/EventNames.ts +21 -0
  45. package/src/core/MPAdditionalDetail.ts +102 -0
  46. package/src/core/MPBadgePosition.ts +12 -0
  47. package/src/core/MPBounds.ts +155 -0
  48. package/src/core/MPBuilding.ts +333 -0
  49. package/src/core/MPBuildingCollection.ts +57 -0
  50. package/src/core/MPBuildingInfo.ts +63 -0
  51. package/src/core/MPCameraEvent.ts +17 -0
  52. package/src/core/MPCameraEventListener.ts +17 -0
  53. package/src/core/MPCameraPosition.ts +82 -0
  54. package/src/core/MPCameraUpdate.ts +174 -0
  55. package/src/core/MPCameraViewFitMode.ts +25 -0
  56. package/src/core/MPCategory.ts +85 -0
  57. package/src/core/MPCategoryCollection.ts +62 -0
  58. package/src/core/MPCollection.ts +59 -0
  59. package/src/core/MPCollisionHandling.ts +12 -0
  60. package/src/core/MPDailyOpeningHours.ts +67 -0
  61. package/src/core/MPDataField.ts +69 -0
  62. package/src/core/MPDetailType.ts +73 -0
  63. package/src/core/MPDirectionsRenderer.ts +238 -0
  64. package/src/core/MPDirectionsService.ts +152 -0
  65. package/src/core/MPDisplayRule.ts +1823 -0
  66. package/src/core/MPEntity.ts +60 -0
  67. package/src/core/MPEntityInfo.ts +28 -0
  68. package/src/core/MPError.ts +122 -0
  69. package/src/core/MPFeatureTypes.ts +8 -0
  70. package/src/core/MPFilter.ts +168 -0
  71. package/src/core/MPFilterBehavior.ts +115 -0
  72. package/src/core/MPFloor.ts +170 -0
  73. package/src/core/MPFloorSelectorInterface.ts +63 -0
  74. package/src/core/MPGeometry.ts +91 -0
  75. package/src/core/MPHighlightBehavior.ts +115 -0
  76. package/src/core/MPHighway.ts +14 -0
  77. package/src/core/MPIconPlacement.ts +13 -0
  78. package/src/core/MPIconSize.ts +39 -0
  79. package/src/core/MPLabelGraphic.ts +24 -0
  80. package/src/core/MPLabelPosition.ts +12 -0
  81. package/src/core/MPLabelType.ts +11 -0
  82. package/src/core/MPLocation.ts +440 -0
  83. package/src/core/MPLocationPropertyNames.ts +30 -0
  84. package/src/core/MPLocationSettings.ts +40 -0
  85. package/src/core/MPLocationType.ts +16 -0
  86. package/src/core/MPMapConfig.ts +280 -0
  87. package/src/core/MPMapStyle.ts +57 -0
  88. package/src/core/MPMultiPolygon.ts +218 -0
  89. package/src/core/MPOpeningHours.ts +48 -0
  90. package/src/core/MPPOIType.ts +43 -0
  91. package/src/core/MPPoint.ts +169 -0
  92. package/src/core/MPPolygon.ts +219 -0
  93. package/src/core/MPPositionProviderInterface.ts +45 -0
  94. package/src/core/MPPositionResultInterface.ts +42 -0
  95. package/src/core/MPPropertyData.ts +234 -0
  96. package/src/core/MPQuery.ts +69 -0
  97. package/src/core/MPRoute.ts +105 -0
  98. package/src/core/MPRouteCoordinate.ts +95 -0
  99. package/src/core/MPRouteLeg.ts +158 -0
  100. package/src/core/MPRouteProperty.ts +83 -0
  101. package/src/core/MPRouteStep.ts +186 -0
  102. package/src/core/MPRouteStopIconConfig.ts +82 -0
  103. package/src/core/MPSelectionBehavior.ts +114 -0
  104. package/src/core/MPSelectionMode.ts +4 -0
  105. package/src/core/MPSettings3D.ts +107 -0
  106. package/src/core/MPSize.ts +21 -0
  107. package/src/core/MPSolution.ts +189 -0
  108. package/src/core/MPSolutionConfig.ts +188 -0
  109. package/src/core/MPSolutionDisplayRule.ts +15 -0
  110. package/src/core/MPUserRole.ts +60 -0
  111. package/src/core/MPUserRoleCollection.ts +37 -0
  112. package/src/core/MPUtils.ts +178 -0
  113. package/src/core/MPVenue.ts +294 -0
  114. package/src/core/MPVenueCollection.ts +58 -0
  115. package/src/core/MPVenueInfo.ts +62 -0
  116. package/src/core/MPWeeklyOpeningHours.ts +129 -0
  117. package/src/core/MapControl.ts +961 -0
  118. package/src/core/MapView.tsx +34 -0
  119. package/src/core/MapsIndoors.ts +571 -0
  120. package/src/core/OnBuildingFoundAtCameraTargetListener.ts +17 -0
  121. package/src/core/OnFloorSelectionChangedListener.ts +17 -0
  122. package/src/core/OnFloorUpdateListener.ts +16 -0
  123. package/src/core/OnLegSelectedListener.ts +17 -0
  124. package/src/core/OnLiveLocationUpdateListener.ts +17 -0
  125. package/src/core/OnLocationSelectedListener.ts +17 -0
  126. package/src/core/OnMapClickListener.ts +20 -0
  127. package/src/core/OnMarkerClickListener.ts +17 -0
  128. package/src/core/OnMarkerInfoWindowClickListener.ts +17 -0
  129. package/src/core/OnPositionUpdateListener.ts +17 -0
  130. package/src/core/OnVenueFoundAtCameraTargetListener.ts +17 -0
  131. package/src/core/README.md +3 -0
  132. package/src/core/RouteStopIconConfig.ts +10 -0
@@ -0,0 +1,1699 @@
1
+ package com.mapsindoorsrn.core;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.facebook.react.bridge.Promise;
6
+ import com.facebook.react.bridge.ReactApplicationContext;
7
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
8
+ import com.facebook.react.bridge.ReactMethod;
9
+ import com.google.gson.Gson;
10
+ import com.mapsindoors.core.MPBadgePosition;
11
+ import com.mapsindoors.core.MPDisplayRule;
12
+ import com.mapsindoors.core.MPIconPlacement;
13
+ import com.mapsindoors.core.MPLabelPosition;
14
+ import com.mapsindoors.core.MPIconSize;
15
+ import com.mapsindoors.core.MPLabelGraphic;
16
+ import com.mapsindoors.core.MPLabelType;
17
+ import com.mapsindoors.core.MPSolutionDisplayRule;
18
+ import com.mapsindoors.core.MapsIndoors;
19
+ import com.mapsindoors.core.errors.MIError;
20
+ import com.mapsindoors.core.errors.MIErrorEnum;
21
+ import com.mapsindoorsrn.core.models.MPError;
22
+
23
+ public class MPDisplayRuleModule extends ReactContextBaseJavaModule {
24
+ private final Gson gson = new Gson();
25
+
26
+ public MPDisplayRuleModule(@NonNull ReactApplicationContext reactContext) {
27
+ super(reactContext);
28
+ }
29
+
30
+ @NonNull
31
+ @Override
32
+ public String getName() {
33
+ return "DisplayRule";
34
+ }
35
+
36
+ private void reject(Promise promise, String id) {
37
+ promise.reject("DisplayRuleError",
38
+ gson.toJson(MPError.fromMIError(
39
+ new MIError(MIErrorEnum.UNKNOWN_ERROR,
40
+ "The DisplayRule (id: "+ id +") cannot be found"))));
41
+ }
42
+
43
+ private MPDisplayRule getRule(String name) {
44
+ switch (name) {
45
+ case "buildingOutline" : return MapsIndoors.getDisplayRule(MPSolutionDisplayRule.BUILDING_OUTLINE);
46
+ case "selectionHighlight": return MapsIndoors.getDisplayRule(MPSolutionDisplayRule.SELECTION_HIGHLIGHT);
47
+ case "positionIndicator": return MapsIndoors.getDisplayRule(MPSolutionDisplayRule.POSITION_INDICATOR);
48
+ default: return MapsIndoors.getDisplayRule(name);
49
+ }
50
+ }
51
+
52
+ @ReactMethod
53
+ public void isVisible(String displayRuleId, final Promise promise) {
54
+ MPDisplayRule displayRule = getRule(displayRuleId);
55
+ if (displayRule != null) {
56
+ promise.resolve(displayRule.isVisible());
57
+ } else {
58
+ reject(promise, displayRuleId);
59
+ }
60
+ }
61
+
62
+ @ReactMethod
63
+ public void setVisible(String displayRuleId, String isVisible, final Promise promise) {
64
+ MPDisplayRule displayRule = getRule(displayRuleId);
65
+ if (displayRule != null) {
66
+ displayRule.setVisible(Boolean.valueOf(isVisible));
67
+ promise.resolve(null);
68
+ } else {
69
+ reject(promise, displayRuleId);
70
+ }
71
+ }
72
+
73
+ @ReactMethod
74
+ public void isIconVisible(String displayRuleId, final Promise promise) {
75
+ MPDisplayRule displayRule = getRule(displayRuleId);
76
+ if (displayRule != null) {
77
+ promise.resolve(displayRule.isIconVisible());
78
+ } else {
79
+ reject(promise, displayRuleId);
80
+ }
81
+ }
82
+
83
+ @ReactMethod
84
+ public void setIconVisible(String displayRuleId, String iconVisible, final Promise promise) {
85
+ MPDisplayRule displayRule = getRule(displayRuleId);
86
+ if (displayRule != null) {
87
+ displayRule.setIconVisible(Boolean.valueOf(iconVisible));
88
+ promise.resolve(null);
89
+ } else {
90
+ reject(promise, displayRuleId);
91
+ }
92
+ }
93
+
94
+ @ReactMethod
95
+ public void isPolygonVisible(String displayRuleId, final Promise promise) {
96
+ MPDisplayRule displayRule = getRule(displayRuleId);
97
+ if (displayRule != null) {
98
+ promise.resolve(displayRule.isPolygonVisible());
99
+ } else {
100
+ reject(promise, displayRuleId);
101
+ }
102
+ }
103
+
104
+ @ReactMethod
105
+ public void setPolygonVisible(String displayRuleId, String polygonVisible, final Promise promise) {
106
+ MPDisplayRule displayRule = getRule(displayRuleId);
107
+ if (displayRule != null) {
108
+ displayRule.setPolygonVisible(Boolean.valueOf(polygonVisible));
109
+ promise.resolve(null);
110
+ } else {
111
+ reject(promise, displayRuleId);
112
+ }
113
+ }
114
+
115
+ @ReactMethod
116
+ public void isLabelVisible(String displayRuleId, final Promise promise) {
117
+ MPDisplayRule displayRule = getRule(displayRuleId);
118
+ if (displayRule != null) {
119
+ promise.resolve(displayRule.isLabelVisible());
120
+ } else {
121
+ reject(promise, displayRuleId);
122
+ }
123
+ }
124
+
125
+ @ReactMethod
126
+ public void setLabelVisible(String displayRuleId, String labelVisible, final Promise promise) {
127
+ MPDisplayRule displayRule = getRule(displayRuleId);
128
+ if (displayRule != null) {
129
+ displayRule.setLabelVisible(Boolean.valueOf(labelVisible));
130
+ promise.resolve(null);
131
+ } else {
132
+ reject(promise, displayRuleId);
133
+ }
134
+ }
135
+
136
+ @ReactMethod
137
+ public void isModel2DVisible(String displayRuleId, final Promise promise) {
138
+ MPDisplayRule displayRule = getRule(displayRuleId);
139
+ if (displayRule != null) {
140
+ promise.resolve(displayRule.isModel2DVisible());
141
+ } else {
142
+ reject(promise, displayRuleId);
143
+ }
144
+ }
145
+
146
+ @ReactMethod
147
+ public void setModel2DVisible(String displayRuleId, String model2DVisible, final Promise promise) {
148
+ MPDisplayRule displayRule = getRule(displayRuleId);
149
+ if (displayRule != null) {
150
+ displayRule.setModel2DVisible(Boolean.valueOf(model2DVisible));
151
+ promise.resolve(null);
152
+ } else {
153
+ reject(promise, displayRuleId);
154
+ }
155
+ }
156
+
157
+ @ReactMethod
158
+ public void isWallVisible(String displayRuleId, final Promise promise) {
159
+ MPDisplayRule displayRule = getRule(displayRuleId);
160
+ if (displayRule != null) {
161
+ promise.resolve(displayRule.isWallVisible());
162
+ } else {
163
+ reject(promise, displayRuleId);
164
+ }
165
+ }
166
+
167
+ @ReactMethod
168
+ public void setWallVisible(String displayRuleId, String wallVisible, final Promise promise) {
169
+ MPDisplayRule displayRule = getRule(displayRuleId);
170
+ if (displayRule != null) {
171
+ displayRule.setWallVisible(Boolean.valueOf(wallVisible));
172
+ promise.resolve(null);
173
+ } else {
174
+ reject(promise, displayRuleId);
175
+ }
176
+ }
177
+
178
+ @ReactMethod
179
+ public void isExtrusionVisible(String displayRuleId, final Promise promise) {
180
+ MPDisplayRule displayRule = getRule(displayRuleId);
181
+ if (displayRule != null) {
182
+ promise.resolve(displayRule.isExtrusionVisible());
183
+ } else {
184
+ reject(promise, displayRuleId);
185
+ }
186
+ }
187
+
188
+ @ReactMethod
189
+ public void setExtrusionVisible(String displayRuleId, String extrusionVisible, final Promise promise) {
190
+ MPDisplayRule displayRule = getRule(displayRuleId);
191
+ if (displayRule != null) {
192
+ displayRule.setExtrusionVisible(Boolean.valueOf(extrusionVisible));
193
+ promise.resolve(null);
194
+ } else {
195
+ reject(promise, displayRuleId);
196
+ }
197
+ }
198
+
199
+ @ReactMethod
200
+ public void getZoomFrom(String displayRuleId, final Promise promise) {
201
+ MPDisplayRule displayRule = getRule(displayRuleId);
202
+ if (displayRule != null) {
203
+ promise.resolve(displayRule.getZoomFrom());
204
+ } else {
205
+ reject(promise, displayRuleId);
206
+ }
207
+ }
208
+
209
+ @ReactMethod
210
+ public void setZoomFrom(String displayRuleId, Double zoomFrom, final Promise promise) {
211
+ MPDisplayRule displayRule = getRule(displayRuleId);
212
+ if (displayRule != null) {
213
+ if (zoomFrom == -1) {
214
+ displayRule.setZoomFrom(null);
215
+ }else {
216
+ displayRule.setZoomFrom(zoomFrom.floatValue());
217
+ }
218
+ promise.resolve(null);
219
+ } else {
220
+ reject(promise, displayRuleId);
221
+ }
222
+ }
223
+
224
+ @ReactMethod
225
+ public void getZoomTo(String displayRuleId, final Promise promise) {
226
+ MPDisplayRule displayRule = getRule(displayRuleId);
227
+ if (displayRule != null) {
228
+ promise.resolve(displayRule.getZoomTo());
229
+ } else {
230
+ reject(promise, displayRuleId);
231
+ }
232
+ }
233
+
234
+ @ReactMethod
235
+ public void setZoomTo(String displayRuleId, Double zoomTo, final Promise promise) {
236
+ MPDisplayRule displayRule = getRule(displayRuleId);
237
+ if (displayRule != null) {
238
+ if (zoomTo == -1) {
239
+ displayRule.setZoomTo(null);
240
+ }else {
241
+ displayRule.setZoomTo(zoomTo.floatValue());
242
+ }
243
+ promise.resolve(null);
244
+ } else {
245
+ reject(promise, displayRuleId);
246
+ }
247
+ }
248
+
249
+ @ReactMethod
250
+ public void getIconUrl(String displayRuleId, final Promise promise) {
251
+ MPDisplayRule displayRule = getRule(displayRuleId);
252
+ if (displayRule != null) {
253
+ promise.resolve(displayRule.getIconUrl());
254
+ } else {
255
+ reject(promise, displayRuleId);
256
+ }
257
+ }
258
+
259
+ @ReactMethod
260
+ public void setIcon(String displayRuleId, String url, final Promise promise) {
261
+ MPDisplayRule displayRule = getRule(displayRuleId);
262
+ if (displayRule != null) {
263
+ displayRule.setIcon(url);
264
+ promise.resolve(null);
265
+ } else {
266
+ reject(promise, displayRuleId);
267
+ }
268
+ }
269
+
270
+ @ReactMethod
271
+ public void getIconSize(String displayRuleId, final Promise promise) {
272
+ MPDisplayRule displayRule = getRule(displayRuleId);
273
+ if (displayRule != null) {
274
+ String iconSizeString = gson.toJson(displayRule.getIconSize());
275
+ promise.resolve(iconSizeString);
276
+ } else {
277
+ reject(promise, displayRuleId);
278
+ }
279
+ }
280
+
281
+ @ReactMethod
282
+ public void setIconSize(String displayRuleId, String iconSizeString, final Promise promise) {
283
+ MPDisplayRule displayRule = getRule(displayRuleId);
284
+ if (displayRule != null) {
285
+ MPIconSize iconSize = gson.fromJson(iconSizeString, MPIconSize.class);
286
+ displayRule.setIconSize(iconSize.getWidth(), iconSize.getHeight());
287
+ promise.resolve(null);
288
+ } else {
289
+ reject(promise, displayRuleId);
290
+ }
291
+ }
292
+
293
+ @ReactMethod
294
+ public void getLabel(String displayRuleId, final Promise promise) {
295
+ MPDisplayRule displayRule = getRule(displayRuleId);
296
+ if (displayRule != null) {
297
+ promise.resolve(displayRule.getLabel());
298
+ } else {
299
+ reject(promise, displayRuleId);
300
+ }
301
+ }
302
+
303
+ @ReactMethod
304
+ public void setLabel(String displayRuleId, String label, final Promise promise) {
305
+ MPDisplayRule displayRule = getRule(displayRuleId);
306
+ if (displayRule != null) {
307
+ displayRule.setLabel(label);
308
+ promise.resolve(null);
309
+ } else {
310
+ reject(promise, displayRuleId);
311
+ }
312
+ }
313
+
314
+ @ReactMethod
315
+ public void getLabelZoomFrom(String displayRuleId, final Promise promise) {
316
+ MPDisplayRule displayRule = getRule(displayRuleId);
317
+ if (displayRule != null) {
318
+ promise.resolve(displayRule.getLabelZoomFrom());
319
+ } else {
320
+ reject(promise, displayRuleId);
321
+ }
322
+ }
323
+
324
+ @ReactMethod
325
+ public void setLabelZoomFrom(String displayRuleId, Double zoomFrom, final Promise promise) {
326
+ MPDisplayRule displayRule = getRule(displayRuleId);
327
+ if (displayRule != null) {
328
+ if (zoomFrom == -1) {
329
+ displayRule.setLabelZoomFrom(null);
330
+ }else {
331
+ displayRule.setLabelZoomFrom(zoomFrom.floatValue());
332
+ }
333
+ promise.resolve(null);
334
+ } else {
335
+ reject(promise, displayRuleId);
336
+ }
337
+ }
338
+
339
+ @ReactMethod
340
+ public void getLabelZoomTo(String displayRuleId, final Promise promise) {
341
+ MPDisplayRule displayRule = getRule(displayRuleId);
342
+ if (displayRule != null) {
343
+ promise.resolve(displayRule.getLabelZoomTo());
344
+ } else {
345
+ reject(promise, displayRuleId);
346
+ }
347
+ }
348
+
349
+ @ReactMethod
350
+ public void setLabelZoomTo(String displayRuleId, Double zoomTo, final Promise promise) {
351
+ MPDisplayRule displayRule = getRule(displayRuleId);
352
+ if (displayRule != null) {
353
+ if (zoomTo == -1) {
354
+ displayRule.setLabelZoomTo(null);
355
+ }else {
356
+ displayRule.setLabelZoomTo(zoomTo.floatValue());
357
+ }
358
+ promise.resolve(null);
359
+ } else {
360
+ reject(promise, displayRuleId);
361
+ }
362
+ }
363
+
364
+ @ReactMethod
365
+ public void getLabelMaxWidth(String displayRuleId, final Promise promise) {
366
+ MPDisplayRule displayRule = getRule(displayRuleId);
367
+ if (displayRule != null) {
368
+ promise.resolve(displayRule.getLabelMaxWidth());
369
+ } else {
370
+ reject(promise, displayRuleId);
371
+ }
372
+ }
373
+
374
+ @ReactMethod
375
+ public void setLabelMaxWidth(String displayRuleId, Double labelMaxWidth, final Promise promise) {
376
+ MPDisplayRule displayRule = getRule(displayRuleId);
377
+ if (displayRule != null) {
378
+ if (labelMaxWidth == -1) {
379
+ displayRule.setLabelMaxWidth(null);
380
+ }else {
381
+ displayRule.setLabelMaxWidth(labelMaxWidth.intValue());
382
+ }
383
+ promise.resolve(null);
384
+ } else {
385
+ reject(promise, displayRuleId);
386
+ }
387
+ }
388
+
389
+ @ReactMethod
390
+ public void getPolygonZoomFrom(String displayRuleId, final Promise promise) {
391
+ MPDisplayRule displayRule = getRule(displayRuleId);
392
+ if (displayRule != null) {
393
+ promise.resolve(displayRule.getPolygonZoomFrom());
394
+ } else {
395
+ reject(promise, displayRuleId);
396
+ }
397
+ }
398
+
399
+ @ReactMethod
400
+ public void setPolygonZoomFrom(String displayRuleId, Double zoomFrom, final Promise promise) {
401
+ MPDisplayRule displayRule = getRule(displayRuleId);
402
+ if (displayRule != null) {
403
+ if (zoomFrom == -1) {
404
+ displayRule.setPolygonZoomFrom(null);
405
+ }else {
406
+ displayRule.setPolygonZoomFrom(zoomFrom.floatValue());
407
+ }
408
+ promise.resolve(null);
409
+ } else {
410
+ reject(promise, displayRuleId);
411
+ }
412
+ }
413
+
414
+ @ReactMethod
415
+ public void getPolygonZoomTo(String displayRuleId, final Promise promise) {
416
+ MPDisplayRule displayRule = getRule(displayRuleId);
417
+ if (displayRule != null) {
418
+ promise.resolve(displayRule.getPolygonZoomTo());
419
+ } else {
420
+ reject(promise, displayRuleId);
421
+ }
422
+ }
423
+
424
+ @ReactMethod
425
+ public void setPolygonZoomTo(String displayRuleId, Double polygonZoomTo, final Promise promise) {
426
+ MPDisplayRule displayRule = getRule(displayRuleId);
427
+ if (displayRule != null) {
428
+ if (polygonZoomTo == -1) {
429
+ displayRule.setPolygonZoomTo(null);
430
+ }else {
431
+ displayRule.setPolygonZoomTo(polygonZoomTo.floatValue());
432
+ }
433
+ promise.resolve(null);
434
+ } else {
435
+ reject(promise, displayRuleId);
436
+ }
437
+ }
438
+
439
+ @ReactMethod
440
+ public void getPolygonStrokeWidth(String displayRuleId, final Promise promise) {
441
+ MPDisplayRule displayRule = getRule(displayRuleId);
442
+ if (displayRule != null) {
443
+ promise.resolve(displayRule.getPolygonStrokeWidth());
444
+ } else {
445
+ reject(promise, displayRuleId);
446
+ }
447
+ }
448
+
449
+ @ReactMethod
450
+ public void setPolygonStrokeWidth(String displayRuleId, Double strokeWidth, final Promise promise) {
451
+ MPDisplayRule displayRule = getRule(displayRuleId);
452
+ if (displayRule != null) {
453
+ if (strokeWidth == -1) {
454
+ displayRule.setPolygonStrokeWidth(null);
455
+ }else {
456
+ displayRule.setPolygonStrokeWidth(strokeWidth.floatValue());
457
+ }
458
+ promise.resolve(null);
459
+ } else {
460
+ reject(promise, displayRuleId);
461
+ }
462
+ }
463
+
464
+ @ReactMethod
465
+ public void getPolygonStrokeColor(String displayRuleId, final Promise promise) {
466
+ MPDisplayRule displayRule = getRule(displayRuleId);
467
+ if (displayRule != null) {
468
+ promise.resolve(displayRule.getPolygonStrokeColor());
469
+ } else {
470
+ reject(promise, displayRuleId);
471
+ }
472
+ }
473
+
474
+ @ReactMethod
475
+ public void setPolygonStrokeColor(String displayRuleId, String polygonStrokeColor, final Promise promise) {
476
+ MPDisplayRule displayRule = getRule(displayRuleId);
477
+ if (displayRule != null) {
478
+ displayRule.setPolygonStrokeColor(polygonStrokeColor);
479
+ promise.resolve(null);
480
+ } else {
481
+ reject(promise, displayRuleId);
482
+ }
483
+ }
484
+
485
+ @ReactMethod
486
+ public void getPolygonStrokeOpacity(String displayRuleId, final Promise promise) {
487
+ MPDisplayRule displayRule = getRule(displayRuleId);
488
+ if (displayRule != null) {
489
+ promise.resolve(displayRule.getPolygonStrokeOpacity());
490
+ } else {
491
+ reject(promise, displayRuleId);
492
+ }
493
+ }
494
+
495
+ @ReactMethod
496
+ public void setPolygonStrokeOpacity(String displayRuleId, Double polygonStrokeOpacity, final Promise promise) {
497
+ MPDisplayRule displayRule = getRule(displayRuleId);
498
+ if (displayRule != null) {
499
+ if (polygonStrokeOpacity == -1) {
500
+ displayRule.setPolygonStrokeOpacity(null);
501
+ }else {
502
+ displayRule.setPolygonStrokeOpacity(polygonStrokeOpacity.floatValue());
503
+ }
504
+ promise.resolve(null);
505
+ } else {
506
+ reject(promise, displayRuleId);
507
+ }
508
+ }
509
+
510
+ @ReactMethod
511
+ public void getPolygonFillOpacity(String displayRuleId, final Promise promise) {
512
+ MPDisplayRule displayRule = getRule(displayRuleId);
513
+ if (displayRule != null) {
514
+ promise.resolve(displayRule.getPolygonFillOpacity());
515
+ } else {
516
+ reject(promise, displayRuleId);
517
+ }
518
+ }
519
+
520
+ @ReactMethod
521
+ public void setPolygonFillOpacity(String displayRuleId, Double polygonFillOpacity, final Promise promise) {
522
+ MPDisplayRule displayRule = getRule(displayRuleId);
523
+ if (displayRule != null) {
524
+ if (polygonFillOpacity == -1) {
525
+ displayRule.setPolygonFillOpacity(null);
526
+ }else {
527
+ displayRule.setPolygonFillOpacity(polygonFillOpacity.floatValue());
528
+ }
529
+ promise.resolve(null);
530
+ } else {
531
+ reject(promise, displayRuleId);
532
+ }
533
+ }
534
+
535
+ @ReactMethod
536
+ public void getPolygonFillColor(String displayRuleId, final Promise promise) {
537
+ MPDisplayRule displayRule = getRule(displayRuleId);
538
+ if (displayRule != null) {
539
+ promise.resolve(displayRule.getPolygonFillColor());
540
+ } else {
541
+ reject(promise, displayRuleId);
542
+ }
543
+ }
544
+
545
+ @ReactMethod
546
+ public void setPolygonFillColor(String displayRuleId, String polygonFillColor, final Promise promise) {
547
+ MPDisplayRule displayRule = getRule(displayRuleId);
548
+ if (displayRule != null) {
549
+ displayRule.setPolygonFillColor(polygonFillColor);
550
+ promise.resolve(null);
551
+ } else {
552
+ reject(promise, displayRuleId);
553
+ }
554
+ }
555
+
556
+ @ReactMethod
557
+ public void getWallColor(String displayRuleId, final Promise promise) {
558
+ MPDisplayRule displayRule = getRule(displayRuleId);
559
+ if (displayRule != null) {
560
+ promise.resolve(displayRule.getWallColor());
561
+ } else {
562
+ reject(promise, displayRuleId);
563
+ }
564
+ }
565
+
566
+ @ReactMethod
567
+ public void setWallColor(String displayRuleId, String wallColor, final Promise promise) {
568
+ MPDisplayRule displayRule = getRule(displayRuleId);
569
+ if (displayRule != null) {
570
+ displayRule.setWallColor(wallColor);
571
+ promise.resolve(null);
572
+ } else {
573
+ reject(promise, displayRuleId);
574
+ }
575
+ }
576
+
577
+ @ReactMethod
578
+ public void getWallHeight(String displayRuleId, final Promise promise) {
579
+ MPDisplayRule displayRule = getRule(displayRuleId);
580
+ if (displayRule != null) {
581
+ promise.resolve(displayRule.getWallHeight());
582
+ } else {
583
+ reject(promise, displayRuleId);
584
+ }
585
+ }
586
+
587
+ @ReactMethod
588
+ public void setWallHeight(String displayRuleId, Double wallHeight, final Promise promise) {
589
+ MPDisplayRule displayRule = getRule(displayRuleId);
590
+ if (displayRule != null) {
591
+ if (wallHeight == -1) {
592
+ displayRule.setWallHeight(null);
593
+ }else {
594
+ displayRule.setWallHeight(wallHeight.floatValue());
595
+ }
596
+ promise.resolve(null);
597
+ } else {
598
+ reject(promise, displayRuleId);
599
+ }
600
+ }
601
+
602
+ @ReactMethod
603
+ public void getWallZoomFrom(String displayRuleId, final Promise promise) {
604
+ MPDisplayRule displayRule = getRule(displayRuleId);
605
+ if (displayRule != null) {
606
+ promise.resolve(displayRule.getWallZoomFrom());
607
+ } else {
608
+ reject(promise, displayRuleId);
609
+ }
610
+ }
611
+
612
+ @ReactMethod
613
+ public void setWallZoomFrom(String displayRuleId, Double zoomFrom, final Promise promise) {
614
+ MPDisplayRule displayRule = getRule(displayRuleId);
615
+ if (displayRule != null) {
616
+ if (zoomFrom == -1) {
617
+ displayRule.setWallZoomFrom(null);
618
+ }else {
619
+ displayRule.setWallZoomFrom(zoomFrom.floatValue());
620
+ }
621
+ promise.resolve(null);
622
+ } else {
623
+ reject(promise, displayRuleId);
624
+ }
625
+ }
626
+
627
+ @ReactMethod
628
+ public void getWallZoomTo(String displayRuleId, final Promise promise) {
629
+ MPDisplayRule displayRule = getRule(displayRuleId);
630
+ if (displayRule != null) {
631
+ promise.resolve(displayRule.getWallZoomTo());
632
+ } else {
633
+ reject(promise, displayRuleId);
634
+ }
635
+ }
636
+
637
+ @ReactMethod
638
+ public void setWallZoomTo(String displayRuleId, Double zoomTo, final Promise promise) {
639
+ MPDisplayRule displayRule = getRule(displayRuleId);
640
+ if (displayRule != null) {
641
+ if (zoomTo == -1) {
642
+ displayRule.setWallZoomTo(null);
643
+ }else {
644
+ displayRule.setWallZoomTo(zoomTo.floatValue());
645
+ }
646
+ promise.resolve(null);
647
+ } else {
648
+ reject(promise, displayRuleId);
649
+ }
650
+ }
651
+
652
+ @ReactMethod
653
+ public void getExtrusionColor(String displayRuleId, final Promise promise) {
654
+ MPDisplayRule displayRule = getRule(displayRuleId);
655
+ if (displayRule != null) {
656
+ promise.resolve(displayRule.getExtrusionColor());
657
+ } else {
658
+ reject(promise, displayRuleId);
659
+ }
660
+ }
661
+
662
+ @ReactMethod
663
+ public void setExtrusionColor(String displayRuleId, String extrusionColor, final Promise promise) {
664
+ MPDisplayRule displayRule = getRule(displayRuleId);
665
+ if (displayRule != null) {
666
+ displayRule.setExtrusionColor(extrusionColor);
667
+ promise.resolve(null);
668
+ } else {
669
+ reject(promise, displayRuleId);
670
+ }
671
+ }
672
+
673
+ @ReactMethod
674
+ public void getExtrusionHeight(String displayRuleId, final Promise promise) {
675
+ MPDisplayRule displayRule = getRule(displayRuleId);
676
+ if (displayRule != null) {
677
+ promise.resolve(displayRule.getExtrusionHeight());
678
+ } else {
679
+ reject(promise, displayRuleId);
680
+ }
681
+ }
682
+
683
+ @ReactMethod
684
+ public void setExtrusionHeight(String displayRuleId, Double extrusionHeight, final Promise promise) {
685
+ MPDisplayRule displayRule = getRule(displayRuleId);
686
+ if (displayRule != null) {
687
+ if (extrusionHeight == -1) {
688
+ displayRule.setExtrusionHeight(null);
689
+ }else {
690
+ displayRule.setExtrusionHeight(extrusionHeight.floatValue());
691
+ }
692
+ promise.resolve(null);
693
+ } else {
694
+ reject(promise, displayRuleId);
695
+ }
696
+ }
697
+
698
+ @ReactMethod
699
+ public void getExtrusionZoomFrom(String displayRuleId, final Promise promise) {
700
+ MPDisplayRule displayRule = getRule(displayRuleId);
701
+ if (displayRule != null) {
702
+ promise.resolve(displayRule.getExtrusionZoomFrom());
703
+ } else {
704
+ reject(promise, displayRuleId);
705
+ }
706
+ }
707
+
708
+ @ReactMethod
709
+ public void setExtrusionZoomFrom(String displayRuleId, Double zoomFrom, final Promise promise) {
710
+ MPDisplayRule displayRule = getRule(displayRuleId);
711
+ if (displayRule != null) {
712
+ if (zoomFrom == -1) {
713
+ displayRule.setExtrusionZoomFrom(null);
714
+ }else {
715
+ displayRule.setExtrusionZoomFrom(zoomFrom.floatValue());
716
+ }
717
+ promise.resolve(null);
718
+ } else {
719
+ reject(promise, displayRuleId);
720
+ }
721
+ }
722
+
723
+ @ReactMethod
724
+ public void getExtrusionZoomTo(String displayRuleId, final Promise promise) {
725
+ MPDisplayRule displayRule = getRule(displayRuleId);
726
+ if (displayRule != null) {
727
+ promise.resolve(displayRule.getExtrusionZoomTo());
728
+ } else {
729
+ reject(promise, displayRuleId);
730
+ }
731
+ }
732
+
733
+ @ReactMethod
734
+ public void setExtrusionZoomTo(String displayRuleId, Double zoomTo, final Promise promise) {
735
+ MPDisplayRule displayRule = getRule(displayRuleId);
736
+ if (displayRule != null) {
737
+ if (zoomTo == -1) {
738
+ displayRule.setWallZoomTo(null);
739
+ }else {
740
+ displayRule.setExtrusionZoomTo(zoomTo.floatValue());
741
+ }
742
+ promise.resolve(null);
743
+ } else {
744
+ reject(promise, displayRuleId);
745
+ }
746
+ }
747
+
748
+ @ReactMethod
749
+ public void getModel2DZoomFrom(String displayRuleId, final Promise promise) {
750
+ MPDisplayRule displayRule = getRule(displayRuleId);
751
+ if (displayRule != null) {
752
+ promise.resolve(displayRule.getModel2DZoomFrom());
753
+ } else {
754
+ reject(promise, displayRuleId);
755
+ }
756
+ }
757
+
758
+ @ReactMethod
759
+ public void setModel2DZoomFrom(String displayRuleId, Double zoomFrom, final Promise promise) {
760
+ MPDisplayRule displayRule = getRule(displayRuleId);
761
+ if (displayRule != null) {
762
+ if (zoomFrom == -1) {
763
+ displayRule.setModel2DZoomFrom(null);
764
+ }else {
765
+ displayRule.setModel2DZoomFrom(zoomFrom.floatValue());
766
+ }
767
+ promise.resolve(null);
768
+ } else {
769
+ reject(promise, displayRuleId);
770
+ }
771
+ }
772
+
773
+ @ReactMethod
774
+ public void getModel2DZoomTo(String displayRuleId, final Promise promise) {
775
+ MPDisplayRule displayRule = getRule(displayRuleId);
776
+ if (displayRule != null) {
777
+ promise.resolve(displayRule.getModel2DZoomTo());
778
+ } else {
779
+ reject(promise, displayRuleId);
780
+ }
781
+ }
782
+
783
+ @ReactMethod
784
+ public void setModel2DZoomTo(String displayRuleId, Double zoomTo, final Promise promise) {
785
+ MPDisplayRule displayRule = getRule(displayRuleId);
786
+ if (displayRule != null) {
787
+ if (zoomTo == -1) {
788
+ displayRule.setModel2DZoomTo(null);
789
+ }else {
790
+ displayRule.setModel2DZoomTo(zoomTo.floatValue());
791
+ }
792
+ promise.resolve(null);
793
+ } else {
794
+ reject(promise, displayRuleId);
795
+ }
796
+ }
797
+
798
+ @ReactMethod
799
+ public void getModel2DWidthMeters(String displayRuleId, final Promise promise) {
800
+ MPDisplayRule displayRule = getRule(displayRuleId);
801
+ if (displayRule != null) {
802
+ promise.resolve(displayRule.getModel2DWidthMeters());
803
+ } else {
804
+ reject(promise, displayRuleId);
805
+ }
806
+ }
807
+
808
+ @ReactMethod
809
+ public void setModel2DWidthMeters(String displayRuleId, Double width, final Promise promise) {
810
+ MPDisplayRule displayRule = getRule(displayRuleId);
811
+ if (displayRule != null) {
812
+ if (width == -1) {
813
+ displayRule.setModel2DWidthMeters(null);
814
+ }else {
815
+ displayRule.setModel2DWidthMeters(width);
816
+ }
817
+ promise.resolve(null);
818
+ } else {
819
+ reject(promise, displayRuleId);
820
+ }
821
+ }
822
+
823
+ @ReactMethod
824
+ public void getModel2DHeightMeters(String displayRuleId, final Promise promise) {
825
+ MPDisplayRule displayRule = getRule(displayRuleId);
826
+ if (displayRule != null) {
827
+ promise.resolve(displayRule.getModel2DHeightMeters());
828
+ } else {
829
+ reject(promise, displayRuleId);
830
+ }
831
+ }
832
+
833
+ @ReactMethod
834
+ public void setModel2DHeightMeters(String displayRuleId, Double height, final Promise promise) {
835
+ MPDisplayRule displayRule = getRule(displayRuleId);
836
+ if (displayRule != null) {
837
+ if (height == -1) {
838
+ displayRule.setModel2DHeightMeters(null);
839
+ }else {
840
+ displayRule.setModel2DHeightMeters(height);
841
+ }
842
+ promise.resolve(null);
843
+ } else {
844
+ reject(promise, displayRuleId);
845
+ }
846
+ }
847
+
848
+ @ReactMethod
849
+ public void getModel2DBearing(String displayRuleId, final Promise promise) {
850
+ MPDisplayRule displayRule = getRule(displayRuleId);
851
+ if (displayRule != null) {
852
+ promise.resolve(displayRule.getModel2DBearing());
853
+ } else {
854
+ reject(promise, displayRuleId);
855
+ }
856
+ }
857
+
858
+ @ReactMethod
859
+ public void setModel2DBearing(String displayRuleId, Double bearing, final Promise promise) {
860
+ MPDisplayRule displayRule = getRule(displayRuleId);
861
+ if (displayRule != null) {
862
+ if (bearing == -1) {
863
+ displayRule.setModel2DBearing(null);
864
+ }else {
865
+ displayRule.setModel2DBearing(bearing);
866
+ }
867
+ promise.resolve(null);
868
+ } else {
869
+ reject(promise, displayRuleId);
870
+ }
871
+ }
872
+
873
+ @ReactMethod
874
+ public void getModel2DModel(String displayRuleId, final Promise promise) {
875
+ MPDisplayRule displayRule = getRule(displayRuleId);
876
+ if (displayRule != null) {
877
+ promise.resolve(displayRule.getModel2DModel());
878
+ } else {
879
+ reject(promise, displayRuleId);
880
+ }
881
+ }
882
+
883
+ @ReactMethod
884
+ public void setModel2DModel(String displayRuleId, String model, final Promise promise) {
885
+ MPDisplayRule displayRule = getRule(displayRuleId);
886
+ if (displayRule != null) {
887
+ displayRule.setModel2DModel(model);
888
+ promise.resolve(null);
889
+ } else {
890
+ reject(promise, displayRuleId);
891
+ }
892
+ }
893
+
894
+ @ReactMethod
895
+ public void getIconScale(String displayRuleId, final Promise promise) {
896
+ MPDisplayRule displayRule = getRule(displayRuleId);
897
+ if (displayRule != null) {
898
+ promise.resolve(displayRule.getIconScale());
899
+ } else {
900
+ reject(promise, displayRuleId);
901
+ }
902
+ }
903
+
904
+ @ReactMethod
905
+ public void setIconScale(String displayRuleId, Double scale, final Promise promise) {
906
+ MPDisplayRule displayRule = getRule(displayRuleId);
907
+ if (displayRule != null) {
908
+ if (scale == -1) {
909
+ displayRule.setIconScale(null);
910
+ }else {
911
+ displayRule.setIconScale(scale.floatValue());
912
+ }
913
+ promise.resolve(null);
914
+ } else {
915
+ reject(promise, displayRuleId);
916
+ }
917
+ }
918
+
919
+ @ReactMethod
920
+ public void getIconPlacement(String displayRuleId, final Promise promise) {
921
+ MPDisplayRule displayRule = getRule(displayRuleId);
922
+ if (displayRule != null) {
923
+ promise.resolve(displayRule.getIconPlacement() != null ? displayRule.getIconPlacement().ordinal() : null);
924
+ } else {
925
+ reject(promise, displayRuleId);
926
+ }
927
+ }
928
+
929
+ @ReactMethod
930
+ public void setIconPlacement(String displayRuleId, Integer placement, final Promise promise) {
931
+ MPDisplayRule displayRule = getRule(displayRuleId);
932
+ if (displayRule != null) {
933
+ if (placement == -1) {
934
+ displayRule.setIconPlacement(null);
935
+ }else {
936
+ MPIconPlacement iconPlacement;
937
+ switch (placement) {
938
+ case 1:
939
+ iconPlacement = MPIconPlacement.ABOVE;
940
+ break;
941
+ case 2:
942
+ iconPlacement = MPIconPlacement.BELOW;
943
+ break;
944
+ case 3:
945
+ iconPlacement = MPIconPlacement.LEFT;
946
+ break;
947
+ case 4:
948
+ iconPlacement = MPIconPlacement.RIGHT;
949
+ break;
950
+ default:
951
+ iconPlacement = MPIconPlacement.CENTER;
952
+ break;
953
+ }
954
+ displayRule.setIconPlacement(iconPlacement);
955
+ }
956
+ promise.resolve(null);
957
+ } else {
958
+ reject(promise, displayRuleId);
959
+ }
960
+ }
961
+
962
+ @ReactMethod
963
+ public void getLabelType(String displayRuleId, final Promise promise) {
964
+ MPDisplayRule displayRule = getRule(displayRuleId);
965
+ if (displayRule != null) {
966
+ promise.resolve(displayRule.getLabelType() != null ? displayRule.getLabelType().ordinal() : null);
967
+ } else {
968
+ reject(promise, displayRuleId);
969
+ }
970
+ }
971
+
972
+ @ReactMethod
973
+ public void setLabelType(String displayRuleId, Integer type, final Promise promise) {
974
+ MPDisplayRule displayRule = getRule(displayRuleId);
975
+ if (displayRule != null) {
976
+ if (type == -1) {
977
+ displayRule.setLabelType(null);
978
+ }else {
979
+ MPLabelType labelType;
980
+ switch (type) {
981
+ case 1:
982
+ labelType = MPLabelType.FLAT;
983
+ break;
984
+ case 2:
985
+ labelType = MPLabelType.GRAPHIC;
986
+ break;
987
+ default:
988
+ labelType = MPLabelType.FLOATING;
989
+ break;
990
+ }
991
+ displayRule.setLabelType(labelType);
992
+ }
993
+ promise.resolve(null);
994
+ } else {
995
+ reject(promise, displayRuleId);
996
+ }
997
+ }
998
+
999
+ @ReactMethod
1000
+ public void getLabelStyleTextSize(String displayRuleId, final Promise promise) {
1001
+ MPDisplayRule displayRule = getRule(displayRuleId);
1002
+ if (displayRule != null) {
1003
+ promise.resolve(displayRule.getLabelStyleTextSize());
1004
+ } else {
1005
+ reject(promise, displayRuleId);
1006
+ }
1007
+ }
1008
+
1009
+ @ReactMethod
1010
+ public void setLabelStyleTextSize(String displayRuleId, Double textSize, final Promise promise) {
1011
+ MPDisplayRule displayRule = getRule(displayRuleId);
1012
+ if (displayRule != null) {
1013
+ if (textSize == -1) {
1014
+ displayRule.setLabelStyleTextSize(null);
1015
+ }else {
1016
+ displayRule.setLabelStyleTextSize(textSize.intValue());
1017
+ }
1018
+ promise.resolve(null);
1019
+ } else {
1020
+ reject(promise, displayRuleId);
1021
+ }
1022
+ }
1023
+
1024
+ @ReactMethod
1025
+ public void getLabelStyleTextColor(String displayRuleId, final Promise promise) {
1026
+ MPDisplayRule displayRule = getRule(displayRuleId);
1027
+ if (displayRule != null) {
1028
+ promise.resolve(displayRule.getLabelStyleTextColor());
1029
+ } else {
1030
+ reject(promise, displayRuleId);
1031
+ }
1032
+ }
1033
+
1034
+ @ReactMethod
1035
+ public void setLabelStyleTextColor(String displayRuleId, String color, final Promise promise) {
1036
+ MPDisplayRule displayRule = getRule(displayRuleId);
1037
+ if (displayRule != null) {
1038
+ displayRule.setLabelStyleTextColor(color);
1039
+ promise.resolve(null);
1040
+ } else {
1041
+ reject(promise, displayRuleId);
1042
+ }
1043
+ }
1044
+
1045
+ @ReactMethod
1046
+ public void getLabelStyleTextOpacity(String displayRuleId, final Promise promise) {
1047
+ MPDisplayRule displayRule = getRule(displayRuleId);
1048
+ if (displayRule != null) {
1049
+ promise.resolve(displayRule.getLabelStyleTextOpacity());
1050
+ } else {
1051
+ reject(promise, displayRuleId);
1052
+ }
1053
+ }
1054
+
1055
+ @ReactMethod
1056
+ public void setLabelStyleTextOpacity(String displayRuleId, Double opacity, final Promise promise) {
1057
+ MPDisplayRule displayRule = getRule(displayRuleId);
1058
+ if (displayRule != null) {
1059
+ if (opacity == -1) {
1060
+ displayRule.setLabelStyleTextOpacity(null);
1061
+ }else {
1062
+ displayRule.setLabelStyleTextOpacity(opacity.floatValue());
1063
+ }
1064
+ promise.resolve(null);
1065
+ } else {
1066
+ reject(promise, displayRuleId);
1067
+ }
1068
+ }
1069
+
1070
+ @ReactMethod
1071
+ public void getLabelStyleHaloColor(String displayRuleId, final Promise promise) {
1072
+ MPDisplayRule displayRule = getRule(displayRuleId);
1073
+ if (displayRule != null) {
1074
+ promise.resolve(displayRule.getLabelStyleHaloColor());
1075
+ } else {
1076
+ reject(promise, displayRuleId);
1077
+ }
1078
+ }
1079
+
1080
+ @ReactMethod
1081
+ public void setLabelStyleHaloColor(String displayRuleId, String color, final Promise promise) {
1082
+ MPDisplayRule displayRule = getRule(displayRuleId);
1083
+ if (displayRule != null) {
1084
+ displayRule.setLabelStyleHaloColor(color);
1085
+ promise.resolve(null);
1086
+ } else {
1087
+ reject(promise, displayRuleId);
1088
+ }
1089
+ }
1090
+
1091
+ @ReactMethod
1092
+ public void getLabelStyleHaloWidth(String displayRuleId, final Promise promise) {
1093
+ MPDisplayRule displayRule = getRule(displayRuleId);
1094
+ if (displayRule != null) {
1095
+ promise.resolve(displayRule.getLabelStyleHaloWidth());
1096
+ } else {
1097
+ reject(promise, displayRuleId);
1098
+ }
1099
+ }
1100
+
1101
+ @ReactMethod
1102
+ public void setLabelStyleHaloWidth(String displayRuleId, Double width, final Promise promise) {
1103
+ MPDisplayRule displayRule = getRule(displayRuleId);
1104
+ if (displayRule != null) {
1105
+ if (width == -1) {
1106
+ displayRule.setLabelStyleHaloWidth(null);
1107
+ }else {
1108
+ displayRule.setLabelStyleHaloWidth(width.intValue());
1109
+ }
1110
+ promise.resolve(null);
1111
+ } else {
1112
+ reject(promise, displayRuleId);
1113
+ }
1114
+ }
1115
+
1116
+ @ReactMethod
1117
+ public void getLabelStyleHaloBlur(String displayRuleId, final Promise promise) {
1118
+ MPDisplayRule displayRule = getRule(displayRuleId);
1119
+ if (displayRule != null) {
1120
+ promise.resolve(displayRule.getLabelStyleHaloBlur());
1121
+ } else {
1122
+ reject(promise, displayRuleId);
1123
+ }
1124
+ }
1125
+
1126
+ @ReactMethod
1127
+ public void setLabelStyleHaloBlur(String displayRuleId, Double blur, final Promise promise) {
1128
+ MPDisplayRule displayRule = getRule(displayRuleId);
1129
+ if (displayRule != null) {
1130
+ if (blur == -1) {
1131
+ displayRule.setLabelStyleHaloBlur(null);
1132
+ }else {
1133
+ displayRule.setLabelStyleHaloBlur(blur.intValue());
1134
+ }
1135
+ promise.resolve(null);
1136
+ } else {
1137
+ reject(promise, displayRuleId);
1138
+ }
1139
+ }
1140
+
1141
+ @ReactMethod
1142
+ public void getLabelStyleBearing(String displayRuleId, final Promise promise) {
1143
+ MPDisplayRule displayRule = getRule(displayRuleId);
1144
+ if (displayRule != null) {
1145
+ promise.resolve(displayRule.getLabelStyleBearing());
1146
+ } else {
1147
+ reject(promise, displayRuleId);
1148
+ }
1149
+ }
1150
+
1151
+ @ReactMethod
1152
+ public void setLabelStyleBearing(String displayRuleId, Double bearing, final Promise promise) {
1153
+ MPDisplayRule displayRule = getRule(displayRuleId);
1154
+ if (displayRule != null) {
1155
+ if (bearing == -1) {
1156
+ displayRule.setLabelStyleBearing(null);
1157
+ }else {
1158
+ displayRule.setLabelStyleBearing(bearing.floatValue());
1159
+ }
1160
+ promise.resolve(null);
1161
+ } else {
1162
+ reject(promise, displayRuleId);
1163
+ }
1164
+ }
1165
+
1166
+ @ReactMethod
1167
+ public void getLabelStylePosition(String displayRuleId, final Promise promise) {
1168
+ MPDisplayRule displayRule = getRule(displayRuleId);
1169
+ if (displayRule != null) {
1170
+ promise.resolve(displayRule.getLabelStylePosition() != null ? displayRule.getLabelStylePosition().ordinal() : null);
1171
+ } else {
1172
+ reject(promise, displayRuleId);
1173
+ }
1174
+ }
1175
+
1176
+ @ReactMethod
1177
+ public void setLabelStylePosition(String displayRuleId, Integer position, final Promise promise) {
1178
+ MPDisplayRule displayRule = getRule(displayRuleId);
1179
+ if (displayRule != null) {
1180
+ if (position == -1) {
1181
+ displayRule.setLabelStylePosition(null);
1182
+ }else {
1183
+ MPLabelPosition labelPosition;
1184
+ switch (position) {
1185
+ case 0:
1186
+ labelPosition = MPLabelPosition.TOP;
1187
+ break;
1188
+ case 1:
1189
+ labelPosition = MPLabelPosition.BOTTOM;
1190
+ break;
1191
+ case 2:
1192
+ labelPosition = MPLabelPosition.LEFT;
1193
+ break;
1194
+ case 3:
1195
+ labelPosition = MPLabelPosition.RIGHT;
1196
+ break;
1197
+ default:
1198
+ labelPosition = MPLabelPosition.BOTTOM;
1199
+ break;
1200
+ }
1201
+ displayRule.setLabelStylePosition(labelPosition);
1202
+ }
1203
+ promise.resolve(null);
1204
+ } else {
1205
+ reject(promise, displayRuleId);
1206
+ }
1207
+ }
1208
+
1209
+ @ReactMethod
1210
+ public void setLabelStyleGraphic(String displayRuleId, String graphic, final Promise promise) {
1211
+ MPDisplayRule displayRule = getRule(displayRuleId);
1212
+ if (displayRule != null) {
1213
+ MPLabelGraphic labelGraphic = gson.fromJson(graphic, MPLabelGraphic.class);
1214
+ displayRule.setLabelStyleGraphic(labelGraphic);
1215
+ promise.resolve(null);
1216
+ } else {
1217
+ reject(promise, displayRuleId);
1218
+ }
1219
+ }
1220
+
1221
+ @ReactMethod
1222
+ public void getLabelStyleGraphic(String displayRuleId, final Promise promise) {
1223
+ MPDisplayRule displayRule = getRule(displayRuleId);
1224
+ if (displayRule != null) {
1225
+ String labelGraphicString = gson.toJson(displayRule.getLabelStyleGraphic());
1226
+ promise.resolve(labelGraphicString);
1227
+ } else {
1228
+ reject(promise, displayRuleId);
1229
+ }
1230
+ }
1231
+
1232
+ @ReactMethod
1233
+ public void getPolygonLightnessFactor(String displayRuleId, final Promise promise) {
1234
+ MPDisplayRule displayRule = getRule(displayRuleId);
1235
+ if (displayRule != null) {
1236
+ promise.resolve(displayRule.getPolygonLightnessFactor());
1237
+ } else {
1238
+ reject(promise, displayRuleId);
1239
+ }
1240
+ }
1241
+
1242
+ @ReactMethod
1243
+ public void setPolygonLightnessFactor(String displayRuleId, Double factor, final Promise promise) {
1244
+ MPDisplayRule displayRule = getRule(displayRuleId);
1245
+ if (displayRule != null) {
1246
+ if (factor == -1) {
1247
+ displayRule.setPolygonLightnessFactor(null);
1248
+ }else {
1249
+ displayRule.setPolygonLightnessFactor(factor.floatValue());
1250
+ }
1251
+ promise.resolve(null);
1252
+ } else {
1253
+ reject(promise, displayRuleId);
1254
+ }
1255
+ }
1256
+
1257
+ @ReactMethod
1258
+ public void getWallLightnessFactor(String displayRuleId, final Promise promise) {
1259
+ MPDisplayRule displayRule = getRule(displayRuleId);
1260
+ if (displayRule != null) {
1261
+ promise.resolve(displayRule.getWallLightnessFactor());
1262
+ } else {
1263
+ reject(promise, displayRuleId);
1264
+ }
1265
+ }
1266
+
1267
+ @ReactMethod
1268
+ public void setWallLightnessFactor(String displayRuleId, Double factor, final Promise promise) {
1269
+ MPDisplayRule displayRule = getRule(displayRuleId);
1270
+ if (displayRule != null) {
1271
+ if (factor == -1) {
1272
+ displayRule.setWallLightnessFactor(null);
1273
+ }else {
1274
+ displayRule.setWallLightnessFactor(factor.floatValue());
1275
+ }
1276
+ promise.resolve(null);
1277
+ } else {
1278
+ reject(promise, displayRuleId);
1279
+ }
1280
+ }
1281
+
1282
+ @ReactMethod
1283
+ public void getExtrusionLightnessFactor(String displayRuleId, final Promise promise) {
1284
+ MPDisplayRule displayRule = getRule(displayRuleId);
1285
+ if (displayRule != null) {
1286
+ promise.resolve(displayRule.getExtrusionLightnessFactor());
1287
+ } else {
1288
+ reject(promise, displayRuleId);
1289
+ }
1290
+ }
1291
+
1292
+ @ReactMethod
1293
+ public void setExtrusionLightnessFactor(String displayRuleId, Double factor, final Promise promise) {
1294
+ MPDisplayRule displayRule = getRule(displayRuleId);
1295
+ if (displayRule != null) {
1296
+ if (factor == -1) {
1297
+ displayRule.setExtrusionLightnessFactor(null);
1298
+ }else {
1299
+ displayRule.setExtrusionLightnessFactor(factor.floatValue());
1300
+ }
1301
+ displayRule.setExtrusionLightnessFactor(factor.floatValue());
1302
+ promise.resolve(null);
1303
+ } else {
1304
+ reject(promise, displayRuleId);
1305
+ }
1306
+ }
1307
+
1308
+ @ReactMethod
1309
+ public void isBadgeVisible(String displayRuleId, final Promise promise) {
1310
+ MPDisplayRule displayRule = getRule(displayRuleId);
1311
+ if (displayRule != null) {
1312
+ promise.resolve(displayRule.isBadgeVisible());
1313
+ } else {
1314
+ reject(promise, displayRuleId);
1315
+ }
1316
+ }
1317
+
1318
+ @ReactMethod
1319
+ public void setBadgeVisible(String displayRuleId, String visible, final Promise promise) {
1320
+ MPDisplayRule displayRule = getRule(displayRuleId);
1321
+ if (displayRule != null) {
1322
+ displayRule.setBadgeVisible(Boolean.valueOf(visible));
1323
+ promise.resolve(null);
1324
+ } else {
1325
+ reject(promise, displayRuleId);
1326
+ }
1327
+ }
1328
+
1329
+ @ReactMethod
1330
+ public void getBadgeZoomFrom(String displayRuleId, final Promise promise) {
1331
+ MPDisplayRule displayRule = getRule(displayRuleId);
1332
+ if (displayRule != null) {
1333
+ promise.resolve(displayRule.getBadgeZoomFrom());
1334
+ } else {
1335
+ reject(promise, displayRuleId);
1336
+ }
1337
+ }
1338
+
1339
+ @ReactMethod
1340
+ public void setBadgeZoomFrom(String displayRuleId, Double zoomFrom, final Promise promise) {
1341
+ MPDisplayRule displayRule = getRule(displayRuleId);
1342
+ if (displayRule != null) {
1343
+ if (zoomFrom == -1) {
1344
+ displayRule.setBadgeZoomFrom(null);
1345
+ }else {
1346
+ displayRule.setBadgeZoomFrom(zoomFrom.floatValue());
1347
+ }
1348
+ displayRule.setBadgeZoomFrom(zoomFrom.floatValue());
1349
+ promise.resolve(null);
1350
+ } else {
1351
+ reject(promise, displayRuleId);
1352
+ }
1353
+ }
1354
+
1355
+ @ReactMethod
1356
+ public void getBadgeZoomTo(String displayRuleId, final Promise promise) {
1357
+ MPDisplayRule displayRule = getRule(displayRuleId);
1358
+ if (displayRule != null) {
1359
+ promise.resolve(displayRule.getBadgeZoomTo());
1360
+ } else {
1361
+ reject(promise, displayRuleId);
1362
+ }
1363
+ }
1364
+
1365
+ @ReactMethod
1366
+ public void setBadgeZoomTo(String displayRuleId, Double zoomTo, final Promise promise) {
1367
+ MPDisplayRule displayRule = getRule(displayRuleId);
1368
+ if (displayRule != null) {
1369
+ if (zoomTo == -1) {
1370
+ displayRule.setBadgeZoomTo(null);
1371
+ }else {
1372
+ displayRule.setBadgeZoomTo(zoomTo.floatValue());
1373
+ }
1374
+ promise.resolve(null);
1375
+ } else {
1376
+ reject(promise, displayRuleId);
1377
+ }
1378
+ }
1379
+
1380
+ @ReactMethod
1381
+ public void getBadgeRadius(String displayRuleId, final Promise promise) {
1382
+ MPDisplayRule displayRule = getRule(displayRuleId);
1383
+ if (displayRule != null) {
1384
+ promise.resolve(displayRule.getBadgeRadius());
1385
+ } else {
1386
+ reject(promise, displayRuleId);
1387
+ }
1388
+ }
1389
+
1390
+ @ReactMethod
1391
+ public void setBadgeRadius(String displayRuleId, Double radius, final Promise promise) {
1392
+ MPDisplayRule displayRule = getRule(displayRuleId);
1393
+ if (displayRule != null) {
1394
+ if (radius == -1) {
1395
+ displayRule.setBadgeRadius(null);
1396
+ }else {
1397
+ displayRule.setBadgeRadius(radius.intValue());
1398
+ }
1399
+ promise.resolve(null);
1400
+ } else {
1401
+ reject(promise, displayRuleId);
1402
+ }
1403
+ }
1404
+
1405
+ @ReactMethod
1406
+ public void getBadgeStrokeWidth(String displayRuleId, final Promise promise) {
1407
+ MPDisplayRule displayRule = getRule(displayRuleId);
1408
+ if (displayRule != null) {
1409
+ promise.resolve(displayRule.getBadgeStrokeWidth());
1410
+ } else {
1411
+ reject(promise, displayRuleId);
1412
+ }
1413
+ }
1414
+
1415
+ @ReactMethod
1416
+ public void setBadgeStrokeWidth(String displayRuleId, Double strokeWidth, final Promise promise) {
1417
+ MPDisplayRule displayRule = getRule(displayRuleId);
1418
+ if (displayRule != null) {
1419
+ if (strokeWidth == -1) {
1420
+ displayRule.setBadgeStrokeWidth(null);
1421
+ }else {
1422
+ displayRule.setBadgeStrokeWidth(strokeWidth.floatValue());
1423
+ }
1424
+ promise.resolve(null);
1425
+ } else {
1426
+ reject(promise, displayRuleId);
1427
+ }
1428
+ }
1429
+
1430
+ @ReactMethod
1431
+ public void getBadgeStrokeColor(String displayRuleId, final Promise promise) {
1432
+ MPDisplayRule displayRule = getRule(displayRuleId);
1433
+ if (displayRule != null) {
1434
+ promise.resolve(displayRule.getBadgeStrokeColor());
1435
+ } else {
1436
+ reject(promise, displayRuleId);
1437
+ }
1438
+ }
1439
+
1440
+ @ReactMethod
1441
+ public void setBadgeStrokeColor(String displayRuleId, String color, final Promise promise) {
1442
+ MPDisplayRule displayRule = getRule(displayRuleId);
1443
+ if (displayRule != null) {
1444
+ displayRule.setBadgeStrokeColor(color);
1445
+ promise.resolve(null);
1446
+ } else {
1447
+ reject(promise, displayRuleId);
1448
+ }
1449
+ }
1450
+
1451
+ @ReactMethod
1452
+ public void getBadgeFillColor(String displayRuleId, final Promise promise) {
1453
+ MPDisplayRule displayRule = getRule(displayRuleId);
1454
+ if (displayRule != null) {
1455
+ promise.resolve(displayRule.getBadgeFillColor());
1456
+ } else {
1457
+ reject(promise, displayRuleId);
1458
+ }
1459
+ }
1460
+
1461
+ @ReactMethod
1462
+ public void setBadgeFillColor(String displayRuleId, String color, final Promise promise) {
1463
+ MPDisplayRule displayRule = getRule(displayRuleId);
1464
+ if (displayRule != null) {
1465
+ displayRule.setBadgeFillColor(color);
1466
+ promise.resolve(null);
1467
+ } else {
1468
+ reject(promise, displayRuleId);
1469
+ }
1470
+ }
1471
+
1472
+ @ReactMethod
1473
+ public void getBadgeScale(String displayRuleId, final Promise promise) {
1474
+ MPDisplayRule displayRule = getRule(displayRuleId);
1475
+ if (displayRule != null) {
1476
+ promise.resolve(displayRule.getBadgeScale());
1477
+ } else {
1478
+ reject(promise, displayRuleId);
1479
+ }
1480
+ }
1481
+
1482
+ @ReactMethod
1483
+ public void setBadgeScale(String displayRuleId, Double scale, final Promise promise) {
1484
+ MPDisplayRule displayRule = getRule(displayRuleId);
1485
+ if (displayRule != null) {
1486
+ if (scale == -1) {
1487
+ displayRule.setBadgeScale(null);
1488
+ }else {
1489
+ displayRule.setBadgeScale(scale.floatValue());
1490
+ }
1491
+ promise.resolve(null);
1492
+ } else {
1493
+ reject(promise, displayRuleId);
1494
+ }
1495
+ }
1496
+
1497
+ @ReactMethod
1498
+ public void getBadgePosition(String displayRuleId, final Promise promise) {
1499
+ MPDisplayRule displayRule = getRule(displayRuleId);
1500
+ if (displayRule != null) {
1501
+ MPBadgePosition badgePosition = displayRule.getBadgePosition();
1502
+ if (badgePosition != null) {
1503
+ if (badgePosition.equals(MPBadgePosition.bottomLeft)) {
1504
+ promise.resolve(1);
1505
+ }else if (badgePosition.equals(MPBadgePosition.bottomRight)) {
1506
+ promise.resolve(0);
1507
+ }else if (badgePosition.equals(MPBadgePosition.topLeft)) {
1508
+ promise.resolve(2);
1509
+ }else {
1510
+ promise.resolve(3);
1511
+ }
1512
+ }else {
1513
+ promise.resolve(null);
1514
+ }
1515
+ } else {
1516
+ reject(promise, displayRuleId);
1517
+ }
1518
+ }
1519
+
1520
+ @ReactMethod
1521
+ public void setBadgePosition(String displayRuleId, Integer position, final Promise promise) {
1522
+ MPDisplayRule displayRule = getRule(displayRuleId);
1523
+ if (displayRule != null) {
1524
+ MPBadgePosition badgePosition;
1525
+ switch (position) {
1526
+ case 1:
1527
+ badgePosition = MPBadgePosition.bottomLeft;
1528
+ break;
1529
+ case 2:
1530
+ badgePosition = MPBadgePosition.topLeft;
1531
+ break;
1532
+ case 3:
1533
+ badgePosition = MPBadgePosition.topRight;
1534
+ break;
1535
+ default:
1536
+ badgePosition = MPBadgePosition.bottomRight;
1537
+ break;
1538
+ }
1539
+ displayRule.setBadgePosition(badgePosition);
1540
+ promise.resolve(null);
1541
+ } else {
1542
+ reject(promise, displayRuleId);
1543
+ }
1544
+ }
1545
+
1546
+ @ReactMethod
1547
+ public void getModel3DModel(String displayRuleId, final Promise promise) {
1548
+ MPDisplayRule displayRule = getRule(displayRuleId);
1549
+ if (displayRule != null) {
1550
+ promise.resolve(displayRule.getModel3DModel());
1551
+ } else {
1552
+ reject(promise, displayRuleId);
1553
+ }
1554
+ }
1555
+
1556
+ @ReactMethod
1557
+ public void setModel3DModel(String displayRuleId, String model, final Promise promise) {
1558
+ MPDisplayRule displayRule = getRule(displayRuleId);
1559
+ if (displayRule != null) {
1560
+ displayRule.setModel3DModel(model);
1561
+ promise.resolve(null);
1562
+ } else {
1563
+ reject(promise, displayRuleId);
1564
+ }
1565
+ }
1566
+
1567
+ @ReactMethod
1568
+ public void getModel3DRotationX(String displayRuleId, final Promise promise) {
1569
+ MPDisplayRule displayRule = getRule(displayRuleId);
1570
+ if (displayRule != null) {
1571
+ promise.resolve(displayRule.getModel3DRotationX());
1572
+ } else {
1573
+ reject(promise, displayRuleId);
1574
+ }
1575
+ }
1576
+
1577
+ @ReactMethod
1578
+ public void setModel3DRotationX(String displayRuleId, Double rotationX, final Promise promise) {
1579
+ MPDisplayRule displayRule = getRule(displayRuleId);
1580
+ if (displayRule != null) {
1581
+ if (rotationX == -1) {
1582
+ displayRule.setModel3DRotationX(null);
1583
+ }else {
1584
+ displayRule.setModel3DRotationX(rotationX.floatValue());
1585
+ }
1586
+ promise.resolve(null);
1587
+ } else {
1588
+ reject(promise, displayRuleId);
1589
+ }
1590
+ }
1591
+
1592
+ @ReactMethod
1593
+ public void getModel3DRotationY(String displayRuleId, final Promise promise) {
1594
+ MPDisplayRule displayRule = getRule(displayRuleId);
1595
+ if (displayRule != null) {
1596
+ promise.resolve(displayRule.getModel3DRotationY());
1597
+ } else {
1598
+ reject(promise, displayRuleId);
1599
+ }
1600
+ }
1601
+
1602
+ @ReactMethod
1603
+ public void setModel3DRotationY(String displayRuleId, Double rotationY, final Promise promise) {
1604
+ MPDisplayRule displayRule = getRule(displayRuleId);
1605
+ if (displayRule != null) {
1606
+ if (rotationY == -1) {
1607
+ displayRule.setModel3DRotationY(null);
1608
+ }else {
1609
+ displayRule.setModel3DRotationY(rotationY.floatValue());
1610
+ }
1611
+ promise.resolve(null);
1612
+ } else {
1613
+ reject(promise, displayRuleId);
1614
+ }
1615
+ }
1616
+
1617
+ @ReactMethod
1618
+ public void getModel3DRotationZ(String displayRuleId, final Promise promise) {
1619
+ MPDisplayRule displayRule = getRule(displayRuleId);
1620
+ if (displayRule != null) {
1621
+ promise.resolve(displayRule.getModel3DRotationZ());
1622
+ } else {
1623
+ reject(promise, displayRuleId);
1624
+ }
1625
+ }
1626
+
1627
+ @ReactMethod
1628
+ public void setModel3DRotationZ(String displayRuleId, Double rotationZ, final Promise promise) {
1629
+ MPDisplayRule displayRule = getRule(displayRuleId);
1630
+ if (displayRule != null) {
1631
+ if (rotationZ == -1) {
1632
+ displayRule.setModel3DRotationZ(null);
1633
+ }else {
1634
+ displayRule.setModel3DRotationZ(rotationZ.floatValue());
1635
+ }
1636
+ promise.resolve(null);
1637
+ } else {
1638
+ reject(promise, displayRuleId);
1639
+ }
1640
+ }
1641
+
1642
+ @ReactMethod
1643
+ public void getModel3DScale(String displayRuleId, final Promise promise) {
1644
+ MPDisplayRule displayRule = getRule(displayRuleId);
1645
+ if (displayRule != null) {
1646
+ promise.resolve(displayRule.getModel3DScale());
1647
+ } else {
1648
+ reject(promise, displayRuleId);
1649
+ }
1650
+ }
1651
+
1652
+ @ReactMethod
1653
+ public void setModel3DScale(String displayRuleId, Double scale, final Promise promise) {
1654
+ MPDisplayRule displayRule = getRule(displayRuleId);
1655
+ if (displayRule != null) {
1656
+ if (scale == -1) {
1657
+ displayRule.setModel3DScale(null);
1658
+ }else {
1659
+ displayRule.setModel3DScale(scale.floatValue());
1660
+ }
1661
+ promise.resolve(null);
1662
+ } else {
1663
+ reject(promise, displayRuleId);
1664
+ }
1665
+ }
1666
+
1667
+ @ReactMethod
1668
+ public void isModel3DVisible(String displayRuleId, final Promise promise) {
1669
+ MPDisplayRule displayRule = getRule(displayRuleId);
1670
+ if (displayRule != null) {
1671
+ promise.resolve(displayRule.isModel3DVisible());
1672
+ } else {
1673
+ reject(promise, displayRuleId);
1674
+ }
1675
+ }
1676
+
1677
+ @ReactMethod
1678
+ public void setModel3DVisible(String displayRuleId, String visible, final Promise promise) {
1679
+ MPDisplayRule displayRule = getRule(displayRuleId);
1680
+ if (displayRule != null) {
1681
+ displayRule.setModel3DVisible(Boolean.valueOf(visible));
1682
+ promise.resolve(null);
1683
+ } else {
1684
+ reject(promise, displayRuleId);
1685
+ }
1686
+ }
1687
+
1688
+ @ReactMethod
1689
+ public void reset(String displayRuleId, final Promise promise) {
1690
+ MPDisplayRule displayRule = getRule(displayRuleId);
1691
+ if (displayRule != null) {
1692
+ displayRule.reset();
1693
+ promise.resolve(null);
1694
+ } else {
1695
+ reject(promise, displayRuleId);
1696
+ }
1697
+ }
1698
+
1699
+ }