2017-10-18 113 views
-1

我使用地圖插件在我的應用程序上顯示地圖。它的工作原理與此代碼:Google maps sdk nativescript:我可以捕捉地圖的圖像嗎?

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-核心模塊3.1.1/TNS-的Android 3.2.0

nativescript - 谷歌 - 地圖-SDK 2.4.1

回答

相關問題