react-native-maps 1.28.2 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +2 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +2 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +175 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +157 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.cpp +183 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.h +431 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +2 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +22 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.h +4 -0
- package/dist/src/specs/NativeComponentGoogleMarker.d.ts +250 -0
- package/dist/src/specs/NativeComponentPolygon.d.ts +108 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.h +3 -0
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +6 -2
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +8 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMarkerView.h +28 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMarkerView.mm +357 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMarkerView.h +24 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMarkerView.mm +64 -0
- package/ios/AirMaps/RNMapsMapView.mm +8 -0
- package/ios/AirMaps/RNMapsPolygonView.h +26 -0
- package/ios/AirMaps/RNMapsPolygonView.mm +240 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +2 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +2 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +2 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +175 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +157 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +178 -0
- package/ios/generated/RNMapsSpecs/Props.h +379 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +143 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +2 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.h +22 -0
- package/ios/generated/RNMapsSpecs/States.h +4 -0
- package/package.json +4 -2
- package/src/MapMarker.tsx +4 -3
- package/src/decorateMapComponent.ts +29 -15
- package/src/specs/NativeComponentGoogleMarker.ts +327 -0
- package/src/specs/NativeComponentPolygon.ts +137 -0
|
@@ -19,10 +19,12 @@ void RNMapsSpecs_registerComponentDescriptorsFromCodegen(
|
|
|
19
19
|
registry->add(concreteComponentDescriptorProvider<RNMapsCalloutComponentDescriptor>());
|
|
20
20
|
registry->add(concreteComponentDescriptorProvider<RNMapsCircleComponentDescriptor>());
|
|
21
21
|
registry->add(concreteComponentDescriptorProvider<RNMapsGoogleMapViewComponentDescriptor>());
|
|
22
|
+
registry->add(concreteComponentDescriptorProvider<RNMapsGoogleMarkerComponentDescriptor>());
|
|
22
23
|
registry->add(concreteComponentDescriptorProvider<RNMapsGooglePolygonComponentDescriptor>());
|
|
23
24
|
registry->add(concreteComponentDescriptorProvider<RNMapsMapViewComponentDescriptor>());
|
|
24
25
|
registry->add(concreteComponentDescriptorProvider<RNMapsMarkerComponentDescriptor>());
|
|
25
26
|
registry->add(concreteComponentDescriptorProvider<RNMapsOverlayComponentDescriptor>());
|
|
27
|
+
registry->add(concreteComponentDescriptorProvider<RNMapsPolygonComponentDescriptor>());
|
|
26
28
|
registry->add(concreteComponentDescriptorProvider<RNMapsPolylineComponentDescriptor>());
|
|
27
29
|
registry->add(concreteComponentDescriptorProvider<RNMapsUrlTileComponentDescriptor>());
|
|
28
30
|
registry->add(concreteComponentDescriptorProvider<RNMapsWMSTileComponentDescriptor>());
|
|
@@ -19,10 +19,12 @@ namespace facebook::react {
|
|
|
19
19
|
using RNMapsCalloutComponentDescriptor = ConcreteComponentDescriptor<RNMapsCalloutShadowNode>;
|
|
20
20
|
using RNMapsCircleComponentDescriptor = ConcreteComponentDescriptor<RNMapsCircleShadowNode>;
|
|
21
21
|
using RNMapsGoogleMapViewComponentDescriptor = ConcreteComponentDescriptor<RNMapsGoogleMapViewShadowNode>;
|
|
22
|
+
using RNMapsGoogleMarkerComponentDescriptor = ConcreteComponentDescriptor<RNMapsGoogleMarkerShadowNode>;
|
|
22
23
|
using RNMapsGooglePolygonComponentDescriptor = ConcreteComponentDescriptor<RNMapsGooglePolygonShadowNode>;
|
|
23
24
|
using RNMapsMapViewComponentDescriptor = ConcreteComponentDescriptor<RNMapsMapViewShadowNode>;
|
|
24
25
|
using RNMapsMarkerComponentDescriptor = ConcreteComponentDescriptor<RNMapsMarkerShadowNode>;
|
|
25
26
|
using RNMapsOverlayComponentDescriptor = ConcreteComponentDescriptor<RNMapsOverlayShadowNode>;
|
|
27
|
+
using RNMapsPolygonComponentDescriptor = ConcreteComponentDescriptor<RNMapsPolygonShadowNode>;
|
|
26
28
|
using RNMapsPolylineComponentDescriptor = ConcreteComponentDescriptor<RNMapsPolylineShadowNode>;
|
|
27
29
|
using RNMapsUrlTileComponentDescriptor = ConcreteComponentDescriptor<RNMapsUrlTileShadowNode>;
|
|
28
30
|
using RNMapsWMSTileComponentDescriptor = ConcreteComponentDescriptor<RNMapsWMSTileShadowNode>;
|
|
@@ -384,6 +384,159 @@ void RNMapsGoogleMapViewEventEmitter::onUserLocationChange(OnUserLocationChange
|
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
|
|
387
|
+
void RNMapsGoogleMarkerEventEmitter::onCalloutPress(OnCalloutPress event) const {
|
|
388
|
+
dispatchEvent("calloutPress", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
389
|
+
auto payload = jsi::Object(runtime);
|
|
390
|
+
payload.setProperty(runtime, "action", event.action);
|
|
391
|
+
payload.setProperty(runtime, "id", event.id);
|
|
392
|
+
{
|
|
393
|
+
auto frame = jsi::Object(runtime);
|
|
394
|
+
frame.setProperty(runtime, "x", event.frame.x);
|
|
395
|
+
frame.setProperty(runtime, "y", event.frame.y);
|
|
396
|
+
frame.setProperty(runtime, "width", event.frame.width);
|
|
397
|
+
frame.setProperty(runtime, "height", event.frame.height);
|
|
398
|
+
payload.setProperty(runtime, "frame", frame);
|
|
399
|
+
}
|
|
400
|
+
{
|
|
401
|
+
auto point = jsi::Object(runtime);
|
|
402
|
+
point.setProperty(runtime, "x", event.point.x);
|
|
403
|
+
point.setProperty(runtime, "y", event.point.y);
|
|
404
|
+
payload.setProperty(runtime, "point", point);
|
|
405
|
+
}
|
|
406
|
+
return payload;
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
void RNMapsGoogleMarkerEventEmitter::onDrag(OnDrag event) const {
|
|
412
|
+
dispatchEvent("drag", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
413
|
+
auto payload = jsi::Object(runtime);
|
|
414
|
+
payload.setProperty(runtime, "id", event.id);
|
|
415
|
+
{
|
|
416
|
+
auto coordinate = jsi::Object(runtime);
|
|
417
|
+
coordinate.setProperty(runtime, "latitude", event.coordinate.latitude);
|
|
418
|
+
coordinate.setProperty(runtime, "longitude", event.coordinate.longitude);
|
|
419
|
+
payload.setProperty(runtime, "coordinate", coordinate);
|
|
420
|
+
}
|
|
421
|
+
{
|
|
422
|
+
auto position = jsi::Object(runtime);
|
|
423
|
+
position.setProperty(runtime, "x", event.position.x);
|
|
424
|
+
position.setProperty(runtime, "y", event.position.y);
|
|
425
|
+
payload.setProperty(runtime, "position", position);
|
|
426
|
+
}
|
|
427
|
+
return payload;
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
void RNMapsGoogleMarkerEventEmitter::onDragEnd(OnDragEnd event) const {
|
|
433
|
+
dispatchEvent("dragEnd", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
434
|
+
auto payload = jsi::Object(runtime);
|
|
435
|
+
payload.setProperty(runtime, "id", event.id);
|
|
436
|
+
{
|
|
437
|
+
auto coordinate = jsi::Object(runtime);
|
|
438
|
+
coordinate.setProperty(runtime, "latitude", event.coordinate.latitude);
|
|
439
|
+
coordinate.setProperty(runtime, "longitude", event.coordinate.longitude);
|
|
440
|
+
payload.setProperty(runtime, "coordinate", coordinate);
|
|
441
|
+
}
|
|
442
|
+
{
|
|
443
|
+
auto position = jsi::Object(runtime);
|
|
444
|
+
position.setProperty(runtime, "x", event.position.x);
|
|
445
|
+
position.setProperty(runtime, "y", event.position.y);
|
|
446
|
+
payload.setProperty(runtime, "position", position);
|
|
447
|
+
}
|
|
448
|
+
return payload;
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
void RNMapsGoogleMarkerEventEmitter::onDragStart(OnDragStart event) const {
|
|
454
|
+
dispatchEvent("dragStart", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
455
|
+
auto payload = jsi::Object(runtime);
|
|
456
|
+
payload.setProperty(runtime, "id", event.id);
|
|
457
|
+
{
|
|
458
|
+
auto coordinate = jsi::Object(runtime);
|
|
459
|
+
coordinate.setProperty(runtime, "latitude", event.coordinate.latitude);
|
|
460
|
+
coordinate.setProperty(runtime, "longitude", event.coordinate.longitude);
|
|
461
|
+
payload.setProperty(runtime, "coordinate", coordinate);
|
|
462
|
+
}
|
|
463
|
+
{
|
|
464
|
+
auto position = jsi::Object(runtime);
|
|
465
|
+
position.setProperty(runtime, "x", event.position.x);
|
|
466
|
+
position.setProperty(runtime, "y", event.position.y);
|
|
467
|
+
payload.setProperty(runtime, "position", position);
|
|
468
|
+
}
|
|
469
|
+
return payload;
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
void RNMapsGoogleMarkerEventEmitter::onPress(OnPress event) const {
|
|
475
|
+
dispatchEvent("press", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
476
|
+
auto payload = jsi::Object(runtime);
|
|
477
|
+
payload.setProperty(runtime, "action", event.action);
|
|
478
|
+
payload.setProperty(runtime, "id", event.id);
|
|
479
|
+
{
|
|
480
|
+
auto coordinate = jsi::Object(runtime);
|
|
481
|
+
coordinate.setProperty(runtime, "latitude", event.coordinate.latitude);
|
|
482
|
+
coordinate.setProperty(runtime, "longitude", event.coordinate.longitude);
|
|
483
|
+
payload.setProperty(runtime, "coordinate", coordinate);
|
|
484
|
+
}
|
|
485
|
+
{
|
|
486
|
+
auto position = jsi::Object(runtime);
|
|
487
|
+
position.setProperty(runtime, "x", event.position.x);
|
|
488
|
+
position.setProperty(runtime, "y", event.position.y);
|
|
489
|
+
payload.setProperty(runtime, "position", position);
|
|
490
|
+
}
|
|
491
|
+
return payload;
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
void RNMapsGoogleMarkerEventEmitter::onSelect(OnSelect event) const {
|
|
497
|
+
dispatchEvent("select", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
498
|
+
auto payload = jsi::Object(runtime);
|
|
499
|
+
payload.setProperty(runtime, "action", event.action);
|
|
500
|
+
payload.setProperty(runtime, "id", event.id);
|
|
501
|
+
{
|
|
502
|
+
auto coordinate = jsi::Object(runtime);
|
|
503
|
+
coordinate.setProperty(runtime, "latitude", event.coordinate.latitude);
|
|
504
|
+
coordinate.setProperty(runtime, "longitude", event.coordinate.longitude);
|
|
505
|
+
payload.setProperty(runtime, "coordinate", coordinate);
|
|
506
|
+
}
|
|
507
|
+
{
|
|
508
|
+
auto position = jsi::Object(runtime);
|
|
509
|
+
position.setProperty(runtime, "x", event.position.x);
|
|
510
|
+
position.setProperty(runtime, "y", event.position.y);
|
|
511
|
+
payload.setProperty(runtime, "position", position);
|
|
512
|
+
}
|
|
513
|
+
return payload;
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
void RNMapsGoogleMarkerEventEmitter::onDeselect(OnDeselect event) const {
|
|
519
|
+
dispatchEvent("deselect", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
520
|
+
auto payload = jsi::Object(runtime);
|
|
521
|
+
payload.setProperty(runtime, "action", event.action);
|
|
522
|
+
payload.setProperty(runtime, "id", event.id);
|
|
523
|
+
{
|
|
524
|
+
auto coordinate = jsi::Object(runtime);
|
|
525
|
+
coordinate.setProperty(runtime, "latitude", event.coordinate.latitude);
|
|
526
|
+
coordinate.setProperty(runtime, "longitude", event.coordinate.longitude);
|
|
527
|
+
payload.setProperty(runtime, "coordinate", coordinate);
|
|
528
|
+
}
|
|
529
|
+
{
|
|
530
|
+
auto position = jsi::Object(runtime);
|
|
531
|
+
position.setProperty(runtime, "x", event.position.x);
|
|
532
|
+
position.setProperty(runtime, "y", event.position.y);
|
|
533
|
+
payload.setProperty(runtime, "position", position);
|
|
534
|
+
}
|
|
535
|
+
return payload;
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
|
|
387
540
|
void RNMapsGooglePolygonEventEmitter::onPress(OnPress event) const {
|
|
388
541
|
dispatchEvent("press", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
389
542
|
auto payload = jsi::Object(runtime);
|
|
@@ -953,6 +1106,28 @@ payload.setProperty(runtime, "id", event.id);
|
|
|
953
1106
|
}
|
|
954
1107
|
|
|
955
1108
|
|
|
1109
|
+
void RNMapsPolygonEventEmitter::onPress(OnPress event) const {
|
|
1110
|
+
dispatchEvent("press", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
1111
|
+
auto payload = jsi::Object(runtime);
|
|
1112
|
+
payload.setProperty(runtime, "action", event.action);
|
|
1113
|
+
payload.setProperty(runtime, "id", event.id);
|
|
1114
|
+
{
|
|
1115
|
+
auto coordinate = jsi::Object(runtime);
|
|
1116
|
+
coordinate.setProperty(runtime, "latitude", event.coordinate.latitude);
|
|
1117
|
+
coordinate.setProperty(runtime, "longitude", event.coordinate.longitude);
|
|
1118
|
+
payload.setProperty(runtime, "coordinate", coordinate);
|
|
1119
|
+
}
|
|
1120
|
+
{
|
|
1121
|
+
auto position = jsi::Object(runtime);
|
|
1122
|
+
position.setProperty(runtime, "x", event.position.x);
|
|
1123
|
+
position.setProperty(runtime, "y", event.position.y);
|
|
1124
|
+
payload.setProperty(runtime, "position", position);
|
|
1125
|
+
}
|
|
1126
|
+
return payload;
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
|
|
956
1131
|
void RNMapsPolylineEventEmitter::onPress(OnPress event) const {
|
|
957
1132
|
dispatchEvent("press", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
958
1133
|
auto payload = jsi::Object(runtime);
|
|
@@ -330,6 +330,141 @@ class RNMapsGoogleMapViewEventEmitter : public ViewEventEmitter {
|
|
|
330
330
|
|
|
331
331
|
void onUserLocationChange(OnUserLocationChange value) const;
|
|
332
332
|
};
|
|
333
|
+
class RNMapsGoogleMarkerEventEmitter : public ViewEventEmitter {
|
|
334
|
+
public:
|
|
335
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
336
|
+
|
|
337
|
+
struct OnCalloutPressFrame {
|
|
338
|
+
double x;
|
|
339
|
+
double y;
|
|
340
|
+
double width;
|
|
341
|
+
double height;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
struct OnCalloutPressPoint {
|
|
345
|
+
double x;
|
|
346
|
+
double y;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
struct OnCalloutPress {
|
|
350
|
+
std::string action;
|
|
351
|
+
std::string id;
|
|
352
|
+
OnCalloutPressFrame frame;
|
|
353
|
+
OnCalloutPressPoint point;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
struct OnDragCoordinate {
|
|
357
|
+
double latitude;
|
|
358
|
+
double longitude;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
struct OnDragPosition {
|
|
362
|
+
double x;
|
|
363
|
+
double y;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
struct OnDrag {
|
|
367
|
+
std::string id;
|
|
368
|
+
OnDragCoordinate coordinate;
|
|
369
|
+
OnDragPosition position;
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
struct OnDragEndCoordinate {
|
|
373
|
+
double latitude;
|
|
374
|
+
double longitude;
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
struct OnDragEndPosition {
|
|
378
|
+
double x;
|
|
379
|
+
double y;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
struct OnDragEnd {
|
|
383
|
+
std::string id;
|
|
384
|
+
OnDragEndCoordinate coordinate;
|
|
385
|
+
OnDragEndPosition position;
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
struct OnDragStartCoordinate {
|
|
389
|
+
double latitude;
|
|
390
|
+
double longitude;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
struct OnDragStartPosition {
|
|
394
|
+
double x;
|
|
395
|
+
double y;
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
struct OnDragStart {
|
|
399
|
+
std::string id;
|
|
400
|
+
OnDragStartCoordinate coordinate;
|
|
401
|
+
OnDragStartPosition position;
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
struct OnPressCoordinate {
|
|
405
|
+
double latitude;
|
|
406
|
+
double longitude;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
struct OnPressPosition {
|
|
410
|
+
double x;
|
|
411
|
+
double y;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
struct OnPress {
|
|
415
|
+
std::string action;
|
|
416
|
+
std::string id;
|
|
417
|
+
OnPressCoordinate coordinate;
|
|
418
|
+
OnPressPosition position;
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
struct OnSelectCoordinate {
|
|
422
|
+
double latitude;
|
|
423
|
+
double longitude;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
struct OnSelectPosition {
|
|
427
|
+
double x;
|
|
428
|
+
double y;
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
struct OnSelect {
|
|
432
|
+
std::string action;
|
|
433
|
+
std::string id;
|
|
434
|
+
OnSelectCoordinate coordinate;
|
|
435
|
+
OnSelectPosition position;
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
struct OnDeselectCoordinate {
|
|
439
|
+
double latitude;
|
|
440
|
+
double longitude;
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
struct OnDeselectPosition {
|
|
444
|
+
double x;
|
|
445
|
+
double y;
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
struct OnDeselect {
|
|
449
|
+
std::string action;
|
|
450
|
+
std::string id;
|
|
451
|
+
OnDeselectCoordinate coordinate;
|
|
452
|
+
OnDeselectPosition position;
|
|
453
|
+
};
|
|
454
|
+
void onCalloutPress(OnCalloutPress value) const;
|
|
455
|
+
|
|
456
|
+
void onDrag(OnDrag value) const;
|
|
457
|
+
|
|
458
|
+
void onDragEnd(OnDragEnd value) const;
|
|
459
|
+
|
|
460
|
+
void onDragStart(OnDragStart value) const;
|
|
461
|
+
|
|
462
|
+
void onPress(OnPress value) const;
|
|
463
|
+
|
|
464
|
+
void onSelect(OnSelect value) const;
|
|
465
|
+
|
|
466
|
+
void onDeselect(OnDeselect value) const;
|
|
467
|
+
};
|
|
333
468
|
class RNMapsGooglePolygonEventEmitter : public ViewEventEmitter {
|
|
334
469
|
public:
|
|
335
470
|
using ViewEventEmitter::ViewEventEmitter;
|
|
@@ -821,6 +956,28 @@ class RNMapsOverlayEventEmitter : public ViewEventEmitter {
|
|
|
821
956
|
};
|
|
822
957
|
void onPress(OnPress value) const;
|
|
823
958
|
};
|
|
959
|
+
class RNMapsPolygonEventEmitter : public ViewEventEmitter {
|
|
960
|
+
public:
|
|
961
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
962
|
+
|
|
963
|
+
struct OnPressCoordinate {
|
|
964
|
+
double latitude;
|
|
965
|
+
double longitude;
|
|
966
|
+
};
|
|
967
|
+
|
|
968
|
+
struct OnPressPosition {
|
|
969
|
+
double x;
|
|
970
|
+
double y;
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
struct OnPress {
|
|
974
|
+
std::string action;
|
|
975
|
+
std::string id;
|
|
976
|
+
OnPressCoordinate coordinate;
|
|
977
|
+
OnPressPosition position;
|
|
978
|
+
};
|
|
979
|
+
void onPress(OnPress value) const;
|
|
980
|
+
};
|
|
824
981
|
class RNMapsPolylineEventEmitter : public ViewEventEmitter {
|
|
825
982
|
public:
|
|
826
983
|
using ViewEventEmitter::ViewEventEmitter;
|
|
@@ -292,6 +292,110 @@ folly::dynamic RNMapsGoogleMapViewProps::getDiffProps(
|
|
|
292
292
|
return result;
|
|
293
293
|
}
|
|
294
294
|
#endif
|
|
295
|
+
RNMapsGoogleMarkerProps::RNMapsGoogleMarkerProps(
|
|
296
|
+
const PropsParserContext &context,
|
|
297
|
+
const RNMapsGoogleMarkerProps &sourceProps,
|
|
298
|
+
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
299
|
+
|
|
300
|
+
anchor(convertRawProp(context, rawProps, "anchor", sourceProps.anchor, {})),
|
|
301
|
+
calloutAnchor(convertRawProp(context, rawProps, "calloutAnchor", sourceProps.calloutAnchor, {})),
|
|
302
|
+
image(convertRawProp(context, rawProps, "image", sourceProps.image, {})),
|
|
303
|
+
icon(convertRawProp(context, rawProps, "icon", sourceProps.icon, {})),
|
|
304
|
+
coordinate(convertRawProp(context, rawProps, "coordinate", sourceProps.coordinate, {})),
|
|
305
|
+
description(convertRawProp(context, rawProps, "description", sourceProps.description, {})),
|
|
306
|
+
draggable(convertRawProp(context, rawProps, "draggable", sourceProps.draggable, {false})),
|
|
307
|
+
title(convertRawProp(context, rawProps, "title", sourceProps.title, {})),
|
|
308
|
+
tracksViewChanges(convertRawProp(context, rawProps, "tracksViewChanges", sourceProps.tracksViewChanges, {true})),
|
|
309
|
+
tracksInfoWindowChanges(convertRawProp(context, rawProps, "tracksInfoWindowChanges", sourceProps.tracksInfoWindowChanges, {false})),
|
|
310
|
+
flat(convertRawProp(context, rawProps, "flat", sourceProps.flat, {false})),
|
|
311
|
+
rotation(convertRawProp(context, rawProps, "rotation", sourceProps.rotation, {0.0})),
|
|
312
|
+
identifier(convertRawProp(context, rawProps, "identifier", sourceProps.identifier, {})),
|
|
313
|
+
tappable(convertRawProp(context, rawProps, "tappable", sourceProps.tappable, {true})),
|
|
314
|
+
opacity(convertRawProp(context, rawProps, "opacity", sourceProps.opacity, {1.0})),
|
|
315
|
+
pinColor(convertRawProp(context, rawProps, "pinColor", sourceProps.pinColor, {})) {}
|
|
316
|
+
|
|
317
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
318
|
+
ComponentName RNMapsGoogleMarkerProps::getDiffPropsImplementationTarget() const {
|
|
319
|
+
return "RNMapsGoogleMarker";
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
folly::dynamic RNMapsGoogleMarkerProps::getDiffProps(
|
|
323
|
+
const Props* prevProps) const {
|
|
324
|
+
static const auto defaultProps = RNMapsGoogleMarkerProps();
|
|
325
|
+
const RNMapsGoogleMarkerProps* oldProps = prevProps == nullptr
|
|
326
|
+
? &defaultProps
|
|
327
|
+
: static_cast<const RNMapsGoogleMarkerProps*>(prevProps);
|
|
328
|
+
if (this == oldProps) {
|
|
329
|
+
return folly::dynamic::object();
|
|
330
|
+
}
|
|
331
|
+
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
|
|
332
|
+
|
|
333
|
+
if (anchor != oldProps->anchor) {
|
|
334
|
+
result["anchor"] = toDynamic(anchor);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (calloutAnchor != oldProps->calloutAnchor) {
|
|
338
|
+
result["calloutAnchor"] = toDynamic(calloutAnchor);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (image != oldProps->image) {
|
|
342
|
+
result["image"] = toDynamic(image);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (icon != oldProps->icon) {
|
|
346
|
+
result["icon"] = toDynamic(icon);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if (coordinate != oldProps->coordinate) {
|
|
350
|
+
result["coordinate"] = toDynamic(coordinate);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (description != oldProps->description) {
|
|
354
|
+
result["description"] = description;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (draggable != oldProps->draggable) {
|
|
358
|
+
result["draggable"] = draggable;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (title != oldProps->title) {
|
|
362
|
+
result["title"] = title;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (tracksViewChanges != oldProps->tracksViewChanges) {
|
|
366
|
+
result["tracksViewChanges"] = tracksViewChanges;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (tracksInfoWindowChanges != oldProps->tracksInfoWindowChanges) {
|
|
370
|
+
result["tracksInfoWindowChanges"] = tracksInfoWindowChanges;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
if (flat != oldProps->flat) {
|
|
374
|
+
result["flat"] = flat;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
if ((rotation != oldProps->rotation) && !(std::isnan(rotation) && std::isnan(oldProps->rotation))) {
|
|
378
|
+
result["rotation"] = rotation;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if (identifier != oldProps->identifier) {
|
|
382
|
+
result["identifier"] = identifier;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
if (tappable != oldProps->tappable) {
|
|
386
|
+
result["tappable"] = tappable;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
if ((opacity != oldProps->opacity) && !(std::isnan(opacity) && std::isnan(oldProps->opacity))) {
|
|
390
|
+
result["opacity"] = opacity;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (pinColor != oldProps->pinColor) {
|
|
394
|
+
result["pinColor"] = *pinColor;
|
|
395
|
+
}
|
|
396
|
+
return result;
|
|
397
|
+
}
|
|
398
|
+
#endif
|
|
295
399
|
RNMapsGooglePolygonProps::RNMapsGooglePolygonProps(
|
|
296
400
|
const PropsParserContext &context,
|
|
297
401
|
const RNMapsGooglePolygonProps &sourceProps,
|
|
@@ -365,6 +469,7 @@ RNMapsMapViewProps::RNMapsMapViewProps(
|
|
|
365
469
|
initialRegion(convertRawProp(context, rawProps, "initialRegion", sourceProps.initialRegion, {})),
|
|
366
470
|
kmlSrc(convertRawProp(context, rawProps, "kmlSrc", sourceProps.kmlSrc, {})),
|
|
367
471
|
legalLabelInsets(convertRawProp(context, rawProps, "legalLabelInsets", sourceProps.legalLabelInsets, {})),
|
|
472
|
+
appleLogoInsets(convertRawProp(context, rawProps, "appleLogoInsets", sourceProps.appleLogoInsets, {})),
|
|
368
473
|
liteMode(convertRawProp(context, rawProps, "liteMode", sourceProps.liteMode, {false})),
|
|
369
474
|
googleMapId(convertRawProp(context, rawProps, "googleMapId", sourceProps.googleMapId, {})),
|
|
370
475
|
googleRenderer(convertRawProp(context, rawProps, "googleRenderer", sourceProps.googleRenderer, {RNMapsMapViewGoogleRenderer::LATEST})),
|
|
@@ -461,6 +566,10 @@ folly::dynamic RNMapsMapViewProps::getDiffProps(
|
|
|
461
566
|
result["legalLabelInsets"] = toDynamic(legalLabelInsets);
|
|
462
567
|
}
|
|
463
568
|
|
|
569
|
+
if (appleLogoInsets != oldProps->appleLogoInsets) {
|
|
570
|
+
result["appleLogoInsets"] = toDynamic(appleLogoInsets);
|
|
571
|
+
}
|
|
572
|
+
|
|
464
573
|
if (liteMode != oldProps->liteMode) {
|
|
465
574
|
result["liteMode"] = liteMode;
|
|
466
575
|
}
|
|
@@ -798,6 +907,80 @@ folly::dynamic RNMapsOverlayProps::getDiffProps(
|
|
|
798
907
|
return result;
|
|
799
908
|
}
|
|
800
909
|
#endif
|
|
910
|
+
RNMapsPolygonProps::RNMapsPolygonProps(
|
|
911
|
+
const PropsParserContext &context,
|
|
912
|
+
const RNMapsPolygonProps &sourceProps,
|
|
913
|
+
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
914
|
+
|
|
915
|
+
coordinates(convertRawProp(context, rawProps, "coordinates", sourceProps.coordinates, {})),
|
|
916
|
+
fillColor(convertRawProp(context, rawProps, "fillColor", sourceProps.fillColor, {})),
|
|
917
|
+
strokeColor(convertRawProp(context, rawProps, "strokeColor", sourceProps.strokeColor, {})),
|
|
918
|
+
strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {1.0})),
|
|
919
|
+
holes(convertRawProp(context, rawProps, "holes", sourceProps.holes, {})),
|
|
920
|
+
lineCap(convertRawProp(context, rawProps, "lineCap", sourceProps.lineCap, {RNMapsPolygonLineCap::Round})),
|
|
921
|
+
lineJoin(convertRawProp(context, rawProps, "lineJoin", sourceProps.lineJoin, {RNMapsPolygonLineJoin::Round})),
|
|
922
|
+
miterLimit(convertRawProp(context, rawProps, "miterLimit", sourceProps.miterLimit, {10.0})),
|
|
923
|
+
lineDashPhase(convertRawProp(context, rawProps, "lineDashPhase", sourceProps.lineDashPhase, {0.0})),
|
|
924
|
+
lineDashPattern(convertRawProp(context, rawProps, "lineDashPattern", sourceProps.lineDashPattern, {})) {}
|
|
925
|
+
|
|
926
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
927
|
+
ComponentName RNMapsPolygonProps::getDiffPropsImplementationTarget() const {
|
|
928
|
+
return "RNMapsPolygon";
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
folly::dynamic RNMapsPolygonProps::getDiffProps(
|
|
932
|
+
const Props* prevProps) const {
|
|
933
|
+
static const auto defaultProps = RNMapsPolygonProps();
|
|
934
|
+
const RNMapsPolygonProps* oldProps = prevProps == nullptr
|
|
935
|
+
? &defaultProps
|
|
936
|
+
: static_cast<const RNMapsPolygonProps*>(prevProps);
|
|
937
|
+
if (this == oldProps) {
|
|
938
|
+
return folly::dynamic::object();
|
|
939
|
+
}
|
|
940
|
+
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
|
|
941
|
+
|
|
942
|
+
if (coordinates != oldProps->coordinates) {
|
|
943
|
+
result["coordinates"] = toDynamic(coordinates);
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
if (fillColor != oldProps->fillColor) {
|
|
947
|
+
result["fillColor"] = *fillColor;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
if (strokeColor != oldProps->strokeColor) {
|
|
951
|
+
result["strokeColor"] = *strokeColor;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
if ((strokeWidth != oldProps->strokeWidth) && !(std::isnan(strokeWidth) && std::isnan(oldProps->strokeWidth))) {
|
|
955
|
+
result["strokeWidth"] = strokeWidth;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
if (holes != oldProps->holes) {
|
|
959
|
+
result["holes"] = toDynamic(holes);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
if (lineCap != oldProps->lineCap) {
|
|
963
|
+
result["lineCap"] = toDynamic(lineCap);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
if (lineJoin != oldProps->lineJoin) {
|
|
967
|
+
result["lineJoin"] = toDynamic(lineJoin);
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
if ((miterLimit != oldProps->miterLimit) && !(std::isnan(miterLimit) && std::isnan(oldProps->miterLimit))) {
|
|
971
|
+
result["miterLimit"] = miterLimit;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
if ((lineDashPhase != oldProps->lineDashPhase) && !(std::isnan(lineDashPhase) && std::isnan(oldProps->lineDashPhase))) {
|
|
975
|
+
result["lineDashPhase"] = lineDashPhase;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
if (lineDashPattern != oldProps->lineDashPattern) {
|
|
979
|
+
result["lineDashPattern"] = toDynamic(lineDashPattern);
|
|
980
|
+
}
|
|
981
|
+
return result;
|
|
982
|
+
}
|
|
983
|
+
#endif
|
|
801
984
|
RNMapsPolylineProps::RNMapsPolylineProps(
|
|
802
985
|
const PropsParserContext &context,
|
|
803
986
|
const RNMapsPolylineProps &sourceProps,
|