In my app I am trying to visualize best route between two points. The route is calculated using data stored in my offline database. After some google search I have seen it is easy to visualize a route using KmlDocument. But all the example I found are Just showing how to create KmlDocument from kml file and visualize it. But in my situation it is not possible, as the route is generated dynamically. So how can I visualize the route on OSMdroid?
How to visualize dynamically created routes on OSMdroid?
302 Views Asked by S.Ahsan At
1
There are 1 best solutions below
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in KML
- Why the code shows only the header and footer of xml file?
- Keep UI Elements Open in Google Earth after kml file is refreshed (NetworkLink)
- OsgEarth model clamped to terrain
- How do I remove the filename prefix in the attribute table of a kml file when exporting a kml file using sf package in R?
- Google Earth KML Placemark description not updating
- How can I add this image to the map stretching over an extent specified in degrees?
- Why doesn't the OL KMZ example work with my file?
- Why doesn't this KML file show up in the web version of Google Earth?
- xml remove xml namespaces appearing at certain elements
- My Maps - Error occurred when uploading kml or gpx file
- Iframe does not load all kml layers
- Why is the Cesium camera tracking a point that's offset quite far from the trackedEntity?
- How to properly change a loaded KML in react-leaflet-kml
- String XSLT namespace issue
- DriverError: unsupported driver: 'LIBKML' When using GDAL to trim a GEOTiff File around a KMZ
Related Questions in OSMDROID
- OSMDROID: load offline tiles from database
- Osmdroid Cache Location Not Respecting Config
- Could the OSMBonusPack work on an Open Sea Map-project?
- how to remove overlays from mapview with index in osmdroid?
- OsmDroid make on cluster clicklistener
- Fragment - TileLoader failed to load tile due to mWriter being null (Message displayed after onPause and onResume)
- using osmdroid in a jetpack compose project
- OSMDroid: how do I set a fixed layer alpha?
- How to implement OsmdroidMap Android?
- OSMDroid - Cannot navigate to a fragment after clicking on a marker
- osmdroid map disappears after switchings tabs
- Osmdroid disable map rotation
- Create a map using openstreetmap with jetpack compose in Kotlin programming language for Android
- (Android/Kotlin) OpenStreetMap - Public Transport OSMdroid
- Handling configuration changes in OSMDroid + Jetpack Compose
Related Questions in OSMBONUSPACK
- Osmdroid how to move position marker in animative way with animateTo function
- Osmbonuspack : marker's onDoubleTap function not working when adding the markers in RadiusMarkerClusterer
- Why androidx.appcompat.widget.AppCompatEditText cannot be cast to com.google.android.material.textfield.TextInputEditText?
- Custom Marker in RadiusMarkerClusterer
- OSMDroid Points of interest using multiple facilities
- Creating URL based on an API key in OSRMRoadManager
- How do I select a language in OSRM's RoadManager
- Failed to resolve: com.github.MKergall:osmbonuspack:6.7.0 #410
- osmbonuspack: unable to assign each marker its own style in kml structure
- Reasons for using OSMBonusPack versus OSRM (Open Source Routing Machine)?
- OSM Bonus Pack - OSRMRoadManager::getRoad: request failed
- customized icon in osmdroid marker android
- How do I Stop a running runOnUiThread Runnable
- Display multiple InfoWindows using osmdroid
- osmdroid zoomToBoundingBox not zooming to boundingBox coordinates
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
If you just want a line on the map that represents your route, then I'm pretty sure the class you want is Polyline.
Source: https://github.com/osmdroid/osmdroid/blob/master/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java
There a few different variants which have different effects depending on what you want, such as the Milestone classes.
Source: https://github.com/osmdroid/osmdroid/tree/master/osmdroid-android/src/main/java/org/osmdroid/views/overlay/milestones
Examples for both are here: https://github.com/osmdroid/osmdroid/blob/master/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/drawing/CustomPaintingSurface.java#L132
I'd suggest you get the sample app from the play store, play around with what's there, then find the source to what best fits your needs and go from there.