heremaps / here-android-sdk-examples

Java-based projects using the HERE SDK for Android.
Apache License 2.0
145 stars 191 forks source link

Are there any variant to detect that some GeoCoordinate belongs to fTCRRoute #475

Closed Strikelon closed 2 years ago

Strikelon commented 2 years ago

Hello!

Are there any variant to detect that some GeoCoordinate belongs to fTCRRoute?

I tried this variant but it is sometimes wrong:

fTCRRoute.boundingBox.contains(myGeoCoordinate)

I mean the situation when I added fTCRRoute to the map, then user clicked on the map, I want to know if user clicked on the route on the map, or somewhere else.

Very often fTCRRoute.boundingBox.contains(myGeoCoordinate) return true, even I clicked somewhere more far, then the route is.

Thank you

NazarKacharaba commented 2 years ago

Hi @Strikelon,

If you add FTCRRoute on the Map as FTCRMapRoute , you can use following API to detect when user clicked the route - MapGesture.OnGestureListener.onMapObjectsSelected(List<ViewObject> objects); Just iterate through objects and find if there is FTCRMapRoute.

Strikelon commented 2 years ago

Thanks!