admin管理员组文章数量:1654021
var identifyTask, identifyParams, symbol;
//栅格
function identify(Layer){
console.log("Console identifyRaster");
dojo.connect(app.map, "onClick", doIdentify);
//实例化IdentifyTask
identifyTask = new esri.tasks.IdentifyTask(Layer.url);
//IdentifyTask参数设置
identifyParams = new esri.tasks.IdentifyParameters();
//冗余范围
identifyParams.tolerance = 3;
//返回地理元素
identifyParams.returnGeometry = true;
//进行Identify的图层
identifyParams.layerIds = [0];
//进行Identify的图层为全部
identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
console.log("Console identifyRaster End");
}
//进行Identify
function doIdentify(evt){
console.log("Console doIdentify");
//清除上一次的高亮显示
app.map.graphics.clear();
//Identify的geometry
identifyParams.geometry = evt.mapPoint;
//Identify范围
identifyParams.mapExtent = app.map.extent;
identifyTask.execute(identifyParams, function(idResults) {
addToMap(idResults, evt);
});
console.log("Console doIdentify End");
}
//在infoWindow中显示Identify结果
function addToMap(idResults, evt){
if(layerType == "Raster"){
//矢量处理方法
console.log("Console addToMap");
console.log("idResults[0]"+idResults[0]);
console.log(idResults[0]);
resultArray.push( Number(Number(idResults[0].feature.attributes["Pixel Value"]).toFixed(2)) );
var X = new Array();
var Y = new Array();
var arry = new Array();
X = resultArray;
for(i = 0;i < X.length;i++){
console.log(X[i]);
Y[i] = i;
}
arry[0]=X;
arry[1]=Y;
document.getElementById("columnChartPlot").innerText = "";
columnChart(arry);
console.log("Console addToMap End");
}else{
//栅格处理方法
console.log("Console addToMap");
console.log(idResults[0]);
var att ;
if(idResults[0].feature.attributes.GRIDCODE){
att = idResults[0].feature.attributes.GRIDCODE
}else{
if(idResults[0].feature.attributes["Class value"]){
att = Number(idResults[0].feature.attributes["Class value"])
}
}
console.log(att);
resultArray.push( att );
var X = new Array();
var Y = new Array();
var arry = new Array();
X = resultArray;
for(i = 0;i < X.length;i++){
console.log(X[i]);
Y[i] = i;
}
arry[0]=X;
arry[1]=Y;
document.getElementById("columnChartPlot").innerText = "";
columnChart(arry);
console.log("Console addToMap End");
}
}
转载于:https://wwwblogs/Felixlovechina/p/3251800.html
版权声明:本文标题:identify.js 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1729650672a1209001.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论