//Executed to search for a Parcel with the correct Map and Page number
function findParcel() {
//set the search text to find parameters
var searchText = dojo.byId("Map").value;
if (searchText.length == 4) {
searchText = searchText + " " + dojo.byId("Page").value;
}
else if (searchText.length == 3 ){
searchText = searchText + " " + dojo.byId("Page").value;
}
findParams.searchText = searchText;
findTask.execute(findParams, showParcel);
}
function showParcel(results) {
//symbology for graphics
var polygonSymbol = 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, 0, 0, 0.5]));
//find results return an array of findResult.
map.graphics.clear();
//Build an array of attribute information and add each found graphic to the map
dojo.forEach(results, function(result) {
var graphic = new esri.Graphic(result.feature);
graphic.setSymbol(polygonSymbol);
map.graphics.add(graphic);
});
} function showParcel(results) {
//symbology for graphics
var polygonSymbol = 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, 0, 0, 0.5]));
//create an extent matching the graphics of the parcel(s)
var parcelExtent = esri.graphicsExtent(results.features);
//find results return an array of findResult.
map.graphics.clear();
//Build an array of attribute information and add each found graphic to the map
dojo.forEach(results, function(result) {
var graphic = new esri.Graphic(result.feature);
graphic.setSymbol(polygonSymbol);
map.graphics.add(graphic);
});
map.setExtent(parcelExtent);
}
function showParcel(results) {
//symbology for graphics
var polygonSymbol = 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, 0, 0, 0.5]));
//find results return an array of graphics in the graphicslayer.
var graphicslayer = new esri.layers.GraphicsLayer();
map.graphics.clear();
//Build an array of attribute information and add each found graphic to the map
dojo.forEach(results, function(result) {
var graphic = new esri.Graphic(result.feature);
graphic.setSymbol(polygonSymbol);
map.graphics.add(graphic);
graphicslayer.add(graphic);
});
//create an extent matching the graphics of the parcel(s)
var parcelExtent = esri.graphicsExtent(graphicslayer.graphics);
map.setExtent(parcelExtent);
}