android 开放街道地图中的附近地点
Nearby places in open street map in android
如何在开放的街道地图中显示附近的地方,如警察局、餐馆。我正在使用 this 库将开放式街道地图集成到我的 android 应用程序中。我集成这个库的方式如下
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Context ctx = getApplicationContext();
//important! set your user agent to prevent getting banned from the osm servers
Configuration.getInstance().load(ctx, PreferenceManager.getDefaultSharedPreferences(ctx));
setContentView(R.layout.activity_main);
MapView map = (MapView) findViewById(R.id.map);
map.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);
map.setUseDataConnection(true);
map.setBuiltInZoomControls(true);
map.setMultiTouchControls(true);
IMapController mapController = map.getController();
mapController.setZoom(14);
GeoPoint startPoint = new GeoPoint(48.8583, 2.2944);
mapController.setCenter(startPoint);
}
您可以使用osmbonuspack to download nearby POIs via OverpassAPIProvider. For deciding which POIs to download look at OSM's map features and corresponding keys,例如便利设施、商店、休闲和等等。
如何在开放的街道地图中显示附近的地方,如警察局、餐馆。我正在使用 this 库将开放式街道地图集成到我的 android 应用程序中。我集成这个库的方式如下
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Context ctx = getApplicationContext();
//important! set your user agent to prevent getting banned from the osm servers
Configuration.getInstance().load(ctx, PreferenceManager.getDefaultSharedPreferences(ctx));
setContentView(R.layout.activity_main);
MapView map = (MapView) findViewById(R.id.map);
map.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);
map.setUseDataConnection(true);
map.setBuiltInZoomControls(true);
map.setMultiTouchControls(true);
IMapController mapController = map.getController();
mapController.setZoom(14);
GeoPoint startPoint = new GeoPoint(48.8583, 2.2944);
mapController.setCenter(startPoint);
}
您可以使用osmbonuspack to download nearby POIs via OverpassAPIProvider. For deciding which POIs to download look at OSM's map features and corresponding keys,例如便利设施、商店、休闲和等等。