【发布时间】:2017-10-18 08:11:00
【问题描述】:
我使用地图插件在我的应用程序上显示地图。它适用于以下代码:
onMapReady(event) {
this.mapView = event.object;
var marker = new Marker();
marker.position = Position.positionFromLatLng(45.46, 9.18);
marker.title = "Milano";
marker.snippet = "Italia";
marker.userData = { index: 1 };
this.mapView.addMarker(marker);
this.mapView.settings.zoomGesturesEnabled = false;
this.mapView.settings.zoomControlsEnabled = false;
this.mapView.settings.rotateGesturesEnabled = false;
this.mapView.settings.scrollGesturesEnabled = false;
this.mapView.settings.compassEnabled =[enter image description here][1] false;
this.mapView.settings.indoorLevelPickerEnabled = false;
}
和模板:
<MapView #mapView row="0" col="0" [latitude]="latitude" visibility="visible" [longitude]="longitude" [zoom]="zoom" (mapReady)="onMapReady($event)"></MapView>
使用此代码,我获得了地图的静态视图(静态视图,因为我无法移动地图),但是当加载地图时,会进行缩放,直到达到我定义的缩放级别。我可以删除这个初始“缩放”(地图相机移动到我的缩放级别)吗?或者更好的是我可以只显示地图的图像吗?
信息: nativescript 3.2.0 / tns-core-modules 3.1.1 / tns-android 3.2.0
nativescript-google-maps-sdk 2.4.1
【问题讨论】:
标签: android google-maps nativescript angular2-nativescript