Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Widget使用google地图时,坐标有偏移 #45

Open
luoyexk opened this issue Sep 9, 2021 · 2 comments
Open

Map Widget使用google地图时,坐标有偏移 #45

luoyexk opened this issue Sep 9, 2021 · 2 comments

Comments

@luoyexk
Copy link

luoyexk commented Sep 9, 2021

当坐标定位在美国时,Google map上显示的marker和真实坐标不匹配

切换到mapbox后,地图上显示的marker位置正确

测试坐标
38.9334361,-77.4063494

任意机型

在Demo里测试天安门前的国旗的经纬度 39.905592, 116.391314,在Google map上显示位置正确

@luoyexk
Copy link
Author

luoyexk commented Sep 9, 2021

测试坐标
38.9334361,-77.4063494

这是在网页上的定位
image

这是选择Google Maps进入界面后的定位
image

这是选择Mapbox进入界面后的定位
image

@luoyexk
Copy link
Author

luoyexk commented Sep 10, 2021

在onMapReady时调用如下代码创建marker,发现marker位置正确,但是控件标记的无人机位置是错误的

KeyManager.getInstance().getValue(FlightControllerKey.create(FlightControllerKey.AIRCRAFT_LOCATION), object : GetCallback {
                override fun onSuccess(p0: Any) {
                    runOnUiThread {
                        val latLng = (p0 as LocationCoordinate3D).run { LatLng(latitude, longitude) }
                        Timber.d("zzzz get location suc: ${latLng.latitude},${latLng.longitude}")
                        (map.map as GoogleMap).addMarker(MarkerOptions()
                            .position(latLng)
                            .icon(BitmapDescriptorFactory.defaultMarker())
                        )
                    }
                }
                override fun onFailure(p0: DJIError) {
                    Timber.d("zzzz get location error: $p0")
                }
            })

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant