com.amap.api.maps.AMapException Java Examples
The following examples show how to use
com.amap.api.maps.AMapException.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OfflineMapActivity_Old.java From TraceByAmap with MIT License | 6 votes |
/** * 继续下载所有暂停中 */ private void startAllInPause() { if (amapManager == null) { return; } for (OfflineMapCity mapCity : amapManager.getDownloadingCityList()) { if (mapCity.getState() == OfflineMapStatus.PAUSE) { try { amapManager.downloadByCityName(mapCity.getCity()); } catch (AMapException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }
Example #2
Source File: OfflineChild.java From TraceByAmap with MIT License | 6 votes |
/** * 启动下载任务 */ private synchronized boolean startDownload() { try { if (isProvince) { amapManager.downloadByProvinceName(mMapCity.getCity()); } else { amapManager.downloadByCityName(mMapCity.getCity()); } return true; } catch (AMapException e) { // TODO Auto-generated catch block e.printStackTrace(); Toast.makeText(mContext, e.getErrorMessage(), Toast.LENGTH_SHORT).show(); return false; } }
Example #3
Source File: AmapDownloadMapFragment.java From BmapLite with GNU General Public License v3.0 | 6 votes |
@Override public void onClickAmapDownloadOptions(String option, OfflineMapCity city) { if ("删除".equals(option)){ delCity(city); }else if ("更新".equals(option)){ updateCity(city); }else if ("开始".equals(option)){ try { amapManager.downloadByCityCode(city.getCode()); } catch (AMapException e) { e.printStackTrace(); onMessage("下载失败"); } }else if ("暂停".equals(option)){ amapManager.pause(); } }
Example #4
Source File: AmapDownloadMapFragment.java From BmapLite with Apache License 2.0 | 6 votes |
@Override public void onClickAmapDownloadOptions(String option, OfflineMapCity city) { if ("删除".equals(option)){ delCity(city); }else if ("更新".equals(option)){ updateCity(city); }else if ("开始".equals(option)){ try { amapManager.downloadByCityCode(city.getCode()); } catch (AMapException e) { e.printStackTrace(); onMessage("下载失败"); } }else if ("暂停".equals(option)){ amapManager.pause(); } }
Example #5
Source File: OfflineChild.java From TraceByAmap with MIT License | 5 votes |
/** * 长按弹出提示框 删除和更新 */ public void showDeleteUpdateDialog(final String name) { AlertDialog.Builder builder = new Builder(mContext); builder.setTitle(name); builder.setSingleChoiceItems(new String[] { "删除", "检查更新" }, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { dialog.dismiss(); if (amapManager == null) { return; } switch (arg1) { case 0: amapManager.remove(name); break; case 1: try { amapManager.updateOfflineCityByName(name); } catch (AMapException e) { // TODO Auto-generated catch block e.printStackTrace(); } break; default: break; } } }); builder.setNegativeButton("取消", null); dialog = builder.create(); dialog.show(); }
Example #6
Source File: AmapDownloadMapFragment.java From BmapLite with GNU General Public License v3.0 | 5 votes |
private void updateCity(OfflineMapCity city) { try { amapManager.downloadByCityCode(city.getCode()); } catch (AMapException e) { e.printStackTrace(); onMessage("更新失败"); } }
Example #7
Source File: AmapDownloadMapFragment.java From BmapLite with Apache License 2.0 | 5 votes |
private void updateCity(OfflineMapCity city) { try { amapManager.downloadByCityCode(city.getCode()); } catch (AMapException e) { e.printStackTrace(); onMessage("更新失败"); } }
Example #8
Source File: OfflineMapDownloadService.java From Maps with GNU General Public License v2.0 | 5 votes |
protected void onHandleIntent() { Intent intent = intentLinkedList.poll(); if (intent != null) { Bundle intentExtras = intent.getExtras(); String name = intentExtras.getString("name"); String type = intentExtras.getString("type"); Log.d("SSS", "[OfflineMapDownloadService] start downloading name: " + name + " type: " + type); if (type != null && name != null) { try { if (type.equals(TYPE_CITY)) { isCurDownloading = mOfflineMapManager.downloadByCityName(name); } else if (type.equals(TYPE_PROVINCE)) { isCurDownloading = mOfflineMapManager.downloadByProvinceName(name); } mBinder.groupPosition = intentExtras.getInt("groupPosition"); mBinder.childPosition = intentExtras.getInt("childPosition"); //如果正在下载则设通知为ongoing if (isCurDownloading) { mNotificationBuilder.setOngoing(true); } } catch (AMapException e) { isCurDownloading = false; Log.e("SSS", "[OfflineMapDownloadService] download " + name + " AMapException!"); } } } else { //如果没有任务,则退出 stopSelf(); } }