@lugg/maps 0.2.0-alpha.27 → 0.2.0-alpha.28
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/java/com/luggmaps/LuggMapView.kt +8 -2
- package/android/src/main/java/com/luggmaps/LuggMapViewManager.kt +17 -0
- package/android/src/main/java/com/luggmaps/core/GoogleMapProvider.kt +18 -1
- package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +1 -0
- package/ios/LuggMapView.mm +12 -0
- package/ios/core/AppleMapProvider.mm +57 -0
- package/ios/core/GoogleMapProvider.mm +61 -2
- package/ios/core/MapProviderDelegate.h +3 -0
- package/lib/module/MapView.js +16 -2
- package/lib/module/MapView.js.map +1 -1
- package/lib/module/MapView.web.js +41 -26
- package/lib/module/MapView.web.js.map +1 -1
- package/lib/module/fabric/LuggMapViewNativeComponent.ts +9 -1
- package/lib/typescript/src/MapView.d.ts +3 -2
- package/lib/typescript/src/MapView.d.ts.map +1 -1
- package/lib/typescript/src/MapView.types.d.ts +8 -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/fabric/LuggMapViewNativeComponent.d.ts +1 -0
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/MapView.tsx +13 -3
- package/src/MapView.types.ts +9 -1
- package/src/MapView.web.tsx +53 -36
- package/src/fabric/LuggMapViewNativeComponent.ts +9 -1
- package/src/index.ts +1 -0
|
@@ -220,9 +220,15 @@ class LuggMapView(private val reactContext: ThemedReactContext) :
|
|
|
220
220
|
provider?.setTheme(value)
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
fun setEdgeInsets(
|
|
223
|
+
fun setEdgeInsets(
|
|
224
|
+
top: Int,
|
|
225
|
+
left: Int,
|
|
226
|
+
bottom: Int,
|
|
227
|
+
right: Int,
|
|
228
|
+
duration: Int = 0
|
|
229
|
+
) {
|
|
224
230
|
edgeInsets = EdgeInsets(top, left, bottom, right)
|
|
225
|
-
provider?.setEdgeInsets(edgeInsets)
|
|
231
|
+
provider?.setEdgeInsets(edgeInsets, duration)
|
|
226
232
|
}
|
|
227
233
|
|
|
228
234
|
// endregion
|
|
@@ -159,6 +159,23 @@ class LuggMapViewManager :
|
|
|
159
159
|
view.moveCamera(latitude, longitude, zoom, duration.toInt())
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
override fun setEdgeInsets(
|
|
163
|
+
view: LuggMapView,
|
|
164
|
+
top: Double,
|
|
165
|
+
left: Double,
|
|
166
|
+
bottom: Double,
|
|
167
|
+
right: Double,
|
|
168
|
+
duration: Double
|
|
169
|
+
) {
|
|
170
|
+
view.setEdgeInsets(
|
|
171
|
+
top.toFloat().dpToPx().toInt(),
|
|
172
|
+
left.toFloat().dpToPx().toInt(),
|
|
173
|
+
bottom.toFloat().dpToPx().toInt(),
|
|
174
|
+
right.toFloat().dpToPx().toInt(),
|
|
175
|
+
duration.toInt()
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
|
|
162
179
|
override fun fitCoordinates(
|
|
163
180
|
view: LuggMapView,
|
|
164
181
|
coordinates: ReadableArray?,
|
|
@@ -209,6 +209,19 @@ class GoogleMapProvider(private val context: Context) :
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
override fun setEdgeInsets(edgeInsets: EdgeInsets) {
|
|
212
|
+
val oldInsets = this.edgeInsets
|
|
213
|
+
this.edgeInsets = edgeInsets
|
|
214
|
+
applyEdgeInsets()
|
|
215
|
+
|
|
216
|
+
val map = googleMap
|
|
217
|
+
if (map != null && oldInsets != edgeInsets) {
|
|
218
|
+
mapView?.post {
|
|
219
|
+
setEdgeInsets(edgeInsets, 0)
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
override fun setEdgeInsets(edgeInsets: EdgeInsets, duration: Int) {
|
|
212
225
|
val map = googleMap
|
|
213
226
|
val oldInsets = this.edgeInsets
|
|
214
227
|
this.edgeInsets = edgeInsets
|
|
@@ -216,7 +229,11 @@ class GoogleMapProvider(private val context: Context) :
|
|
|
216
229
|
if (map != null && oldInsets != edgeInsets) {
|
|
217
230
|
val cameraUpdate = CameraUpdateFactory.newCameraPosition(map.cameraPosition)
|
|
218
231
|
applyEdgeInsets()
|
|
219
|
-
|
|
232
|
+
when {
|
|
233
|
+
duration < 0 -> map.animateCamera(cameraUpdate)
|
|
234
|
+
duration > 0 -> map.animateCamera(cameraUpdate, duration, null)
|
|
235
|
+
else -> map.moveCamera(cameraUpdate)
|
|
236
|
+
}
|
|
220
237
|
} else {
|
|
221
238
|
applyEdgeInsets()
|
|
222
239
|
}
|
package/ios/LuggMapView.mm
CHANGED
|
@@ -273,6 +273,18 @@ using namespace luggmaps::events;
|
|
|
273
273
|
duration:duration];
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
+
- (void)setEdgeInsets:(double)top
|
|
277
|
+
left:(double)left
|
|
278
|
+
bottom:(double)bottom
|
|
279
|
+
right:(double)right
|
|
280
|
+
duration:(double)duration {
|
|
281
|
+
UIEdgeInsets oldInsets = _edgeInsets;
|
|
282
|
+
_edgeInsets = UIEdgeInsetsMake(top, left, bottom, right);
|
|
283
|
+
[_provider setEdgeInsets:_edgeInsets
|
|
284
|
+
oldEdgeInsets:oldInsets
|
|
285
|
+
duration:duration];
|
|
286
|
+
}
|
|
287
|
+
|
|
276
288
|
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args {
|
|
277
289
|
RCTLuggMapViewHandleCommand(self, commandName, args);
|
|
278
290
|
}
|
|
@@ -29,6 +29,13 @@
|
|
|
29
29
|
double _minZoom;
|
|
30
30
|
double _maxZoom;
|
|
31
31
|
NSMapTable<id<MKOverlay>, LuggPolylineView *> *_overlayToPolylineMap;
|
|
32
|
+
|
|
33
|
+
// Edge insets animation
|
|
34
|
+
CADisplayLink *_edgeInsetsDisplayLink;
|
|
35
|
+
UIEdgeInsets _edgeInsetsFrom;
|
|
36
|
+
UIEdgeInsets _edgeInsetsTo;
|
|
37
|
+
CFTimeInterval _edgeInsetsAnimationStart;
|
|
38
|
+
CFTimeInterval _edgeInsetsAnimationDuration;
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
@synthesize delegate = _delegate;
|
|
@@ -76,6 +83,7 @@
|
|
|
76
83
|
}
|
|
77
84
|
|
|
78
85
|
- (void)destroy {
|
|
86
|
+
[self stopEdgeInsetsAnimation];
|
|
79
87
|
[_mapView removeFromSuperview];
|
|
80
88
|
_mapView = nil;
|
|
81
89
|
_isMapReady = NO;
|
|
@@ -151,6 +159,55 @@
|
|
|
151
159
|
}
|
|
152
160
|
}
|
|
153
161
|
|
|
162
|
+
- (void)setEdgeInsets:(UIEdgeInsets)edgeInsets
|
|
163
|
+
oldEdgeInsets:(UIEdgeInsets)oldEdgeInsets
|
|
164
|
+
duration:(double)duration {
|
|
165
|
+
[self stopEdgeInsetsAnimation];
|
|
166
|
+
|
|
167
|
+
if (duration != 0 && _mapView) {
|
|
168
|
+
double actualDuration = duration < 0 ? 0.3 : duration / 1000.0;
|
|
169
|
+
_edgeInsetsFrom = oldEdgeInsets;
|
|
170
|
+
_edgeInsetsTo = edgeInsets;
|
|
171
|
+
_edgeInsetsAnimationDuration = actualDuration;
|
|
172
|
+
_edgeInsetsAnimationStart = CACurrentMediaTime();
|
|
173
|
+
|
|
174
|
+
_edgeInsetsDisplayLink = [CADisplayLink
|
|
175
|
+
displayLinkWithTarget:self
|
|
176
|
+
selector:@selector(edgeInsetsAnimationTick:)];
|
|
177
|
+
[_edgeInsetsDisplayLink addToRunLoop:[NSRunLoop mainRunLoop]
|
|
178
|
+
forMode:NSRunLoopCommonModes];
|
|
179
|
+
} else {
|
|
180
|
+
[self setEdgeInsets:edgeInsets oldEdgeInsets:oldEdgeInsets];
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
- (void)edgeInsetsAnimationTick:(CADisplayLink *)displayLink {
|
|
185
|
+
CFTimeInterval elapsed = CACurrentMediaTime() - _edgeInsetsAnimationStart;
|
|
186
|
+
CGFloat progress = MIN(elapsed / _edgeInsetsAnimationDuration, 1.0);
|
|
187
|
+
|
|
188
|
+
// Ease out cubic
|
|
189
|
+
CGFloat t = 1.0 - (1.0 - progress) * (1.0 - progress) * (1.0 - progress);
|
|
190
|
+
|
|
191
|
+
UIEdgeInsets current = UIEdgeInsetsMake(
|
|
192
|
+
_edgeInsetsFrom.top + (_edgeInsetsTo.top - _edgeInsetsFrom.top) * t,
|
|
193
|
+
_edgeInsetsFrom.left + (_edgeInsetsTo.left - _edgeInsetsFrom.left) * t,
|
|
194
|
+
_edgeInsetsFrom.bottom +
|
|
195
|
+
(_edgeInsetsTo.bottom - _edgeInsetsFrom.bottom) * t,
|
|
196
|
+
_edgeInsetsFrom.right +
|
|
197
|
+
(_edgeInsetsTo.right - _edgeInsetsFrom.right) * t);
|
|
198
|
+
|
|
199
|
+
[self setEdgeInsets:current oldEdgeInsets:_mapView.layoutMargins];
|
|
200
|
+
|
|
201
|
+
if (progress >= 1.0) {
|
|
202
|
+
[self stopEdgeInsetsAnimation];
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
- (void)stopEdgeInsetsAnimation {
|
|
207
|
+
[_edgeInsetsDisplayLink invalidate];
|
|
208
|
+
_edgeInsetsDisplayLink = nil;
|
|
209
|
+
}
|
|
210
|
+
|
|
154
211
|
- (CLLocationDistance)cameraDistanceForZoomLevel:(double)zoomLevel {
|
|
155
212
|
return 128000000.0 / pow(2, zoomLevel);
|
|
156
213
|
}
|
|
@@ -19,6 +19,13 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
19
19
|
NSMutableArray<LuggMarkerView *> *_pendingMarkerViews;
|
|
20
20
|
NSMutableArray<LuggPolylineView *> *_pendingPolylineViews;
|
|
21
21
|
NSMapTable<LuggPolylineView *, GMSPolylineAnimator *> *_polylineAnimators;
|
|
22
|
+
|
|
23
|
+
// Edge insets animation
|
|
24
|
+
CADisplayLink *_edgeInsetsDisplayLink;
|
|
25
|
+
UIEdgeInsets _edgeInsetsFrom;
|
|
26
|
+
UIEdgeInsets _edgeInsetsTo;
|
|
27
|
+
CFTimeInterval _edgeInsetsAnimationStart;
|
|
28
|
+
CFTimeInterval _edgeInsetsAnimationDuration;
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
@synthesize delegate = _delegate;
|
|
@@ -86,6 +93,7 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
86
93
|
}
|
|
87
94
|
|
|
88
95
|
- (void)destroy {
|
|
96
|
+
[self stopEdgeInsetsAnimation];
|
|
89
97
|
[_pendingMarkerViews removeAllObjects];
|
|
90
98
|
[_pendingPolylineViews removeAllObjects];
|
|
91
99
|
[_polylineAnimators removeAllObjects];
|
|
@@ -155,10 +163,61 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
155
163
|
|
|
156
164
|
- (void)setEdgeInsets:(UIEdgeInsets)edgeInsets
|
|
157
165
|
oldEdgeInsets:(UIEdgeInsets)oldEdgeInsets {
|
|
166
|
+
[self setEdgeInsets:edgeInsets oldEdgeInsets:oldEdgeInsets duration:0];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
- (void)setEdgeInsets:(UIEdgeInsets)edgeInsets
|
|
170
|
+
oldEdgeInsets:(UIEdgeInsets)oldEdgeInsets
|
|
171
|
+
duration:(double)duration {
|
|
158
172
|
if (UIEdgeInsetsEqualToEdgeInsets(_edgeInsets, edgeInsets))
|
|
159
173
|
return;
|
|
160
|
-
|
|
161
|
-
|
|
174
|
+
|
|
175
|
+
[self stopEdgeInsetsAnimation];
|
|
176
|
+
|
|
177
|
+
if (duration != 0 && _mapView) {
|
|
178
|
+
double actualDuration = duration < 0 ? 0.3 : duration / 1000.0;
|
|
179
|
+
_edgeInsetsFrom = _edgeInsets;
|
|
180
|
+
_edgeInsetsTo = edgeInsets;
|
|
181
|
+
_edgeInsets = edgeInsets;
|
|
182
|
+
_edgeInsetsAnimationDuration = actualDuration;
|
|
183
|
+
_edgeInsetsAnimationStart = CACurrentMediaTime();
|
|
184
|
+
|
|
185
|
+
_edgeInsetsDisplayLink = [CADisplayLink
|
|
186
|
+
displayLinkWithTarget:self
|
|
187
|
+
selector:@selector(edgeInsetsAnimationTick:)];
|
|
188
|
+
[_edgeInsetsDisplayLink addToRunLoop:[NSRunLoop mainRunLoop]
|
|
189
|
+
forMode:NSRunLoopCommonModes];
|
|
190
|
+
} else {
|
|
191
|
+
_edgeInsets = edgeInsets;
|
|
192
|
+
_mapView.padding = edgeInsets;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
- (void)edgeInsetsAnimationTick:(CADisplayLink *)displayLink {
|
|
197
|
+
CFTimeInterval elapsed = CACurrentMediaTime() - _edgeInsetsAnimationStart;
|
|
198
|
+
CGFloat progress = MIN(elapsed / _edgeInsetsAnimationDuration, 1.0);
|
|
199
|
+
|
|
200
|
+
// Ease out cubic
|
|
201
|
+
CGFloat t = 1.0 - (1.0 - progress) * (1.0 - progress) * (1.0 - progress);
|
|
202
|
+
|
|
203
|
+
UIEdgeInsets current = UIEdgeInsetsMake(
|
|
204
|
+
_edgeInsetsFrom.top + (_edgeInsetsTo.top - _edgeInsetsFrom.top) * t,
|
|
205
|
+
_edgeInsetsFrom.left + (_edgeInsetsTo.left - _edgeInsetsFrom.left) * t,
|
|
206
|
+
_edgeInsetsFrom.bottom +
|
|
207
|
+
(_edgeInsetsTo.bottom - _edgeInsetsFrom.bottom) * t,
|
|
208
|
+
_edgeInsetsFrom.right +
|
|
209
|
+
(_edgeInsetsTo.right - _edgeInsetsFrom.right) * t);
|
|
210
|
+
|
|
211
|
+
_mapView.padding = current;
|
|
212
|
+
|
|
213
|
+
if (progress >= 1.0) {
|
|
214
|
+
[self stopEdgeInsetsAnimation];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
- (void)stopEdgeInsetsAnimation {
|
|
219
|
+
[_edgeInsetsDisplayLink invalidate];
|
|
220
|
+
_edgeInsetsDisplayLink = nil;
|
|
162
221
|
}
|
|
163
222
|
|
|
164
223
|
#pragma mark - GMSMapViewDelegate
|
|
@@ -39,6 +39,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
39
39
|
- (void)setMaxZoom:(double)maxZoom;
|
|
40
40
|
- (void)setEdgeInsets:(UIEdgeInsets)edgeInsets
|
|
41
41
|
oldEdgeInsets:(UIEdgeInsets)oldEdgeInsets;
|
|
42
|
+
- (void)setEdgeInsets:(UIEdgeInsets)edgeInsets
|
|
43
|
+
oldEdgeInsets:(UIEdgeInsets)oldEdgeInsets
|
|
44
|
+
duration:(double)duration;
|
|
42
45
|
|
|
43
46
|
// Children
|
|
44
47
|
- (void)addMarkerView:(LuggMarkerView *)markerView;
|
package/lib/module/MapView.js
CHANGED
|
@@ -30,7 +30,7 @@ export class MapView extends React.Component {
|
|
|
30
30
|
const first = coordinates[0];
|
|
31
31
|
if (!ref || !first) return;
|
|
32
32
|
const {
|
|
33
|
-
|
|
33
|
+
padding,
|
|
34
34
|
duration = -1
|
|
35
35
|
} = options ?? {};
|
|
36
36
|
const {
|
|
@@ -38,7 +38,7 @@ export class MapView extends React.Component {
|
|
|
38
38
|
left = 0,
|
|
39
39
|
bottom = 0,
|
|
40
40
|
right = 0
|
|
41
|
-
} =
|
|
41
|
+
} = padding ?? {};
|
|
42
42
|
if (coordinates.length === 1) {
|
|
43
43
|
const zoom = this.props.initialZoom ?? 10;
|
|
44
44
|
this.moveCamera(first, {
|
|
@@ -49,6 +49,20 @@ export class MapView extends React.Component {
|
|
|
49
49
|
}
|
|
50
50
|
Commands.fitCoordinates(ref, coordinates, top, left, bottom, right, duration);
|
|
51
51
|
}
|
|
52
|
+
setEdgeInsets(edgeInsets, options) {
|
|
53
|
+
const ref = this.nativeRef.current;
|
|
54
|
+
if (!ref) return;
|
|
55
|
+
const {
|
|
56
|
+
top = 0,
|
|
57
|
+
left = 0,
|
|
58
|
+
bottom = 0,
|
|
59
|
+
right = 0
|
|
60
|
+
} = edgeInsets;
|
|
61
|
+
const {
|
|
62
|
+
duration = -1
|
|
63
|
+
} = options ?? {};
|
|
64
|
+
Commands.setEdgeInsets(ref, top, left, bottom, right, duration);
|
|
65
|
+
}
|
|
52
66
|
render() {
|
|
53
67
|
const {
|
|
54
68
|
provider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","StyleSheet","LuggMapViewNativeComponent","Commands","LuggMapWrapperViewNativeComponent","jsx","_jsx","jsxs","_jsxs","MapView","Component","defaultProps","provider","OS","initialZoom","zoomEnabled","scrollEnabled","rotateEnabled","pitchEnabled","theme","nativeRef","createRef","moveCamera","coordinate","options","ref","current","zoom","duration","latitude","longitude","fitCoordinates","coordinates","first","
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","LuggMapViewNativeComponent","Commands","LuggMapWrapperViewNativeComponent","jsx","_jsx","jsxs","_jsxs","MapView","Component","defaultProps","provider","OS","initialZoom","zoomEnabled","scrollEnabled","rotateEnabled","pitchEnabled","theme","nativeRef","createRef","moveCamera","coordinate","options","ref","current","zoom","duration","latitude","longitude","fitCoordinates","coordinates","first","padding","top","left","bottom","right","length","props","setEdgeInsets","edgeInsets","render","mapId","initialCoordinate","minZoom","maxZoom","userLocationEnabled","myLocationButtonEnabled","onCameraMove","onCameraIdle","onReady","children","rest","style","absoluteFill"],"sourceRoot":"../../src","sources":["MapView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,OAAOC,0BAA0B,IAC/BC,QAAQ,QACH,qCAAqC;AAC5C,OAAOC,iCAAiC,MAAM,4CAA4C;AAAC,S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,GAChBkC,IAAI;MACR1C,QAAQ,EAAEA,QAAS;MACnBgC,KAAK,EAAEA,KAAM;MACbC,iBAAiB,EAAEA,iBAAkB;MACrC/B,WAAW,EAAEA,WAAY;MACzBgC,OAAO,EAAEA,OAAQ;MACjBC,OAAO,EAAEA,OAAQ;MACjBhC,WAAW,EAAEA,WAAY;MACzBC,aAAa,EAAEA,aAAc;MAC7BC,aAAa,EAAEA,aAAc;MAC7BC,YAAY,EAAEA,YAAa;MAC3BwB,UAAU,EAAEA,UAAW;MACvBM,mBAAmB,EAAEA,mBAAoB;MACzCC,uBAAuB,EAAEA,uBAAwB;MACjD9B,KAAK,EAAEA,KAAM;MACb+B,YAAY,EAAEA,YAAa;MAC3BC,YAAY,EAAEA,YAAa;MAC3BC,OAAO,EAAEA,OAAQ;MAAAC,QAAA,gBAEjB/C,IAAA,CAACF,iCAAiC;QAACmD,KAAK,EAAEtD,UAAU,CAACuD;MAAa,CAAE,CAAC,EACpEH,QAAQ;IAAA,CACiB,CAAC;EAEjC;AACF","ignoreList":[]}
|
|
@@ -93,10 +93,9 @@ export const MapView = /*#__PURE__*/forwardRef(function MapView(props, ref) {
|
|
|
93
93
|
const [isDragging, setIsDragging] = useState(false);
|
|
94
94
|
const wasGesture = useRef(false);
|
|
95
95
|
const prevEdgeInsets = useRef(edgeInsets);
|
|
96
|
-
const offsetCenter = useCallback((coord, zoom,
|
|
97
|
-
const p =
|
|
98
|
-
|
|
99
|
-
if (!p || !div) {
|
|
96
|
+
const offsetCenter = useCallback((coord, zoom, insets, reverse = false) => {
|
|
97
|
+
const p = insets ?? prevEdgeInsets.current;
|
|
98
|
+
if (!p) {
|
|
100
99
|
return {
|
|
101
100
|
lat: coord.latitude,
|
|
102
101
|
lng: coord.longitude
|
|
@@ -115,7 +114,32 @@ export const MapView = /*#__PURE__*/forwardRef(function MapView(props, ref) {
|
|
|
115
114
|
lat,
|
|
116
115
|
lng
|
|
117
116
|
};
|
|
118
|
-
}, [
|
|
117
|
+
}, []);
|
|
118
|
+
const applyEdgeInsets = useCallback((newEdgeInsets, duration) => {
|
|
119
|
+
if (!map) return;
|
|
120
|
+
const prev = prevEdgeInsets.current;
|
|
121
|
+
const center = map.getCenter();
|
|
122
|
+
const zoom = map.getZoom() ?? initialZoom;
|
|
123
|
+
if (center) {
|
|
124
|
+
const logicalCenter = offsetCenter({
|
|
125
|
+
latitude: center.lat(),
|
|
126
|
+
longitude: center.lng()
|
|
127
|
+
}, zoom, prev, true);
|
|
128
|
+
const newCenter = offsetCenter({
|
|
129
|
+
latitude: logicalCenter.lat,
|
|
130
|
+
longitude: logicalCenter.lng
|
|
131
|
+
}, zoom, newEdgeInsets, false);
|
|
132
|
+
if (duration === 0) {
|
|
133
|
+
map.moveCamera({
|
|
134
|
+
center: newCenter,
|
|
135
|
+
zoom
|
|
136
|
+
});
|
|
137
|
+
} else {
|
|
138
|
+
map.panTo(newCenter);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
prevEdgeInsets.current = newEdgeInsets;
|
|
142
|
+
}, [map, initialZoom, offsetCenter]);
|
|
119
143
|
useImperativeHandle(ref, () => ({
|
|
120
144
|
moveCamera(coordinate, options) {
|
|
121
145
|
if (!map) return;
|
|
@@ -143,7 +167,7 @@ export const MapView = /*#__PURE__*/forwardRef(function MapView(props, ref) {
|
|
|
143
167
|
const first = coordinates[0];
|
|
144
168
|
if (!map || !first) return;
|
|
145
169
|
const {
|
|
146
|
-
|
|
170
|
+
padding: fitPadding,
|
|
147
171
|
duration = -1
|
|
148
172
|
} = options ?? {};
|
|
149
173
|
if (coordinates.length === 1) {
|
|
@@ -160,14 +184,18 @@ export const MapView = /*#__PURE__*/forwardRef(function MapView(props, ref) {
|
|
|
160
184
|
lng: coord.longitude
|
|
161
185
|
});
|
|
162
186
|
});
|
|
187
|
+
const ei = prevEdgeInsets.current;
|
|
163
188
|
map.fitBounds(bounds, {
|
|
164
|
-
top: (
|
|
165
|
-
left: (
|
|
166
|
-
bottom: (
|
|
167
|
-
right: (
|
|
189
|
+
top: (ei?.top ?? 0) + (fitPadding?.top ?? 0),
|
|
190
|
+
left: (ei?.left ?? 0) + (fitPadding?.left ?? 0),
|
|
191
|
+
bottom: (ei?.bottom ?? 0) + (fitPadding?.bottom ?? 0),
|
|
192
|
+
right: (ei?.right ?? 0) + (fitPadding?.right ?? 0)
|
|
168
193
|
});
|
|
194
|
+
},
|
|
195
|
+
setEdgeInsets(newEdgeInsets, options) {
|
|
196
|
+
applyEdgeInsets(newEdgeInsets, options?.duration);
|
|
169
197
|
}
|
|
170
|
-
}), [map, initialZoom,
|
|
198
|
+
}), [map, initialZoom, offsetCenter, applyEdgeInsets]);
|
|
171
199
|
useEffect(() => {
|
|
172
200
|
if (map && !readyFired.current) {
|
|
173
201
|
readyFired.current = true;
|
|
@@ -179,22 +207,9 @@ export const MapView = /*#__PURE__*/forwardRef(function MapView(props, ref) {
|
|
|
179
207
|
const prev = prevEdgeInsets.current;
|
|
180
208
|
const changed = prev?.top !== edgeInsets.top || prev?.left !== edgeInsets.left || prev?.bottom !== edgeInsets.bottom || prev?.right !== edgeInsets.right;
|
|
181
209
|
if (changed) {
|
|
182
|
-
|
|
183
|
-
const zoom = map.getZoom() ?? initialZoom;
|
|
184
|
-
if (center) {
|
|
185
|
-
const logicalCenter = offsetCenter({
|
|
186
|
-
latitude: center.lat(),
|
|
187
|
-
longitude: center.lng()
|
|
188
|
-
}, zoom, prev, true);
|
|
189
|
-
const newCenter = offsetCenter({
|
|
190
|
-
latitude: logicalCenter.lat,
|
|
191
|
-
longitude: logicalCenter.lng
|
|
192
|
-
}, zoom, edgeInsets, false);
|
|
193
|
-
map.panTo(newCenter);
|
|
194
|
-
}
|
|
195
|
-
prevEdgeInsets.current = edgeInsets;
|
|
210
|
+
applyEdgeInsets(edgeInsets);
|
|
196
211
|
}
|
|
197
|
-
}, [map, edgeInsets,
|
|
212
|
+
}, [map, edgeInsets, applyEdgeInsets]);
|
|
198
213
|
const handleDragStart = () => {
|
|
199
214
|
setIsDragging(true);
|
|
200
215
|
wasGesture.current = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","useCallback","useEffect","useId","useImperativeHandle","useRef","useState","View","ColorScheme","Map","useMap","Marker","MapContext","jsx","_jsx","jsxs","_jsxs","createSyntheticEvent","nativeEvent","currentTarget","target","bubbles","cancelable","defaultPrevented","eventPhase","isTrusted","preventDefault","stopPropagation","isDefaultPrevented","isPropagationStopped","persist","timeStamp","Date","now","type","userLocationDotStyle","width","height","backgroundColor","border","borderRadius","boxShadow","UserLocationMarker","enabled","coordinate","setCoordinate","watchId","updateLocation","position","latitude","coords","longitude","navigator","geolocation","getCurrentPosition","watchPosition","clearWatch","anchor","x","y","children","style","MapView","props","ref","mapId","initialCoordinate","initialZoom","minZoom","maxZoom","zoomEnabled","scrollEnabled","pitchEnabled","edgeInsets","userLocationEnabled","theme","onCameraMove","onCameraIdle","onReady","id","map","containerRef","readyFired","isDragging","setIsDragging","wasGesture","prevEdgeInsets","offsetCenter","coord","zoom","edgeInsetsOverride","reverse","p","div","getDiv","lat","lng","dir","scale","Math","pow","offsetX","right","left","offsetY","bottom","top","latRad","PI","log","tan","cos","atan","sinh","moveCamera","options","duration","targetZoom","getZoom","center","undefined","currentZoom","zoomChanged","setZoom","panTo","fitCoordinates","coordinates","first","fitEdgeInsets","length","bounds","google","maps","LatLngBounds","forEach","extend","fitBounds","current","prev","changed","getCenter","logicalCenter","newCenter","handleDragStart","handleDragEnd","handleCameraChanged","event","detail","payload","gesture","handleIdle","gestureHandling","colorScheme","DARK","LIGHT","FOLLOW_SYSTEM","defaultCenter","Provider","value","defaultZoom","disableDefaultUI","isFractionalZoomEnabled","tilt","onDragstart","onDragend","onCameraChanged","onIdle"],"sourceRoot":"../../src","sources":["MapView.web.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QAEH,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AAK,EAAE;MAAE9E,GAAG;MAAEG;IAAW,CAAE;IAAAvB,QAAA,eAC9C9C,IAAA,CAACP,IAAI;MAACyD,GAAG,EAAEiB,YAAa;MAACpB,KAAK,EAAEA,KAAM;MAAAD,QAAA,eACpC5C,KAAA,CAACP,GAAG;QACFsE,EAAE,EAAEA,EAAG;QACPd,KAAK,EAAEA,KAAM;QACb2F,aAAa,EAAEA,aAAc;QAC7BG,WAAW,EAAE5F,WAAY;QACzBC,OAAO,EAAEA,OAAQ;QACjBC,OAAO,EAAEA,OAAQ;QACjBkF,eAAe,EAAEA,eAAgB;QACjCC,WAAW,EAAEA,WAAY;QACzBQ,gBAAgB;QAChBC,uBAAuB;QACvBC,IAAI,EAAE1F,YAAY,KAAK,KAAK,GAAG,CAAC,GAAGgD,SAAU;QAC7C2C,WAAW,EAAEpB,eAAgB;QAC7BqB,SAAS,EAAEpB,aAAc;QACzBqB,eAAe,EAAEpB,mBAAoB;QACrCqB,MAAM,EAAEhB,UAAW;QAAA1F,QAAA,gBAEnB9C,IAAA,CAAC4B,kBAAkB;UAACC,OAAO,EAAE+B;QAAoB,CAAE,CAAC,EACnDd,QAAQ;MAAA,CACN;IAAC,CACF;EAAC,CACY,CAAC;AAE1B,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["forwardRef","useCallback","useEffect","useId","useImperativeHandle","useRef","useState","View","ColorScheme","Map","useMap","Marker","MapContext","jsx","_jsx","jsxs","_jsxs","createSyntheticEvent","nativeEvent","currentTarget","target","bubbles","cancelable","defaultPrevented","eventPhase","isTrusted","preventDefault","stopPropagation","isDefaultPrevented","isPropagationStopped","persist","timeStamp","Date","now","type","userLocationDotStyle","width","height","backgroundColor","border","borderRadius","boxShadow","UserLocationMarker","enabled","coordinate","setCoordinate","watchId","updateLocation","position","latitude","coords","longitude","navigator","geolocation","getCurrentPosition","watchPosition","clearWatch","anchor","x","y","children","style","MapView","props","ref","mapId","initialCoordinate","initialZoom","minZoom","maxZoom","zoomEnabled","scrollEnabled","pitchEnabled","edgeInsets","userLocationEnabled","theme","onCameraMove","onCameraIdle","onReady","id","map","containerRef","readyFired","isDragging","setIsDragging","wasGesture","prevEdgeInsets","offsetCenter","coord","zoom","insets","reverse","p","current","lat","lng","dir","scale","Math","pow","offsetX","right","left","offsetY","bottom","top","latRad","PI","log","tan","cos","atan","sinh","applyEdgeInsets","newEdgeInsets","duration","prev","center","getCenter","getZoom","logicalCenter","newCenter","moveCamera","panTo","options","targetZoom","undefined","currentZoom","zoomChanged","setZoom","fitCoordinates","coordinates","first","padding","fitPadding","length","bounds","google","maps","LatLngBounds","forEach","extend","ei","fitBounds","setEdgeInsets","changed","handleDragStart","handleDragEnd","handleCameraChanged","event","detail","payload","gesture","handleIdle","gestureHandling","colorScheme","DARK","LIGHT","FOLLOW_SYSTEM","defaultCenter","Provider","value","defaultZoom","disableDefaultUI","isFractionalZoomEnabled","tilt","onDragstart","onDragend","onCameraChanged","onIdle"],"sourceRoot":"../../src","sources":["MapView.web.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QAEH,OAAO;AAEd,SAASC,IAAI,QAAQ,cAAc;AACnC,SACEC,WAAW,EACXC,GAAG,EACHC,MAAM,QAGD,2BAA2B;AAClC,SAASC,MAAM,QAAQ,4BAAyB;AAChD,SAASC,UAAU,QAAQ,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAY/C,MAAMC,oBAAoB,GAAQC,WAAc,KAC7C;EACCA,WAAW;EACXC,aAAa,EAAE,IAAI;EACnBC,MAAM,EAAE,IAAI;EACZC,OAAO,EAAE,KAAK;EACdC,UAAU,EAAE,KAAK;EACjBC,gBAAgB,EAAE,KAAK;EACvBC,UAAU,EAAE,CAAC;EACbC,SAAS,EAAE,IAAI;EACfC,cAAc,EAAEA,CAAA,KAAM,CAAC,CA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EG;IAAW,CAAE;IAAAvB,QAAA,eAC9C9C,IAAA,CAACP,IAAI;MAACyD,GAAG,EAAEiB,YAAa;MAACpB,KAAK,EAAEA,KAAM;MAAAD,QAAA,eACpC5C,KAAA,CAACP,GAAG;QACFsE,EAAE,EAAEA,EAAG;QACPd,KAAK,EAAEA,KAAM;QACb8F,aAAa,EAAEA,aAAc;QAC7BG,WAAW,EAAE/F,WAAY;QACzBC,OAAO,EAAEA,OAAQ;QACjBC,OAAO,EAAEA,OAAQ;QACjBqF,eAAe,EAAEA,eAAgB;QACjCC,WAAW,EAAEA,WAAY;QACzBQ,gBAAgB;QAChBC,uBAAuB;QACvBC,IAAI,EAAE7F,YAAY,KAAK,KAAK,GAAG,CAAC,GAAGsD,SAAU;QAC7CwC,WAAW,EAAEpB,eAAgB;QAC7BqB,SAAS,EAAEpB,aAAc;QACzBqB,eAAe,EAAEpB,mBAAoB;QACrCqB,MAAM,EAAEhB,UAAW;QAAA7F,QAAA,gBAEnB9C,IAAA,CAAC4B,kBAAkB;UAACC,OAAO,EAAE+B;QAAoB,CAAE,CAAC,EACnDd,QAAQ;MAAA,CACN;IAAC,CACF;EAAC,CACY,CAAC;AAE1B,CAAC,CAAC","ignoreList":[]}
|
|
@@ -77,10 +77,18 @@ interface NativeCommands {
|
|
|
77
77
|
edgeInsetsRight: Double,
|
|
78
78
|
duration: Double
|
|
79
79
|
) => void;
|
|
80
|
+
setEdgeInsets: (
|
|
81
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
82
|
+
top: Double,
|
|
83
|
+
left: Double,
|
|
84
|
+
bottom: Double,
|
|
85
|
+
right: Double,
|
|
86
|
+
duration: Double
|
|
87
|
+
) => void;
|
|
80
88
|
}
|
|
81
89
|
|
|
82
90
|
export const Commands = codegenNativeCommands<NativeCommands>({
|
|
83
|
-
supportedCommands: ['moveCamera', 'fitCoordinates'],
|
|
91
|
+
supportedCommands: ['moveCamera', 'fitCoordinates', 'setEdgeInsets'],
|
|
84
92
|
});
|
|
85
93
|
|
|
86
94
|
export default codegenNativeComponent<NativeProps>(
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions } from './MapView.types';
|
|
3
|
-
import type { Coordinate } from './types';
|
|
2
|
+
import type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, SetEdgeInsetsOptions } from './MapView.types';
|
|
3
|
+
import type { Coordinate, EdgeInsets } from './types';
|
|
4
4
|
export declare class MapView extends React.Component<MapViewProps> implements MapViewRef {
|
|
5
5
|
static defaultProps: Partial<MapViewProps>;
|
|
6
6
|
private nativeRef;
|
|
7
7
|
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
8
8
|
fitCoordinates(coordinates: Coordinate[], options?: FitCoordinatesOptions): void;
|
|
9
|
+
setEdgeInsets(edgeInsets: EdgeInsets, options?: SetEdgeInsetsOptions): void;
|
|
9
10
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=MapView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtD,qBAAa,OACX,SAAQ,KAAK,CAAC,SAAS,CAAC,YAAY,CACpC,YAAW,UAAU;IAErB,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAQxC;IAEF,OAAO,CAAC,SAAS,CAA0B;IAE3C,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAc9D,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAyBzE,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,oBAAoB;IASpE,MAAM;CAkDP"}
|
|
@@ -12,7 +12,13 @@ export interface MoveCameraOptions {
|
|
|
12
12
|
* Options for fitting coordinates in view
|
|
13
13
|
*/
|
|
14
14
|
export interface FitCoordinatesOptions {
|
|
15
|
-
|
|
15
|
+
padding?: EdgeInsets;
|
|
16
|
+
duration?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Options for setting edge insets
|
|
20
|
+
*/
|
|
21
|
+
export interface SetEdgeInsetsOptions {
|
|
16
22
|
duration?: number;
|
|
17
23
|
}
|
|
18
24
|
/**
|
|
@@ -21,6 +27,7 @@ export interface FitCoordinatesOptions {
|
|
|
21
27
|
export interface MapViewRef {
|
|
22
28
|
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
23
29
|
fitCoordinates(coordinates: Coordinate[], options?: FitCoordinatesOptions): void;
|
|
30
|
+
setEdgeInsets(edgeInsets: EdgeInsets, options?: SetEdgeInsetsOptions): void;
|
|
24
31
|
}
|
|
25
32
|
/**
|
|
26
33
|
* Camera event payload
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.types.d.ts","sourceRoot":"","sources":["../../../src/MapView.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC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[],"mappings":"AAsBA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,
|
|
1
|
+
{"version":3,"file":"MapView.web.d.ts","sourceRoot":"","sources":["../../../src/MapView.web.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAKX,MAAM,iBAAiB,CAAC;AAoEzB,eAAO,MAAM,OAAO,qGA0QlB,CAAC"}
|
|
@@ -51,6 +51,7 @@ type ComponentType = HostComponent<NativeProps>;
|
|
|
51
51
|
interface NativeCommands {
|
|
52
52
|
moveCamera: (viewRef: React.ElementRef<ComponentType>, latitude: Double, longitude: Double, zoom: Double, duration: Double) => void;
|
|
53
53
|
fitCoordinates: (viewRef: React.ElementRef<ComponentType>, coordinates: Coordinate[], edgeInsetsTop: Double, edgeInsetsLeft: Double, edgeInsetsBottom: Double, edgeInsetsRight: Double, duration: Double) => void;
|
|
54
|
+
setEdgeInsets: (viewRef: React.ElementRef<ComponentType>, top: Double, left: Double, bottom: Double, right: Double, duration: Double) => void;
|
|
54
55
|
}
|
|
55
56
|
export declare const Commands: NativeCommands;
|
|
56
57
|
declare const _default: ComponentType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LuggMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM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aAAa,CAAC,WAAW,CAAC,CAAC;AAEhD,UAAU,cAAc;IACtB,UAAU,EAAE,CACV,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,cAAc,EAAE,CACd,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,WAAW,EAAE,UAAU,EAAE,EACzB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,gBAEnB,CAAC;wBAIE,aAAa;AAFlB,wBAEmB"}
|
|
1
|
+
{"version":3,"file":"LuggMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM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AI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,cAAc,EAAE,CACd,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,WAAW,EAAE,UAAU,EAAE,EACzB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,aAAa,EAAE,CACb,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,gBAEnB,CAAC;wBAIE,aAAa;AAFlB,wBAEmB"}
|
|
@@ -5,6 +5,6 @@ export { Marker } from './components';
|
|
|
5
5
|
export type { MarkerProps } from './components';
|
|
6
6
|
export { Polyline } from './components';
|
|
7
7
|
export type { PolylineProps, PolylineEasing, PolylineAnimatedOptions, } from './components';
|
|
8
|
-
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, CameraEventPayload, } from './MapView.types';
|
|
8
|
+
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, SetEdgeInsetsOptions, CameraEventPayload, } from './MapView.types';
|
|
9
9
|
export type { MapProvider as MapProviderType, MapTheme, Coordinate, Point, EdgeInsets, } from './types';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,YAAY,EACV,aAAa,EACb,cAAc,EACd,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,QAAQ,EACR,UAAU,EACV,KAAK,EACL,UAAU,GACX,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,YAAY,EACV,aAAa,EACb,cAAc,EACd,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,QAAQ,EACR,UAAU,EACV,KAAK,EACL,UAAU,GACX,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
package/src/MapView.tsx
CHANGED
|
@@ -9,8 +9,9 @@ import type {
|
|
|
9
9
|
MapViewRef,
|
|
10
10
|
MoveCameraOptions,
|
|
11
11
|
FitCoordinatesOptions,
|
|
12
|
+
SetEdgeInsetsOptions,
|
|
12
13
|
} from './MapView.types';
|
|
13
|
-
import type { Coordinate } from './types';
|
|
14
|
+
import type { Coordinate, EdgeInsets } from './types';
|
|
14
15
|
|
|
15
16
|
export class MapView
|
|
16
17
|
extends React.Component<MapViewProps>
|
|
@@ -47,8 +48,8 @@ export class MapView
|
|
|
47
48
|
const first = coordinates[0];
|
|
48
49
|
if (!ref || !first) return;
|
|
49
50
|
|
|
50
|
-
const {
|
|
51
|
-
const { top = 0, left = 0, bottom = 0, right = 0 } =
|
|
51
|
+
const { padding, duration = -1 } = options ?? {};
|
|
52
|
+
const { top = 0, left = 0, bottom = 0, right = 0 } = padding ?? {};
|
|
52
53
|
|
|
53
54
|
if (coordinates.length === 1) {
|
|
54
55
|
const zoom = this.props.initialZoom ?? 10;
|
|
@@ -67,6 +68,15 @@ export class MapView
|
|
|
67
68
|
);
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
setEdgeInsets(edgeInsets: EdgeInsets, options?: SetEdgeInsetsOptions) {
|
|
72
|
+
const ref = this.nativeRef.current;
|
|
73
|
+
if (!ref) return;
|
|
74
|
+
|
|
75
|
+
const { top = 0, left = 0, bottom = 0, right = 0 } = edgeInsets;
|
|
76
|
+
const { duration = -1 } = options ?? {};
|
|
77
|
+
Commands.setEdgeInsets(ref, top, left, bottom, right, duration);
|
|
78
|
+
}
|
|
79
|
+
|
|
70
80
|
render() {
|
|
71
81
|
const {
|
|
72
82
|
provider,
|
package/src/MapView.types.ts
CHANGED
|
@@ -14,7 +14,14 @@ export interface MoveCameraOptions {
|
|
|
14
14
|
* Options for fitting coordinates in view
|
|
15
15
|
*/
|
|
16
16
|
export interface FitCoordinatesOptions {
|
|
17
|
-
|
|
17
|
+
padding?: EdgeInsets;
|
|
18
|
+
duration?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Options for setting edge insets
|
|
23
|
+
*/
|
|
24
|
+
export interface SetEdgeInsetsOptions {
|
|
18
25
|
duration?: number;
|
|
19
26
|
}
|
|
20
27
|
|
|
@@ -27,6 +34,7 @@ export interface MapViewRef {
|
|
|
27
34
|
coordinates: Coordinate[],
|
|
28
35
|
options?: FitCoordinatesOptions
|
|
29
36
|
): void;
|
|
37
|
+
setEdgeInsets(edgeInsets: EdgeInsets, options?: SetEdgeInsetsOptions): void;
|
|
30
38
|
}
|
|
31
39
|
|
|
32
40
|
/**
|
package/src/MapView.web.tsx
CHANGED
|
@@ -25,9 +25,10 @@ import type {
|
|
|
25
25
|
MapViewRef,
|
|
26
26
|
MoveCameraOptions,
|
|
27
27
|
FitCoordinatesOptions,
|
|
28
|
+
SetEdgeInsetsOptions,
|
|
28
29
|
CameraEventPayload,
|
|
29
30
|
} from './MapView.types';
|
|
30
|
-
import type { Coordinate } from './types';
|
|
31
|
+
import type { Coordinate, EdgeInsets } from './types';
|
|
31
32
|
|
|
32
33
|
const createSyntheticEvent = <T,>(nativeEvent: T): NativeSyntheticEvent<T> =>
|
|
33
34
|
({
|
|
@@ -126,15 +127,9 @@ export const MapView = forwardRef<MapViewRef, MapViewProps>(function MapView(
|
|
|
126
127
|
const prevEdgeInsets = useRef(edgeInsets);
|
|
127
128
|
|
|
128
129
|
const offsetCenter = useCallback(
|
|
129
|
-
(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
edgeInsetsOverride?: typeof edgeInsets,
|
|
133
|
-
reverse = false
|
|
134
|
-
) => {
|
|
135
|
-
const p = edgeInsetsOverride ?? edgeInsets;
|
|
136
|
-
const div = map?.getDiv();
|
|
137
|
-
if (!p || !div) {
|
|
130
|
+
(coord: Coordinate, zoom: number, insets?: EdgeInsets, reverse = false) => {
|
|
131
|
+
const p = insets ?? prevEdgeInsets.current;
|
|
132
|
+
if (!p) {
|
|
138
133
|
return { lat: coord.latitude, lng: coord.longitude };
|
|
139
134
|
}
|
|
140
135
|
|
|
@@ -157,7 +152,41 @@ export const MapView = forwardRef<MapViewRef, MapViewProps>(function MapView(
|
|
|
157
152
|
|
|
158
153
|
return { lat, lng };
|
|
159
154
|
},
|
|
160
|
-
[
|
|
155
|
+
[]
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
const applyEdgeInsets = useCallback(
|
|
159
|
+
(newEdgeInsets: EdgeInsets, duration?: number) => {
|
|
160
|
+
if (!map) return;
|
|
161
|
+
|
|
162
|
+
const prev = prevEdgeInsets.current;
|
|
163
|
+
const center = map.getCenter();
|
|
164
|
+
const zoom = map.getZoom() ?? initialZoom;
|
|
165
|
+
|
|
166
|
+
if (center) {
|
|
167
|
+
const logicalCenter = offsetCenter(
|
|
168
|
+
{ latitude: center.lat(), longitude: center.lng() },
|
|
169
|
+
zoom,
|
|
170
|
+
prev,
|
|
171
|
+
true
|
|
172
|
+
);
|
|
173
|
+
const newCenter = offsetCenter(
|
|
174
|
+
{ latitude: logicalCenter.lat, longitude: logicalCenter.lng },
|
|
175
|
+
zoom,
|
|
176
|
+
newEdgeInsets,
|
|
177
|
+
false
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
if (duration === 0) {
|
|
181
|
+
map.moveCamera({ center: newCenter, zoom });
|
|
182
|
+
} else {
|
|
183
|
+
map.panTo(newCenter);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
prevEdgeInsets.current = newEdgeInsets;
|
|
188
|
+
},
|
|
189
|
+
[map, initialZoom, offsetCenter]
|
|
161
190
|
);
|
|
162
191
|
|
|
163
192
|
useImperativeHandle(
|
|
@@ -190,7 +219,7 @@ export const MapView = forwardRef<MapViewRef, MapViewProps>(function MapView(
|
|
|
190
219
|
const first = coordinates[0];
|
|
191
220
|
if (!map || !first) return;
|
|
192
221
|
|
|
193
|
-
const {
|
|
222
|
+
const { padding: fitPadding, duration = -1 } = options ?? {};
|
|
194
223
|
|
|
195
224
|
if (coordinates.length === 1) {
|
|
196
225
|
this.moveCamera(first, { zoom: initialZoom, duration });
|
|
@@ -202,15 +231,20 @@ export const MapView = forwardRef<MapViewRef, MapViewProps>(function MapView(
|
|
|
202
231
|
bounds.extend({ lat: coord.latitude, lng: coord.longitude });
|
|
203
232
|
});
|
|
204
233
|
|
|
234
|
+
const ei = prevEdgeInsets.current;
|
|
205
235
|
map.fitBounds(bounds, {
|
|
206
|
-
top: (
|
|
207
|
-
left: (
|
|
208
|
-
bottom: (
|
|
209
|
-
right: (
|
|
236
|
+
top: (ei?.top ?? 0) + (fitPadding?.top ?? 0),
|
|
237
|
+
left: (ei?.left ?? 0) + (fitPadding?.left ?? 0),
|
|
238
|
+
bottom: (ei?.bottom ?? 0) + (fitPadding?.bottom ?? 0),
|
|
239
|
+
right: (ei?.right ?? 0) + (fitPadding?.right ?? 0),
|
|
210
240
|
});
|
|
211
241
|
},
|
|
242
|
+
|
|
243
|
+
setEdgeInsets(newEdgeInsets: EdgeInsets, options?: SetEdgeInsetsOptions) {
|
|
244
|
+
applyEdgeInsets(newEdgeInsets, options?.duration);
|
|
245
|
+
},
|
|
212
246
|
}),
|
|
213
|
-
[map, initialZoom,
|
|
247
|
+
[map, initialZoom, offsetCenter, applyEdgeInsets]
|
|
214
248
|
);
|
|
215
249
|
|
|
216
250
|
useEffect(() => {
|
|
@@ -231,26 +265,9 @@ export const MapView = forwardRef<MapViewRef, MapViewProps>(function MapView(
|
|
|
231
265
|
prev?.right !== edgeInsets.right;
|
|
232
266
|
|
|
233
267
|
if (changed) {
|
|
234
|
-
|
|
235
|
-
const zoom = map.getZoom() ?? initialZoom;
|
|
236
|
-
if (center) {
|
|
237
|
-
const logicalCenter = offsetCenter(
|
|
238
|
-
{ latitude: center.lat(), longitude: center.lng() },
|
|
239
|
-
zoom,
|
|
240
|
-
prev,
|
|
241
|
-
true
|
|
242
|
-
);
|
|
243
|
-
const newCenter = offsetCenter(
|
|
244
|
-
{ latitude: logicalCenter.lat, longitude: logicalCenter.lng },
|
|
245
|
-
zoom,
|
|
246
|
-
edgeInsets,
|
|
247
|
-
false
|
|
248
|
-
);
|
|
249
|
-
map.panTo(newCenter);
|
|
250
|
-
}
|
|
251
|
-
prevEdgeInsets.current = edgeInsets;
|
|
268
|
+
applyEdgeInsets(edgeInsets);
|
|
252
269
|
}
|
|
253
|
-
}, [map, edgeInsets,
|
|
270
|
+
}, [map, edgeInsets, applyEdgeInsets]);
|
|
254
271
|
|
|
255
272
|
const handleDragStart = () => {
|
|
256
273
|
setIsDragging(true);
|
|
@@ -77,10 +77,18 @@ interface NativeCommands {
|
|
|
77
77
|
edgeInsetsRight: Double,
|
|
78
78
|
duration: Double
|
|
79
79
|
) => void;
|
|
80
|
+
setEdgeInsets: (
|
|
81
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
82
|
+
top: Double,
|
|
83
|
+
left: Double,
|
|
84
|
+
bottom: Double,
|
|
85
|
+
right: Double,
|
|
86
|
+
duration: Double
|
|
87
|
+
) => void;
|
|
80
88
|
}
|
|
81
89
|
|
|
82
90
|
export const Commands = codegenNativeCommands<NativeCommands>({
|
|
83
|
-
supportedCommands: ['moveCamera', 'fitCoordinates'],
|
|
91
|
+
supportedCommands: ['moveCamera', 'fitCoordinates', 'setEdgeInsets'],
|
|
84
92
|
});
|
|
85
93
|
|
|
86
94
|
export default codegenNativeComponent<NativeProps>(
|