mapbox / mapbox-navigation-android

Mapbox Navigation SDK for Android
https://docs.mapbox.com/android/navigation/overview/
Other
622 stars 319 forks source link

Ability to hide/change the origin waypoint icon #5882

Open abhishek1508 opened 2 years ago

abhishek1508 commented 2 years ago

I would like a way to hide .originWaypointIcon() after starting a trip, "origin is only origin the first time you start navigating". The current suggested workaround is to update the resource used for .originWaypointIcon() to have a transparent color.

/cc @mapbox/navigation-android @mapbox/navigation-ios

cafesilencio commented 2 years ago

I'm not sure what the ask is here. The MapboxRouteLineView has a hideOriginAndDestinationPoints method. This will hide both origin and destination markers since they are on the same layer. Otherwise what's described above as the "workaround" will also do the job.

If the functionality needs to be expanded beyond the available options above then it's worth exploring the idea of creating a waypoint API as has been suggested previously.

abhishek1508 commented 2 years ago

Can we separate hideOriginAndDestinationPoints into 2 individual API(s) - hideOriginPoint, hideDestinationPoint and hideWaypoints() //hides all waypoint, hideWaypoint(point)// hides given waypoint. This gives more control as a user to hide only one of these markers, vs now hideOriginAndDestinationPoints hides both origin and destination, even though the request is to only hide origin.

cafesilencio commented 2 years ago

The waypoints are on the same map layer so they can't be hidden separately with the current implementation.. There is the possibility of creating additional layers with the waypoints separated but this is more significant which is why I suggested pursing the waypoints API suggestion.

dudeuter commented 2 years ago

waypoints API suggestion Would this be a class dedicated to waypoints in a similar manner to the RouteLine and RouteArrows classes?

In addition to origin, final destination, and destinations in-between. We'll likely also provide a way to distinguish waypoints added by the Directions API that aren't explicitly requested (EV Routing).

We will probably also want to provide an API to style waypoints on any metadata that the Directions API may return in the future.