Search in sources :

Example 6 with LatLng

use of com.amap.api.maps2d.model.LatLng in project summer-android by cn-cerc.

the class ClockInActivity method changeToAmapView.

private void changeToAmapView(Bundle savedInstanceState) {
    if (myLaLn == null) {
        mAmapView = new MapView(this, new AMapOptions().camera(new CameraPosition(new LatLng(114.025, 22.540412), 16, 0, 0)));
    } else {
        mAmapView = new MapView(this, new AMapOptions().camera(new CameraPosition(new LatLng(myLaLn.latitude, myLaLn.longitude), 16, 0, 0)));
    }
    mAmapView.onCreate(savedInstanceState);
    mAmapView.onResume();
    mContainerLayout.addView(mAmapView);
    if (aMap == null) {
        aMap = mAmapView.getMap();
        setUpMap();
        setupLocationStyle();
    }
}
Also used : CameraPosition(com.amap.api.maps2d.model.CameraPosition) MapView(com.amap.api.maps2d.MapView) AMapOptions(com.amap.api.maps2d.AMapOptions) LatLng(com.amap.api.maps2d.model.LatLng)

Example 7 with LatLng

use of com.amap.api.maps2d.model.LatLng 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();
}
Also used : MarkerOptions(com.amap.api.maps2d.model.MarkerOptions) LatLng(com.amap.api.maps2d.model.LatLng)

Example 8 with LatLng

use of com.amap.api.maps2d.model.LatLng 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();
}
Also used : MarkerOptions(com.amap.api.maps2d.model.MarkerOptions) LatLng(com.amap.api.maps2d.model.LatLng)

Aggregations

LatLng (com.amap.api.maps2d.model.LatLng)8 CameraPosition (com.amap.api.maps2d.model.CameraPosition)4 MarkerOptions (com.amap.api.maps2d.model.MarkerOptions)4 MapView (com.amap.api.maps2d.MapView)2 LatLonPoint (com.amap.api.services.core.LatLonPoint)2 GeocodeSearch (com.amap.api.services.geocoder.GeocodeSearch)2 ProgressDialog (android.app.ProgressDialog)1 Intent (android.content.Intent)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 AMapLocation (com.amap.api.location.AMapLocation)1 AMapLocationListener (com.amap.api.location.AMapLocationListener)1 AMap (com.amap.api.maps2d.AMap)1 AMapOptions (com.amap.api.maps2d.AMapOptions)1 PoiItem (com.amap.api.services.core.PoiItem)1 GeocodeResult (com.amap.api.services.geocoder.GeocodeResult)1 RegeocodeResult (com.amap.api.services.geocoder.RegeocodeResult)1 OnItemClickLisenter (com.jweihao.jdemo.utils.OnItemClickLisenter)1 ArrayList (java.util.ArrayList)1