修改定位无效问题
This commit is contained in:
@@ -30,7 +30,7 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
//
|
||||
// }
|
||||
|
||||
val niLocationFlow = MutableSharedFlow<NiLocation>(3)
|
||||
val niLocationFlow = MutableSharedFlow<NiLocation>(5)
|
||||
|
||||
init {
|
||||
///添加定位图层到地图,[NIMapView.LAYER_GROUPS.NAVIGATION] 是最上层layer组
|
||||
@@ -67,18 +67,12 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
val errorCode = it.locType
|
||||
mCurrentLocation = it
|
||||
mLocationLayer.setPosition(it.latitude, it.longitude, it.radius)
|
||||
// Log.e(
|
||||
// "qj",
|
||||
// "location==${it.longitude}==errorCode===$errorCode===${it.locTypeDescription}"
|
||||
// )
|
||||
Log.e("qj", "location==${it.longitude}==errorCode===$errorCode===${it.locTypeDescription}")
|
||||
|
||||
// if (niLocationListener != null) {
|
||||
getCurrentNiLocation()?.let { it1 ->
|
||||
mContext.lifecycleScope.launch(Dispatchers.Default) {
|
||||
mContext.lifecycleScope.launch {
|
||||
niLocationFlow.emit(it1)
|
||||
}
|
||||
|
||||
// }// niLocationListener.call(it1) }
|
||||
}
|
||||
//第一次定位成功显示当前位置
|
||||
if (this.bFirst) {
|
||||
|
||||
@@ -504,7 +504,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
0 -> {
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
if (direction != 0.0) {
|
||||
if (direction > 0.0) {
|
||||
val symbolGpsTemp =
|
||||
MarkerSymbol(niLocationBitmap, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolGpsTemp
|
||||
@@ -519,7 +519,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
1 -> {
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
if (direction != 0.0) {
|
||||
if (direction > 0.0) {
|
||||
val symbolLidarTemp =
|
||||
MarkerSymbol(niLocationBitmap1, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolLidarTemp
|
||||
|
||||
Reference in New Issue
Block a user