osmdroid

OSMDroid - Default marker moving when zooming out on Android API 28

旧街凉风 提交于 2020-04-11 12:42:12
问题 I recently started to use OSMDroid, but I struggle to get a default marker at a specific Geopoint on Android API 28. I followed the tutorial from the OSMDroid's Github and wrote a code like this: //Making a Mapbox TileSource MapBoxTileSource mbTest = new MapBoxTileSource("mapbox.streets", ACCESS_TOKEN); map = (MapView) findViewById(R.id.map); map.setTileSource(mbTest); //Setting up map map.setVisibility(View.VISIBLE); map.setMultiTouchControls(true); map.getController().setCenter(new GeoPoint

OSM offline on Android

自闭症网瘾萝莉.ら 提交于 2020-03-23 23:17:04
问题 I'm trying to build an offline map on android and I'm still a beginner in that. so I added osmdroid to my project and I downloaded a the map data from this link. after some searching in the internet I still didn't find an example to display the data. In addition osmdroid use sd card location from what I found. is there a possibility to change that with a clear example about how to do it ? thank you 回答1: You downloaded raw openstreetmap data. Osmdroid requires rendered tiles for offline

OSMDROID: error: incompatible types: IGeoPoint cannot be converted to GeoPoint

我只是一个虾纸丫 提交于 2020-02-29 04:56:51
问题 I am building a sample OSMdroid app mixing and matching from various sources. In using this sample code, import org.osmdroid.util.GeoPoint; ... private void setOverlayLoc(Location overlayloc){ GeoPoint overlocGeoPoint = new GeoPoint(overlayloc); //--- overlayItemArray.clear(); OverlayItem newMyLocationItem = new OverlayItem( "My Location", "My Location", overlocGeoPoint); overlayItemArray.add(newMyLocationItem); } ... @Override public void draw(Canvas canvas, MapView mapview, boolean arg2) {

OSMDROID: error: incompatible types: IGeoPoint cannot be converted to GeoPoint

丶灬走出姿态 提交于 2020-02-29 04:55:11
问题 I am building a sample OSMdroid app mixing and matching from various sources. In using this sample code, import org.osmdroid.util.GeoPoint; ... private void setOverlayLoc(Location overlayloc){ GeoPoint overlocGeoPoint = new GeoPoint(overlayloc); //--- overlayItemArray.clear(); OverlayItem newMyLocationItem = new OverlayItem( "My Location", "My Location", overlocGeoPoint); overlayItemArray.add(newMyLocationItem); } ... @Override public void draw(Canvas canvas, MapView mapview, boolean arg2) {

Changing OSMDroid's MyLocationOverlay marker

纵然是瞬间 提交于 2020-02-25 08:47:06
问题 I want to change the marker in the MyLocationOverlay. What I've tried so far is subclassing OSMDroid's MyLocationOverlay and overriding the default marker, using code provided in this answer. However, it didn't work properly (I got the error: method drawMyLocation must override or implement a supertype method but commenting @Override solved it). However, the marker image stays the same (the question asked about Google Maps API, whereas I'm using OSMDroid) - how can I solve it? 回答1: You have a

Changing OSMDroid's MyLocationOverlay marker

≡放荡痞女 提交于 2020-02-25 08:47:06
问题 I want to change the marker in the MyLocationOverlay. What I've tried so far is subclassing OSMDroid's MyLocationOverlay and overriding the default marker, using code provided in this answer. However, it didn't work properly (I got the error: method drawMyLocation must override or implement a supertype method but commenting @Override solved it). However, the marker image stays the same (the question asked about Google Maps API, whereas I'm using OSMDroid) - how can I solve it? 回答1: You have a

Parse and view geojson with OsmBonusPack

无人久伴 提交于 2020-01-24 14:09:06
问题 I want to parse geojson and view data on osmbonuspack & osmdroid mapview. I used this totorial: https://code.google.com/p/osmbonuspack/wiki/Tutorial_4 IS there any way to parse a geojson file like kml? thanks 回答1: Here is how I created a new overlay using a given GeoJSON file and the link given in question. private void addAdditionalLayer () { String jsonString = null; try { InputStream jsonStream = getAssets().open("myLocations.geojson"); int size = jsonStream.available(); byte[] buffer =

Help setting up OSMdroid library for displaying OpenSourceMaps

廉价感情. 提交于 2020-01-16 14:46:37
问题 Hey. I am having trouble setting up the OSMdroid library to display OpenSourceMaps. I am working on an activity that will allow the user to see a map of their current location wit buttons to allow the user to switch between normal google maps view, terrain google maps view, and openstreetmaps view. I am currently using the JAR file and just adding it to the build path of my project. It compiles fine however I don't understand how to use the library. There are very few tutorials/directions

Simple osmdroid application doesn't work

久未见 提交于 2020-01-15 09:38:30
问题 I'm trying to launch a very simple android application using OpenStreetMaps-Tools for Android , and I have nothing but runtime errors. Android virtual device: Platform 2.2, API level 8, SD card 1024MiB. My IDE is IntelliJ Idea 11. Here is my AndroidManifest.xml : <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="test.osmdroid005" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="7" />

OSMDroid PathOverlay drawing is corrupted at high zoom levels

有些话、适合烂在心里 提交于 2020-01-14 04:40:10
问题 I'm using OSMdroid to implement a mapping application. I have implemented a custom MapTileProvider that uses a tile source that allows zoom levels up to 22. The default MAPNIK provider only allows zooms to level 18. The problem is that any PathOverlay instances draw perfectly until zoom level 19, but then are not drawn properly at zoom level 20-22. it looks like someone's rubbed out the path with an eraser over 90% of the path length (see screenshots below). I've stepped through the draw()