ÓÐÒ»¸öÑ»·ÔÚIEÉÏÃæ´´½¨Ãæ
for(var iIndex=0;iIndex<100;iIndex++){
var pPoints=getRandPolygon();
var strPoints=pPoints.join(",");
var poly=new Polygon(strPoints,"transparent", 0,0,"transparent");
var pBound =new Polyline(strPoints,"#ff0000", 1,0.7,1);
_MapApp.addOverlay(poly);
var strMsg= " ³¤¶È:"+poly.getLength()+",Ãæ»ý:"+poly.getArea();
poly.data = strMsg ;
poly.boundry = pBound ;
poly.addListener("mouseover",function(e){showtip(poly);});
poly.addListener("mouseout",function(){htm();});
}
Ϊʲôѻ·ÍêÁË ÒÔºóÊó±êmouseover ʵÌåÉÏshowtip Ö´ÐеĶ¼ÊÇ×îºóÒ»¸öpolyµÄÄÚÈÝ????
ÄãÕâ¸öÊÇÔÚÒ»¸öÑ»·Öи³ÖµµÄ£¬ ºóÃæµÄ°ÑÇ°ÃæµÄ¸ø¸²¸ÇÁË
try[
code=JScript]poly.addListener("mouseover",function(e){showtip(poly);});
poly.addListener("mouseout",function(){htm();});
------------
(function(){poly.addListener("mouseover",function(e){showtip(poly);});
poly.addListener("mouseout",function(){htm();});
})();[/code]
ÒýÓà ±Õ°ü¾µäÎÊÌâ¡£¡£¡£ JScript code poly.addListener("mouseover",function(e){showtip(poly);}); //¸ÄΪ poly.addListener("mouseover",function(p){ return function(e){
²úÆ·µÄÅäÖÃÒ³Ãæ¹²ÓÃÒ»¸öÓÃJavaScriptµÄdTreeʵÏÖµÄÊ÷Ðνṹ£¬ÏÔʾµÄʱºò£¬Ê÷Ðνṹ¿¿ÔÚÒ³ÃæµÄ×î×ó±ß£¬¸úÎÒµÄÅäÖÃÒ³ÃæÖмä¸ôÁËÒ»´ó¿é£¬ÏÖÔÚÏë°ÑÊ÷ÐÎĿ¼¾ÓÖУ¬½ô¿¿ÔÚÅäÖÃÄÚÈÝÅԱߣ¬ÈçºÎ¿ØÖÆÊ÷ÐÎĿ¼µÄλÖã¬ÒÔ¼°¿É²»¿ ......
<asp:datagrid id="DataGrid1" runat="server" Width="632px" AutoGenerateColumns="False" OnItemDataBound="DataGrid1_ItemDataBound"> ......