8000 fix(google-maps): setting default coord or zoom · NativeScript/plugins@2d27620 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d27620

Browse files
committed
fix(google-maps): setting default coord or zoom
1 parent 28af14c commit 2d27620

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

packages/google-maps/index.android.ts

+11Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,17 +375,15 @@ export class MapView extends MapViewBase {
375375
});
376376
const container = new android.widget.LinearLayout(this._context);
377377
const nativeView = new com.google.android.gms.maps.MapView(this._context);
378-
nativeView.onCreate(this.createdBundle);
379-
nativeView.onResume();
380378
nativeView.getMapAsync(this.#listener);
381379
this.mapView = nativeView;
382-
nativeView.onCreate(null);
380+
nativeView.onCreate(this.createdBundle);
383381
nativeView.onResume();
384382
return container;
385383
}
384+
386385
initNativeView(): void {
387386
super.initNativeView();
388-
console.log('initNativeView');
389387
}
390388

391389
[latProperty.setNative](value) {
@@ -963,6 +961,15 @@ export class CameraPosition implements ICameraPosition {
963961
set zoom(value) {
964962
this.#native = new com.google.android.gms.maps.model.CameraPosition(this.native.target, value, this.native.tilt, this.native.bearing);
965963
}
964+
965+
toJSON() {
966+
return {
967+
target: this.target,
968+
tilt: this.tilt,
969+
bearing: this.bearing,
970+
zoom: this.zoom,
971+
};
972+
}
966973
}
967974

968975
abstract class OverLayBase {

0 commit comments

Comments
 (0)
0