<%-- -Copyright (C) 2004-2006 Autodesk, Inc. -This library is free software; you can redistribute it and/or -modify it under the terms of version 2.1 of the GNU Lesser -General Public License as published by the Free Software Foundation. -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --%> <%@ page import="org.osgeo.mapguide.*" %> <%@ page import="java.util.*" %> <%@ page import="java.io.*" %> <%@ page import="java.text.*" %> <%@ page import="javax.servlet.jsp.*" %> <%@ page import="javax.servlet.http.*" %> <%@ include file ="../utilityfunctions.jsp" %> Plot Task <% // Display a couple of forms prompting the user to either // plot the current view of the map, or the current view of // the map at a specified scale. Submitting one of these forms // opens a new window containing an EPlot DWF. The EPlot DWF // is generated by the plot.jsp script. String mgSessionId = request.getParameter("SESSION"); double currentScale = 0; NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(3); MgPoint viewCenter = null; double viewScale = 0; try { // Initialize the web-tier and connect to the Site using // the session identifier stored in JSP session state. InitializeWebTier(); MgUserInformation userInfo = new MgUserInformation(mgSessionId); MgSiteConnection siteConnection = new MgSiteConnection(); siteConnection.Open(userInfo); // Create a ResourcService object and use it to open the Map // object from the sessions repository. Use the Map object to // determine the current scale of the map for display on this // page. MgMap map = new MgMap(siteConnection); map.Open("Sheboygan"); viewCenter = map.GetViewCenter(); viewScale = map.GetViewScale(); } catch (MgException e) { out.write(e.GetExceptionMessage()); out.write(e.GetDetails()); return; } %>
 Plot as DWF
Plot a View of the Map
View Center X: <%= nf.format(viewCenter.GetCoordinate().GetX()) %>
View Center Y: <%= nf.format(viewCenter.GetCoordinate().GetY()) %>
View Scale: 1:<%= nf.format((int)viewScale) %>
Plot the Current Map View
 Use Print Layout
Plot at a Specified Scale
Scale:
 Use Print Layout