日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Android >内容正文

Android

arcgis android 指南针,Arcgis runtime for Android 100.5 (六) 自定义指南针

發布時間:2023/12/8 Android 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 arcgis android 指南针,Arcgis runtime for Android 100.5 (六) 自定义指南针 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Arcgis沒有提供指南針控件,如果需要,可以自定義一個,很簡單

去阿里圖標庫下載一個能用的指南針如

指南針

放置在布局文件中

xmlns:fab="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".MainActivity">

android:id="@+id/mapView"

android:layout_width="match_parent"

android:layout_height="match_parent" />

android:id="@+id/ivCompass"

android:layout_width="40dp"

android:layout_height="40dp"

android:padding="5dp"

android:layout_alignParentRight="true"

android:layout_marginTop="10dp"

android:layout_marginRight="20dp"

android:src="@mipmap/ic_compass" />

監聽地圖旋轉角度,指南針跟著轉

private var lastBearing = 0f//指南針最后旋轉角度

mapView.addMapRotationChangedListener {

val bearing: Float =

(360f - mapView.mapRotation).toFloat()

//創建指南針旋轉動畫

val rotateAnimation = RotateAnimation(

lastBearing, bearing, Animation.RELATIVE_TO_SELF, 0.5f,

Animation.RELATIVE_TO_SELF, 0.5f

)

rotateAnimation.fillAfter = true

ivCompass.startAnimation(rotateAnimation)

lastBearing = bearing

}

點擊指南針,地圖角度回正

ivCompass.setOnClickListener {

mapView.setViewpointRotationAsync(0.0)

}

這樣就OK了

總結

以上是生活随笔為你收集整理的arcgis android 指南针,Arcgis runtime for Android 100.5 (六) 自定义指南针的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。