com.amap.api.maps2d.CameraUpdate Java Examples

The following examples show how to use com.amap.api.maps2d.CameraUpdate. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LocationActivity.java    From Socket.io-FLSocketIM-Android with MIT License 6 votes vote down vote up
private void cameraMove(LatLng latLng) {

        userMoveCamera = false;
        CameraUpdateFactory factory = new CameraUpdateFactory();
        CameraUpdate cameraUpdate = factory.newLatLngZoom(latLng, (float) 15.5);
        aMap.animateCamera(cameraUpdate, new AMap.CancelableCallback() {
            @Override
            public void onFinish() {
                userMoveCamera = true;
            }

            @Override
            public void onCancel() {
                userMoveCamera = true;
            }
        });
    }
 
Example #2
Source File: AMAPLocationActivity.java    From sealtalk-android with MIT License 6 votes vote down vote up
private void addChooseMarker() {
    //加入自定义标签
    MarkerOptions centerMarkerOption = new MarkerOptions().position(myLocation).icon(successDescripter);
    centerMarker = aMap.addMarker(centerMarkerOption);
    centerMarker.setPositionByPixels(mapView.getWidth() / 2, mapView.getHeight() / 2);
    handler.postDelayed(new Runnable() {
        @Override
        public void run() {
            CameraUpdate update = CameraUpdateFactory.zoomTo(17f);
            aMap.animateCamera(update, 1000, new AMap.CancelableCallback() {
                @Override
                public void onFinish() {
                    aMap.setOnCameraChangeListener(AMAPLocationActivity.this);
                }

                @Override
                public void onCancel() {
                }
            });
        }
    }, 1000);
}
 
Example #3
Source File: AmapActivity.java    From sealtalk-android with MIT License 6 votes vote down vote up
private void initAmap() {
        if (aMap == null) {
            aMap = mapView.getMap();
        }
        aMap.setLocationSource(this);// 设置定位监听
        aMap.setMyLocationEnabled(true);
        aMap.getUiSettings().setZoomControlsEnabled(false);

//        aMap.setMyLocationType(AMap.LOCATION_TYPE_LOCATE);
        CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(15);
        aMap.moveCamera(cameraUpdate);

        movingDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.icon_loaction_choose_moving);
        chooseDescripter = BitmapDescriptorFactory.fromResource(R.drawable.icon_loaction_choose);
        successDescripter = BitmapDescriptorFactory.fromResource(R.drawable.icon_usecarnow_position_succeed);

        geocodeSearch = new GeocodeSearch(this);
        geocodeSearch.setOnGeocodeSearchListener(this);
    }
 
Example #4
Source File: AmapActivity.java    From sealtalk-android with MIT License 6 votes vote down vote up
private void addChooseMarker() {
    MarkerOptions centerMarkerOption = new MarkerOptions().position(myLocation).icon(chooseDescripter);
    centerMarker = aMap.addMarker(centerMarkerOption);
    centerMarker.setPositionByPixels(mapView.getWidth() / 2, mapView.getHeight() / 2);
    handler.postDelayed(new Runnable() {
        @Override
        public void run() {
            CameraUpdate update = CameraUpdateFactory.zoomTo(17f);
            aMap.animateCamera(update, 1000, new AMap.CancelableCallback() {
                @Override
                public void onFinish() {
                    aMap.setOnCameraChangeListener(AmapActivity.this);
                }
                @Override
                public void onCancel() {
                }
            });
        }
    }, 1000);
}
 
Example #5
Source File: AMAPLocationActivity.java    From sealtalk-android with MIT License 5 votes vote down vote up
private void initAmap() {
    if (aMap == null) {
        aMap = mapView.getMap();
    }

    if (getIntent().hasExtra("location")) {
        isPerview = true;
        mMsg = getIntent().getParcelableExtra("location");
        tvCurLocation.setVisibility(View.GONE);
        returns.setVisibility(View.GONE);

        if (model) {
            CameraPosition location = new CameraPosition.Builder()
                    .target(new LatLng(mMsg.getLat(), mMsg.getLng())).zoom(18).bearing(0).tilt(30).build();
            show(location);
        } else {
            aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f)
                    .position(new LatLng(mMsg.getLat(), mMsg.getLng())).title(mMsg.getPoi())
                    .snippet(mMsg.getLat() + "," + mMsg.getLng()).draggable(false));
        }
        return;
    }


    aMap.setLocationSource(this);// 设置定位监听
    aMap.setMyLocationEnabled(true);
    aMap.getUiSettings().setZoomControlsEnabled(false);
    aMap.getUiSettings().setMyLocationButtonEnabled(false);
    CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(15);//设置缩放监听
    aMap.moveCamera(cameraUpdate);

    successDescripter = BitmapDescriptorFactory.fromResource(R.drawable.icon_usecarnow_position_succeed);
    geocodeSearch = new GeocodeSearch(this);
    geocodeSearch.setOnGeocodeSearchListener(this);
}
 
Example #6
Source File: AMAPLocationActivity.java    From sealtalk-android with MIT License 5 votes vote down vote up
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.myLocation:
            CameraUpdate update = CameraUpdateFactory.changeLatLng(myLocation);
            aMap.animateCamera(update);
            break;
        default:
            break;
    }
}
 
Example #7
Source File: AmapActivity.java    From sealtalk-android with MIT License 5 votes vote down vote up
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.myLocation:
            CameraUpdate update = CameraUpdateFactory.changeLatLng(myLocation);
            aMap.animateCamera(update);
            break;
        default:
            break;
    }
}
 
Example #8
Source File: Waypoint1Activity.java    From Android-GSDemo-Gaode-Map with MIT License 5 votes vote down vote up
private void cameraUpdate(){
    LatLng pos = new LatLng(droneLocationLat, droneLocationLng);
    float zoomlevel = (float) 18.0;
    CameraUpdate cu = CameraUpdateFactory.newLatLngZoom(pos, zoomlevel);
    aMap.moveCamera(cu);

}
 
Example #9
Source File: Waypoint2Activity.java    From Android-GSDemo-Gaode-Map with MIT License 5 votes vote down vote up
private void cameraUpdate() {
    LatLng pos = new LatLng(mAircraftLat, mAircraftLng);
    float zoomlevel = (float) 18.0;
    CameraUpdate cu = CameraUpdateFactory.newLatLngZoom(pos, zoomlevel);
    aMap.moveCamera(cu);

}
 
Example #10
Source File: AMapLiteActivity.java    From XposedRimetHelper with GNU General Public License v2.0 4 votes vote down vote up
private void cameraUpdate(LatLng latLng) {
    CameraUpdate cameraSigma =
            CameraUpdateFactory.newCameraPosition(
                    new CameraPosition(latLng, 18, 0, 0));
    mAMap.moveCamera(cameraSigma);
}