@lugg/maps 0.2.0-alpha.16 → 0.2.0-alpha.17
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/LuggGoogleMapView.kt +4 -3
- package/ios/LuggAppleMapView.mm +5 -3
- package/ios/LuggGoogleMapView.mm +8 -6
- package/lib/module/MapView.js +2 -2
- package/lib/module/MapView.js.map +1 -1
- package/lib/typescript/src/MapView.d.ts +1 -1
- package/lib/typescript/src/MapView.d.ts.map +1 -1
- package/lib/typescript/src/MapView.types.d.ts +2 -2
- package/lib/typescript/src/MapView.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/MapView.tsx +2 -2
- package/src/MapView.types.ts +2 -2
|
@@ -291,7 +291,7 @@ class LuggGoogleMapView(private val reactContext: ThemedReactContext) :
|
|
|
291
291
|
|
|
292
292
|
private fun addMarkerViewToMap(markerView: LuggMarkerView) {
|
|
293
293
|
val map = googleMap ?: run {
|
|
294
|
-
RNLog.w(reactContext, "
|
|
294
|
+
RNLog.w(reactContext, "LuggMaps: addMarkerViewToMap called without a map")
|
|
295
295
|
return
|
|
296
296
|
}
|
|
297
297
|
|
|
@@ -380,7 +380,7 @@ class LuggGoogleMapView(private val reactContext: ThemedReactContext) :
|
|
|
380
380
|
if (value.isNullOrEmpty()) return
|
|
381
381
|
|
|
382
382
|
if (mapView != null) {
|
|
383
|
-
RNLog.w(reactContext, "
|
|
383
|
+
RNLog.w(reactContext, "LuggMaps: mapId cannot be changed after map is initialized")
|
|
384
384
|
return
|
|
385
385
|
}
|
|
386
386
|
|
|
@@ -450,7 +450,8 @@ class LuggGoogleMapView(private val reactContext: ThemedReactContext) :
|
|
|
450
450
|
fun moveCamera(latitude: Double, longitude: Double, zoom: Double, duration: Int) {
|
|
451
451
|
val map = googleMap ?: return
|
|
452
452
|
val position = LatLng(latitude, longitude)
|
|
453
|
-
val
|
|
453
|
+
val targetZoom = if (zoom > 0) zoom.toFloat() else map.cameraPosition.zoom
|
|
454
|
+
val cameraUpdate = CameraUpdateFactory.newLatLngZoom(position, targetZoom)
|
|
454
455
|
when {
|
|
455
456
|
duration < 0 -> map.animateCamera(cameraUpdate)
|
|
456
457
|
duration > 0 -> map.animateCamera(cameraUpdate, duration, null)
|
package/ios/LuggAppleMapView.mm
CHANGED
|
@@ -537,16 +537,18 @@ using namespace luggmaps::events;
|
|
|
537
537
|
return;
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
+
double targetZoom = zoom > 0 ? zoom : _mapView.zoomLevel;
|
|
541
|
+
|
|
540
542
|
if (duration < 0) {
|
|
541
543
|
[self setCameraWithLatitude:latitude
|
|
542
544
|
longitude:longitude
|
|
543
|
-
zoom:
|
|
545
|
+
zoom:targetZoom
|
|
544
546
|
animated:YES];
|
|
545
547
|
} else if (duration > 0) {
|
|
546
548
|
CLLocationCoordinate2D center =
|
|
547
549
|
CLLocationCoordinate2DMake(latitude, longitude);
|
|
548
550
|
MKCoordinateRegion region = [_mapView regionForCenterCoordinate:center
|
|
549
|
-
zoomLevel:
|
|
551
|
+
zoomLevel:targetZoom];
|
|
550
552
|
[UIView animateWithDuration:duration / 1000.0
|
|
551
553
|
animations:^{
|
|
552
554
|
[self->_mapView setRegion:region animated:NO];
|
|
@@ -554,7 +556,7 @@ using namespace luggmaps::events;
|
|
|
554
556
|
} else {
|
|
555
557
|
[self setCameraWithLatitude:latitude
|
|
556
558
|
longitude:longitude
|
|
557
|
-
zoom:
|
|
559
|
+
zoom:targetZoom
|
|
558
560
|
animated:NO];
|
|
559
561
|
}
|
|
560
562
|
}
|
package/ios/LuggGoogleMapView.mm
CHANGED
|
@@ -245,8 +245,10 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
245
245
|
marker.zIndex = (int)markerView.zIndex;
|
|
246
246
|
if (markerView.hasCustomView) {
|
|
247
247
|
UIView *iconView = markerView.iconView;
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
if (marker.iconView != iconView) {
|
|
249
|
+
[iconView removeFromSuperview];
|
|
250
|
+
marker.iconView = iconView;
|
|
251
|
+
}
|
|
250
252
|
marker.groundAnchor = markerView.anchor;
|
|
251
253
|
} else {
|
|
252
254
|
marker.iconView = nil;
|
|
@@ -396,10 +398,10 @@ static NSString *const kDemoMapId = @"DEMO_MAP_ID";
|
|
|
396
398
|
return;
|
|
397
399
|
}
|
|
398
400
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
float targetZoom = zoom > 0 ? (float)zoom : _mapView.camera.zoom;
|
|
402
|
+
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:latitude
|
|
403
|
+
longitude:longitude
|
|
404
|
+
zoom:targetZoom];
|
|
403
405
|
if (duration < 0) {
|
|
404
406
|
[_mapView animateToCameraPosition:camera];
|
|
405
407
|
} else if (duration > 0) {
|
package/lib/module/MapView.js
CHANGED
|
@@ -25,9 +25,9 @@ export class MapView extends React.Component {
|
|
|
25
25
|
const ref = this.nativeRef.current;
|
|
26
26
|
if (!ref) return;
|
|
27
27
|
const {
|
|
28
|
-
zoom,
|
|
28
|
+
zoom = 0,
|
|
29
29
|
duration = -1
|
|
30
|
-
} = options;
|
|
30
|
+
} = options ?? {};
|
|
31
31
|
this.nativeCommands.moveCamera(ref, coordinate.latitude, coordinate.longitude, zoom, duration);
|
|
32
32
|
}
|
|
33
33
|
fitCoordinates(coordinates, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","StyleSheet","LuggGoogleMapViewNativeComponent","Commands","GoogleMapCommands","LuggAppleMapViewNativeComponent","AppleMapCommands","LuggMapWrapperViewNativeComponent","jsx","_jsx","jsxs","_jsxs","MapView","Component","defaultProps","provider","OS","initialZoom","zoomEnabled","scrollEnabled","rotateEnabled","pitchEnabled","nativeRef","createRef","nativeCommands","props","isApple","moveCamera","coordinate","options","ref","current","zoom","duration","latitude","longitude","fitCoordinates","coordinates","first","padding","top","left","bottom","right","length","render","mapId","initialCoordinate","minZoom","maxZoom","userLocationEnabled","onCameraMove","onCameraIdle","onReady","children","rest","NativeMapView","style","absoluteFill"],"sourceRoot":"../../src","sources":["MapView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,OAAOC,gCAAgC,IACrCC,QAAQ,IAAIC,iBAAiB,QACxB,2CAA2C;AAClD,OAAOC,+BAA+B,IACpCF,QAAQ,IAAIG,gBAAgB,QACvB,0CAA0C;AACjD,OAAOC,iCAAiC,MAAM,4CAA4C;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS3F,OAAO,MAAMC,OAAO,SACVb,KAAK,CAACc,SAAS,CAEzB;EACE,OAAOC,YAAY,GAA0B;IAC3CC,QAAQ,EAAEf,QAAQ,CAACgB,EAAE,KAAK,KAAK,GAAG,OAAO,GAAG,QAAQ;IACpDC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE,IAAI;IACjBC,aAAa,EAAE,IAAI;IACnBC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE;EAChB,CAAC;EAEOC,SAAS,gBAAGvB,KAAK,CAACwB,SAAS,CAAM,CAAC;EAE1C,IAAYC,cAAcA,CAAA,EAAG;IAC3B,MAAMT,QAAQ,GAAG,IAAI,CAACU,KAAK,CAACV,QAAQ,IAAIH,OAAO,CAACE,YAAY,CAACC,QAAQ;IACrE,MAAMW,OAAO,GAAG1B,QAAQ,CAACgB,EAAE,KAAK,KAAK,IAAID,QAAQ,KAAK,OAAO;IAC7D,OAAOW,OAAO,GAAGpB,gBAAgB,GAAGF,iBAAiB;EACvD;EAEAuB,UAAUA,CAACC,UAAsB,EAAEC,
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","LuggGoogleMapViewNativeComponent","Commands","GoogleMapCommands","LuggAppleMapViewNativeComponent","AppleMapCommands","LuggMapWrapperViewNativeComponent","jsx","_jsx","jsxs","_jsxs","MapView","Component","defaultProps","provider","OS","initialZoom","zoomEnabled","scrollEnabled","rotateEnabled","pitchEnabled","nativeRef","createRef","nativeCommands","props","isApple","moveCamera","coordinate","options","ref","current","zoom","duration","latitude","longitude","fitCoordinates","coordinates","first","padding","top","left","bottom","right","length","render","mapId","initialCoordinate","minZoom","maxZoom","userLocationEnabled","onCameraMove","onCameraIdle","onReady","children","rest","NativeMapView","style","absoluteFill"],"sourceRoot":"../../src","sources":["MapView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,OAAOC,gCAAgC,IACrCC,QAAQ,IAAIC,iBAAiB,QACxB,2CAA2C;AAClD,OAAOC,+BAA+B,IACpCF,QAAQ,IAAIG,gBAAgB,QACvB,0CAA0C;AACjD,OAAOC,iCAAiC,MAAM,4CAA4C;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS3F,OAAO,MAAMC,OAAO,SACVb,KAAK,CAACc,SAAS,CAEzB;EACE,OAAOC,YAAY,GAA0B;IAC3CC,QAAQ,EAAEf,QAAQ,CAACgB,EAAE,KAAK,KAAK,GAAG,OAAO,GAAG,QAAQ;IACpDC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE,IAAI;IACjBC,aAAa,EAAE,IAAI;IACnBC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE;EAChB,CAAC;EAEOC,SAAS,gBAAGvB,KAAK,CAACwB,SAAS,CAAM,CAAC;EAE1C,IAAYC,cAAcA,CAAA,EAAG;IAC3B,MAAMT,QAAQ,GAAG,IAAI,CAACU,KAAK,CAACV,QAAQ,IAAIH,OAAO,CAACE,YAAY,CAACC,QAAQ;IACrE,MAAMW,OAAO,GAAG1B,QAAQ,CAACgB,EAAE,KAAK,KAAK,IAAID,QAAQ,KAAK,OAAO;IAC7D,OAAOW,OAAO,GAAGpB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;IACP,MAAM;MACJ9B,QAAQ;MACR+B,KAAK;MACLC,iBAAiB;MACjB9B,WAAW;MACX+B,OAAO;MACPC,OAAO;MACP/B,WAAW;MACXC,aAAa;MACbC,aAAa;MACbC,YAAY;MACZkB,OAAO;MACPW,mBAAmB;MACnBC,YAAY;MACZC,YAAY;MACZC,OAAO;MACPC,QAAQ;MACR,GAAGC;IACL,CAAC,GAAG,IAAI,CAAC9B,KAAK;IAEd,MAAM+B,aAAa,GACjBxD,QAAQ,CAACgB,EAAE,KAAK,KAAK,IAAID,QAAQ,KAAK,OAAO,GACzCV,+BAA+B,GAC/BH,gCAAgC;IAEtC,oBACES,KAAA,CAAC6C,aAAa;MACZ1B,GAAG,EAAE,IAAI,CAACR,SAAU;MAAA,GAChBiC,IAAI;MACRT,KAAK,EAAEA,KAAM;MACbC,iBAAiB,EAAEA,iBAAkB;MACrC9B,WAAW,EAAEA,WAAY;MACzB+B,OAAO,EAAEA,OAAQ;MACjBC,OAAO,EAAEA,OAAQ;MACjB/B,WAAW,EAAEA,WAAY;MACzBC,aAAa,EAAEA,aAAc;MAC7BC,aAAa,EAAEA,aAAc;MAC7BC,YAAY,EAAEA,YAAa;MAC3BkB,OAAO,EAAEA,OAAQ;MACjBW,mBAAmB,EAAEA,mBAAoB;MACzCC,YAAY,EAAEA,YAAa;MAC3BC,YAAY,EAAEA,YAAa;MAC3BC,OAAO,EAAEA,OAAQ;MAAAC,QAAA,gBAEjB7C,IAAA,CAACF,iCAAiC;QAACkD,KAAK,EAAExD,UAAU,CAACyD;MAAa,CAAE,CAAC,EACpEJ,QAAQ;IAAA,CACI,CAAC;EAEpB;AACF","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ export declare class MapView extends React.Component<MapViewProps> implements Ma
|
|
|
5
5
|
static defaultProps: Partial<MapViewProps>;
|
|
6
6
|
private nativeRef;
|
|
7
7
|
private get nativeCommands();
|
|
8
|
-
moveCamera(coordinate: Coordinate, options
|
|
8
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
9
9
|
fitCoordinates(coordinates: Coordinate[], options?: FitCoordinatesOptions): void;
|
|
10
10
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,qBAAa,OACX,SAAQ,KAAK,CAAC,SAAS,CAAC,YAAY,CACpC,YAAW,UAAU;IAErB,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAOxC;IAEF,OAAO,CAAC,SAAS,CAA0B;IAE3C,OAAO,KAAK,cAAc,GAIzB;IAED,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB;
|
|
1
|
+
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,qBAAa,OACX,SAAQ,KAAK,CAAC,SAAS,CAAC,YAAY,CACpC,YAAW,UAAU;IAErB,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAOxC;IAEF,OAAO,CAAC,SAAS,CAA0B;IAE3C,OAAO,KAAK,cAAc,GAIzB;IAED,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAc9D,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAyBzE,MAAM;CAkDP"}
|
|
@@ -6,7 +6,7 @@ import type { MapProvider, Coordinate, EdgeInsets } from './types';
|
|
|
6
6
|
* @default duration -1
|
|
7
7
|
*/
|
|
8
8
|
export interface MoveCameraOptions {
|
|
9
|
-
zoom
|
|
9
|
+
zoom?: number;
|
|
10
10
|
duration?: number;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -21,7 +21,7 @@ export interface FitCoordinatesOptions {
|
|
|
21
21
|
* MapView ref methods
|
|
22
22
|
*/
|
|
23
23
|
export interface MapViewRef {
|
|
24
|
-
moveCamera(coordinate: Coordinate, options
|
|
24
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
25
25
|
fitCoordinates(coordinates: Coordinate[], options?: FitCoordinatesOptions): void;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
@@ -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;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;
|
|
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;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EA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AC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACzE;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACzE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
package/package.json
CHANGED
package/src/MapView.tsx
CHANGED
|
@@ -36,11 +36,11 @@ export class MapView
|
|
|
36
36
|
return isApple ? AppleMapCommands : GoogleMapCommands;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
moveCamera(coordinate: Coordinate, options
|
|
39
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions) {
|
|
40
40
|
const ref = this.nativeRef.current;
|
|
41
41
|
if (!ref) return;
|
|
42
42
|
|
|
43
|
-
const { zoom, duration = -1 } = options;
|
|
43
|
+
const { zoom = 0, duration = -1 } = options ?? {};
|
|
44
44
|
this.nativeCommands.moveCamera(
|
|
45
45
|
ref,
|
|
46
46
|
coordinate.latitude,
|
package/src/MapView.types.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { MapProvider, Coordinate, EdgeInsets } from './types';
|
|
|
7
7
|
* @default duration -1
|
|
8
8
|
*/
|
|
9
9
|
export interface MoveCameraOptions {
|
|
10
|
-
zoom
|
|
10
|
+
zoom?: number;
|
|
11
11
|
duration?: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -24,7 +24,7 @@ export interface FitCoordinatesOptions {
|
|
|
24
24
|
* MapView ref methods
|
|
25
25
|
*/
|
|
26
26
|
export interface MapViewRef {
|
|
27
|
-
moveCamera(coordinate: Coordinate, options
|
|
27
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
28
28
|
fitCoordinates(
|
|
29
29
|
coordinates: Coordinate[],
|
|
30
30
|
options?: FitCoordinatesOptions
|