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

Animating the movement of a cursor along a polyline with two colors codes: the completed part and the part to do ? #1984

Open
xuantienpham opened this issue Feb 24, 2024 · 1 comment

Comments

@xuantienpham
Copy link

Hi all,

I am seeking a solution for animating a cursor (Marker) along a polyline with two colors: one indicating the completed portion and the other indicating the remaining part. The animation speed should be adjustable at any time, allowing for modification of the cursor's movement speed.

Within the class MapController, there exists a function named animateTo that I believe can accommodate my solution. It generates coordinates GeoPoint between the starting and ending points, as well as handling the starting and ending orientations.

public void animateTo(final IGeoPoint point, final Double pZoom, final Long pSpeed, final Float pOrientation, final Boolean pClockwise)

This function halts all ongoing animations and ensures that the animation completes. The class MapAnimatorListener serves this purpose, but it is currently marked as private. Could it be changed to protected so one subclasse of MapController can access this field? Similarly, I would like to access to the field mCurrentAnimator, allowing it to be updated with another ValueAnimator when the speed's animation changes.

Additionally, could the class MapView include a setController() method for injecting a subclass of MapController ?

Thanks a lot.

@xuantienpham
Copy link
Author

xuantienpham commented Feb 25, 2024

I found the class SampleRace at https://github.com/osmdroid/osmdroid/blob/feature/#1089/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/SampleRace.java which handles the movement of the cursor along a polyline. However, the center's of map isn't locked to the cursor's position. Additionally, I want rotation to occur when the cursor transitions from one segment to another along the polyline.

Thanks !

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