HOW TO
Instructions provided describe how to enable auto refresh of the map image when the layers are checked on or off for visibility in the HTML Viewer layer list(Table of contents).
Code:
document.write('<input type="Checkbox" name="LayerVisible" value="' + i + '"');
if (t.LayerVisible[i] == 1) document.write(' checked');
document.writeln(' ></td>');
Code:
document.write('<input type="Checkbox" name="LayerVisible" value="' + i + '"');
if (t.LayerVisible[i] == 1) document.write(' checked');
//**** new line added here ****
document.writeln(' onclick="javascript:updateLayers()" ');
document.writeln(' ></td>');
Note:
Step 1 and 2 enables auto refresh of layers based on check box value. Indicate to the user that Auto Refresh is enabled and may be remove the 'Refresh Map' button shown in the layer list. Optional Steps 3 and 4 shows how to modify the HTML Viewer to add these features.
Code:
document.writeln(' </TD>');
document.writeln('</TR>');
</SCRIPT>
</TABLE>
Code:
document.writeln(' </TD>');
document.writeln('</TR>');
//**** new code start *******
document.writeln('<TR>');
document.writeln(' <TD ALIGN="center" COLSPAN="3">');
document.writeln('<font size="-1" color="blue"><b>Auto Refresh Enabled</b></font>');
document.writeln(' </TD>');
document.writeln('</TR>');
//**** new code end *********
</SCRIPT>
</TABLE>
Code:
document.writeln(' <INPUT TYPE="button" style="background-color: #FFFFE7;" NAME="refreshButton" VALUE="' + t.buttonList[44] + '" onClick="updateLayers()">');
Code:
//***** commented out to remove the refresh button ********
//document.writeln(' <INPUT TYPE="button" style="background-color: #FFFFE7;" NAME="refreshButton" VALUE="' + t.buttonList[44] + '" onClick="updateLayers()">');
Get help from ArcGIS experts
Download the Esri Support App