Search in sources :

Example 26 with LatLng

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());
}
Also used : DPoint(com.amap.api.location.DPoint) CoordinateConverter(com.amap.api.location.CoordinateConverter) LatLng(com.amap.api.maps.model.LatLng)

Example 27 with LatLng

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();
}
Also used : LatLngBounds(com.amap.api.maps.model.LatLngBounds) LatLng(com.amap.api.maps.model.LatLng)

Example 28 with LatLng

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();
}
Also used : LatLngBounds(com.amap.api.maps.model.LatLngBounds) LatLng(com.amap.api.maps.model.LatLng)

Example 29 with LatLng

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);
}
Also used : SimpleTarget(com.bumptech.glide.request.target.SimpleTarget) Bitmap(android.graphics.Bitmap) LatLng(com.amap.api.maps.model.LatLng) GlideAnimation(com.bumptech.glide.request.animation.GlideAnimation)

Example 30 with LatLng

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());
        }
    }
}
Also used : SuggestionCity(com.amap.api.services.core.SuggestionCity) PoiItem(com.amap.api.services.core.PoiItem) LatLng(com.amap.api.maps.model.LatLng) LatLonPoint(com.amap.api.services.core.LatLonPoint)

Aggregations

LatLng (com.amap.api.maps.model.LatLng)48 LatLonPoint (com.amap.api.services.core.LatLonPoint)15 MarkerOptions (com.amap.api.maps.model.MarkerOptions)9 ArrayList (java.util.ArrayList)7 LatLngBounds (com.amap.api.maps.model.LatLngBounds)6 Marker (com.amap.api.maps.model.Marker)6 Bitmap (android.graphics.Bitmap)4 Point (android.graphics.Point)4 CameraUpdate (com.amap.api.maps.CameraUpdate)4 PolylineOptions (com.amap.api.maps.model.PolylineOptions)4 TextView (android.widget.TextView)3 CameraPosition (com.amap.api.maps.model.CameraPosition)3 Polyline (com.amap.api.maps.model.Polyline)3 SuppressLint (android.annotation.SuppressLint)2 View (android.view.View)2 BounceInterpolator (android.view.animation.BounceInterpolator)2 Interpolator (android.view.animation.Interpolator)2 ImageView (android.widget.ImageView)2 BindView (butterknife.BindView)2 DPoint (com.amap.api.location.DPoint)2