HOW TO
In default HTML Viewer Web sites, the legend is dynamically generated and updated as a user zooms in or out.
In some circumstances, you may prefer a different legend than that generated by the default viewer.
As a basic solution, you can create your desired legend as a static image and edit the viewer to load it into the viewer's "TOCFrame" permanently. Edits are also required to prevent the static image from being overwritten by the default viewer's refresh functions.
Code:
<ARCXML version="1.1">
<REQUEST>
<GET_IMAGE>
<PROPERTIES>
<LEGEND title="Legend" font="Arial" autoextend="true" columns="1" width="170" height="300" backgroundcolor="255,255,255" >
</LEGEND>
<DRAW map="false"/>
</PROPERTIES>
</GET_IMAGE>
</REQUEST>
</ARCXML>
Code:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<HTML>
<HEAD>
<TITLE>Untitled</TITLE>
</HEAD>
<IMG SRC="images/theLegend.gif"/>
</BODY>
</HTML>
Code:
document.writeln('<FRAME NAME="TOCFrame" SRC="StaticLegend.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="Yes" RESIZE="YES">');
Code:
var showTOC=false;
Code:
var legendVisible=true;
Code:
switch(XMLMode) {
case 1:
. �
if (toolMode==20) {
updateMeasureBox();
}
// if (legendVisible) {
// showLegend();
// }
Code:
case 98:
// just put up a map with legend
var theURL = "";
theURL = getURL(theReply);
if (theURL != "") {
document.theImage.src = theURL;
}
//else {
// alert(theReply + "\nUnable to display Map image");
//}
//if (legendVisible) {
// showLegend();
// drawLegendOnly=false;
//}
Code:
// if (aimsLegendPresent) {
// // create a legend image
// if (legendVisible) theString += addLegendToMap();
// }
Code:
if (aimsLayersPresent) {
if (sFactor!=mapScaleFactor) {
mapScaleFactor = sFactor;
// if ((hasTOC) && (!legendVisible)) parent.TOCFrame.document.location = appDir + "toc.htm";
if (aimsLayersPresent) {
if (LayerListOpen) writeLayerListForm();
}
}
}
Code:
theURL = getInsideString(theReply,'url="',dQuote,pos,0,false);
}
//legendImage = getLegendURL(theReply);
return theURL;
}
Code:
//getLegend();
Article ID:000007065
Get help from ArcGIS experts
Download the Esri Support App