Bbox newBounds = factory.createBbox(x, y, bounds.getWidth() / 2, bounds.getHeight() / 2);
mapPresenter.getViewPort().applyBounds(newBounds);
}
public void onMouseWheel(MouseWheelEvent event) {
ViewPort viewPort = mapPresenter.getViewPort();
if (event.isNorth()) {
if (scrollZoomType == ScrollZoomType.ZOOM_POSITION) {
int index = viewPort.getZoomStrategy().getZoomStepIndex(viewPort.getScale());
viewPort.applyScale(viewPort.getZoomStrategy().getZoomStepScale(index - 1), viewPort.transform(
new Coordinate(event.getX(), event.getY()), RenderSpace.SCREEN, RenderSpace.WORLD));
} else {
int index = viewPort.getZoomStrategy().getZoomStepIndex(viewPort.getScale());
viewPort.applyScale(viewPort.getZoomStrategy().getZoomStepScale(index - 1));
}
} else {
if (scrollZoomType == ScrollZoomType.ZOOM_POSITION) {
int index = viewPort.getZoomStrategy().getZoomStepIndex(viewPort.getScale());
viewPort.applyScale(viewPort.getZoomStrategy().getZoomStepScale(index + 1), viewPort.transform(
new Coordinate(event.getX(), event.getY()), RenderSpace.SCREEN, RenderSpace.WORLD));
} else {
int index = viewPort.getZoomStrategy().getZoomStepIndex(viewPort.getScale());
viewPort.applyScale(viewPort.getZoomStrategy().getZoomStepScale(index + 1));
}
}
}