@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
package/ios/LuggMarkerView.mm
CHANGED
|
@@ -26,6 +26,7 @@ using namespace luggmaps::events;
|
|
|
26
26
|
CLLocationDegrees _rotate;
|
|
27
27
|
CGFloat _scale;
|
|
28
28
|
BOOL _rasterize;
|
|
29
|
+
BOOL _centerOnPress;
|
|
29
30
|
BOOL _draggable;
|
|
30
31
|
BOOL _didLayout;
|
|
31
32
|
UIView *_iconView;
|
|
@@ -49,6 +50,7 @@ using namespace luggmaps::events;
|
|
|
49
50
|
_rotate = 0;
|
|
50
51
|
_scale = 1;
|
|
51
52
|
_rasterize = YES;
|
|
53
|
+
_centerOnPress = YES;
|
|
52
54
|
_didLayout = NO;
|
|
53
55
|
|
|
54
56
|
_iconView = [[UIView alloc] init];
|
|
@@ -78,6 +80,7 @@ using namespace luggmaps::events;
|
|
|
78
80
|
_rotate = newViewProps.rotate;
|
|
79
81
|
_scale = newViewProps.scale;
|
|
80
82
|
_rasterize = newViewProps.rasterize;
|
|
83
|
+
_centerOnPress = newViewProps.centerOnPress;
|
|
81
84
|
_draggable = newViewProps.draggable;
|
|
82
85
|
}
|
|
83
86
|
|
|
@@ -174,6 +177,10 @@ using namespace luggmaps::events;
|
|
|
174
177
|
return _rasterize;
|
|
175
178
|
}
|
|
176
179
|
|
|
180
|
+
- (BOOL)centerOnPress {
|
|
181
|
+
return _centerOnPress;
|
|
182
|
+
}
|
|
183
|
+
|
|
177
184
|
- (BOOL)draggable {
|
|
178
185
|
return _draggable;
|
|
179
186
|
}
|
|
@@ -282,6 +289,22 @@ using namespace luggmaps::events;
|
|
|
282
289
|
_iconView.bounds.size.height);
|
|
283
290
|
}
|
|
284
291
|
|
|
292
|
+
- (void)showCallout {
|
|
293
|
+
if ([self.delegate respondsToSelector:@selector(showCalloutForMarkerView:)]) {
|
|
294
|
+
[self.delegate showCalloutForMarkerView:self];
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
- (void)hideCallout {
|
|
299
|
+
if ([self.delegate respondsToSelector:@selector(hideCalloutForMarkerView:)]) {
|
|
300
|
+
[self.delegate hideCalloutForMarkerView:self];
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args {
|
|
305
|
+
RCTLuggMarkerViewHandleCommand(self, commandName, args);
|
|
306
|
+
}
|
|
307
|
+
|
|
285
308
|
- (void)prepareForRecycle {
|
|
286
309
|
[super prepareForRecycle];
|
|
287
310
|
_didLayout = NO;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#import <CoreLocation/CoreLocation.h>
|
|
2
|
+
#import <React/RCTViewComponentView.h>
|
|
3
|
+
#import <UIKit/UIKit.h>
|
|
4
|
+
|
|
5
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
6
|
+
|
|
7
|
+
@class LuggTileOverlayView;
|
|
8
|
+
|
|
9
|
+
@protocol LuggTileOverlayViewDelegate <NSObject>
|
|
10
|
+
@optional
|
|
11
|
+
- (void)tileOverlayViewDidUpdate:(LuggTileOverlayView *)tileOverlayView;
|
|
12
|
+
@end
|
|
13
|
+
|
|
14
|
+
@interface LuggTileOverlayView : RCTViewComponentView
|
|
15
|
+
|
|
16
|
+
@property(nonatomic, readonly) NSString *urlTemplate;
|
|
17
|
+
@property(nonatomic, readonly) NSInteger tileSize;
|
|
18
|
+
@property(nonatomic, readonly) CGFloat opacity;
|
|
19
|
+
@property(nonatomic, readonly) BOOL hasBounds;
|
|
20
|
+
@property(nonatomic, readonly) CLLocationCoordinate2D northeast;
|
|
21
|
+
@property(nonatomic, readonly) CLLocationCoordinate2D southwest;
|
|
22
|
+
@property(nonatomic, readonly) NSInteger zIndex;
|
|
23
|
+
@property(nonatomic, readonly) BOOL tappable;
|
|
24
|
+
@property(nonatomic, weak, nullable) id<LuggTileOverlayViewDelegate> delegate;
|
|
25
|
+
@property(nonatomic, strong, nullable) NSObject *overlay;
|
|
26
|
+
|
|
27
|
+
- (void)emitPressEvent;
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#import "LuggTileOverlayView.h"
|
|
2
|
+
#import "events/TileOverlayPressEvent.h"
|
|
3
|
+
|
|
4
|
+
#import <react/renderer/components/RNMapsSpec/ComponentDescriptors.h>
|
|
5
|
+
#import <react/renderer/components/RNMapsSpec/EventEmitters.h>
|
|
6
|
+
#import <react/renderer/components/RNMapsSpec/Props.h>
|
|
7
|
+
#import <react/renderer/components/RNMapsSpec/RCTComponentViewHelpers.h>
|
|
8
|
+
|
|
9
|
+
#import "RCTFabricComponentsPlugins.h"
|
|
10
|
+
|
|
11
|
+
using namespace facebook::react;
|
|
12
|
+
using namespace luggmaps::events;
|
|
13
|
+
|
|
14
|
+
@interface LuggTileOverlayView () <RCTLuggTileOverlayViewViewProtocol>
|
|
15
|
+
@end
|
|
16
|
+
|
|
17
|
+
@implementation LuggTileOverlayView {
|
|
18
|
+
NSString *_urlTemplate;
|
|
19
|
+
NSInteger _tileSize;
|
|
20
|
+
CGFloat _opacity;
|
|
21
|
+
BOOL _hasBounds;
|
|
22
|
+
CLLocationCoordinate2D _northeast;
|
|
23
|
+
CLLocationCoordinate2D _southwest;
|
|
24
|
+
NSInteger _zIndex;
|
|
25
|
+
BOOL _tappable;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
29
|
+
return concreteComponentDescriptorProvider<
|
|
30
|
+
LuggTileOverlayViewComponentDescriptor>();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
34
|
+
if (self = [super initWithFrame:frame]) {
|
|
35
|
+
static const auto defaultProps =
|
|
36
|
+
std::make_shared<const LuggTileOverlayViewProps>();
|
|
37
|
+
_props = defaultProps;
|
|
38
|
+
|
|
39
|
+
_urlTemplate = @"";
|
|
40
|
+
_tileSize = 256;
|
|
41
|
+
_opacity = 1.0;
|
|
42
|
+
|
|
43
|
+
self.hidden = YES;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return self;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
- (void)updateProps:(Props::Shared const &)props
|
|
50
|
+
oldProps:(Props::Shared const &)oldProps {
|
|
51
|
+
[super updateProps:props oldProps:oldProps];
|
|
52
|
+
const auto &newViewProps =
|
|
53
|
+
*std::static_pointer_cast<LuggTileOverlayViewProps const>(props);
|
|
54
|
+
|
|
55
|
+
_urlTemplate =
|
|
56
|
+
[NSString stringWithUTF8String:newViewProps.urlTemplate.c_str()];
|
|
57
|
+
_tileSize = newViewProps.tileSize;
|
|
58
|
+
_opacity = newViewProps.opacity;
|
|
59
|
+
|
|
60
|
+
auto ne = newViewProps.bounds.northeast;
|
|
61
|
+
auto sw = newViewProps.bounds.southwest;
|
|
62
|
+
_hasBounds = (ne.latitude != 0 || ne.longitude != 0 || sw.latitude != 0 ||
|
|
63
|
+
sw.longitude != 0);
|
|
64
|
+
if (_hasBounds) {
|
|
65
|
+
_northeast = CLLocationCoordinate2DMake(ne.latitude, ne.longitude);
|
|
66
|
+
_southwest = CLLocationCoordinate2DMake(sw.latitude, sw.longitude);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
_zIndex = newViewProps.zIndex.value_or(0);
|
|
70
|
+
_tappable = newViewProps.tappable;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask {
|
|
74
|
+
[super finalizeUpdates:updateMask];
|
|
75
|
+
|
|
76
|
+
if (updateMask & RNComponentViewUpdateMaskProps) {
|
|
77
|
+
if ([self.delegate
|
|
78
|
+
respondsToSelector:@selector(tileOverlayViewDidUpdate:)]) {
|
|
79
|
+
[self.delegate tileOverlayViewDidUpdate:self];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
- (NSString *)urlTemplate {
|
|
85
|
+
return _urlTemplate;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
- (NSInteger)tileSize {
|
|
89
|
+
return _tileSize;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
- (CGFloat)opacity {
|
|
93
|
+
return _opacity;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
- (BOOL)hasBounds {
|
|
97
|
+
return _hasBounds;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
- (CLLocationCoordinate2D)northeast {
|
|
101
|
+
return _northeast;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
- (CLLocationCoordinate2D)southwest {
|
|
105
|
+
return _southwest;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
- (NSInteger)zIndex {
|
|
109
|
+
return _zIndex;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
- (BOOL)tappable {
|
|
113
|
+
return _tappable;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
- (void)emitPressEvent {
|
|
117
|
+
TileOverlayPressEvent::emit<LuggTileOverlayViewEventEmitter>(_eventEmitter);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
- (void)prepareForRecycle {
|
|
121
|
+
[super prepareForRecycle];
|
|
122
|
+
self.overlay = nil;
|
|
123
|
+
self.delegate = nil;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
Class<RCTComponentViewProtocol> LuggTileOverlayViewCls(void) {
|
|
127
|
+
return LuggTileOverlayView.class;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@end
|