osmdroid

Osmdroid: How I can create and load a map from my own bitmaps(tiles)?

我与影子孤独终老i 提交于 2019-12-09 12:06:38
问题 I am starting to use Osmdroid and I would like to use this technology for showing a map about an F1 circuit. I have a big picture and I can cut it up to divide it into smaller tiles. Can I modify the osmdroid library for the upload of these pictures? I would like to save these bitmaps (tiles) in my assets folder. I am pretty lost on how to do this. I am using this way because android, normally, gives a memory error when I try show this complete full-size picture. If I only show some tiles of

Animating markers on OpenStreet Maps using osmdroid

前提是你 提交于 2019-12-09 07:05:12
问题 I'm using the google Maps marker animation logic given here. My marker gets animated,but after each marker.setPosition(newPosition); I need to call mapView.invalidate(); which refreshes the map resulting in very sluggish animation. Is there any workaround? 回答1: The next solution is working correctly for me: import org.osmdroid.api.IGeoPoint; import org.osmdroid.api.IMapController; import org.osmdroid.util.GeoPoint; import org.osmdroid.views.MapView; import org.osmdroid.views.Projection;

Osmdroid - change local map folder

回眸只為那壹抹淺笑 提交于 2019-12-09 00:44:00
问题 I am using offline version of osmdroid, maps are placed in sdcard/osmdroid. Do you know, how to change the file path? I have been searching through their code for handling ZIP files but I haven't found any solution. Anyone faced this issue before? Thx 回答1: Here you can check out the code to build your own version of OSMdroid. Changing ZIP and local folder is totally possbile, had to do it myself a few months ago. Responsible for the Zips are this classes: org/osmdroid/tileprovider/modules

OSM - Show current location with custom icon

微笑、不失礼 提交于 2019-12-08 14:29:42
Can anyone tell me how can I show my current location on OSM map with custom icon? With default person icon :: MyLocationNewOverlay myLocationoverlay = new MyLocationNewOverlay(mapView); myLocationoverlay.enableFollowLocation(); myLocationoverlay.enableMyLocation(); mapView.getOverlays().add(myLocationoverlay); With custom icon :: MyLocationNewOverlay myLocationoverlay = new MyLocationNewOverlay(mapView); myLocationoverlay.enableFollowLocation(); Drawable currentDraw = ResourcesCompat.getDrawable(getResources(), R.mipmap.ic_launcher, null); Bitmap currentIcon = null; if (currentDraw != null) {

android mapping using osmDroid mapping api

半腔热情 提交于 2019-12-08 11:06:39
问题 I want to develope android mapping app using osmDroid mapping api with offline and online capabilites, but I couldn't find many tutorials about it, so If any one have any link to tutorials that use osmdroid mapping api offline or online. I have write a small app just to display the map from the default provider but, the application run but no map is displayed (only squers) what is wrong?? the code: MapView map = new MapView(this, 256); map.setClickable(true); map.setBuiltInZoomControls(true);

Disable scrolling in Osmdroid map

纵然是瞬间 提交于 2019-12-08 06:04:00
问题 I have an Osmdroid MapView. Even though I have set mapView.setClickable(false); mapView.setFocusable(false); the map can still be moved around. Is there a simple way to disable all interactions with the map view? 回答1: I've found a solution. You need to handle the touch events directly by setting a OnTouchListener . For example, public class MapViewLayout extends RelativeLayout { private MapView mapView; /** * @see #setDetachedMode(boolean) */ private boolean detachedMode; // implement

Disable scrolling in Osmdroid map

北慕城南 提交于 2019-12-08 04:42:29
I have an Osmdroid MapView. Even though I have set mapView.setClickable(false); mapView.setFocusable(false); the map can still be moved around. Is there a simple way to disable all interactions with the map view? I've found a solution. You need to handle the touch events directly by setting a OnTouchListener . For example, public class MapViewLayout extends RelativeLayout { private MapView mapView; /** * @see #setDetachedMode(boolean) */ private boolean detachedMode; // implement initialization of your layout... private void setUpMapView() { mapView.setOnTouchListener(new OnTouchListener() {

OSM - Show current location with custom icon

杀马特。学长 韩版系。学妹 提交于 2019-12-08 04:37:37
问题 Can anyone tell me how can I show my current location on OSM map with custom icon? 回答1: With default person icon :: MyLocationNewOverlay myLocationoverlay = new MyLocationNewOverlay(mapView); myLocationoverlay.enableFollowLocation(); myLocationoverlay.enableMyLocation(); mapView.getOverlays().add(myLocationoverlay); With custom icon :: MyLocationNewOverlay myLocationoverlay = new MyLocationNewOverlay(mapView); myLocationoverlay.enableFollowLocation(); Drawable currentDraw = ResourcesCompat

osmdroid MapTileDownloader now showing 403 forbidden as HTTP response

为君一笑 提交于 2019-12-07 20:03:48
问题 I have successfully been using osmdroid-android-4.1.jar for a while to display OSM map tiles in my app. Now, since yesterday, I don't get any tiles at all displayed. When I connect my phone to the PC I see the 403 forbidden response in the log. I built the app on an Ubuntu machine using Android Studio. I haven't got a good understanding of .aar file yet, could it be that the 4.1jar is now outdated and not setting the correct user-agent? I know Mapquest isn't supported now but I'm using Mapnik

How to add a setMyLocationEnabled button on OSMap?

醉酒当歌 提交于 2019-12-07 17:18:47
问题 Can we enable a 'GotoMyLocation' button on OSMDroid like mMap.setMyLocationEnabled(true); on GoogleMap? I didn't find such feature in MapView class. 回答1: Create one of these org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay mylocation = new MyLocationNewOverlay(...); Add it to your MapView mMapView.getOverlays().add(mylocation); Then try mylocation.enableFollowLocation(); 回答2: To set your current location use, LOCATION_SERVICE of LocationManager. This will listen your gps location