use of com.amap.api.maps2d.model.MarkerOptions in project summer-android by cn-cerc.
the class ClockInActivity method onLocationChanged.
@Override
public void onLocationChanged(AMapLocation aMapLocation) {
if (mListener != null && aMapLocation != null) {
if (aMapLocation != null && aMapLocation.getErrorCode() == 0) {
if (isFirstLoc) {
CameraPosition LUJIAZUI = new CameraPosition.Builder().target(new LatLng(aMapLocation.getLatitude(), aMapLocation.getLongitude())).zoom(17).bearing(0).tilt(45).build();
aMap.animateCamera(CameraUpdateFactory.newCameraPosition(LUJIAZUI));
isFirstLoc = false;
}
// 显示系统小蓝点
mListener.onLocationChanged(aMapLocation);
NowLocation = aMapLocation;
myLaLn = new LatLng(aMapLocation.getLatitude(), aMapLocation.getLongitude());
Log.i("Location", aMapLocation.getLatitude() + "::::" + aMapLocation.getLongitude());
if (markerOption == null) {
String address = NowLocation.getProvince() + NowLocation.getCity() + NowLocation.getDistrict() + NowLocation.getStreet() + NowLocation.getStreetNum() + NowLocation.getAoiName();
text_address.setText(address);
latLngSign = myLaLn;
markerOption = new MarkerOptions().icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)).position(new LatLng(aMapLocation.getLatitude(), aMapLocation.getLongitude())).draggable(true);
}
} else {
String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
Log.e("AmapErr", errText);
ActivityCompat.requestPermissions(ClockInActivity.this, new String[] { Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION }, 0x67);
}
}
}
use of com.amap.api.maps2d.model.MarkerOptions in project KL2 by jweihao.
the class GaoDeActivity method refleshLocationMark.
/**
* 刷新地图标志物gps定位位置
*
* @param latitude
* @param longitude
*/
private void refleshLocationMark(double latitude, double longitude) {
if (mLocationGpsMarker == null) {
mLocationGpsMarker = mAMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(getResources(), R.mipmap.location_blue))).draggable(true));
}
mLocationGpsMarker.setPosition(new LatLng(latitude, longitude));
mAMap.invalidate();
}
use of com.amap.api.maps2d.model.MarkerOptions in project KL2 by jweihao.
the class GaoDeActivity method refleshSelectByListMark.
/**
* 刷新地图标志物选中列表的位置
*
* @param latitude
* @param longitude
*/
private void refleshSelectByListMark(double latitude, double longitude) {
if (mSelectByListMarker == null) {
mSelectByListMarker = mAMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(getResources(), R.mipmap.location_red))).draggable(true));
}
mSelectByListMarker.setPosition(new LatLng(latitude, longitude));
if (!mSelectByListMarker.isVisible()) {
mSelectByListMarker.setVisible(true);
}
mAMap.invalidate();
}
use of com.amap.api.maps2d.model.MarkerOptions in project KL2 by jweihao.
the class GaoDeActivity method refleshMark.
/**
* 刷新地图标志物位置
*
* @param latitude
* @param longitude
*/
private void refleshMark(double latitude, double longitude) {
if (mMarker == null) {
mMarker = mAMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(getResources(), android.R.color.transparent))).draggable(true));
}
mMarker.setPosition(new LatLng(latitude, longitude));
mAMap.invalidate();
}
Aggregations