osmdroid

How to display Route on my OSM application

ⅰ亾dé卋堺 提交于 2019-12-11 08:22:46
问题 In log 02-19 14:41:29.151 10336-10336/com.example.app E/BONUSPACK﹕ OSRMRoadManager::getRoad: request failed. 02-19 14:41:29.151 10336-10336/com.example.app I/System.out﹕ 2 and I have route.gpx file but i don't know how to use it GeoPoint startPoint = new GeoPoint(48.13, -1.63); mapView = (MapView) findViewById(R.id.mapview); mapCTRL = (MapController) mapView.getController(); mapCTRL.setZoom(13); mapView.setBuiltInZoomControls(true); mapCTRL.setCenter((new GeoPoint(startPoint))); RoadManager

Offline routing and navigation in OSMDroid, How can I get this feature?

跟風遠走 提交于 2019-12-11 06:46:31
问题 I am developing Android app with OSM which support offline routing and navigation. I want to integrate the offline routing and navigation in OSM for Android app. There are lots of routing software and I am confused which one is better. Can anyone compare the feature of routing and navigation of different routing providers? 回答1: You can find a comparison of routing services here: https://github.com/MKergall/osmbonuspack/wiki/WhichRoutingService But if you want offline routing, GraphHopper will

Unable to pan or move the osmdroid map

£可爱£侵袭症+ 提交于 2019-12-11 04:49:51
问题 I'm using the osmdroid map in a sample application. The map is seen,zoom works,and everything is fine except that i'm unable to pan/move the map. My main xml code is: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <org.osmdroid.views.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true"

MapController setCenter doesn't work

霸气de小男生 提交于 2019-12-11 04:07:02
问题 I've got a GeoPoint gPt with 55.790833, 49.114444 coordinates. I add that thing to map and try to center. But my marker is not in the center of map (it's a little bit higher). What is wrong? This is my code: mResourceProxy = new ResourceProxyImpl(this.getActivity().getApplicationContext()); mapView = (MapView) v.findViewById(R.id.mapview); mapView.setTileSource(TileSourceFactory.MAPNIK); mapView.setBuiltInZoomControls(true); mMapController = mapView.getController(); mMapController.setZoom(15)

Overpass API Android Example?

∥☆過路亽.° 提交于 2019-12-11 02:06:46
问题 for study we have to develop an Android game which is location based. Currently we use OSMDroid to show the map. There are resources (like wood, stone, ...) which the player has to collect. These resources are currently stored in our backend with hardcoded long/lat and will be added with setMarker onto the current map. To provide this game globally, we want to set the resources dynamically based on the "real" world. So we need different layers from OSM (like forest, sea, ..) to set our

Android OSM zoom level 19 and above

人盡茶涼 提交于 2019-12-10 19:59:57
问题 I'm new to Android Development. I have an application that shows a MapView and I've set a bounding box to restrict the user to only viewing the tiles in a specific area. The issue I have is that I need to zoom in, past level 18. Which I've also been able to do so by setting the max zoom level. However, there aren't any tiles available from the default tile provider for zoom 19 and above I really only require up to 20, 21 max too. Is there a way for me to create my own tiles? Have custom tiles

Osmdroid - custom offline tile source change location

别等时光非礼了梦想. 提交于 2019-12-10 19:02:53
问题 I am using this code for displaying offline Osmdroid map tiles. Problem is, I have stored my tiles in location /sdcard/emulated0/0/. It there any way how to pass it into XYTileSource? Thx myMapView.setTileSource (new XYTileSource ("Mapnik", ResourceProxy.string.offline_mode, 13, 17, 512, ".png", "http://127.0.0.1")) 来源: https://stackoverflow.com/questions/25759654/osmdroid-custom-offline-tile-source-change-location

osmdroid ItemizedOverlay error: The method boundCenterBottom(Drawable) is undefined for the type

怎甘沉沦 提交于 2019-12-10 17:54:54
问题 I'm struggling for some hours now with this problem: I'm trying to get my itemizedoverlay to work, but I keep getting this error: The method boundCenterBottom(Drawable) is undefined for the type my class: public MyDynamicItemizedOverlay(Drawable defaultMarker) { super(boundCenterBottom(defaultMarker)); items = new ArrayList<OverlayItem>(); populate(); } public void addNewItem(GeoPoint location, String markerText, String snippet) { items.add(new OverlayItem(snippet, markerText, location));

get coordinates by clicking on map (openstreetmaps)

孤街醉人 提交于 2019-12-09 17:04:54
问题 How can we get the coordinates of a point by clicking on it in open street maps? tried: public void onClick(View v) { Projection proj = mapView.getProjection(); IGeoPoint p = proj.fromPixels(v.getX(), v.getY()); System.out.println("x: "+ v.getX() + " y: "+ v.getY()); } cheers, Thanasio 回答1: Use dispatchTouchEvent() method. It works because the MapActivity inherits the dispatchTouch event, not the OnTouchEvent from Activity Class. @Override public boolean dispatchTouchEvent(MotionEvent ev) {

OSMDroid Loading Custom Offline tiles From Assets Folder

隐身守侯 提交于 2019-12-09 16:15:43
问题 I was wondering whether it was possible to do such a thing. I know that one would need to modify some of the existing code to pull this off but I was wondering if anyone had any direction on where to look and how to do this. I am placing a few custom tiles on a specific area on the map as a replacement for OSM tiles providers but need them to be stored in the /assets/ folder. Any ideas? 回答1: I use the nexts classes to do that. import java.io.InputStream; import org.osmdroid.ResourceProxy