Tengo ArcGIS Server 9.3, y estoy tratando de utilizar la API JS. He visualizado con éxito el mapa, y puedo localizar y hacer zoom a una característica basada en el valor ParcelID. El problema es que no puedo resaltar esta parcela. Es decir, he intentado configurar el símbolo, pero no se muestra. Aquí está el código:
<script>
dojo.require("esri.map");
dojo.require("esri.layers.FeatureLayer");
var map,featureLayer,query,sfs;
function init() {
map = new esri.Map("mapDiv", {
sliderOrientation: "horizontal"
});
var imageParameters = new esri.layers.ImageParameters();
imageParameters.format = "PNG24"; //set the image type to PNG24, note default is PNG8.
//Takes a URL to a non cached map service.
var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://*******/*****/rest/services/****/MapServer", {
"opacity":1,
"imageParameters":imageParameters
});
dynamicMapServiceLayer.setVisibleLayers([4,10,11,16]);
map.addLayer(dynamicMapServiceLayer);
//Locate Parcel--------
sfs = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT,new dojo.Color([255,0,0]), 2),new dojo.Color([255,255,0,0.25]));
featureLayer = new esri.layers.FeatureLayer("http://*****/*****/rest/services/*****/MapServer/4", {
outFields: ["*"],
mode: esri.layers.FeatureLayer.MODE_SELECTION
});
featureLayer.setSelectionSymbol(sfs);
map.addLayers([featureLayer]);
query = new esri.tasks.Query();
query.where = "ParcelID_NS = '101010101'";
var deferred = featureLayer.selectFeatures(query, esri.layers.FeatureLayer.SELECTION_NEW, function (selection) {
var stateExtent = selection[0].geometry.getExtent().expand(3.0);
map.setExtent(stateExtent);
});
//----------------------
}
dojo.ready(init);
</script>
¿Alguna ayuda? Gracias.