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

position marker following the route(polyline) like google maps #432

Open
Ostreey opened this issue Oct 29, 2022 · 6 comments
Open

position marker following the route(polyline) like google maps #432

Ostreey opened this issue Oct 29, 2022 · 6 comments

Comments

@Ostreey
Copy link

Ostreey commented Oct 29, 2022

Hi! MKergall thank you very much for this greate library.
Curently im creating navigation app with speedcameras detection. I have most of the stuff already working i have few question regarding improving user experiance.

  1. When in google maps you set the road, somehow position marker is following exactly the route (polyline), it seems like some kind of snap algorythm. Is there something like this implemented in osmdroid/osmbonuspack ? If not could you give me some guidelines how to do it ?
  2. I'm using animateTo() to follow current location and move the map, position marker is just static imageView on the map. It works fairly good, although it has an effect of - animating to next gps location, stoping for half of second and animating again to new gps location. I would like to remove that effect of stopping for short period of time by increasing animation lenght, unfortunatelly parameter 'animation lenght' in animateTo() doesnt do the trick. Seems like at some point current position is just stopping to move and loosing real position. I did animated marker which is moving on the map following next gps position and it works good, i could do the same with setCenter, setMapRotation but maybe i'm just doing something wrong with animateTo?

Thank you very much

@eclectice
Copy link

@Ostreey
Copy link
Author

Ostreey commented Nov 4, 2022

This is great. thanks

@Ostreey
Copy link
Author

Ostreey commented Nov 19, 2022

See OsmDroid demo app's 10K race in Paris under the Data section at play.google.com/store/apps/details?id=org.osmdroid. The source code for the demo can be found here https://github.com/osmdroid/osmdroid/blob/master/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/SampleRace.java

https://www.youtube.com/shorts/nl3AB052_tE

So I'm following examples in order to make border color around roadoverlay. I got it to work but since its two paints above each other if my roadOverlay is long (has many Geopoints) it's making app laggy. Is there any workaround available ?
Thanks

@MKergall
Copy link
Owner

you can simplify your route with the DouglasPeucker reducer (PointReducer class).

@Ostreey
Copy link
Author

Ostreey commented Nov 25, 2022

Thank you, it helped.
Another question. I'm using custom tiles generated in mobac (.sqlite). It's entire map of country - weight 27GB divided into 12 files. Although tiles are loading slower than the one using internet directly (from cache) from OSM tile server. Files are inside of device internal memory. When im using animate to from lower zoom to (10) to lower zoom (18) mostly after zoom i get white screen and tiles are slowly loading one by one (around 3 seconds loading time ). Is it normal ?
I'm using this for offline tiles.
map.setTileSource((new XYTileSource( "Ecuador", 6, 19, 256, ".png", new String[] {} )));

Is it possible to archive following effect: When using animateTo while zooming in - tiles from lower level stays on the screen and new tiles are beeing loaded on top of them ? This would atleast remove ugly effect of white squares

@xdindincx
Copy link

Hi! @Ostreey

Can you please tell me how you were able to animate/move the marker along the polyline generated between 2 geopoints? I have looked into the 10K Race in Paris example but I am not quite getting it.

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

4 participants