如何写精华回答,获更多曝光?
发布
使用mapkit显示地图,通过mapController 设置setMyLocationEnabled(true)未显示当前位置。mapController.isMyLocationEnabled()返回true;使用geoLocationManager.getCurrentLocation 返回的位置偏差较大。
let location = await geoLocationManager.getCurrentLocation({
priority: geoLocationManager.LocationRequestPriority.UNSET,
scenario: geoLocationManager.LocationRequestScenario.CAR_HAILING
})
let target: mapCommon.LatLng = {
latitude: location.latitude,
longitude: location.longitude
}
let cameraPosition: mapCommon.CameraPosition = {
target: target,
zoom: 15
}
this.mapController.moveCamera(map.newCameraPosition(cameraPosition))