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

UserLocationObjectListener: некорректные координаты в onObjectAdded #322

Open
sham0688 opened this issue Jul 15, 2021 · 0 comments

Comments

@sham0688
Copy link

В onObjectAdded приходит geometry с latitude = 0.0 и longitude = 0.0, хотя pin на карте появляется сразу в реальном месте.
Реальные координаты появляются только в onObjectUpdated спустя несколько секунд.

object : UserLocationObjectListener {
        override fun onObjectAdded(userLocationView: UserLocationView) {
            updateMyLocationPoint("onObjectAdded", userLocationView.pin)
        }

        override fun onObjectUpdated(userLocationView: UserLocationView, objectEvent: ObjectEvent) {
            updateMyLocationPoint("onObjectUpdated", userLocationView.pin)
        }

        private fun updateMyLocationPoint(action: String, pin: PlacemarkMapObject) {
            Log.d(action, "pin ${pin.geometry.latitude}" +
                    ", ${pin.geometry.longitude}" +
                    ", ${pin.isValid}" +
                    ", ${pin.isVisible}")
        }
    }

лог:

2021-07-15 13:59:41.504 18378-18378/com.android.debug D/onObjectAdded: pin 0.0, 0.0, true, true
2021-07-15 13:59:41.506 18378-18378/com.android.debug D/onObjectUpdated: pin 0.0, 0.0, true, false
2021-07-15 13:59:41.507 18378-18378/com.android.debug D/onObjectUpdated: pin 0.0, 0.0, true, false
2021-07-15 13:59:56.241 18378-18378/com.android.debug D/onObjectUpdated: pin 58.0077645, 56.2651901, true, false

Аналогичная ситуация и с userLocationView.arrow userLocationView.accuracyCircle.
В итоге имеем существенный лаг в получении реальных координат.

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