<%@ 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="../common/common.jsp" %> Hello, map

Spatial Reference

<% String sessionId = request.getParameter("SESSION"); String mapName = request.getParameter("MAPNAME"); try { // --------------------------------------------------// // Basic initialization needs to be done every time. MapGuideJavaApi.MgInitializeWebTier(webconfigFilePath); // Get the user information using the session id, // and set up a connection to the site server. MgUserInformation userInfo = new MgUserInformation(sessionId); MgSiteConnection siteConnection = new MgSiteConnection(); siteConnection.Open(userInfo); // Finished basic initialization. // --------------------------------------------------// // Query the spatial reference system used for the map. MgMap map = new MgMap(siteConnection); map.Open(mapName); String srs = map.GetMapSRS(); // Format it and display it in the task pane. out.println("

Map " + map.GetName() + " uses this reference system:

"); Integer lineLength = 30; out.println("
");
      while (srs.length() > lineLength)
      {
        out.println(srs.substring(0, lineLength));
        srs = srs.substring(lineLength);
      }
      out.println(srs);
      out.println("
"); } catch (MgException e) { out.println("

Error: "); out.println(e.GetDetails()); out.println("

"); } %>