<%-- $HeadURL$ --%> <%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld' prefix='jetspeed' %> <%@ page import="org.deegree.model.spatialschema.GeometryFactory"%> <%@ page import="org.deegree.model.spatialschema.Envelope"%> <%@ page import="java.awt.Rectangle" %> <%@ page import="org.deegree.portal.context.ViewContext" %> <%@ page import="org.deegree.portal.portlet.modules.actions.IGeoPortalPortletPerform" %> <%@ page import="org.deegree.portal.portlet.modules.actions.AbstractPortletPerform" %> <%@ page import="org.deegree.framework.util.MapUtils" %> <%@ page import="org.deegree.framework.util.StringTools"%> <%@ page import="org.deegree.portal.portlet.modules.map.actions.portlets.ScaleChooserPortletPerform"%> <%@ page import="org.deegree.model.crs.CoordinateSystem"%> <%@ page import="org.deegree.model.crs.CRSFactory"%> <% String coordSys = request.getParameter( "CRS" ); double viewminx = Double.parseDouble( request.getParameter( "VIEWMINX" ) ); double viewminy = Double.parseDouble( request.getParameter( "VIEWMINY" ) ); double viewmaxx = Double.parseDouble( request.getParameter( "VIEWMAXX" ) ); double viewmaxy = Double.parseDouble( request.getParameter( "VIEWMAXY" ) ); int width = Integer.parseInt( request.getParameter( "WIDTH" ) ); int height = Integer.parseInt( request.getParameter( "HEIGHT" ) ); double currentScale = 0; CoordinateSystem cs = CRSFactory.create( coordSys ); Envelope env = GeometryFactory.createEnvelope( viewminx, viewminy, viewmaxx, viewmaxy, cs ); currentScale = MapUtils.calcScale( width, height, env, cs, ScaleChooserPortletPerform.DEFAULT_PIXEL_SIZE ); String scale = String.valueOf( (int)Math.round( currentScale ) ); %>