PROBLEM
It is possible to define query parameters in an HTML Viewer's URL to select and zoom to predefined features at the initialization of the HTML Viewer.
When setting up an image service using the cities shapefile located in the ArcIMS Tutorial Data directory, the following URL zooms to and highlights Paris.
Code:
http://zephyr/website/cities/viewer.htm?ActiveLayer=0&Query=CITY_NAME%3D%27Paris%27&QueryZoom=Yes
By default, the HTML Viewer code highlights the features only for Image Service.
Note:
When highlighting is enabled, the scenario where this fails is when the shapefile contains several features that are selected and one of the features has been clicked on to 'zoom to feature'. In Image server that feature is highlighted in red, but this does not occur for ArcMap server.
Code:
if (!isArcMapService) {
Code:
//commenting out opening if statement
//if (!isArcMapService) {
if (highlightedOne!="") {
// add Draw Highlighed Feature to Map XML request
selString +='<LAYER type="featureclass" name="' + titleList[23] + '" visible="true">';
//selString +='<DATASET fromlayer="' + ActiveLayer + '" />';
selString +='<DATASET fromlayer="' + LayerID[ActiveLayerIndex] + '" />';
selString +='<QUERY where="' + highlightedOne + '" />';
selString +='<SIMPLERENDERER>';
if (selectType=="point") {
selString +='<SIMPLEMARKERSYMBOL color="' + highlightColor + '" type="Circle" width="10" />';
} else if (selectType=="line") {
selString +='<SIMPLELINESYMBOL type="SOLID" color="' + highlightColor + '" width="3" />';
} else {
//selString +='<SIMPLEPOLYGONSYMBOL FILLCOLOR="' + highlightColor + '" FILLTYPE="Gray" ';
selString +='<SIMPLEPOLYGONSYMBOL fillcolor="' + highlightColor + '" filltype="solid" transparency="' + forceComma(transparentLevel) + '" boundarycolor="255,255,255" />';
}
selString +='</SIMPLERENDERER>';
selString +='</LAYER>';
//alert(selString);
}
//commenting out closing bracket
//}
}
return selString;
}
Article ID:000007616
Get help from ArcGIS experts
Download the Esri Support App