本文整理汇总了Java中com.amap.api.location.AMapLocation.getErrorInfo方法的典型用法代码示例。如果您正苦于以下问题:Java AMapLocation.getErrorInfo方法的具体用法?Java AMapLocation.getErrorInfo怎么用?Java AMapLocation.getErrorInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amap.api.location.AMapLocation
的用法示例。
在下文中一共展示了AMapLocation.getErrorInfo方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
@Override
public void onLocationChanged(AMapLocation aMapLocation) {
if (mListener != null && aMapLocation != null) {
if (aMapLocation != null && aMapLocation.getErrorCode() == 0) {
mAMapLocation = aMapLocation;
mlocationClient.stopLocation();
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
lp = new LatLonPoint(aMapLocation.getLatitude(), aMapLocation.getLongitude());
mAMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lp.getLatitude(), lp.getLongitude()), 17));
doSearchQuery(aMapLocation.getPoiName().trim(), aMapLocation.getCityCode(), false);
} else {
String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
ToastUtils.showToast(this, errText);
}
}
}
示例2: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
/**
* 实现定位
* @param amapLocation
*/
@Override
public void onLocationChanged(AMapLocation amapLocation) {
if (mListener != null && amapLocation != null) {
if (amapLocation != null
&&amapLocation.getErrorCode() == 0) {
if(isFirstTime){//只要第一次的数据,当然,也可以在这里关闭定位
// mlocationClient.stopLocation();//停止定位
mListener.onLocationChanged(amapLocation);// 显示系统小蓝点
lvHolder.title = "[位置]";
lvHolder.address = amapLocation.getProvider()+amapLocation.getCity()+amapLocation.getStreet()+amapLocation.getStreetNum();
lvHolder.lp = new LatLonPoint(amapLocation.getLatitude(),amapLocation.getLongitude());
mEndMarker.setPosition(new LatLng(amapLocation.getLatitude(),amapLocation.getLongitude()));
data.add(0,lvHolder);
doSearchQuery();
}
} else {
String errText = "定位失败," + amapLocation.getErrorCode()+ ": " + amapLocation.getErrorInfo();
Log.e("AmapErr",errText);
}
}
}
示例3: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
/**
* 定位地点
* @param amapLocation
*/
@Override
public void onLocationChanged(AMapLocation amapLocation) {
if (mListener != null&&amapLocation != null) {
EventBus.getDefault().post(amapLocation);
if (amapLocation != null
&&amapLocation.getErrorCode() == 0) {
if(startList.size()==0)
startList.add(new NaviLatLng(amapLocation.getLatitude(),amapLocation.getLongitude()));
if(!calculateSuccess){
mListener.onLocationChanged(amapLocation);// 显示系统小蓝点
}
} else {
String errText = "定位失败," + amapLocation.getErrorCode()+ ": " + amapLocation.getErrorInfo();
Log.e("AmapErr",errText);
}
}
}
示例4: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
@Override
public void onLocationChanged(AMapLocation aMapLocation) {
if (mListener != null && aMapLocation != null) {
if (aMapLocation != null
&& aMapLocation.getErrorCode() == 0) {
LatLng location = new LatLng(aMapLocation.getLatitude(), aMapLocation.getLongitude());
if (!mFirstFix) {
mFirstFix = true;
addCircle(location, aMapLocation.getAccuracy());//添加定位精度圆
addMarker(location);//添加定位图标
mSensorHelper.setCurrentMarker(mLocMarker);//定位图标旋转
mAMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location, 18));
} else {
mCircle.setCenter(location);
mCircle.setRadius(aMapLocation.getAccuracy());
mLocMarker.setPosition(location);
mAMap.moveCamera(CameraUpdateFactory.changeLatLng(location));
}
} else {
String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
Log.e("AmapErr", errText);
}
}
}
示例5: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
/**
* 定位成功后回调函数
*/
@Override
public void onLocationChanged(AMapLocation amapLocation) {
if (mListener != null && amapLocation != null) {
if (amapLocation != null && amapLocation.getErrorCode() == 0) {
tvResult.setVisibility(View.GONE);
mListener.onLocationChanged(amapLocation);// 显示系统小蓝点
} else {
String errText = "定位失败," + amapLocation.getErrorCode() + ": "
+ amapLocation.getErrorInfo();
Log.e("AmapErr", errText);
tvResult.setVisibility(View.VISIBLE);
tvResult.setText(errText);
}
}
}
示例6: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
/**
* 定位监听回掉
*/
@Override
public void onLocationChanged(AMapLocation amapLocation) {
if (mListener != null && amapLocation != null) {
if (amapLocation.getErrorCode() == 0) {
mCity = amapLocation.getCity();
mCityTextView.setText(mCity);
mPresenter.searchWeatherRecord(getContext(), amapLocation.getCity());
mListener.onLocationChanged(amapLocation);// 显示系统小蓝点
} else {
String errText = "定位失败," + amapLocation.getErrorCode() + ": " + amapLocation.getErrorInfo();
Log.e("AmapErr", errText);
//mLocationErrText.setVisibility(View.VISIBLE);
//mLocationErrText.setText(errText);
}
}
}
示例7: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
@Override
public void onLocationChanged(AMapLocation amapLocation) {
if (mListener != null && amapLocation != null) {
if (amapLocation.getErrorCode() == 0) {
// mCity = amapLocation.getCity();
// mCityTextView.setText(mCity);
//
// mPresenter.searchWeatherRecord(getContext(), amapLocation.getCity());
mListener.onLocationChanged(amapLocation);// 显示系统小蓝点
} else {
String errText = "定位失败," + amapLocation.getErrorCode() + ": " + amapLocation.getErrorInfo();
Log.e("AmapErr", errText);
//mLocationErrText.setVisibility(View.VISIBLE);
//mLocationErrText.setText(errText);
}
}
}
示例8: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
@Override
public void onLocationChanged(AMapLocation amapLocation) {
if (mListener != null && amapLocation != null) {
if (amapLocation != null && amapLocation.getErrorCode() == 0) {
mListener.onLocationChanged(amapLocation);// 显示系统小蓝点
LatLng mylocation = new LatLng(amapLocation.getLatitude(),
amapLocation.getLongitude());
mAMap.moveCamera(CameraUpdateFactory.changeLatLng(mylocation));
if (btn.isChecked()) {
record.addpoint(amapLocation);
mPolyoptions.add(mylocation);
redrawline();
}
} else {
String errText = "定位失败," + amapLocation.getErrorCode() + ": "
+ amapLocation.getErrorInfo();
Log.e("AmapErr", errText);
}
}
}
示例9: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
@Override
public void onLocationChanged(AMapLocation location) {
if (location == null) {
return;
}
if (location.getErrorCode() != 0) {
String error = location.getErrorInfo();
this.sendResult(this.getErrorResult(error));
if (!isInit) {
this.isInit = true;
this.error = error;
}
return;
}
double latitude = location.getLatitude();
double longitude = location.getLongitude();
if (latitude == this.latitude || longitude == this.longitude) {
return;
}
this.isInit = true;
this.error = null;
this.latitude = latitude;
this.longitude = longitude;
this.sendResult(this.getPositionResult(latitude, longitude));
}
示例10: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
@Override
public void onLocationChanged(AMapLocation aMapLocation) {
if (mListener != null&&aMapLocation != null) {
if (aMapLocation != null
&&aMapLocation.getErrorCode() == 0) {
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
} else {
String errText = "定位失败," + aMapLocation.getErrorCode()+ ": " + aMapLocation.getErrorInfo();
Log.e("AmapErr",errText);
}
}
}
示例11: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
@Override
public void onLocationChanged(AMapLocation aMapLocation) {
if (mListener != null && aMapLocation != null) {
if (aMapLocation != null
&& aMapLocation.getErrorCode() == 0) {
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
updateInfos(aMapLocation);
} else {
String errText = "定位失败," + aMapLocation.getErrorCode()+ ": " + aMapLocation.getErrorInfo();
Log.e("AmapErr",errText);
}
}
}
示例12: onLocationChanged
import com.amap.api.location.AMapLocation; //导入方法依赖的package包/类
@Override
public void onLocationChanged(AMapLocation aMapLocation) {
if (mListener != null && aMapLocation != null) {
if (aMapLocation != null && aMapLocation.getErrorCode() == 0) {
mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
} else {
String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
Log.e("AmapErr", errText);
}
}
}