/*创建区,地标矩形*/function Rectangle1(point,content,width,height,border,background,color,marginLeft,marginTop,type){this.point=point;this.content=content;this.width=width;this.height=height;this.border=border;this.background=background;this.color=color;this.marginLeft=marginLeft;this.marginTop=marginTop;this.type=type;}Rectangle1.prototype=new GOverlay();Rectangle1.prototype.initialize=function(map) {var div=document.createElement("div");div.style.border=this.border;/*"1px solid #000000";*/div.style.position="absolute";div.style.width=this.width+"px";if(this.height>0){/*等于0为不指定高度*/div.style.height=this.height+"px";}div.style.background=this.background;/*"#CE0000";*/div.style.font="9pt Arial";div.style.paddingLeft="1px";div.style.paddingRight="1px";div.style.color=this.color;/*"#ffffff";*/div.style.cursor="pointer";/*CreateHtmlNode*/var Element={};Element.CreateHtmlNode=function(tag,htmlString) { var n=document.createElement(tag);n.innerHTML=htmlString;return n;};textDiv=Element.CreateHtmlNode("div",this.content);div.appendChild(textDiv);map.getPane(G_MAP_MAP_PANE).appendChild(div);/*点击关闭图标if(this.type=="landmark"){GEvent.addDomListener(div,"click",function() {map.removeOverlay(publickMarker);})}*/this.map=map;this.div=div;};Rectangle1.prototype.remove=function(){this.div.parentNode.removeChild(this.div);};Rectangle1.prototype.copy=function(){return new Rectangle1(this.point,this.content,this.width,this.height,this.border,this.background,this.color,this.marginLeft,this.marginTop,this.type);};Rectangle1.prototype.redraw=function(force){if (!force){return;}  var c1=this.map.fromLatLngToDivPixel(this.point);  this.div.style.left=(c1.x-1+this.marginLeft) + "px";  this.div.style.top=(c1.y-1-16+this.marginTop) + "px";};/*创建提示矩形*/function Rectangle2(content,width,top,left,background,color,margin){this.content=content;this.width=width;this.top=top;this.left=left;this.background=background;this.color=color;this.margin=margin;}Rectangle2.prototype=new GOverlay();Rectangle2.prototype.initialize=function(map) {var div=document.createElement("div");div.style.border="1px solid #000000";div.style.position="absolute";div.style.width=this.width+"px";div.style.background=this.background;/*"#ffffff";*/div.style.font="9pt Arial";div.style.padding="0px";div.style.color=this.color;/*"#000000";*//*CreateHtmlNode*/var Element={};Element.CreateHtmlNode=function(tag,htmlString) { var n=document.createElement(tag);n.innerHTML=htmlString;return n;};textDiv=Element.CreateHtmlNode("div",this.content);div.appendChild(textDiv);map.getPane(G_MAP_MAP_PANE).appendChild(div);this.map=map;this.div=div;};Rectangle2.prototype.remove=function(){this.div.parentNode.removeChild(this.div);};Rectangle2.prototype.copy=function(){return new Rectangle2(this.content,this.width,this.top,this.left,this.background,this.color,this.margin);};Rectangle2.prototype.redraw=function(){var bounds=this.map.getBounds();var c1=this.map.fromLatLngToDivPixel(bounds.getSouthWest());var c2=this.map.fromLatLngToDivPixel(bounds.getNorthEast());this.div.style.top=(c2.y+this.top)+"px";this.div.style.left=(c1.x+this.left+this.margin)+"px";};/*创建酒店矩形*/function Rectangle3(point,content,width,height,marginLeft,marginTop){this.point=point;this.content=content;this.width=width;this.height=height;this.marginLeft=marginLeft;this.marginTop=marginTop;}Rectangle3.prototype=new GOverlay();Rectangle3.prototype.initialize=function(map) {var div=document.createElement("div");div.style.position="absolute";div.style.width=this.width+"px";div.style.height=this.height+"px";div.style.font="9pt Arial";/*CreateHtmlNode*/var Element={};Element.CreateHtmlNode=function(tag,htmlString) { var n=document.createElement(tag);n.innerHTML=htmlString;return n;};textDiv=Element.CreateHtmlNode("div",this.content);div.appendChild(textDiv);map.getPane(G_MAP_MAP_PANE).appendChild(div);this.map=map;this.div=div;};Rectangle3.prototype.remove=function(){this.div.parentNode.removeChild(this.div);};Rectangle3.prototype.copy=function(){return new Rectangle3(this.point,this.content,this.width,this.height,this.marginLeft,this.marginTop);};Rectangle3.prototype.redraw=function(force){if (!force){return;}  var c1=this.map.fromLatLngToDivPixel(this.point);  this.div.style.left=(c1.x+this.marginLeft) + "px";  this.div.style.top=(c1.y+this.marginTop) + "px";}