HTML Viewer中的IdentifyAll工具只返回指定的可见图层的要素
HTML Viewer中的IdentifyAll工具默认返回所有可见图层的要素,
下面的定制使
HTML Viewer中的IdentifyAll工具只返回指定的可见图层的要素
例子:这个站点有5个图层cities, rivers,lakes,country和latlon,设置为只查看cities, rivers,lakes,country图层。见图
需要修改位于
<磁盘>/ArcIMS/Website/<Website_Name>文件夹中的ArcIMSParam.js和
<磁盘>/ArcIMS/Website/<Website_Name>/Javascript 目录中的aimsIdentify.js文件。
1.打开地图配置文件(后缀.AXL),创建用于HTML Viewer的服务,注意要查看的图层的ID值。
或从图层信息中查看
2.在文本编辑器中打开ArcIMSParam.js文件,作下列修改:
A.找到这行代码:
var useIdentify=true;
改为:var useIdentify=false;
B.将这行代码:
var useIdentifyAll=false;
改为:
var useIdentifyAll=true;
3.在文本编辑器中打开aimsIdentify.js:
A.找到:
aimsIdentifyPresent=true;
在这行代码后添加新变量如下,指名选择的层的ID(参见步骤1),ID间用逗号隔开。
var idLayers = "1,2,3,4";
B.找到identifyAll函数,将下列代码:
改为:
C.找到doIdentifyAll函数,将下列代码:
改为:
只查看cities, rivers,lakes,country图层
下面的定制使
HTML Viewer中的IdentifyAll工具只返回指定的可见图层的要素
例子:这个站点有5个图层cities, rivers,lakes,country和latlon,设置为只查看cities, rivers,lakes,country图层。见图
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_9ef78ee2c4293bce8340nI2wYGjQMErm.jpg)
需要修改位于
<磁盘>/ArcIMS/Website/<Website_Name>文件夹中的ArcIMSParam.js和
<磁盘>/ArcIMS/Website/<Website_Name>/Javascript 目录中的aimsIdentify.js文件。
1.打开地图配置文件(后缀.AXL),创建用于HTML Viewer的服务,注意要查看的图层的ID值。
或从图层信息中查看
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_49f20c9c9ae58718c68d7BCtbqNYXusg.jpg)
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_2334a1c958501903a510F3CoL72H5KNK.jpg)
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_b0044dadd0acca2cc146ePrAOn6ORwPW.jpg)
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_f537659ae605c098a87btclaTtQynX3h.jpg)
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_685d86ad7a5a6ae14e93xaAPEzEfyJiU.jpg)
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_f5f1005a5e11c2d4e4251p7AeJ5e0lXb.jpg)
2.在文本编辑器中打开ArcIMSParam.js文件,作下列修改:
A.找到这行代码:
var useIdentify=true;
改为:var useIdentify=false;
B.将这行代码:
var useIdentifyAll=false;
改为:
var useIdentifyAll=true;
3.在文本编辑器中打开aimsIdentify.js:
A.找到:
aimsIdentifyPresent=true;
在这行代码后添加新变量如下,指名选择的层的ID(参见步骤1),ID间用逗号隔开。
var idLayers = "1,2,3,4";
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_5ef9a057d27f9255c34asmGzMw219mgG.jpg)
B.找到identifyAll函数,将下列代码:
CODE:
for (var i=(LayerID.length-1);i>=0;i--) {
replyArray="";
if ((mapScaleFactor>=LayerMinScale) &&
(mapScaleFactor<=LayerMaxScale) && (LayerVisible) && (LayerIsFeature)) j =
i;
}
replyArray="";
if ((mapScaleFactor>=LayerMinScale) &&
(mapScaleFactor<=LayerMaxScale) && (LayerVisible) && (LayerIsFeature)) j =
i;
}
改为:
CODE:
for (var i=(LayerID.length-1);i>=0;i--) {
replyArray="";
var idLayer = idLayers.split(",");
var isLayerId = false;
for (var xx = 0; xx<idLayer.length; xx++){
if (LayerID==idLayer[xx]) isLayerId = true;
}
if (isLayerId){
if ((mapScaleFactor>=LayerMinScale) &&
(mapScaleFactor<=LayerMaxScale) && (LayerVisible) && (LayerIsFeature)) j =
i;
}
}
replyArray="";
var idLayer = idLayers.split(",");
var isLayerId = false;
for (var xx = 0; xx<idLayer.length; xx++){
if (LayerID==idLayer[xx]) isLayerId = true;
}
if (isLayerId){
if ((mapScaleFactor>=LayerMinScale) &&
(mapScaleFactor<=LayerMaxScale) && (LayerVisible) && (LayerIsFeature)) j =
i;
}
}
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_28531662a288cfd93707pnuX7gVbwonm.jpg)
C.找到doIdentifyAll函数,将下列代码:
CODE:
if (fID < (LayerID.length)) {
if ((mapScaleFactor>=LayerMinScale[fID]) && (mapScaleFactor<=LayerMaxScale[fID]) && (LayerVisible[fID]) && (LayerIsFeature[fID])) {
theString = writeGetFeaturesDrill(idWest,idSouth,idEast,idNorth,fID);
//alert(theString);
sendToServer(imsQueryURL,theString,10);
} else {
doIdentifyAll("");
}
}
if ((mapScaleFactor>=LayerMinScale[fID]) && (mapScaleFactor<=LayerMaxScale[fID]) && (LayerVisible[fID]) && (LayerIsFeature[fID])) {
theString = writeGetFeaturesDrill(idWest,idSouth,idEast,idNorth,fID);
//alert(theString);
sendToServer(imsQueryURL,theString,10);
} else {
doIdentifyAll("");
}
}
改为:
CODE:
if (fID < (LayerID.length)) {
var idLayer = idLayers.split(",");
var isLayerId = false;
for (var xx = 0; xx<idLayer.length; xx++){
if (LayerID[fID]==idLayer[xx]) isLayerId = true;
}
if (isLayerId){
if ((mapScaleFactor>=LayerMinScale[fID]) && (mapScaleFactor<=LayerMaxScale[fID]) && (LayerVisible[fID]) && (LayerIsFeature[fID])) {
theString = writeGetFeaturesDrill(idWest,idSouth,idEast,idNorth,fID);
//alert(theString);
sendToServer(imsQueryURL,theString,10);
}
} else {
doIdentifyAll("");
}
}
var idLayer = idLayers.split(",");
var isLayerId = false;
for (var xx = 0; xx<idLayer.length; xx++){
if (LayerID[fID]==idLayer[xx]) isLayerId = true;
}
if (isLayerId){
if ((mapScaleFactor>=LayerMinScale[fID]) && (mapScaleFactor<=LayerMaxScale[fID]) && (LayerVisible[fID]) && (LayerIsFeature[fID])) {
theString = writeGetFeaturesDrill(idWest,idSouth,idEast,idNorth,fID);
//alert(theString);
sendToServer(imsQueryURL,theString,10);
}
} else {
doIdentifyAll("");
}
}
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_54fe1d3d0d515ef7cbabRWpikBCiMhY5.jpg)
只查看cities, rivers,lakes,country图层
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_8d47bccd9c46b8b48b44WHo4JAJCH3XW.jpg)
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_4b99f53ccd2322e1e3c9chuu7aFAKw0M.jpg)
![](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_c28b68aaa76e47dcf7c2du23Q6yu4UF8.jpg)
![点击在新窗口查看全图
CTRL+鼠标滚轮放大或缩小](http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_37/20071025_8cc22a7d1fe18d957a2eC88Q7iogVNeM.jpg)