如何集成离线Map?我在尝试这个?
private class AsyncTask<String,Void,String> {
// Downloading data in non-ui thread
@Override
protected String doInBackground(String... url) {
// For storing data from web service
String data = "";
try {
// Fetching the data from web service
data = downloadUrl(url[0]);
Log.d("DownloadTask", "DownloadTask : " + data);
} catch (Exception e) {
Log.d("Background Task", e.toString());
}
return data;
}
// Executes in UI thread, after the execution of
// doInBackground()
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
ParserTask parserTask = new ParserTask();
// Invokes the thread for parsing the JSON data
parserTask.execute(result);
}
}
1条答案
按热度按时间0s7z1bwu1#
你可以使用mapbox,openstreetMap或osmdroid!https://github.com/osmdroid/osmdroidhttps://docs.mapbox.com/android/maps/guides/offline/https://www.openstreetmap.org/