I have list of ObjectId's present in xmlwant to highlight them on map by adding a graphic layer.How do i write a query to search this?I had a wiered idea of doing thisforeach(oid in xml){query.where="OBJECTID="+oid+" or ";}xml generally contains 1000 values [confused/]
var query = new esri.tasks.Query();
query.returnGeometry = true;
query.outFields = ["OBJECTID", "CMDTY", "DIA_IN", "RISK_SCORE", "MOD_DATE"];
query.outSpatialReference = { "wkid": 102100 };
query.where = ""; //How do i do this??
var infoTemplate = new esri.InfoTemplate();
infoTemplate.setTitle("${OBJECTID}");
infoTemplate.setContent("<b>Comodity: </b>${CMDTY}<br/>"
+ "<b>Internal Diameter: </b>${DIA_IN}<br/>"
+ "<b>Risk Score: </b>${RISK_SCORE}<br/>"
+ "<b>Last Updated on: </b>${MOD_DATE}");
map.infoWindow.resize(245, 125);
dojo.connect(queryTask, "onComplete", function (featureSet) {
map.graphics.clear();
var highlightSymbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([0, 0, 0]), 3);
var symbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([255, 0, 0]), 1);
var countiesGraphicsLayer = new esri.layers.GraphicsLayer();
for (var i = 0, il = featureSet.features.length; i < il; i++) {
var graphic = featureSet.features;
graphic.setSymbol(symbol);
graphic.setInfoTemplate(infoTemplate);
countiesGraphicsLayer.add(graphic);
}
map.addLayer(countiesGraphicsLayer);
map.graphics.enableMouseEvents();