В ArcGis JS API я новичок, поэтому не бейте сильно ногами.
Вот проблемный кусок кода
Код: Выделить всё
function showResults(featureSet) {
//remove all graphics on the maps graphics layer
map.graphics.clear();
//Performance enhancer - assign featureSet array to a single variable.
var resultFeatures = featureSet.features;
//Loop through each feature returned
for (var i=0, il=resultFeatures.length; i<il; i++) {
//Get the current feature from the featureSet.
//Feature is a graphic
var graphic = resultFeatures[i];
graphic.setSymbol(selectedCountySymbol);
var extent = graphic.geometry.getExtent();
map.setExtent(extent);
//Add graphic to the map graphics layer.
map.graphics.add(graphic);
}
}
Тут я пытаюсь сделать зум на выбранный объект
Код: Выделить всё
map.setExtent(extent);
Код: Выделить всё
graphic.setSymbol(selectedCountySymbol);
map.graphics.add(graphic);
И выше по стеку
Код: Выделить всё
var selectedCountySymbol;
......
selectedCountySymbol = getSymbolForSelectedFeature(SimpleFillSymbol, SimpleLineSymbol, SimpleFillSymbol.STYLE_SOLID, SimpleLineSymbol.STYLE_SOLID, Color);
......
function getSymbolForSelectedFeature(SimpleFillSymbol, SimpleLineSymbol, FillStyleSymbol, LineStyleSymbol, Color){
return new SimpleFillSymbol().setColor(new Color([255, 10, 10, 3.5]));
}