@lugg/maps 1.0.0-beta.3 → 1.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/android/src/main/java/com/luggmaps/LuggCalloutView.kt +4 -2
- package/android/src/main/java/com/luggmaps/LuggCalloutViewManager.kt +4 -3
- package/android/src/main/java/com/luggmaps/LuggCircleView.kt +85 -0
- package/android/src/main/java/com/luggmaps/LuggCircleViewManager.kt +79 -0
- package/android/src/main/java/com/luggmaps/LuggGroundOverlayView.kt +81 -0
- package/android/src/main/java/com/luggmaps/LuggGroundOverlayViewManager.kt +82 -0
- package/android/src/main/java/com/luggmaps/LuggMapView.kt +49 -0
- package/android/src/main/java/com/luggmaps/LuggMapViewManager.kt +31 -0
- package/android/src/main/java/com/luggmaps/LuggMarkerView.kt +23 -0
- package/android/src/main/java/com/luggmaps/LuggMarkerViewManager.kt +13 -0
- package/android/src/main/java/com/luggmaps/LuggPackage.kt +4 -1
- package/android/src/main/java/com/luggmaps/LuggTileOverlayView.kt +92 -0
- package/android/src/main/java/com/luggmaps/LuggTileOverlayViewManager.kt +80 -0
- package/android/src/main/java/com/luggmaps/core/GoogleMapProvider.kt +451 -17
- package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +14 -0
- package/android/src/main/java/com/luggmaps/events/CirclePressEvent.kt +12 -0
- package/android/src/main/java/com/luggmaps/events/GroundOverlayPressEvent.kt +12 -0
- package/android/src/main/java/com/luggmaps/events/TileOverlayPressEvent.kt +12 -0
- package/android/src/main/java/com/luggmaps/extensions/ViewExtensions.kt +11 -0
- package/ios/LuggCalloutView.h +1 -1
- package/ios/LuggCalloutView.mm +21 -11
- package/ios/LuggCircleView.h +31 -0
- package/ios/LuggCircleView.mm +133 -0
- package/ios/LuggGroundOverlayView.h +30 -0
- package/ios/LuggGroundOverlayView.mm +125 -0
- package/ios/LuggMapView.mm +84 -2
- package/ios/LuggMarkerView.h +3 -0
- package/ios/LuggMarkerView.mm +23 -0
- package/ios/LuggTileOverlayView.h +31 -0
- package/ios/LuggTileOverlayView.mm +130 -0
- package/ios/core/AppleMapProvider.mm +595 -17
- package/ios/core/GoogleMapProvider.mm +390 -28
- package/ios/core/MapProviderDelegate.h +20 -1
- package/ios/events/CirclePressEvent.h +20 -0
- package/ios/events/GroundOverlayPressEvent.h +20 -0
- package/ios/events/TileOverlayPressEvent.h +20 -0
- package/lib/module/MapView.js +11 -0
- package/lib/module/MapView.js.map +1 -1
- package/lib/module/MapView.web.js +3 -0
- package/lib/module/MapView.web.js.map +1 -1
- package/lib/module/components/Circle.js +46 -0
- package/lib/module/components/Circle.js.map +1 -0
- package/lib/module/components/Circle.types.js +4 -0
- package/lib/module/components/Circle.types.js.map +1 -0
- package/lib/module/components/Circle.web.js +79 -0
- package/lib/module/components/Circle.web.js.map +1 -0
- package/lib/module/components/GroundOverlay.js +45 -0
- package/lib/module/components/GroundOverlay.js.map +1 -0
- package/lib/module/components/GroundOverlay.types.js +4 -0
- package/lib/module/components/GroundOverlay.types.js.map +1 -0
- package/lib/module/components/GroundOverlay.web.js +77 -0
- package/lib/module/components/GroundOverlay.web.js.map +1 -0
- package/lib/module/components/Marker.js +22 -4
- package/lib/module/components/Marker.js.map +1 -1
- package/lib/module/components/Marker.web.js +20 -7
- package/lib/module/components/Marker.web.js.map +1 -1
- package/lib/module/components/TileOverlay.js +44 -0
- package/lib/module/components/TileOverlay.js.map +1 -0
- package/lib/module/components/TileOverlay.types.js +4 -0
- package/lib/module/components/TileOverlay.types.js.map +1 -0
- package/lib/module/components/TileOverlay.web.js +69 -0
- package/lib/module/components/TileOverlay.web.js.map +1 -0
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/index.web.js +3 -0
- package/lib/module/components/index.web.js.map +1 -1
- package/lib/module/fabric/LuggCalloutViewNativeComponent.ts +1 -1
- package/lib/module/fabric/LuggCircleViewNativeComponent.ts +25 -0
- package/lib/module/fabric/LuggGroundOverlayViewNativeComponent.ts +29 -0
- package/lib/module/fabric/LuggMapViewNativeComponent.ts +9 -1
- package/lib/module/fabric/LuggMarkerViewNativeComponent.ts +14 -2
- package/lib/module/fabric/LuggTileOverlayViewNativeComponent.ts +30 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +3 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/typescript/src/MapView.d.ts.map +1 -1
- package/lib/typescript/src/MapView.types.d.ts +36 -1
- package/lib/typescript/src/MapView.types.d.ts.map +1 -1
- package/lib/typescript/src/MapView.web.d.ts.map +1 -1
- package/lib/typescript/src/components/Circle.d.ts +10 -0
- package/lib/typescript/src/components/Circle.d.ts.map +1 -0
- package/lib/typescript/src/components/Circle.types.d.ts +33 -0
- package/lib/typescript/src/components/Circle.types.d.ts.map +1 -0
- package/lib/typescript/src/components/Circle.web.d.ts +3 -0
- package/lib/typescript/src/components/Circle.web.d.ts.map +1 -0
- package/lib/typescript/src/components/GroundOverlay.d.ts +10 -0
- package/lib/typescript/src/components/GroundOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/GroundOverlay.types.d.ts +35 -0
- package/lib/typescript/src/components/GroundOverlay.types.d.ts.map +1 -0
- package/lib/typescript/src/components/GroundOverlay.web.d.ts +3 -0
- package/lib/typescript/src/components/GroundOverlay.web.d.ts.map +1 -0
- package/lib/typescript/src/components/Marker.d.ts +6 -3
- package/lib/typescript/src/components/Marker.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.types.d.ts +18 -6
- package/lib/typescript/src/components/Marker.types.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.web.d.ts +3 -2
- package/lib/typescript/src/components/Marker.web.d.ts.map +1 -1
- package/lib/typescript/src/components/TileOverlay.d.ts +10 -0
- package/lib/typescript/src/components/TileOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/TileOverlay.types.d.ts +36 -0
- package/lib/typescript/src/components/TileOverlay.types.d.ts.map +1 -0
- package/lib/typescript/src/components/TileOverlay.web.d.ts +3 -0
- package/lib/typescript/src/components/TileOverlay.web.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +7 -1
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/components/index.web.d.ts +6 -0
- package/lib/typescript/src/components/index.web.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts +1 -1
- package/lib/typescript/src/fabric/LuggCircleViewNativeComponent.d.ts +18 -0
- package/lib/typescript/src/fabric/LuggCircleViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggGroundOverlayViewNativeComponent.d.ts +21 -0
- package/lib/typescript/src/fabric/LuggGroundOverlayViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts +6 -1
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts +8 -1
- package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggTileOverlayViewNativeComponent.d.ts +21 -0
- package/lib/typescript/src/fabric/LuggTileOverlayViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +9 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +7 -1
- package/lib/typescript/src/index.web.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +0 -4
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +5 -2
- package/src/MapView.tsx +11 -0
- package/src/MapView.types.ts +85 -1
- package/src/MapView.web.tsx +11 -0
- package/src/components/Circle.tsx +52 -0
- package/src/components/Circle.types.ts +33 -0
- package/src/components/Circle.web.tsx +93 -0
- package/src/components/GroundOverlay.tsx +47 -0
- package/src/components/GroundOverlay.types.ts +36 -0
- package/src/components/GroundOverlay.web.tsx +85 -0
- package/src/components/Marker.tsx +32 -6
- package/src/components/Marker.types.ts +19 -6
- package/src/components/Marker.web.tsx +191 -148
- package/src/components/TileOverlay.tsx +44 -0
- package/src/components/TileOverlay.types.ts +37 -0
- package/src/components/TileOverlay.web.tsx +95 -0
- package/src/components/index.ts +10 -0
- package/src/components/index.web.ts +9 -0
- package/src/fabric/LuggCalloutViewNativeComponent.ts +1 -1
- package/src/fabric/LuggCircleViewNativeComponent.ts +25 -0
- package/src/fabric/LuggGroundOverlayViewNativeComponent.ts +29 -0
- package/src/fabric/LuggMapViewNativeComponent.ts +9 -1
- package/src/fabric/LuggMarkerViewNativeComponent.ts +14 -2
- package/src/fabric/LuggTileOverlayViewNativeComponent.ts +30 -0
- package/src/index.ts +12 -1
- package/src/index.web.ts +15 -0
- package/src/types.ts +0 -5
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
#import "GoogleMapProvider.h"
|
|
2
|
+
|
|
3
|
+
using facebook::react::LuggMapViewInsetAdjustment;
|
|
4
|
+
using facebook::react::LuggMapViewMapType;
|
|
5
|
+
using facebook::react::LuggMapViewPoiFilterMode;
|
|
6
|
+
using facebook::react::LuggMapViewTheme;
|
|
7
|
+
|
|
2
8
|
#import "../LuggCalloutView.h"
|
|
9
|
+
#import "../LuggCircleView.h"
|
|
10
|
+
#import "../LuggGroundOverlayView.h"
|
|
3
11
|
#import "../LuggMarkerView.h"
|
|
4
12
|
#import "../LuggPolygonView.h"
|
|
5
13
|
#import "../LuggPolylineView.h"
|
|
14
|
+
#import "../LuggTileOverlayView.h"
|
|
6
15
|
#import "GMSPolylineAnimator.h"
|
|
7
16
|
#import "PolylineAnimatorBase.h"
|
|
8
17
|
|
|
@@ -10,7 +19,8 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
10
19
|
|
|
11
20
|
@interface GoogleMapProvider () <
|
|
12
21
|
LuggMarkerViewDelegate, LuggCalloutViewDelegate, LuggPolylineViewDelegate,
|
|
13
|
-
LuggPolygonViewDelegate
|
|
22
|
+
LuggPolygonViewDelegate, LuggCircleViewDelegate,
|
|
23
|
+
LuggGroundOverlayViewDelegate, LuggTileOverlayViewDelegate>
|
|
14
24
|
@end
|
|
15
25
|
|
|
16
26
|
@implementation GoogleMapProvider {
|
|
@@ -18,14 +28,20 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
18
28
|
GMSMapView *_mapView;
|
|
19
29
|
BOOL _isMapReady;
|
|
20
30
|
BOOL _isDragging;
|
|
21
|
-
|
|
31
|
+
LuggMapViewTheme _theme;
|
|
22
32
|
UIEdgeInsets _edgeInsets;
|
|
23
33
|
NSMutableArray<LuggMarkerView *> *_pendingMarkerViews;
|
|
24
34
|
NSMutableArray<LuggPolylineView *> *_pendingPolylineViews;
|
|
25
35
|
NSMutableArray<LuggPolygonView *> *_pendingPolygonViews;
|
|
36
|
+
NSMutableArray<LuggCircleView *> *_pendingCircleViews;
|
|
37
|
+
NSMutableArray<LuggGroundOverlayView *> *_pendingGroundOverlayViews;
|
|
38
|
+
NSMutableArray<LuggTileOverlayView *> *_pendingTileOverlayViews;
|
|
26
39
|
NSMapTable<LuggPolylineView *, GMSPolylineAnimator *> *_polylineAnimators;
|
|
27
40
|
NSMapTable<GMSPolygon *, LuggPolygonView *> *_polygonToViewMap;
|
|
41
|
+
NSMapTable<GMSCircle *, LuggCircleView *> *_circleToViewMap;
|
|
28
42
|
NSMapTable<GMSMarker *, LuggMarkerView *> *_markerToViewMap;
|
|
43
|
+
NSMapTable<GMSGroundOverlay *, LuggGroundOverlayView *>
|
|
44
|
+
*_groundOverlayToViewMap;
|
|
29
45
|
LuggMarkerView *_activeNonBubbledMarker;
|
|
30
46
|
|
|
31
47
|
// Edge insets animation
|
|
@@ -45,9 +61,14 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
45
61
|
_pendingMarkerViews = [NSMutableArray array];
|
|
46
62
|
_pendingPolylineViews = [NSMutableArray array];
|
|
47
63
|
_pendingPolygonViews = [NSMutableArray array];
|
|
64
|
+
_pendingCircleViews = [NSMutableArray array];
|
|
65
|
+
_pendingGroundOverlayViews = [NSMutableArray array];
|
|
66
|
+
_pendingTileOverlayViews = [NSMutableArray array];
|
|
48
67
|
_polylineAnimators = [NSMapTable weakToStrongObjectsMapTable];
|
|
49
68
|
_polygonToViewMap = [NSMapTable strongToWeakObjectsMapTable];
|
|
69
|
+
_circleToViewMap = [NSMapTable strongToWeakObjectsMapTable];
|
|
50
70
|
_markerToViewMap = [NSMapTable strongToWeakObjectsMapTable];
|
|
71
|
+
_groundOverlayToViewMap = [NSMapTable strongToWeakObjectsMapTable];
|
|
51
72
|
}
|
|
52
73
|
return self;
|
|
53
74
|
}
|
|
@@ -101,6 +122,9 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
101
122
|
[self processPendingMarkers];
|
|
102
123
|
[self processPendingPolylines];
|
|
103
124
|
[self processPendingPolygons];
|
|
125
|
+
[self processPendingCircles];
|
|
126
|
+
[self processPendingGroundOverlays];
|
|
127
|
+
[self processPendingTileOverlays];
|
|
104
128
|
|
|
105
129
|
[_delegate mapProviderDidReady];
|
|
106
130
|
}
|
|
@@ -110,9 +134,14 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
110
134
|
[_pendingMarkerViews removeAllObjects];
|
|
111
135
|
[_pendingPolylineViews removeAllObjects];
|
|
112
136
|
[_pendingPolygonViews removeAllObjects];
|
|
137
|
+
[_pendingCircleViews removeAllObjects];
|
|
138
|
+
[_pendingGroundOverlayViews removeAllObjects];
|
|
139
|
+
[_pendingTileOverlayViews removeAllObjects];
|
|
113
140
|
[_polylineAnimators removeAllObjects];
|
|
114
141
|
[_polygonToViewMap removeAllObjects];
|
|
142
|
+
[_circleToViewMap removeAllObjects];
|
|
115
143
|
[_markerToViewMap removeAllObjects];
|
|
144
|
+
[_groundOverlayToViewMap removeAllObjects];
|
|
116
145
|
[_mapView clear];
|
|
117
146
|
[_mapView removeFromSuperview];
|
|
118
147
|
_mapView = nil;
|
|
@@ -141,7 +170,43 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
141
170
|
_mapView.myLocationEnabled = enabled;
|
|
142
171
|
}
|
|
143
172
|
|
|
144
|
-
- (void)
|
|
173
|
+
- (void)setInsetAdjustment:(LuggMapViewInsetAdjustment)insetAdjustment {
|
|
174
|
+
_mapView.paddingAdjustmentBehavior =
|
|
175
|
+
(insetAdjustment == LuggMapViewInsetAdjustment::Automatic)
|
|
176
|
+
? kGMSMapViewPaddingAdjustmentBehaviorAlways
|
|
177
|
+
: kGMSMapViewPaddingAdjustmentBehaviorNever;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
- (void)setPoiEnabled:(BOOL)enabled {
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
- (void)setPoiFilterMode:(LuggMapViewPoiFilterMode)mode {
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
- (void)setPoiFilterCategories:(NSArray<NSString *> *)categories {
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
- (void)setMapType:(LuggMapViewMapType)mapType {
|
|
190
|
+
if (!_mapView)
|
|
191
|
+
return;
|
|
192
|
+
|
|
193
|
+
switch (mapType) {
|
|
194
|
+
case LuggMapViewMapType::Satellite:
|
|
195
|
+
_mapView.mapType = kGMSTypeSatellite;
|
|
196
|
+
break;
|
|
197
|
+
case LuggMapViewMapType::Terrain:
|
|
198
|
+
_mapView.mapType = kGMSTypeTerrain;
|
|
199
|
+
break;
|
|
200
|
+
case LuggMapViewMapType::Hybrid:
|
|
201
|
+
_mapView.mapType = kGMSTypeHybrid;
|
|
202
|
+
break;
|
|
203
|
+
default:
|
|
204
|
+
_mapView.mapType = kGMSTypeNormal;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
- (void)setTheme:(LuggMapViewTheme)theme {
|
|
145
210
|
_theme = theme;
|
|
146
211
|
[self applyTheme];
|
|
147
212
|
}
|
|
@@ -151,13 +216,13 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
151
216
|
return;
|
|
152
217
|
|
|
153
218
|
switch (_theme) {
|
|
154
|
-
case
|
|
219
|
+
case LuggMapViewTheme::Dark:
|
|
155
220
|
_mapView.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;
|
|
156
221
|
break;
|
|
157
|
-
case
|
|
222
|
+
case LuggMapViewTheme::Light:
|
|
158
223
|
_mapView.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
|
|
159
224
|
break;
|
|
160
|
-
default:
|
|
225
|
+
default:
|
|
161
226
|
_mapView.overrideUserInterfaceStyle = UIUserInterfaceStyleUnspecified;
|
|
162
227
|
break;
|
|
163
228
|
}
|
|
@@ -291,15 +356,26 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
291
356
|
}
|
|
292
357
|
|
|
293
358
|
- (void)mapView:(GMSMapView *)mapView didTapOverlay:(GMSOverlay *)overlay {
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
359
|
+
if ([overlay isKindOfClass:[GMSPolygon class]]) {
|
|
360
|
+
GMSPolygon *polygon = (GMSPolygon *)overlay;
|
|
361
|
+
LuggPolygonView *polygonView = [_polygonToViewMap objectForKey:polygon];
|
|
362
|
+
if (polygonView && polygonView.tappable) {
|
|
363
|
+
[polygonView emitPressEvent];
|
|
364
|
+
}
|
|
365
|
+
} else if ([overlay isKindOfClass:[GMSCircle class]]) {
|
|
366
|
+
GMSCircle *circle = (GMSCircle *)overlay;
|
|
367
|
+
LuggCircleView *circleView = [_circleToViewMap objectForKey:circle];
|
|
368
|
+
if (circleView && circleView.tappable) {
|
|
369
|
+
[circleView emitPressEvent];
|
|
370
|
+
}
|
|
371
|
+
} else if ([overlay isKindOfClass:[GMSGroundOverlay class]]) {
|
|
372
|
+
GMSGroundOverlay *groundOverlay = (GMSGroundOverlay *)overlay;
|
|
373
|
+
LuggGroundOverlayView *groundOverlayView =
|
|
374
|
+
[_groundOverlayToViewMap objectForKey:groundOverlay];
|
|
375
|
+
if (groundOverlayView && groundOverlayView.tappable) {
|
|
376
|
+
[groundOverlayView emitPressEvent];
|
|
377
|
+
}
|
|
378
|
+
}
|
|
303
379
|
}
|
|
304
380
|
|
|
305
381
|
- (BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker {
|
|
@@ -312,15 +388,21 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
312
388
|
|
|
313
389
|
LuggCalloutView *calloutView = markerView.calloutView;
|
|
314
390
|
if (calloutView && calloutView.hasCustomContent) {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
391
|
+
if (markerView.centerOnPress) {
|
|
392
|
+
[mapView animateToLocation:marker.position];
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
mapView.selectedMarker = marker;
|
|
396
|
+
|
|
397
|
+
if (!calloutView.bubbled) {
|
|
398
|
+
[self showNonBubbledCallout:markerView];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
return YES;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
if (!markerView.centerOnPress) {
|
|
405
|
+
mapView.selectedMarker = marker;
|
|
324
406
|
return YES;
|
|
325
407
|
}
|
|
326
408
|
}
|
|
@@ -439,7 +521,7 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
439
521
|
if (contentSize.width <= 0 || contentSize.height <= 0)
|
|
440
522
|
return;
|
|
441
523
|
|
|
442
|
-
CGPoint
|
|
524
|
+
CGPoint offset = calloutView.offset;
|
|
443
525
|
CGPoint point = [_mapView.projection
|
|
444
526
|
pointForCoordinate:_activeNonBubbledMarker.coordinate];
|
|
445
527
|
|
|
@@ -448,9 +530,34 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
448
530
|
iconView.bounds.size.height * _activeNonBubbledMarker.scale;
|
|
449
531
|
|
|
450
532
|
contentView.center =
|
|
451
|
-
CGPointMake(point.x +
|
|
452
|
-
point.y - markerHeight * _activeNonBubbledMarker.anchor.y
|
|
453
|
-
contentSize.height
|
|
533
|
+
CGPointMake(point.x + offset.x,
|
|
534
|
+
point.y - markerHeight * _activeNonBubbledMarker.anchor.y -
|
|
535
|
+
contentSize.height / 2.0 + offset.y);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
- (void)showCalloutForMarkerView:(LuggMarkerView *)markerView {
|
|
539
|
+
LuggCalloutView *calloutView = markerView.calloutView;
|
|
540
|
+
if (calloutView && calloutView.hasCustomContent) {
|
|
541
|
+
[self dismissNonBubbledCallout];
|
|
542
|
+
GMSMarker *marker = (GMSMarker *)markerView.marker;
|
|
543
|
+
if (calloutView.bubbled) {
|
|
544
|
+
_mapView.selectedMarker = marker;
|
|
545
|
+
} else {
|
|
546
|
+
[self showNonBubbledCallout:markerView];
|
|
547
|
+
}
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
if (markerView.title.length > 0) {
|
|
552
|
+
_mapView.selectedMarker = (GMSMarker *)markerView.marker;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
- (void)hideCalloutForMarkerView:(LuggMarkerView *)markerView {
|
|
557
|
+
[self dismissNonBubbledCallout];
|
|
558
|
+
if (_mapView.selectedMarker == markerView.marker) {
|
|
559
|
+
_mapView.selectedMarker = nil;
|
|
560
|
+
}
|
|
454
561
|
}
|
|
455
562
|
|
|
456
563
|
#pragma mark - MarkerViewDelegate
|
|
@@ -475,6 +582,24 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
475
582
|
[self syncPolygonView:polygonView];
|
|
476
583
|
}
|
|
477
584
|
|
|
585
|
+
#pragma mark - CircleViewDelegate
|
|
586
|
+
|
|
587
|
+
- (void)circleViewDidUpdate:(LuggCircleView *)circleView {
|
|
588
|
+
[self syncCircleView:circleView];
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
#pragma mark - GroundOverlayViewDelegate
|
|
592
|
+
|
|
593
|
+
- (void)groundOverlayViewDidUpdate:(LuggGroundOverlayView *)groundOverlayView {
|
|
594
|
+
[self syncGroundOverlayView:groundOverlayView];
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
#pragma mark - TileOverlayViewDelegate
|
|
598
|
+
|
|
599
|
+
- (void)tileOverlayViewDidUpdate:(LuggTileOverlayView *)tileOverlayView {
|
|
600
|
+
[self syncTileOverlayView:tileOverlayView];
|
|
601
|
+
}
|
|
602
|
+
|
|
478
603
|
#pragma mark - Marker Management
|
|
479
604
|
|
|
480
605
|
- (void)addMarkerView:(LuggMarkerView *)markerView {
|
|
@@ -739,6 +864,243 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
739
864
|
[_polygonToViewMap setObject:polygonView forKey:polygon];
|
|
740
865
|
}
|
|
741
866
|
|
|
867
|
+
#pragma mark - Circle Management
|
|
868
|
+
|
|
869
|
+
- (void)addCircleView:(LuggCircleView *)circleView {
|
|
870
|
+
circleView.delegate = self;
|
|
871
|
+
[self syncCircleView:circleView];
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
- (void)removeCircleView:(LuggCircleView *)circleView {
|
|
875
|
+
GMSCircle *circle = (GMSCircle *)circleView.circle;
|
|
876
|
+
if (circle) {
|
|
877
|
+
[_circleToViewMap removeObjectForKey:circle];
|
|
878
|
+
circle.map = nil;
|
|
879
|
+
circleView.circle = nil;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
- (void)syncCircleView:(LuggCircleView *)circleView {
|
|
884
|
+
if (!_mapView) {
|
|
885
|
+
if (![_pendingCircleViews containsObject:circleView]) {
|
|
886
|
+
[_pendingCircleViews addObject:circleView];
|
|
887
|
+
}
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
if (!circleView.circle) {
|
|
892
|
+
[self addCircleViewToMap:circleView];
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
GMSCircle *circle = (GMSCircle *)circleView.circle;
|
|
897
|
+
circle.position = circleView.center;
|
|
898
|
+
circle.radius = circleView.radius;
|
|
899
|
+
circle.fillColor = circleView.fillColor;
|
|
900
|
+
circle.strokeColor = circleView.strokeColor;
|
|
901
|
+
circle.strokeWidth = circleView.strokeWidth;
|
|
902
|
+
circle.zIndex = (int)circleView.zIndex;
|
|
903
|
+
circle.tappable = circleView.tappable;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
- (void)processPendingCircles {
|
|
907
|
+
if (!_mapView)
|
|
908
|
+
return;
|
|
909
|
+
|
|
910
|
+
for (LuggCircleView *circleView in _pendingCircleViews) {
|
|
911
|
+
[self addCircleViewToMap:circleView];
|
|
912
|
+
}
|
|
913
|
+
[_pendingCircleViews removeAllObjects];
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
- (void)addCircleViewToMap:(LuggCircleView *)circleView {
|
|
917
|
+
if (!_mapView)
|
|
918
|
+
return;
|
|
919
|
+
|
|
920
|
+
GMSCircle *circle = [GMSCircle circleWithPosition:circleView.center
|
|
921
|
+
radius:circleView.radius];
|
|
922
|
+
circle.fillColor = circleView.fillColor;
|
|
923
|
+
circle.strokeColor = circleView.strokeColor;
|
|
924
|
+
circle.strokeWidth = circleView.strokeWidth;
|
|
925
|
+
circle.zIndex = (int)circleView.zIndex;
|
|
926
|
+
circle.tappable = circleView.tappable;
|
|
927
|
+
circle.map = _mapView;
|
|
928
|
+
circleView.circle = circle;
|
|
929
|
+
[_circleToViewMap setObject:circleView forKey:circle];
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
#pragma mark - Ground Overlay Management
|
|
933
|
+
|
|
934
|
+
- (void)addGroundOverlayView:(LuggGroundOverlayView *)groundOverlayView {
|
|
935
|
+
groundOverlayView.delegate = self;
|
|
936
|
+
[self syncGroundOverlayView:groundOverlayView];
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
- (void)removeGroundOverlayView:(LuggGroundOverlayView *)groundOverlayView {
|
|
940
|
+
groundOverlayView.delegate = nil;
|
|
941
|
+
GMSGroundOverlay *overlay = (GMSGroundOverlay *)groundOverlayView.overlay;
|
|
942
|
+
if (overlay) {
|
|
943
|
+
[_groundOverlayToViewMap removeObjectForKey:overlay];
|
|
944
|
+
overlay.map = nil;
|
|
945
|
+
groundOverlayView.overlay = nil;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
- (void)syncGroundOverlayView:(LuggGroundOverlayView *)groundOverlayView {
|
|
950
|
+
if (!_mapView) {
|
|
951
|
+
if (![_pendingGroundOverlayViews containsObject:groundOverlayView]) {
|
|
952
|
+
[_pendingGroundOverlayViews addObject:groundOverlayView];
|
|
953
|
+
}
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
NSString *imageUri = groundOverlayView.imageUri;
|
|
958
|
+
if (imageUri.length == 0)
|
|
959
|
+
return;
|
|
960
|
+
|
|
961
|
+
// Remove old overlay
|
|
962
|
+
GMSGroundOverlay *oldOverlay = (GMSGroundOverlay *)groundOverlayView.overlay;
|
|
963
|
+
if (oldOverlay) {
|
|
964
|
+
[_groundOverlayToViewMap removeObjectForKey:oldOverlay];
|
|
965
|
+
oldOverlay.map = nil;
|
|
966
|
+
groundOverlayView.overlay = nil;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
// Load image and create overlay
|
|
970
|
+
NSURL *url = [NSURL URLWithString:imageUri];
|
|
971
|
+
if (!url)
|
|
972
|
+
return;
|
|
973
|
+
|
|
974
|
+
__weak __typeof(self) weakSelf = self;
|
|
975
|
+
__weak LuggGroundOverlayView *weakOverlayView = groundOverlayView;
|
|
976
|
+
dispatch_async(
|
|
977
|
+
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
978
|
+
NSData *data = [NSData dataWithContentsOfURL:url];
|
|
979
|
+
UIImage *image = data ? [UIImage imageWithData:data] : nil;
|
|
980
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
981
|
+
[weakSelf addGroundOverlayToMap:weakOverlayView image:image];
|
|
982
|
+
});
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
- (void)addGroundOverlayToMap:(LuggGroundOverlayView *)groundOverlayView
|
|
987
|
+
image:(UIImage *)image {
|
|
988
|
+
if (!_mapView || !groundOverlayView || !image)
|
|
989
|
+
return;
|
|
990
|
+
|
|
991
|
+
GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc]
|
|
992
|
+
initWithCoordinate:groundOverlayView.southwest
|
|
993
|
+
coordinate:groundOverlayView.northeast];
|
|
994
|
+
|
|
995
|
+
GMSGroundOverlay *overlay = [GMSGroundOverlay groundOverlayWithBounds:bounds
|
|
996
|
+
icon:image];
|
|
997
|
+
overlay.opacity = groundOverlayView.opacity;
|
|
998
|
+
overlay.bearing = groundOverlayView.bearing;
|
|
999
|
+
overlay.zIndex = (int)groundOverlayView.zIndex;
|
|
1000
|
+
overlay.tappable = groundOverlayView.tappable;
|
|
1001
|
+
overlay.map = _mapView;
|
|
1002
|
+
|
|
1003
|
+
groundOverlayView.overlay = overlay;
|
|
1004
|
+
[_groundOverlayToViewMap setObject:groundOverlayView forKey:overlay];
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
- (void)processPendingGroundOverlays {
|
|
1008
|
+
if (!_mapView)
|
|
1009
|
+
return;
|
|
1010
|
+
|
|
1011
|
+
for (LuggGroundOverlayView *view in _pendingGroundOverlayViews) {
|
|
1012
|
+
[self syncGroundOverlayView:view];
|
|
1013
|
+
}
|
|
1014
|
+
[_pendingGroundOverlayViews removeAllObjects];
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
#pragma mark - Tile Overlay Management
|
|
1018
|
+
|
|
1019
|
+
- (void)addTileOverlayView:(LuggTileOverlayView *)tileOverlayView {
|
|
1020
|
+
tileOverlayView.delegate = self;
|
|
1021
|
+
[self syncTileOverlayView:tileOverlayView];
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
- (void)removeTileOverlayView:(LuggTileOverlayView *)tileOverlayView {
|
|
1025
|
+
tileOverlayView.delegate = nil;
|
|
1026
|
+
GMSTileLayer *tileLayer = (GMSTileLayer *)tileOverlayView.overlay;
|
|
1027
|
+
if (tileLayer) {
|
|
1028
|
+
tileLayer.map = nil;
|
|
1029
|
+
tileOverlayView.overlay = nil;
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
- (void)syncTileOverlayView:(LuggTileOverlayView *)tileOverlayView {
|
|
1034
|
+
if (!_mapView) {
|
|
1035
|
+
if (![_pendingTileOverlayViews containsObject:tileOverlayView]) {
|
|
1036
|
+
[_pendingTileOverlayViews addObject:tileOverlayView];
|
|
1037
|
+
}
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
NSString *urlTemplate = tileOverlayView.urlTemplate;
|
|
1042
|
+
if (urlTemplate.length == 0)
|
|
1043
|
+
return;
|
|
1044
|
+
|
|
1045
|
+
// Remove old tile layer
|
|
1046
|
+
GMSTileLayer *oldLayer = (GMSTileLayer *)tileOverlayView.overlay;
|
|
1047
|
+
if (oldLayer) {
|
|
1048
|
+
oldLayer.map = nil;
|
|
1049
|
+
tileOverlayView.overlay = nil;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
BOOL hasBounds = tileOverlayView.hasBounds;
|
|
1053
|
+
CLLocationCoordinate2D sw = tileOverlayView.southwest;
|
|
1054
|
+
CLLocationCoordinate2D ne = tileOverlayView.northeast;
|
|
1055
|
+
|
|
1056
|
+
GMSTileURLConstructor constructor = ^NSURL *(NSUInteger x, NSUInteger y,
|
|
1057
|
+
NSUInteger zoom) {
|
|
1058
|
+
if (hasBounds) {
|
|
1059
|
+
double n = pow(2.0, zoom);
|
|
1060
|
+
double tileSW_lat =
|
|
1061
|
+
180.0 / M_PI * atan(sinh(M_PI * (1 - 2.0 * (y + 1) / n)));
|
|
1062
|
+
double tileNE_lat = 180.0 / M_PI * atan(sinh(M_PI * (1 - 2.0 * y / n)));
|
|
1063
|
+
double tileSW_lng = x / n * 360.0 - 180.0;
|
|
1064
|
+
double tileNE_lng = (x + 1) / n * 360.0 - 180.0;
|
|
1065
|
+
|
|
1066
|
+
if (tileNE_lat < sw.latitude || tileSW_lat > ne.latitude ||
|
|
1067
|
+
tileNE_lng < sw.longitude || tileSW_lng > ne.longitude) {
|
|
1068
|
+
return nil;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
NSString *urlString =
|
|
1073
|
+
[urlTemplate stringByReplacingOccurrencesOfString:@"{x}"
|
|
1074
|
+
withString:[@(x) stringValue]];
|
|
1075
|
+
urlString =
|
|
1076
|
+
[urlString stringByReplacingOccurrencesOfString:@"{y}"
|
|
1077
|
+
withString:[@(y) stringValue]];
|
|
1078
|
+
urlString =
|
|
1079
|
+
[urlString stringByReplacingOccurrencesOfString:@"{z}"
|
|
1080
|
+
withString:[@(zoom) stringValue]];
|
|
1081
|
+
return [NSURL URLWithString:urlString];
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
GMSURLTileLayer *tileLayer =
|
|
1085
|
+
[GMSURLTileLayer tileLayerWithURLConstructor:constructor];
|
|
1086
|
+
tileLayer.tileSize = tileOverlayView.tileSize;
|
|
1087
|
+
tileLayer.opacity = tileOverlayView.opacity;
|
|
1088
|
+
tileLayer.zIndex = (int)tileOverlayView.zIndex;
|
|
1089
|
+
tileLayer.map = _mapView;
|
|
1090
|
+
|
|
1091
|
+
tileOverlayView.overlay = tileLayer;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
- (void)processPendingTileOverlays {
|
|
1095
|
+
if (!_mapView)
|
|
1096
|
+
return;
|
|
1097
|
+
|
|
1098
|
+
for (LuggTileOverlayView *view in _pendingTileOverlayViews) {
|
|
1099
|
+
[self syncTileOverlayView:view];
|
|
1100
|
+
}
|
|
1101
|
+
[_pendingTileOverlayViews removeAllObjects];
|
|
1102
|
+
}
|
|
1103
|
+
|
|
742
1104
|
#pragma mark - Lifecycle
|
|
743
1105
|
|
|
744
1106
|
- (void)pauseAnimations {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
#import <CoreLocation/CoreLocation.h>
|
|
2
2
|
#import <UIKit/UIKit.h>
|
|
3
|
+
#import <react/renderer/components/RNMapsSpec/Props.h>
|
|
3
4
|
|
|
4
5
|
NS_ASSUME_NONNULL_BEGIN
|
|
5
6
|
|
|
6
7
|
@class LuggMarkerView;
|
|
7
8
|
@class LuggPolylineView;
|
|
8
9
|
@class LuggPolygonView;
|
|
10
|
+
@class LuggCircleView;
|
|
11
|
+
@class LuggGroundOverlayView;
|
|
12
|
+
@class LuggTileOverlayView;
|
|
9
13
|
|
|
10
14
|
@protocol MapProviderDelegate <NSObject>
|
|
11
15
|
- (void)mapProviderDidReady;
|
|
@@ -38,12 +42,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
38
42
|
- (void)destroy;
|
|
39
43
|
|
|
40
44
|
// Props
|
|
45
|
+
- (void)setInsetAdjustment:
|
|
46
|
+
(facebook::react::LuggMapViewInsetAdjustment)insetAdjustment;
|
|
41
47
|
- (void)setZoomEnabled:(BOOL)enabled;
|
|
42
48
|
- (void)setScrollEnabled:(BOOL)enabled;
|
|
43
49
|
- (void)setRotateEnabled:(BOOL)enabled;
|
|
44
50
|
- (void)setPitchEnabled:(BOOL)enabled;
|
|
45
51
|
- (void)setUserLocationEnabled:(BOOL)enabled;
|
|
46
|
-
- (void)
|
|
52
|
+
- (void)setMapType:(facebook::react::LuggMapViewMapType)mapType;
|
|
53
|
+
- (void)setTheme:(facebook::react::LuggMapViewTheme)theme;
|
|
47
54
|
- (void)setMinZoom:(double)minZoom;
|
|
48
55
|
- (void)setMaxZoom:(double)maxZoom;
|
|
49
56
|
- (void)setEdgeInsets:(UIEdgeInsets)edgeInsets
|
|
@@ -51,6 +58,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
51
58
|
- (void)setEdgeInsets:(UIEdgeInsets)edgeInsets
|
|
52
59
|
oldEdgeInsets:(UIEdgeInsets)oldEdgeInsets
|
|
53
60
|
duration:(double)duration;
|
|
61
|
+
- (void)setPoiEnabled:(BOOL)enabled;
|
|
62
|
+
- (void)setPoiFilterMode:(facebook::react::LuggMapViewPoiFilterMode)mode;
|
|
63
|
+
- (void)setPoiFilterCategories:(NSArray<NSString *> *)categories;
|
|
54
64
|
|
|
55
65
|
// Children
|
|
56
66
|
- (void)addMarkerView:(LuggMarkerView *)markerView;
|
|
@@ -62,6 +72,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
62
72
|
- (void)addPolygonView:(LuggPolygonView *)polygonView;
|
|
63
73
|
- (void)removePolygonView:(LuggPolygonView *)polygonView;
|
|
64
74
|
- (void)syncPolygonView:(LuggPolygonView *)polygonView;
|
|
75
|
+
- (void)addCircleView:(LuggCircleView *)circleView;
|
|
76
|
+
- (void)removeCircleView:(LuggCircleView *)circleView;
|
|
77
|
+
- (void)syncCircleView:(LuggCircleView *)circleView;
|
|
78
|
+
- (void)addGroundOverlayView:(LuggGroundOverlayView *)groundOverlayView;
|
|
79
|
+
- (void)removeGroundOverlayView:(LuggGroundOverlayView *)groundOverlayView;
|
|
80
|
+
- (void)syncGroundOverlayView:(LuggGroundOverlayView *)groundOverlayView;
|
|
81
|
+
- (void)addTileOverlayView:(LuggTileOverlayView *)tileOverlayView;
|
|
82
|
+
- (void)removeTileOverlayView:(LuggTileOverlayView *)tileOverlayView;
|
|
83
|
+
- (void)syncTileOverlayView:(LuggTileOverlayView *)tileOverlayView;
|
|
65
84
|
|
|
66
85
|
// Lifecycle
|
|
67
86
|
- (void)pauseAnimations;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#import <react/renderer/components/RNMapsSpec/EventEmitters.h>
|
|
4
|
+
|
|
5
|
+
namespace luggmaps {
|
|
6
|
+
namespace events {
|
|
7
|
+
|
|
8
|
+
struct CirclePressEvent {
|
|
9
|
+
template <typename Emitter>
|
|
10
|
+
static void emit(const facebook::react::SharedEventEmitter &eventEmitter) {
|
|
11
|
+
if (!eventEmitter)
|
|
12
|
+
return;
|
|
13
|
+
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
14
|
+
typename Emitter::OnCirclePress event;
|
|
15
|
+
emitter->onCirclePress(event);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
} // namespace events
|
|
20
|
+
} // namespace luggmaps
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#import <react/renderer/components/RNMapsSpec/EventEmitters.h>
|
|
4
|
+
|
|
5
|
+
namespace luggmaps {
|
|
6
|
+
namespace events {
|
|
7
|
+
|
|
8
|
+
struct GroundOverlayPressEvent {
|
|
9
|
+
template <typename Emitter>
|
|
10
|
+
static void emit(const facebook::react::SharedEventEmitter &eventEmitter) {
|
|
11
|
+
if (!eventEmitter)
|
|
12
|
+
return;
|
|
13
|
+
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
14
|
+
typename Emitter::OnGroundOverlayPress event;
|
|
15
|
+
emitter->onGroundOverlayPress(event);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
} // namespace events
|
|
20
|
+
} // namespace luggmaps
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#import <react/renderer/components/RNMapsSpec/EventEmitters.h>
|
|
4
|
+
|
|
5
|
+
namespace luggmaps {
|
|
6
|
+
namespace events {
|
|
7
|
+
|
|
8
|
+
struct TileOverlayPressEvent {
|
|
9
|
+
template <typename Emitter>
|
|
10
|
+
static void emit(const facebook::react::SharedEventEmitter &eventEmitter) {
|
|
11
|
+
if (!eventEmitter)
|
|
12
|
+
return;
|
|
13
|
+
auto emitter = std::static_pointer_cast<Emitter const>(eventEmitter);
|
|
14
|
+
typename Emitter::OnTileOverlayPress event;
|
|
15
|
+
emitter->onTileOverlayPress(event);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
} // namespace events
|
|
20
|
+
} // namespace luggmaps
|
package/lib/module/MapView.js
CHANGED
|
@@ -8,11 +8,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
export class MapView extends React.Component {
|
|
9
9
|
static defaultProps = {
|
|
10
10
|
provider: Platform.OS === 'ios' ? 'apple' : 'google',
|
|
11
|
+
mapType: 'standard',
|
|
11
12
|
initialZoom: 10,
|
|
12
13
|
zoomEnabled: true,
|
|
13
14
|
scrollEnabled: true,
|
|
14
15
|
rotateEnabled: true,
|
|
15
16
|
pitchEnabled: true,
|
|
17
|
+
poiEnabled: true,
|
|
16
18
|
theme: 'system'
|
|
17
19
|
};
|
|
18
20
|
nativeRef = /*#__PURE__*/React.createRef();
|
|
@@ -66,6 +68,7 @@ export class MapView extends React.Component {
|
|
|
66
68
|
render() {
|
|
67
69
|
const {
|
|
68
70
|
provider,
|
|
71
|
+
mapType,
|
|
69
72
|
mapId,
|
|
70
73
|
initialCoordinate,
|
|
71
74
|
initialZoom,
|
|
@@ -78,7 +81,10 @@ export class MapView extends React.Component {
|
|
|
78
81
|
edgeInsets,
|
|
79
82
|
userLocationEnabled,
|
|
80
83
|
userLocationButtonEnabled,
|
|
84
|
+
poiEnabled,
|
|
85
|
+
poiFilter,
|
|
81
86
|
theme,
|
|
87
|
+
insetAdjustment,
|
|
82
88
|
onPress,
|
|
83
89
|
onLongPress,
|
|
84
90
|
onCameraMove,
|
|
@@ -91,6 +97,7 @@ export class MapView extends React.Component {
|
|
|
91
97
|
ref: this.nativeRef,
|
|
92
98
|
...rest,
|
|
93
99
|
provider: provider,
|
|
100
|
+
mapType: mapType,
|
|
94
101
|
mapId: mapId,
|
|
95
102
|
initialCoordinate: initialCoordinate,
|
|
96
103
|
initialZoom: initialZoom,
|
|
@@ -103,7 +110,11 @@ export class MapView extends React.Component {
|
|
|
103
110
|
edgeInsets: edgeInsets,
|
|
104
111
|
userLocationEnabled: userLocationEnabled,
|
|
105
112
|
userLocationButtonEnabled: userLocationButtonEnabled,
|
|
113
|
+
poiEnabled: poiEnabled,
|
|
114
|
+
poiFilterMode: poiFilter?.mode,
|
|
115
|
+
poiFilterCategories: poiFilter?.categories,
|
|
106
116
|
theme: theme,
|
|
117
|
+
insetAdjustment: insetAdjustment,
|
|
107
118
|
onMapPress: onPress,
|
|
108
119
|
onMapLongPress: onLongPress,
|
|
109
120
|
onCameraMove: onCameraMove,
|