当前位置: 首页>>代码示例>>Java>>正文


Java AMapLocation.getErrorInfo方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:PoiAroundSearchActivity.java

示例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);
            }
        }
    }
 
开发者ID:Vicent9920,项目名称:MyMap,代码行数:29,代码来源:PiclocationActivity.java

示例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);
        }
    }
}
 
开发者ID:Vicent9920,项目名称:MyMap,代码行数:23,代码来源:NavigationActivity.java

示例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);
        }
    }
}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:26,代码来源:MapActivity.java

示例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);
		}
	}
}
 
开发者ID:amapapi,项目名称:Android_Location_Demo,代码行数:19,代码来源:GeoFence_District_Activity.java

示例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);
        }
    }
}
 
开发者ID:Alex-ZHOU,项目名称:VMAndroid,代码行数:22,代码来源:RecordFragment.java

示例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);
            }
        }
    }
 
开发者ID:Alex-ZHOU,项目名称:VMAndroid,代码行数:19,代码来源:RecordDBActivity.java

示例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);
		}
	}
}
 
开发者ID:amapapi,项目名称:RecordPath3D,代码行数:21,代码来源:MainActivity.java

示例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));
}
 
开发者ID:luocongqiu,项目名称:cordova-plugin-navigation,代码行数:32,代码来源:LocationListener.java

示例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);
        }
    }
}
 
开发者ID:lupwei,项目名称:Croprotector,代码行数:13,代码来源:HistoryMap_fragment.java

示例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);
        }
    }
}
 
开发者ID:gghyoo,项目名称:CarPathRecorder,代码行数:14,代码来源:MainActivity.java

示例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);
        }
    }
}
 
开发者ID:shensky711,项目名称:Run-With-You,代码行数:12,代码来源:LocationActivity.java


注:本文中的com.amap.api.location.AMapLocation.getErrorInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。