osmdroid

osmdroid get current user location

断了今生、忘了曾经 提交于 2019-12-24 05:59:30
问题 I am trying to implement OpenStreetMap using osmdroid. I successfully got the world map set to a particular set of geo co-ordinates. here is my code: package com.example.re.osm; //OSM MAP CODE import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; import org.osmdroid.api.IMapController;

How to create osmdroid XYTileSource for offline tiles in version 4.1?

随声附和 提交于 2019-12-24 05:54:44
问题 I have offline osmdroid maps working using version 4.0. Upgrading to 4.1, they no longer work. I have narrowed the problem down to the XYTileSource, in which aBaseUrl changed from being a string in 4.0 to and array in 4.1. How do I get offline tiles to work in 4.1? Old 4.0 code that worked. The tiles are in /sdcard/osmdroid/tiles.zip XYTileSource ts = new XYTileSource ( "tiles", ResourceProxy.string.offline_mode, 13, 17, 256, ".png", "http://127.0.0.1"); mapView = (MapView) findViewById(R.id

How to get onTap in Polygon in osmdroid?

久未见 提交于 2019-12-24 05:17:33
问题 I have lot's of polygon drawn. Some of which overlaps. I want to be able to detect a tap inside the polygon and display a dialog saying it was clicked inside the polygon (this polygon should be detected on tap). This kind of property can be seen with ItemizedIconOverlay where we can detect all of the OverlayItem with the tap on the OverlayItem. How to implement this on polygon? The way I draw and add Polygon is: MyPolygon myNewPolygon = new MyPolygon(this); myPolygon.setPoints(Polygon

Cluster markers with osmdroid

浪子不回头ぞ 提交于 2019-12-23 20:55:17
问题 I am new to osmdroid . I am using offline maps using mbtiles . I am using too many markers on the map that make my map very slow. I read it some where that clustering would be helpful but i am not getting any useful example of how to make cluster marker in osmdroid . please help. 回答1: Now there is a ready-to-use solution: in OSMBonusPack (an add-on to osmdroid), there is a MarkerClusterer. The tutorial is here: http://code.google.com/p/osmbonuspack/wiki/Tutorial_3 来源: https://stackoverflow

Setting min and max zoom levels

早过忘川 提交于 2019-12-22 13:51:34
问题 Having trouble with the zoom interface using OSMDroid API- can not seem to get the zoom control to zoom beyond level 18. Using a local ( SD card ) custom map cache with levels 12-22. We can zoom from 12 -18, but not beyond. There doesn't seem to be any way to set the min or max zoom. Anyone have any ideas on where this setting is defined? 回答1: You need to make a class extending MapView, there you can set it by overriding the getMaxZoomLevel() and getMinZoomLevel(), like this: public class

two finger or pinc zoom to mapview in osmdroid

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 17:42:38
问题 I need help I'm trying to zoom to mapview by getting users multi touch points (firstly 2 finger touch) I know there is setMultiTouchControls() function but this is not what I want to do. I tried to explain with a picture :) it was easier than writting; The black bold arrows show the fingers' movement directions. The same situation can be considered for opposite directions.(zoom in) 回答1: Finally, In osmdroid 3.0.10 this feature had been implemented. mapView.setBuiltInZoomControls(true);

Restricting the area the user can go to on Mapview

限于喜欢 提交于 2019-12-21 02:03:22
问题 I am using a customised version of the mapview (OSMDroid version). I am using custom tiles within it and I only want the user to be able to view the area where I have my custom tiles. Is there a way to set the boundary lat longs so when they pan the map it doesn't go past these boundaries? 回答1: Update: I know this is an old question, but osmdroid now has a setScrollableAreaLimit() method that will achieve what you are looking for. There is also a setMinZoomLevel() and setMaxZoomLevel() method

Determine user location on osm maps

时光总嘲笑我的痴心妄想 提交于 2019-12-20 09:55:49
问题 I am working on an android application that determines user location in osm maps. I am being able to show user location on the map, but if the location change the whole map is reloaded, what’s wrong with that? Also how I can increase the accuracy of the user location? And how can I make a circle that increase and decrease according to the accuracy(as shown in Google one)? code : public class OsmDemoActivity extends Activity implements LocationListener, MapViewConstants { private MapView

Cannot access resource icons when running with osmdroid-android-3.0.7

浪子不回头ぞ 提交于 2019-12-20 04:53:50
问题 I am trying to start a simple map activity that displays a map an a couple of markers using osmdroid-android-3.0.7 library. The code worked under an older version (1.10). I am getting the following error: 02-03 15:14:30.574: E/AndroidRuntime(10277): Caused by: java.lang.IllegalArgumentException: Resource not found: marker_default.png When I unzipped the jar file I can see a list of icons in the top level directory and one of them is indeed marker_default.png. This is the snippet of the code:

How can download map in osmdroid?

烈酒焚心 提交于 2019-12-19 08:54:00
问题 All I have used osmdroid and i want to download map zip files from android app and than create offline map. Any one have more knowledge about osmdroid and offline map and navigation. 回答1: The easisest way is to download MOBAC, then run it and mark out an area you want, store the tiles in Osmdroid.zip format. When that's done, drop the zip file into the osmdroid folder on your device. 回答2: First of all you need to download Mobile Atlas Creator. This link is for the latest version of MOBAC 1-