@@ -0,0 +1,1130 @@
+/*%0A * This is part of Geomajas, a GIS framework, http://www.geomajas.org/.%0A *%0A * Copyright 2008-2011 Geosparc nv, http://www.geosparc.com/, Belgium.%0A *%0A * The program is available in open source according to the GNU Affero%0A * General Public License. All contributions in this program are covered%0A * by the Geomajas Contributors License Agreement. For full licensing%0A * details, see LICENSE.txt in the project root.%0A */%0A%0Apackage org.geomajas.puregwt.client.map.controller;%0A%0Aimport org.geomajas.puregwt.client.map.ZoomOption;%0Aimport org.geomajas.puregwt.client.spatial.Bbox;%0A%0A/**%0A * Map controller that lets the user drag a rectangle on the map, after which it zooms to that rectangle.%0A * %0A * @author Pieter De Graef%0A */%0Apublic class ZoomToRectangleController extends AbstractRectangleController %7B%0A%0A%09/**%0A%09 * Effectively zoom to the bounds that the user drew on the map.%0A%09 * %0A%09 * @param worldBounds%0A%09 *            The result of the user's dragging on the map, expressed in world space.%0A%09 */%0A%09protected void execute(Bbox worldBounds) %7B%0A%09%09mapPresenter.getMapModel().getViewPort().applyBounds(worldBounds, ZoomOption.LEVEL_CHANGE);%0A%09%7D%0A%7D

Create zoom to rectangle controller