Questions tagged [osmdroid]
osmdroid provides Tools / Views to interact with OpenStreetMap-Data, as a close to drop in replacement for the MapView class, with additions.
1,187
questions
0
votes
0
answers
29
views
why can't i see the route path after an on click event? [osmdroid]
I have some problems developing my app, the first problem is the following:
I am trying to create a path between two points. When I enter the points directly on the code the path is displayed ...
0
votes
0
answers
11
views
osmdroid: Follow map north on rotation
I want to integrate OSM into my application to show the map of a given location. I want to show the north direction on the map, even when the user rotates the map. The OsmAnd app has a compass mode ...
0
votes
2
answers
42
views
Why androidx.appcompat.widget.AppCompatEditText cannot be cast to com.google.android.material.textfield.TextInputEditText?
I would like to be able to create a path between two points by entering coordinates through two text fields and using the function I created, to create the path, using a button that takes the two ...
0
votes
0
answers
15
views
Cannot resolve symbol 'osmdroid' when importing (import org.osmdroid.tileprovider.tilesource.TileSourceFactory; & import org.osmdroid.views.MapView;)
I'm a beginner and I'm trying to use OSM for my app and I can't find any solution to this. I followed every step of this site https://osmdroid.github.io/osmdroid/How-to-use-the-osmdroid-library.html ...
0
votes
0
answers
30
views
Osmdroid as alternative to Mapbox
I am currently using MapBox SDK to display raster map tiles within an Java/Kotlin implemented Android app. However, I want to replace the Mapbox SDK with an alternative primarily because, as far as I ...
0
votes
0
answers
16
views
Openstreetmap - Osmdroid - WMTS
I'm looking to use mapping services via WMTS protocol through the OpenstreetMap android SDK (osmdroid).
However no matter the zoom level, I load for each web request an image of 256x256px.
This causes ...
0
votes
1
answer
28
views
Custom Marker in RadiusMarkerClusterer
I created a customMarker that in addition to the image contains a label at the bottom with a name.
If I create a "FolderOverlay" everything works correctly I see my custom Marker.
This is my ...
0
votes
1
answer
37
views
Osmdroid (open street map) marker slow to draw after click to map
I'm brand new to Open Street Map and have successfully added a map to my activity at the user's location and implemented an onClickListener that upon a click shows a marker and retrieves the latitude ...
0
votes
0
answers
38
views
Stop rotation of osmdroid custom icon when user is moving
To set icons in osmdroid map I use myLocationNewOverlay.setDirectionArrow(bitmapIcon, bitmapIcon);, but the icon rotate when the user moves.
Is there any way to stop the rotation of the icon when it ...
1
vote
1
answer
77
views
crash when i try to create a path between two points in osmdroid
I have recently started studying android and kotlin programming, I'm trying to create an application that allows you to create one or more routes on a map, save it and then retrieve it when necessary. ...
0
votes
0
answers
20
views
OsmDroid: where to put the onClick method for Marker?
I've put this method in my custom drawMarker() function:
fun drawMarker() {
marker!!.setOnMarkerClickListener(object : OnMarkerClickListener {
override fun onMarkerClick(marker: ...
0
votes
1
answer
25
views
OsmDroid: User agent doesn't work with Fragments
Every example available on the internet tells us to use this line of code to get the user agent (without it the map won't load).
osm.osmdroid.config.Configuration.getInstance()
.load(...
0
votes
0
answers
41
views
Generate routes with Osmdroid
I would like to create an Android application (using Osmdroid) that would generate a random route. The length of the route would be given by the user. I have not found a similar question/solution. I ...
0
votes
1
answer
34
views
OSMDroid get the radius of the map
I'm using OSMDroid (Open Street Map for Android), and I'm trying to get the radius of the visible map, to send it to my API and get a result scaled correctly.
Here is what I'm doing on iOS using ...
0
votes
1
answer
48
views
OsmDroid Maps is not loading in Android 10 (Online Mode)
I'm working with osmdroid map in online mode. The map is loading properly in online mode in Android 11. But in Android 10 getting below issue.
java.io.IOException: Cleartext HTTP traffic to b.tile....
0
votes
1
answer
43
views
Android Osmdroid map polygon click unexpected delay
I have many(250+) polygons drawn on map. And I need to able to click on them. So i created custom class, that extented Polygon, where i override onSingleTapUp func(code below). The click works, but ...
0
votes
0
answers
75
views
OSM in android fragment become blank tilesz
I'm using android studio for my android app with OSM(org.osmdroid:osmdroid-android:6.1.13) just to see the map with a marker of my current location.
My problem is I have 2 fragment (f1 and f2), I put ...
0
votes
0
answers
12
views
Taking a MapSnapshot of a bounding box
I was wondering if, given the edges of a bounding box, it was possible to obtain a MapSnapshot in OSMDroid. Its constructors seem to either leverage a MapView or a Projection (https://osmdroid.github....
1
vote
1
answer
37
views
OSMDroid Points of interest using multiple facilities
I am using OSMDroid with its bonus pack to display a map and get point of interest near a location, but I can't find a way to get POI of different type in once.
As indicated in the documentation I am ...
0
votes
0
answers
27
views
OSMDroid doesnt load maps that use API
i was trying to have a map that uses the OpenCycleMap but it doesn't load the map
final String[] tileURLs = {"http://a.tile.thunderforest.com/cycle/",
"http://b.tile....
1
vote
1
answer
59
views
Osmdroid loading only Elements inside of a Polygon with OverpassAPIProvider
So I am trying the following: Using the Overpass API in osmdroid to only load those nodes, ways or relations that are within or partially within a Polygon.
Tweaking the OverpassAPIProvider class from ...
0
votes
0
answers
77
views
How to get name of polygon or polyline if my location inthere ? (OSMDroid)
Im working with OSMDroid to make map offline in Android Studio.
this is my code to create Polygon :
polygon = new Polygon();
polygon.setPoints(list_polygon);
polygon.setFillColor(Color.parseColor(&...
0
votes
0
answers
101
views
Osmdroid offline zip files (tiles) maps does not load on android 10 and 11 devices
I'm working with osmdroid map in offline mode. I have downloaded tiles using Global mapper and zip tiles are keep in download folder(/sdcard/Download). But on Accessing it getting below error in ...
0
votes
0
answers
51
views
Checking for intersection between an area and a set of points with heterogeneous geographical data
I have an application which deals with geographical data and, in particular, tracks. Given an area (radius around geopoint, or bounding box of geopoints) I need to find, among of all these tracks, the ...
0
votes
0
answers
34
views
Map is not showing using osmdroid ver 6.1.11 Custom XYTileSource in Android 10
I used a custom XYTileSource to display a local map in Android 8 and its working, but the map is not showing when I tried it in Android 10.
2
votes
2
answers
70
views
osmdroid map tiles only load after zooming out
After each fresh install tiles in my MapView only load after zooming out quite a bit. After that it works fine, but I can't figure out what causes this.
The debug logs are as follows:
D/OsmDroid: ...
1
vote
1
answer
53
views
Creating URL based on an API key in OSRMRoadManager
I've signed up for an API on openrouteservice.org. How do I import it into OSRMRoadManager? I've tried all the combinations from the examples on their website, but my every try results in the 403 ...
0
votes
1
answer
299
views
How to load geoserver WMS layer on osmdroid map in particular bounding box?
I am using osmdroid library to show mapview in my application. I have to load wms layer in my osm map to show village boundaries.
I have search on google and stack overflow and I found following blogs ...
0
votes
0
answers
51
views
Handling singleTap and longPress on a map, using OSMDroid / OSMBonusPack in Android Kotlin
Similar problem as described in this post, can someone help me out solving this issue: both singleTap and longPress events doesn't get called in the map. This is what I do (I'm using Hilt for the ...
0
votes
2
answers
49
views
How do I select a language in OSRM's RoadManager
I need to force OSRM to switch the language in road.mNodes.mInstructions to English in order to work with English TTS. How do I achieve that in Kotlin? I'm using OSRMRoadManager from OSMBonusPack.
0
votes
0
answers
44
views
Osmdroid: Show route with overlaying polylines properly
As visible in the image, my app requires complex routes. This may involve driving the same road two times in different directions. I have made the polylines significantly thicker than the default ...
0
votes
1
answer
102
views
OSMdroid custom offline xyzTiles?
Suppose you made a map in QGIS then used the tool "Generate XYZ Tiles" to create a directory or MBTiles file of XYZ Map Tiles. Is it possible to display that on an Android phone using ...
2
votes
0
answers
27
views
Android: is it possible to query mbtiles database in android platform
I use the vector mbtiles database in my Android project.
It contains some list of Features.
I use this mbtiles as a data source for Vector Layer at Mapbox.
At the same time I need to get this list of ...
0
votes
0
answers
55
views
Use OSMDROID to display my server generated map tiles
I am trying to display map tiles using osmdroid. but it is displaying blank screen.
This is my code:
map.setZ(100);
map.setTileSource(new OnlineTileSourceBase("", 12, 18, 256, ".png&...
0
votes
0
answers
29
views
Setting the rotation of personIcon?
Is there a way to set the rotation of the personIcon from MyLocationNewOverlay? I saw something about DirectedLocationOverlay, but I'm not sure how that ties in.
mLocationOverlay = ...
1
vote
0
answers
37
views
Add OnClickListener to Marker InfoWindow
Is there a workaround for adding an OnClickListener to a marker's InfoWindow? I can add one to the marker itself. But I'm finding it more intuitive at a UI standpoint to tap the infowindow rather than ...
0
votes
1
answer
65
views
OSMDroid crashes when I touch the view while it's animating
My app crashes when mapController.animateTo is called and there is any touch event while the animation is still taking place. This is a stripped down version of what I'm doing. But this code crashes ...
0
votes
0
answers
16
views
Distinguish onScroll event based on mapController.animateTo() vs user input
I'm trying to implement a feature that centers the map on the device's location, but I want to disable it as soon as the user manually moves the map.
Right now I have Button that sets a Boolean (...
1
vote
1
answer
137
views
OSMDroid LocationChange Listener
I'm creating a map and I have a locationOverlay that works fine. However I need to update some variables as the location changes.
Do I use a LocationListener with OSMDroid? Or is there something ...
1
vote
0
answers
36
views
Why does my current location marker change from a person to an arrow?
I'm using the code provided by the wiki https://github.com/osmdroid/osmdroid/wiki/How-to-use-the-osmdroid-library-(Kotlin)
To test I'm using an emulated android device and my physical phone.
The issue ...
0
votes
0
answers
36
views
OSMdroid - current location doesn't display on map
I have an Android Studio app where I am able to load in OSMdroid as a MapView as well as place GeoPoints on the map (markers). My issue is that I cannot display my current location.
I have tried this.
...
0
votes
0
answers
13
views
How to draw a radar scanning animation in osmdroid
I use polygon and set its fillpaint with RadialGradient,but it doesn't work!
val polygon = Polygon()
val pp = polygon.fillPaint
val xx = mapView.projection.toPixels(pointCenter, null).x
val yy = ...
0
votes
1
answer
56
views
How to get direction between current location to another location on OSM in android studio
*I want to get direction between two location using OSM in android studio. one location is user current location and other one is provide my data base . also assume that there is two variable ...
0
votes
0
answers
65
views
How to add an overlay map to a base map in OSMdroid
I'm writing an android map tile-based navigation app that uses OSM as map data source.
As base map I use MAPNIK, so it looks like
private MapView myBaseMap;
myBaseMap.setTileSource(TileSourceFactory....
0
votes
1
answer
111
views
Getting individual coordinates from OSMDroid routing, to use in finding elevations on trip
I am trying to create a hill finder application
Like this
The user enters a starting location, and an end location. With the end goal of displaying a chart with the elevations of the road in the trip
...
0
votes
1
answer
54
views
Allow user to choose from different Tile Sources in osmdroid
I want to add a map chooser to my osmdroid app, so the user can choose different map types at runtime (e.g. mapnik, Bing maps, opencyclemap etc). Similar to the way you can do that in other map ...
0
votes
1
answer
173
views
Files in Android Scoped Storage Get Randomly Deleted
I have a navigation-like application in Google Play and I have switched to scoped storage recently.
The application needs to download the map files (to work offline) which are then rendered using the ...
-1
votes
1
answer
231
views
how to search location name on osmdroid to get latitude longitude
how to get the latitude and longitude by search location names with open street map osmdroid.
My Expectation is, It looks like implement google map places autocomplete, but I don't know how to make ...
0
votes
1
answer
139
views
How to draw the current location information in osmdroid
Assumption and what I want to achieve
I'm working on an application that receives current location information from an external RTK-GPS via serial communication, and draws dots or lines on an ...
3
votes
0
answers
266
views
OSM map crashes random on loading Tile image in android
App crashes randomly on loading the OSM map tile image stating error in log as continuously
Failed to open file '/data/data/packageName/code_cache/.overlay/base.apk/assets/Mapnik/14/4294/6311.png': No ...