@Override public void onGetNetworkState(int iError) { if (iError == MKEvent.ERROR_NETWORK_CONNECT) { Toast.makeText( GoogleApplication.getInstance().getApplicationContext(), "您的网络出错啦!", Toast.LENGTH_LONG).show(); } else if (iError == MKEvent.ERROR_NETWORK_DATA) { Toast.makeText( GoogleApplication.getInstance().getApplicationContext(), "输入正确的检索条件!", Toast.LENGTH_LONG).show(); } }
@Override public void onGetNetworkState(int iError) { if (iError == MKEvent.ERROR_NETWORK_CONNECT) { Toast.makeText(BaiduMapActivity.this, "您的网络出错啦!", Toast.LENGTH_LONG).show(); } else if (iError == MKEvent.ERROR_NETWORK_DATA) { Toast.makeText(BaiduMapActivity.this, "输入正确的检索条件!", Toast.LENGTH_LONG).show(); } // ... }
@Override public void onGetPermissionState(int iError) { if (iError == MKEvent.ERROR_PERMISSION_DENIED) { // 授权Key错误: Log.e("map permissio denied. check your app key"); } }
@Override public void onGetNetworkState(int iError) { if (iError == MKEvent.ERROR_NETWORK_CONNECT) { Toast.makeText(AppContext.getInstance().getApplicationContext(), "您的网络出错啦!", Toast.LENGTH_LONG).show(); } else if (iError == MKEvent.ERROR_NETWORK_DATA) { Toast.makeText(AppContext.getInstance().getApplicationContext(), "输入正确的检索条件!", Toast.LENGTH_LONG).show(); } // ... }
@Override public void onGetDrivingRouteResult(MKDrivingRouteResult res, int error) { // 起点或终点有歧义,需要选择具体的城市列表或地址列表 if (error == MKEvent.ERROR_ROUTE_ADDR) { return; } // 错误号可参考MKEvent中的定义 if (error != 0 || res == null) { Toast.makeText(LocationActivity.this, "抱歉,未找到结果", Toast.LENGTH_SHORT).show(); return; } // 将路线数据保存给全局变量 mDividerRoute = res.getPlan(0).getRoute(0); getRouteInfo(res); mRouteOverlay = new RouteOverlay(LocationActivity.this, mMapView); if (mSelfRoute) { mDividerRoute.customizeRoute(mStartGeoPoint, mEndGeoPoint, dummyData()); } // 此处仅展示一个方案作为示例 mRouteOverlay.setData(mDividerRoute); // 清除其他图层 // mMapView.getOverlays().clear(); // 添加定位地点图层 // mMapView.getOverlays().add(mLocationOverlay); // 添加路线图层 mMapView.getOverlays().add(mRouteOverlay); // 执行刷新使生效 mMapView.refresh(); // 使用zoomToSpan()绽放地图,使路线能完全显示在地图上 mMapView.getController().zoomToSpan(mRouteOverlay.getLatSpanE6(), mRouteOverlay.getLonSpanE6()); // 移动地图到起点 mMapView.getController().animateTo(res.getStart().pt); // 重置路线节点索引,节点浏览时使用 }
@Override public void onGetWalkingRouteResult(MKWalkingRouteResult res, int error) { // 起点或终点有歧义,需要选择具体的城市列表或地址列表 if (error == MKEvent.ERROR_ROUTE_ADDR) { return; } // 错误号可参考MKEvent中的定义 if (error != 0 || res == null) { Toast.makeText(LocationActivity.this, "抱歉,未找到结果", Toast.LENGTH_SHORT).show(); return; } // 将路线数据保存给全局变量 mWalkRoute = res.getPlan(0).getRoute(0); getWalkInfo(res); mRouteOverlay = new RouteOverlay(LocationActivity.this, mMapView); if (mSelfRoute) { mWalkRoute.customizeRoute(mStartGeoPoint, mEndGeoPoint, dummyData()); } // 此处仅展示一个方案作为示例 mRouteOverlay.setData(mWalkRoute); // 清除其他图层 // mMapView.getOverlays().clear(); // 添加定位地点图层 // mMapView.getOverlays().add(mLocationOverlay); // 添加路线图层 mMapView.getOverlays().add(mRouteOverlay); // 执行刷新使生效 mMapView.refresh(); // 使用zoomToSpan()绽放地图,使路线能完全显示在地图上 mMapView.getController().zoomToSpan(mRouteOverlay.getLatSpanE6(), mRouteOverlay.getLonSpanE6()); // 移动地图到起点 mMapView.getController().animateTo(res.getStart().pt); // 重置路线节点索引,节点浏览时使用 }
@Override public void onGetNetworkState(int iError) { if (iError == MKEvent.ERROR_NETWORK_CONNECT) { Toast.makeText(MyRenren.getInstance().getApplicationContext(), "您的网络出错啦!", Toast.LENGTH_LONG).show(); } else if (iError == MKEvent.ERROR_NETWORK_DATA) { Toast.makeText(MyRenren.getInstance().getApplicationContext(), "输入正确的检索条件!", Toast.LENGTH_LONG).show(); } // ... }
@Override public void onGetPermissionState(int iError) { if (iError == MKEvent.ERROR_PERMISSION_DENIED) { //授权Key错误: Toast.makeText(MyRenren.getInstance().getApplicationContext(), "请开启互联网", Toast.LENGTH_LONG).show(); MyRenren.getInstance().m_bKeyRight = false; } }
@Override public void onGetNetworkState(int iError) { if (iError == MKEvent.ERROR_NETWORK_CONNECT) { Log.e("yikuair", "BaiduLocation says network error" + "error number is: " + iError); } else if (iError == MKEvent.ERROR_NETWORK_DATA) { Log.e("yikuair", "BaiduLocation says network data error" + "error number is: " + iError); } // ... }
@Override public void onGetPermissionState(int iError) { if (iError == MKEvent.ERROR_PERMISSION_DENIED) { //授权Key错误: ComFun.showToast("请输入正确的授权Key!"); } }
@Override public void onGetNetworkState(int iError) { if (iError == MKEvent.ERROR_NETWORK_CONNECT) { if(AppConfig.DEBUG) { SmartToast.showLongToast(BaiduMapActivity.this, R.string.hint_check_network, false); } } else if (iError == MKEvent.ERROR_NETWORK_DATA) { if(AppConfig.DEBUG) { SmartToast.showLongToast(BaiduMapActivity.this, R.string.hint_check_find_case, false); } } }
@Override public void onGetNetworkState(int iError) { if (iError == MKEvent.ERROR_NETWORK_CONNECT) { Toast.makeText( SeeXianApplication.getInstance() .getApplicationContext(), "您的网络出错啦!", Toast.LENGTH_LONG).show(); } else if (iError == MKEvent.ERROR_NETWORK_DATA) { Toast.makeText( SeeXianApplication.getInstance() .getApplicationContext(), "输入正确的检索条件!", Toast.LENGTH_LONG).show(); } }
@Override public void onGetPermissionState(int iError) { if (iError == MKEvent.ERROR_PERMISSION_DENIED) { // 授权Key错误: Toast.makeText( SeeXianApplication.getInstance() .getApplicationContext(), "请在 DemoApplication.java文件输入正确的授权Key!", Toast.LENGTH_LONG).show(); SeeXianApplication.getInstance().m_bKeyRight = false; } }
@Override public void onGetNetworkState(int iError) { if (iError == MKEvent.ERROR_NETWORK_CONNECT) { ComFun.showToast("您的网络出错啦!"); } else if (iError == MKEvent.ERROR_NETWORK_DATA) { ComFun.showToast("输入正确的检索条件!"); } }