📄 mapviewer.jsp
字号:
<%--
The Java ADF was developed with JavaServer Faces (JSF) version 1.0.
For the latest information on supported servlet engines and application servers as well as
software and documentation updates, visit the ESRI Support Web site at http://support.esri.com.
For more information about JSF, visit http://java.sun.com/j2ee/javaserverfaces.
--%>
<%@ page contentType="text/html; charset=ISO-8859-1" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="jsfc" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="jsfh" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.esri.com/arcgis/webcontrols" prefix="ags" %>
<ags:noCache />
<jsfc:loadBundle basename="res.ResTemplates" var="resource" />
<jsfc:view>
<html>
<head>
<title><c:out value="${resource['MapViewer.MapViewerTemplate']}" /></title>
<ags:htmlBase />
<link href="css/mapviewer.css" rel="stylesheet" type="text/css">
<script language="Javascript" src="js/templates.js"></script>
</head>
<body topmargin="5">
<jsfh:form id="frmMap">
<ags:context id="mapContext" resource="USA@[Server] ">
<!-- Title and Logo -->
<table cellSpacing="0" class="headerTable">
<tr>
<td width="55"><img src="images/globe.gif" width="45" height="45"></td>
<td class="headerFont"><c:out value="${resource['MapViewer.MapViewer']}" /></td>
</tr>
</table>
<br>
<table cellspacing="0">
<tr class="lightBlue">
<td width="210" style="background-color:#FFFFFF;"> </td>
<td>
<%-- ZoomIn tool --%>
<img id="imgZoomIn" name="imgZoomIn" src="images/zoomin.gif"
alt="<c:out value="${resource['Templates.ZoomIn']}" />"
title="<c:out value="${resource['Templates.ZoomIn']}" />"
onmouseover="this.src='images/zoominU.gif'"
onmousedown="this.src='images/zoominD.gif';MapDragRectangle('Map0', 'ZoomIn');HighlightTool('ZoomIn');"
onmouseout="ButtonOut('imgZoomIn', 'Map0', 'ZoomIn', 'images/zoomin.gif', 'images/zoominD.gif')">
</td>
<td>
<%-- ZoomOut tool --%>
<img id="imgZoomOut" name="imgZoomOut" src="images/zoomout.gif"
alt="<c:out value="${resource['Templates.ZoomOut']}" />"
title="<c:out value="${resource['Templates.ZoomOut']}" />"
onmouseover="this.src='images/zoomoutU.gif'"
onmousedown="this.src='images/zoomoutD.gif';MapDragRectangle('Map0', 'ZoomOut');HighlightTool('ZoomOut');"
onmouseout="ButtonOut('imgZoomOut', 'Map0', 'ZoomOut', 'images/zoomout.gif', 'images/zoomoutD.gif')">
</td>
<td>
<%-- Pan tool --%>
<img id="imgPan" name="imgPan" src="images/pan.gif"
alt="<c:out value="${resource['Templates.Pan']}" />"
title="<c:out value="${resource['Templates.Pan']}" />"
onmouseover="this.src='images/panU.gif'"
onmousedown="this.src='images/panD.gif';MapDragImage('Map0', 'Pan');HighlightTool('Pan');"
onmouseout="ButtonOut('imgPan', 'Map0', 'Pan', 'images/pan.gif', 'images/panD.gif')">
</td>
<td>
<%-- Zoom to Full Extent button --%>
<jsfh:commandButton id="cmdFullExt" image="images/fullext.gif"
title="#{resource['Templates.FullExtent']}"
alt="#{resource['Templates.FullExtent']}"
onmousedown="this.src='images/fullextD.gif'"
onmouseover="this.src='images/fullextU.gif'"
onmouseout="this.src='images/fullext.gif'">
<jsfc:actionListener type="com.esri.arcgis.webcontrols.ags.faces.event.ZoomFullExtentListener" />
</jsfh:commandButton>
</td>
<%-- Load Extent Stack --%>
<c:set var="initStack" value="${sessionScope['mapContext'].attributes['esriAGSExtentStack']}" />
<td>
<%-- Zoom to Previous Extent button --%>
<jsfh:commandButton id="cmdBackExt" action="#{sessionScope['mapContext'].attributes['esriAGSExtentStack'].doPrevious}" image="images/back.gif"
title="#{resource['Templates.PreviousExtent']}"
alt="#{resource['Templates.PreviousExtent']}"
onmousedown="this.src='images/backD.gif'"
onmouseover="this.src='images/backU.gif'"
onmouseout="this.src='images/back.gif'" />
</td>
<td>
<%-- Zoom to Next Extent button --%>
<jsfh:commandButton id="cmdForwardExt" action="#{sessionScope['mapContext'].attributes['esriAGSExtentStack'].doNext}" image="images/forward.gif"
title="#{resource['Templates.NextExtent']}"
alt="#{resource['Templates.NextExtent']}"
onmousedown="this.src='images/forwardD.gif'"
onmouseover="this.src='images/forwardU.gif'"
onmouseout="this.src='images/forward.gif'" />
</td>
<td>
<%-- Identify tool --%>
<IMG id="imgIdentify" name="imgIdentify" src="images/identify.gif"
alt="<c:out value="${resource['Templates.Identify']}" />"
title="<c:out value="${resource['Templates.Identify']}" />"
onmouseover="this.src='images/identifyU.gif'"
onmousedown="this.src='images/identifyD.gif';MapPoint('Map0', 'Identify');HighlightTool('Identify');"
onmouseout="ButtonOut('imgIdentify', 'Map0', 'Identify', 'images/identify.gif', 'images/identifyD.gif')">
</td>
<td>
Add Layer:
<jsfh:selectOneMenu value="#{mapContext.attributes['esriAddLayer'].addLayerName}">
<jsfc:selectItems value="#{mapContext.attributes['esriAddLayer'].catalog.addLayerNames}" />
</jsfh:selectOneMenu>
at
<jsfh:selectOneMenu value="#{mapContext.attributes['esriAddLayer'].addLayerIndex}">
<jsfc:selectItems value="#{mapContext.attributes['esriAddLayer'].catalog.addLayerIndices}" />
</jsfh:selectOneMenu>
<jsfh:commandButton id="addBtn" value="Add Layer" actionListener="#{mapContext.attributes['esriAddLayer'].processAddLayer}" />
<br />
<font style="color:red;font-weight:bold;">
<jsfh:message for="addBtn" />
</font>
</td>
</tr>
</table>
<table cellpadding="3">
<tr valign="TOP">
<td><ags:toc height="320" width="200" cssClass="tocClass" borderWidth="2" /></td>
<td rowspan="3">
<table cellspacing="0">
<tr class="lightBlue" align="CENTER">
<td>
<jsfh:commandButton id="cmdPanUL" image="images/upperleft.gif" title="#{resource['Templates.PanUpperLeft']}" alt="#{resource['Templates.PanUpperLeft']}">
<jsfc:actionListener type="com.esri.arcgis.webcontrols.ags.faces.event.DirectionalPanListener" />
<jsfc:attribute name="direction" value="upperLeft" />
<jsfc:attribute name="factor" value=".5" />
</jsfh:commandButton>
</td>
<td>
<jsfh:commandButton id="cmdPanU" image="images/up.gif" title="#{resource['Templates.PanUp']}" alt="#{resource['Templates.PanUp']}">
<jsfc:actionListener type="com.esri.arcgis.webcontrols.ags.faces.event.DirectionalPanListener" />
<jsfc:attribute name="direction" value="up" />
<jsfc:attribute name="factor" value=".5" />
</jsfh:commandButton>
</td>
<td>
<jsfh:commandButton id="cmdPanUR" image="images/upperright.gif" title="#{resource['Templates.PanUpperRight']}" alt="#{resource['Templates.PanUpperRight']}" >
<jsfc:actionListener type="com.esri.arcgis.webcontrols.ags.faces.event.DirectionalPanListener" />
<jsfc:attribute name="direction" value="upperRight" />
<jsfc:attribute name="factor" value=".5" />
</jsfh:commandButton>
</td>
</tr>
<tr align="CENTER" class="lightBlue">
<td>
<jsfh:commandButton id="cmdPanL" image="images/left.gif" title="#{resource['Templates.PanLeft']}" alt="#{resource['Templates.PanLeft']}">
<jsfc:actionListener type="com.esri.arcgis.webcontrols.ags.faces.event.DirectionalPanListener" />
<jsfc:attribute name="direction" value="left" />
<jsfc:attribute name="factor" value=".5" />
</jsfh:commandButton>
</td>
<td>
<ags:map id="Map0" width="500" height="405" activeTool="ZoomIn" />
</td>
<td>
<jsfh:commandButton id="cmdPanR" image="images/right.gif" title="#{resource['Templates.PanRight']}" alt="#{resource['Templates.PanRight']}">
<jsfc:actionListener type="com.esri.arcgis.webcontrols.ags.faces.event.DirectionalPanListener" />
<jsfc:attribute name="direction" value="right" />
<jsfc:attribute name="factor" value=".5" />
</jsfh:commandButton>
</td>
</tr>
<tr class="lightBlue" align="CENTER">
<td>
<jsfh:commandButton id="cmdPanLL" image="images/lowerleft.gif" title="#{resource['Templates.PanLowerLeft']}" alt="#{resource['Templates.PanLowerLeft']}">
<jsfc:actionListener type="com.esri.arcgis.webcontrols.ags.faces.event.DirectionalPanListener" />
<jsfc:attribute name="direction" value="lowerLeft" />
<jsfc:attribute name="factor" value=".5" />
</jsfh:commandButton>
</td>
<td>
<jsfh:commandButton id="cmdPanD" image="images/down.gif" title="#{resource['Templates.PanDown']}" alt="#{resource['Templates.PanDown']}">
<jsfc:actionListener type="com.esri.arcgis.webcontrols.ags.faces.event.DirectionalPanListener" />
<jsfc:attribute name="direction" value="down" />
<jsfc:attribute name="factor" value=".5" />
</jsfh:commandButton>
</td>
<td>
<jsfh:commandButton id="cmdPanLR" image="images/lowerright.gif" title="#{resource['Templates.PanLowerRight']}" alt="#{resource['Templates.PanLowerRight']}">
<jsfc:actionListener type="com.esri.arcgis.webcontrols.ags.faces.event.DirectionalPanListener" />
<jsfc:attribute name="direction" value="lowerRight" />
<jsfc:attribute name="factor" value=".5" />
</jsfh:commandButton>
</td>
</tr>
</table>
</td>
<td rowspan="2" valign="BOTTOM"><ags:northArrow /></td>
</tr>
<tr>
<td valign="top">
<ags:overview id="Overview0" resource="USA@[Server]" width="200" height="125" borderWidth="2" cssClass="overviewClass" />
</td>
</tr>
<tr>
<td colspan="2" align="RIGHT"><ags:scaleBar width="300" height="35" /></td>
</tr>
</table>
<%-- Identify Results control --%>
<ags:identifyResults id="IdentifyResults" left="40" top="40" />
</ags:context>
<%-- Hightlight the current active tool on the tool bar--%>
<script language="JavaScript">HighlightTool(document.forms[docFormID].elements["Map0_mode"].value);</script>
</jsfh:form>
</body>
</html>
</jsfc:view>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -