如何在最新版本的Yandex mapkit上构建右键?缩放和位置按钮。我只是创建地图类并感到困惑。文档非常少。.
//Your location. Point class
//for example: Point(53.0101, 53.0101);
private Point DRIVER_POSITION = new Point(float, float);
....
userLocationLayer = mapView.getMap().getUserLocationLayer();
userLocationLayer.setEnabled(true);
userLocationLayer.setHeadingEnabled(true);
userLocationLayer.setObjectListener(this);
.....
//onClick events. FAB Button's
.....
zoomUp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mapView.getMap().move(new CameraPosition(mapView.getMap().getCameraPosition().getTarget(),
mapView.getMap().getCameraPosition().getZoom()+1, 0.0f, 0.0f),
new Animation(Animation.Type.SMOOTH, 1),
null);
}
});
zoomDown.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mapView.getMap().move(new CameraPosition(mapView.getMap().getCameraPosition().getTarget(),
mapView.getMap().getCameraPosition().getZoom()-1, 0.0f, 0.0f),
new Animation(Animation.Type.SMOOTH, 1),
null);
}
});
positionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mapView.getMap().move(
new CameraPosition(userLocationLayer.cameraPosition().getTarget(), 15.0f, 0.0f, 0.0f),
new Animation(Animation.Type.SMOOTH, 1),
null);
}
});