use of com.amap.api.maps.model.LatLng in project uav_mobile_app by jiushuokj.
the class CoordinateTransUtils method getGDLatLng.
/**
* GPS坐标转成高德坐标
*
* @param lat
* @param lng
* @return
*/
public static LatLng getGDLatLng(double lat, double lng) {
CoordinateConverter converter = new CoordinateConverter(DemoApplication.getInstance());
// CoordType.GPS 待转换坐标类型
converter.from(CoordinateConverter.CoordType.GPS);
// sourceLatLng待转换坐标点 DPoint类型
DPoint desLatLng = new DPoint();
try {
converter.coord(new DPoint(lat, lng));
// 执行转换操作
desLatLng = converter.convert();
} catch (Exception e) {
e.printStackTrace();
}
return new LatLng(desLatLng.getLatitude(), desLatLng.getLongitude());
}
use of com.amap.api.maps.model.LatLng in project DoraemonKit by didi.
the class RouteOverlay method getLatLngBounds.
protected LatLngBounds getLatLngBounds() {
LatLngBounds.Builder b = LatLngBounds.builder();
b.include(new LatLng(startPoint.latitude, startPoint.longitude));
b.include(new LatLng(endPoint.latitude, endPoint.longitude));
return b.build();
}
use of com.amap.api.maps.model.LatLng in project DoraemonKit by didi.
the class AMapRouteOverlay method getLatLngBounds.
protected LatLngBounds getLatLngBounds() {
LatLngBounds.Builder b = LatLngBounds.builder();
b.include(new LatLng(startPoint.latitude, startPoint.longitude));
b.include(new LatLng(endPoint.latitude, endPoint.longitude));
return b.build();
}
use of com.amap.api.maps.model.LatLng in project ride-read-android by Ride-Read.
the class MapFragment method addMomentToMap.
private void addMomentToMap(MapMoment moment) {
LatLng latLng = new LatLng(moment.getLatitude(), moment.getLongitude());
// imageView.setImageResource(R.raw.landing_hot_product_1);
String uri01 = moment.getPictures().get(0);
String uri02 = moment.getPictures().get(0) + QiNiuUtils.CROP_SMALL_100;
SimpleTarget target = new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap bitmap, GlideAnimation glideAnimation) {
Bitmap bitmap1 = convertBitmapFromXML(getActivity(), moment.getCount(), bitmap);
addMarker(latLng, bitmap1, moment);
}
};
Glide.with(this).load(uri01).asBitmap().into(target);
}
use of com.amap.api.maps.model.LatLng in project ride-read-android by Ride-Read.
the class MapFragment method onPoiSearched.
@Override
public void onPoiSearched(PoiResult poiResult, int i) {
if (null == poiResult)
return;
List<PoiItem> poiList = poiResult.getPois();
if (!ListUtils.isEmpty(poiList)) {
PoiItem firstResult = poiList.get(0);
LatLonPoint resultPoint = firstResult.getLatLonPoint();
LatLng resultLatLng = new LatLng(resultPoint.getLatitude(), resultPoint.getLongitude());
mAMap.moveCamera(CameraUpdateFactory.changeLatLng(resultLatLng));
ToastUtils.show("搜索结果为:" + firstResult.getAdName());
} else {
List<SuggestionCity> suggestionCitys = poiResult.getSearchSuggestionCitys();
if (!ListUtils.isEmpty(suggestionCitys)) {
ToastUtils.show("搜索失败,建议搜索填写:" + suggestionCitys.get(0).getCityName());
}
}
}
Aggregations