ESRI.ADF.UI.MapIdentifyTool = function(element) {
ESRI.ADF.UI.MapIdentifyTool.initializeBase(this);
this.selectedIndex = 0;
this.selectedValue = "";
this._lastExpanded = false;
this._addToResultsLink = "";
this._layerInfo = "";
this._dropDownList = "";
this._identifyIcon = null;
this._waitIcon = null;
this._processing = false;
this._onIdentify = Function.createDelegate(this,function(geom) {
// don't continue if previous call is not finished
if (!this._processing) {
var map = $find("Map1");
this._processing = true;
// remove callout if it already exists
var dropdown = $get("dropdown_" + this.get_id());
if (dropdown!=null) dropdown.style.display = "none";
if (this.identifyMapTips) this.identifyMapTips.dispose();
if(this.identifyMapCallout) {
map.removeGraphic(this.identifyMapCallout);
this.identifyMapCallout.dispose();
}
// put the ajax activity indicator at cursor click and make visible
var mappnt = new ESRI.ADF.Geometries.Point(geom.get_x(), geom.get_y());
scrnpnt = this._map.toScreenPoint(mappnt);
var wicon = $find(this.get_id()+'_waiticon');
if(wicon==null) {
this.waitIcon = $create(ESRI.ADF.Graphics.GraphicFeature,
{"id":this.get_id()+'_waiticon',"geometry":geom,"symbol":new ESRI.ADF.Graphics.MarkerSymbol(this._waitIcon,8,8)
});
this.waitIcon.get_symbol().set_imageFormat("gif");
this.waitIcon.get_symbol().set_width(16);
this.waitIcon.get_symbol().set_height(16);
}
else
this.waitIcon.set_geometry(geom);
map.addGraphic(this.waitIcon);
// make callback for identify
var argument = "mode=identify&coords=" + geom.get_x() + ":" + geom.get_y();
if (document.documentElement.dir=="rtl") argument += "&dir=rtl";
this.doCallback(argument,this);
}
});
arcgisIdentifyTool = this;
};
ESRI.ADF.UI.MapIdentifyTool.prototype = {
startIdentify : function() {
arcgisIdentifyTool = this;
this._processing = false;
this._map.getGeometry(ESRI.ADF.Graphics.ShapeType.Point,this._onIdentify,null,'black','gray','pointer',true);
},
processCallbackResult : function(action,params) {
if(action=="mappoint") {
this.identifyLocation(this._map.get_id(), params[0], params[1], params[2]);
}
else if(action=='error') {
if(this.waitIcon) { map.removeGraphic(this.waitIcon); }
alert("Error: " + params[0]);
Sys.Debug.trace ('Error: '+params[0])
}
},
doCallback : function(argument, context) { ESRI.ADF.System._doCallback(this._callbackFunctionString, this.get_uniqueID(), this.get_id(), argument, context);
}
};
ESRI.ADF.UI.MapIdentifyTool.registerClass('ESRI.ADF.UI.MapIdentifyTool', Sys.Component);
解决方案 »
- jQuery中,某元素载入和更改时需要出发同一操作问题。
- 请问javascript有没有string.IsNullOrEmpty
- script中的src和iframe中的src起冲突致使iframe链接失败
- 求教关于js传递参数?
- pasteHtml改变内容的问题
- div中有个Iframe,Iframe中的页面有个按钮,我怎么实现点击这个按钮来隐藏整个div?
- JS,我都快疯了
- 如何用javascript实现“另存为”的功能的对话框
- 行行好,帮一下。关于javascript中showModalDialog的小问题
- 如何在NETSPACE中播放多个MIDI?
- 这段代码谁知道什么意思,能帮我分析一下吗?
- 求正则表达式
我一直想了解一下,它从客户端进行mapidentify时,获取图中要素的过程,一样,等待高手回答。