var gis = gis || {}; gis.anchored = function() { }; gis.anchored.popup = function(lonlat,data){ //alert(JSON.stringify(data)); //alert(gis.anchored.tohtml(data)); /* data={popupBorder:"1px solid #A5AAB4",width:320,height:155,title:"专题", style:["width:30%","text-align:center;"], data:[['港口名称','南京港'],['港区个数','2'],['锚地个数','2'],['作业区个数','16']]}; */ var chicken=$('#chicken'); chicken.remove(); data=gis.anchored.portinfo({portName:'南京港',portNumber:2,anchorageNumber:2,chanceNumber:16}) var popup = new SuperMap.Popup.Anchored( "chicken", lonlat, new SuperMap.Size(data.width,data.height), gis.anchored.tohtml(data), null, true, null ); popup.setBorder(data.popupBorder||"1px solid #A5AAB4"); //popup.updateSize(); //chicken_contentDiv popup.extdataheight=data.height; return popup; } gis.anchored.popupHtml = function(lonlat,data,toHtml){ var chicken=$('#chicken'); chicken.remove(); var popup = new SuperMap.Popup.Anchored( "chicken", lonlat, new SuperMap.Size(data.width,data.height), toHtml, null, true, null ); popup.setBorder(data.popupBorder||"1px solid #A5AAB4"); //popup.updateSize(); //chicken_contentDiv popup.extdataheight=data.height; return popup; } gis.anchored.addPopup = function(map,popup){ map.addPopup(popup); //$('#chicken_close').css("display","none"); var contentDiv=$('#chicken_contentDiv'); //alert($('#chicken_GroupDiv').width()); contentDiv.css("overflow","visible"); //contentDiv.css("position","absolute"); //contentDiv.css("border","1px solid #A5AAB4"); contentDiv.css("width",$('#chicken_GroupDiv').width());//alert(contentDiv.width()); //alert(contentDiv.width()+"**"+$('#chicken_GroupDiv').width()); var tableDiv=$('.tabledivClass'); //alert($('.titleClass').height()); //tableDiv.css("height",tableDiv.height()); tableDiv.css("height",popup.extdataheight-26); //tableDiv.css("width",contentDiv.width()); /* if($.support&&$.support.leadingWhitespace&&contentDiv.width()==$('#chicken_GroupDiv').width()){ contentDiv.css("width",$('#chicken_GroupDiv').width()-12); //tableDiv.css("height",tableDiv.height()-26); } */ $('.smPopupCloseBox').css("top",2); $('.smPopupCloseBox').css("right",3); $.each($(".altrowstable"), function(i,val){ gis.anchored.tableBeautify.call(this,"#fff","#F5F5F5","#FFFFCC") }); } gis.anchored.tableBeautify = function(oddColor,evenColor,ouseoverColor){ //alert(this);return; if(this){ //var tr=this.getElementsByTagName("tr"); for(var i=0;i"+ouseoverColor); this.style.backgroundColor=ouseoverColor; } /* temptr.onclick=function(){ //alert(this.sectionRowIndex); } */ var tagName_td=temptr.getElementsByTagName("td"); if(tagName_td){ var presentColsAmount=temptr.getElementsByTagName("td").length; if(presentColsAmount&&presentColsAmount>=4){ for(var cc=1;cc").addClass("popupWindow").appendTo($("#result")); var html=new Array(); var nvlval=''; if(data){ if(data.title){ html.push("
"); html.push(data.title); html.push("
"); } if(data.data){ //html.push("
"); html.push("
"); //html.push(data.title);html.push("
"); html.push(""); for(var i=0;i"); for(var j=0;j"); html.push(o[j]); html.push(""); } html.push(""); } html.push("
"); html.push("
"); } } //alert(html.join("")); return html.join(""); } gis.anchored.portinfo = function(data){ var obj={popupBorder:"1px solid #A5AAB4",width:320,height:152,title:"港口信息", style:["width:30%","text-align:center;"], data:[['港口名称',data.portName],['港区个数',data.portNumber],['锚地个数',data.anchorageNumber],['作业区个数',data.chanceNumber]]}; return obj; } gis.anchored.nvlinfo = function(data){ var obj={popupBorder:"1px solid #A5AAB4",width:320,height:155,title:data.poptitle, style:["width:30%","text-align:center;"], data:[['名称',data.portName]]}; return obj; } $(document).ready(function() { });