var OpenLayers={singleFile:true};
(function(){
var _1=(typeof OpenLayers=="object"&&OpenLayers.singleFile);
window.OpenLayers={_scriptName:(!_1)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){
var _2="";
var _3=OpenLayers._scriptName;
var _4=document.getElementsByTagName("script");
for(var i=0;i<_4.length;i++){
var _6=_4[i].getAttribute("src");
if(_6){
var _7=_6.lastIndexOf(_3);
var _8=_6.lastIndexOf("?");
if(_8<0){
_8=_6.length;
}
if((_7>-1)&&(_7+_3.length==_8)){
_2=_6.slice(0,_8-_3.length);
break;
}
}
}
return _2;
}};
if(!_1){
var _9=new Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js","OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseTypes/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayers/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax.js","OpenLayers/Events.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS.js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","OpenLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCloud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.js","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Polygon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handler/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/Control.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenLayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLayers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/SelectFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Geometry.js","OpenLayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js","OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geometry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineString.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLayers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/GML.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/Text.js","OpenLayers/Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayers/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js","OpenLayers/Layer/WFS.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/NavToolbar.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");
var _a=navigator.userAgent;
var _b=(_a.match("MSIE")||_a.match("Safari"));
if(_b){
var _c=new Array(_9.length);
}
var _d=OpenLayers._getScriptLocation()+"lib/";
for(var i=0;i<_9.length;i++){
if(_b){
_c[i]="<script src='"+_d+_9[i]+"'></script>";
}else{
var s=document.createElement("script");
s.src=_d+_9[i];
var h=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;
h.appendChild(s);
}
}
if(_b){
document.write(_c.join(""));
}
}
})();
OpenLayers.VERSION_NUMBER="$Revision: 6819 $";
OpenLayers.Util={};
OpenLayers.Util.getElement=function(){
var _11=[];
for(var i=0;i<arguments.length;i++){
var _13=arguments[i];
if(typeof _13=="string"){
_13=document.getElementById(_13);
}
if(arguments.length==1){
return _13;
}
_11.push(_13);
}
return _11;
};
if($==null){
var $=OpenLayers.Util.getElement;
}
OpenLayers.Util.extend=function(_14,_15){
if(_14&&_15){
for(var _16 in _15){
var _17=_15[_16];
if(_17!==undefined){
_14[_16]=_17;
}
}
var _18=typeof window.Event=="function"&&_15 instanceof window.Event;
if(!_18&&_15.hasOwnProperty&&_15.hasOwnProperty("toString")){
_14.toString=_15.toString;
}
}
return _14;
};
OpenLayers.Util.removeItem=function(_19,_1a){
for(var i=_19.length-1;i>=0;i--){
if(_19[i]==_1a){
_19.splice(i,1);
}
}
return _19;
};
OpenLayers.Util.clearArray=function(_1c){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"array = []"}));
_1c.length=0;
};
OpenLayers.Util.indexOf=function(_1d,obj){
for(var i=0;i<_1d.length;i++){
if(_1d[i]==obj){
return i;
}
}
return -1;
};
OpenLayers.Util.modifyDOMElement=function(_20,id,px,sz,_24,_25,_26,_27){
if(id){
_20.id=id;
}
if(px){
_20.style.left=px.x+"px";
_20.style.top=px.y+"px";
}
if(sz){
_20.style.width=sz.w+"px";
_20.style.height=sz.h+"px";
}
if(_24){
_20.style.position=_24;
}
if(_25){
_20.style.border=_25;
}
if(_26){
_20.style.overflow=_26;
}
if(parseFloat(_27)>=0&&parseFloat(_27)<1){
_20.style.filter="alpha(opacity="+(_27*100)+")";
_20.style.opacity=_27;
}else{
if(parseFloat(_27)==1){
_20.style.filter="";
_20.style.opacity="";
}
}
};
OpenLayers.Util.createDiv=function(id,px,sz,_2b,_2c,_2d,_2e,_2f){
var dom=document.createElement("div");
if(_2b){
dom.style.backgroundImage="url("+_2b+")";
}
if(!id){
id=OpenLayers.Util.createUniqueID("OpenLayersDiv");
}
if(!_2c){
_2c="absolute";
}
OpenLayers.Util.modifyDOMElement(dom,id,px,sz,_2c,_2d,_2e,_2f);
return dom;
};
OpenLayers.Util.createImage=function(id,px,sz,_34,_35,_36,_37,_38){
var _39=document.createElement("img");
if(!id){
id=OpenLayers.Util.createUniqueID("OpenLayersDiv");
}
if(!_35){
_35="relative";
}
OpenLayers.Util.modifyDOMElement(_39,id,px,sz,_35,_36,null,_37);
if(_38){
_39.style.display="none";
OpenLayers.Event.observe(_39,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,_39));
OpenLayers.Event.observe(_39,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,_39));
}
_39.style.alt=id;
_39.galleryImg="no";
if(_34){
_39.src=_34;
}
return _39;
};
OpenLayers.Util.setOpacity=function(_3a,_3b){
OpenLayers.Util.modifyDOMElement(_3a,null,null,null,null,null,null,_3b);
};
OpenLayers.Util.onImageLoad=function(){
if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){
this.style.backgroundColor=null;
this.style.display="";
}
};
OpenLayers.Util.onImageLoadErrorColor="pink";
OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;
OpenLayers.Util.onImageLoadError=function(){
this._attempts=(this._attempts)?(this._attempts+1):1;
if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){
this.src=this.src;
}else{
this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor;
}
this.style.display="";
};
OpenLayers.Util.alphaHack=function(){
var _3c=navigator.appVersion.split("MSIE");
var _3d=parseFloat(_3c[1]);
var _3e=false;
try{
_3e=!!(document.body.filters);
}
catch(e){
}
return (_3e&&(_3d>=5.5)&&(_3d<7));
};
OpenLayers.Util.modifyAlphaImageDiv=function(div,id,px,sz,_43,_44,_45,_46,_47){
OpenLayers.Util.modifyDOMElement(div,id,px,sz,null,null,null,_47);
var img=div.childNodes[0];
if(_43){
img.src=_43;
}
OpenLayers.Util.modifyDOMElement(img,div.id+"_innerImage",null,sz,"relative",_45);
if(OpenLayers.Util.alphaHack()){
div.style.display="inline-block";
if(_46==null){
_46="scale";
}
div.style.filter="progid:DXImageTransform.Microsoft"+".AlphaImageLoader(src='"+img.src+"', "+"sizingMethod='"+_46+"')";
if(parseFloat(div.style.opacity)>=0&&parseFloat(div.style.opacity)<1){
div.style.filter+=" alpha(opacity="+div.style.opacity*100+")";
}
img.style.filter="alpha(opacity=0)";
}
};
OpenLayers.Util.createAlphaImageDiv=function(id,px,sz,_4c,_4d,_4e,_4f,_50,_51){
var div=OpenLayers.Util.createDiv();
var img=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);
div.appendChild(img);
if(_51){
img.style.display="none";
OpenLayers.Event.observe(img,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,div));
OpenLayers.Event.observe(img,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,div));
}
OpenLayers.Util.modifyAlphaImageDiv(div,id,px,sz,_4c,_4d,_4e,_4f,_50);
return div;
};
OpenLayers.Util.upperCaseObject=function(_54){
var _55={};
for(var key in _54){
_55[key.toUpperCase()]=_54[key];
}
return _55;
};
OpenLayers.Util.applyDefaults=function(to,_58){
var _59=typeof window.Event=="function"&&_58 instanceof window.Event;
for(var key in _58){
if(to[key]===undefined||(!_59&&_58.hasOwnProperty&&_58.hasOwnProperty(key)&&!to.hasOwnProperty(key))){
to[key]=_58[key];
}
}
if(!_59&&_58.hasOwnProperty&&_58.hasOwnProperty("toString")&&!to.hasOwnProperty("toString")){
to.toString=_58.toString;
}
return to;
};
OpenLayers.Util.getParameterString=function(_5b){
var _5c=[];
for(var key in _5b){
var _5e=_5b[key];
if((_5e!=null)&&(typeof _5e!="function")){
var _5f;
if(typeof _5e=="object"&&_5e.constructor==Array){
var _60=[];
for(var _61=0;_61<_5e.length;_61++){
_60.push(encodeURIComponent(_5e[_61]));
}
_5f=_60.join(",");
}else{
_5f=encodeURIComponent(_5e);
}
_5c.push(encodeURIComponent(key)+"="+_5f);
}
}
return _5c.join("&");
};
OpenLayers.ImgPath="";
OpenLayers.Util.getImagesLocation=function(){
return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/");
};
OpenLayers.Util.Try=function(){
var _62=null;
for(var i=0;i<arguments.length;i++){
var _64=arguments[i];
try{
_62=_64();
break;
}
catch(e){
}
}
return _62;
};
OpenLayers.Util.getNodes=function(p,_66){
var _67=OpenLayers.Util.Try(function(){
return OpenLayers.Util._getNodes(p.documentElement.childNodes,_66);
},function(){
return OpenLayers.Util._getNodes(p.childNodes,_66);
});
return _67;
};
OpenLayers.Util._getNodes=function(_68,_69){
var _6a=[];
for(var i=0;i<_68.length;i++){
if(_68[i].nodeName==_69){
_6a.push(_68[i]);
}
}
return _6a;
};
OpenLayers.Util.getTagText=function(_6c,_6d,_6e){
var _6f=OpenLayers.Util.getNodes(_6c,_6d);
if(_6f&&(_6f.length>0)){
if(!_6e){
_6e=0;
}
if(_6f[_6e].childNodes.length>1){
return _6f.childNodes[1].nodeValue;
}else{
if(_6f[_6e].childNodes.length==1){
return _6f[_6e].firstChild.nodeValue;
}
}
}else{
return "";
}
};
OpenLayers.Util.getXmlNodeValue=function(_70){
var val=null;
OpenLayers.Util.Try(function(){
val=_70.text;
if(!val){
val=_70.textContent;
}
if(!val){
val=_70.firstChild.nodeValue;
}
},function(){
val=_70.textContent;
});
return val;
};
OpenLayers.Util.mouseLeft=function(evt,div){
var _74=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;
while(_74!=div&&_74!=null){
_74=_74.parentNode;
}
return (_74!=div);
};
OpenLayers.Util.rad=function(x){
return x*Math.PI/180;
};
OpenLayers.Util.distVincenty=function(p1,p2){
var a=6378137,b=6356752.3142,f=1/298.257223563;
var L=OpenLayers.Util.rad(p2.lon-p1.lon);
var U1=Math.atan((1-f)*Math.tan(OpenLayers.Util.rad(p1.lat)));
var U2=Math.atan((1-f)*Math.tan(OpenLayers.Util.rad(p2.lat)));
var _7e=Math.sin(U1),_7f=Math.cos(U1);
var _80=Math.sin(U2),_81=Math.cos(U2);
var _82=L,_83=2*Math.PI;
var _84=20;
while(Math.abs(_82-_83)>1e-12&&--_84>0){
var _85=Math.sin(_82),_86=Math.cos(_82);
var _87=Math.sqrt((_81*_85)*(_81*_85)+(_7f*_80-_7e*_81*_86)*(_7f*_80-_7e*_81*_86));
if(_87==0){
return 0;
}
var _88=_7e*_80+_7f*_81*_86;
var _89=Math.atan2(_87,_88);
var _8a=Math.asin(_7f*_81*_85/_87);
var _8b=Math.cos(_8a)*Math.cos(_8a);
var _8c=_88-2*_7e*_80/_8b;
var C=f/16*_8b*(4+f*(4-3*_8b));
_83=_82;
_82=L+(1-C)*f*Math.sin(_8a)*(_89+C*_87*(_8c+C*_88*(-1+2*_8c*_8c)));
}
if(_84==0){
return NaN;
}
var uSq=_8b*(a*a-b*b)/(b*b);
var A=1+uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));
var B=uSq/1024*(256+uSq*(-128+uSq*(74-47*uSq)));
var _91=B*_87*(_8c+B/4*(_88*(-1+2*_8c*_8c)-B/6*_8c*(-3+4*_87*_87)*(-3+4*_8c*_8c)));
var s=b*A*(_89-_91);
var d=s.toFixed(3)/1000;
return d;
};
OpenLayers.Util.getParameters=function(url){
url=url||window.location.href;
var _95="";
if(OpenLayers.String.contains(url,"?")){
var _96=url.indexOf("?")+1;
var end=OpenLayers.String.contains(url,"#")?url.indexOf("#"):url.length;
_95=url.substring(_96,end);
}
var _98={};
var _99=_95.split(/[&;]/);
for(var i=0;i<_99.length;++i){
var _9b=_99[i].split("=");
if(_9b[0]){
var key=decodeURIComponent(_9b[0]);
var _9d=_9b[1]||"";
_9d=_9d.split(",");
for(var j=0;j<_9d.length;j++){
_9d[j]=decodeURIComponent(_9d[j]);
}
if(_9d.length==1){
_9d=_9d[0];
}
_98[key]=_9d;
}
}
return _98;
};
OpenLayers.Util.getArgs=function(url){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.Util.getParameters"}));
return OpenLayers.Util.getParameters(url);
};
OpenLayers.Util.lastSeqID=0;
OpenLayers.Util.createUniqueID=function(_a0){
if(_a0==null){
_a0="id_";
}
OpenLayers.Util.lastSeqID+=1;
return _a0+OpenLayers.Util.lastSeqID;
};
OpenLayers.INCHES_PER_UNIT={"inches":1,"ft":12,"mi":63360,"m":39.3701,"km":39370.1,"dd":4374754,"yd":36};
OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;
OpenLayers.INCHES_PER_UNIT["degrees"]=OpenLayers.INCHES_PER_UNIT.dd;
OpenLayers.INCHES_PER_UNIT["nmi"]=1852*OpenLayers.INCHES_PER_UNIT.m;
OpenLayers.DOTS_PER_INCH=72;
OpenLayers.Util.normalizeScale=function(_a1){
var _a2=(_a1>1)?(1/_a1):_a1;
return _a2;
};
OpenLayers.Util.getResolutionFromScale=function(_a3,_a4){
if(_a4==null){
_a4="degrees";
}
var _a5=OpenLayers.Util.normalizeScale(_a3);
var _a6=1/(_a5*OpenLayers.INCHES_PER_UNIT[_a4]*OpenLayers.DOTS_PER_INCH);
return _a6;
};
OpenLayers.Util.getScaleFromResolution=function(_a7,_a8){
if(_a8==null){
_a8="degrees";
}
var _a9=_a7*OpenLayers.INCHES_PER_UNIT[_a8]*OpenLayers.DOTS_PER_INCH;
return _a9;
};
OpenLayers.Util.safeStopPropagation=function(evt){
OpenLayers.Event.stop(evt,true);
};
OpenLayers.Util.pagePosition=function(_ab){
var _ac=0,_ad=0;
var _ae=_ab;
var _af=_ab;
while(_ae){
if(_ae==document.body){
if(_af&&_af.style&&OpenLayers.Element.getStyle(_af,"position")=="absolute"){
break;
}
}
_ac+=_ae.offsetTop||0;
_ad+=_ae.offsetLeft||0;
_af=_ae;
try{
_ae=_ae.offsetParent;
}
catch(e){
OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{"elemId":_ae.id}));
break;
}
}
_ae=_ab;
while(_ae){
_ac-=_ae.scrollTop||0;
_ad-=_ae.scrollLeft||0;
_ae=_ae.parentNode;
}
return [_ad,_ac];
};
OpenLayers.Util.isEquivalentUrl=function(_b0,_b1,_b2){
_b2=_b2||{};
OpenLayers.Util.applyDefaults(_b2,{ignoreCase:true,ignorePort80:true,ignoreHash:true});
var _b3=OpenLayers.Util.createUrlObject(_b0,_b2);
var _b4=OpenLayers.Util.createUrlObject(_b1,_b2);
for(var key in _b3){
if(_b2.test){
alert(key+"\n1:"+_b3[key]+"\n2:"+_b4[key]);
}
var _b6=_b3[key];
var _b7=_b4[key];
switch(key){
case "args":
break;
case "host":
case "port":
case "protocol":
if((_b6=="")||(_b7=="")){
break;
}
default:
if((key!="args")&&(_b3[key]!=_b4[key])){
return false;
}
break;
}
}
for(var key in _b3.args){
if(_b3.args[key]!=_b4.args[key]){
return false;
}
delete _b4.args[key];
}
for(var key in _b4.args){
return false;
}
return true;
};
OpenLayers.Util.createUrlObject=function(url,_b9){
_b9=_b9||{};
var _ba={};
if(_b9.ignoreCase){
url=url.toLowerCase();
}
var a=document.createElement("a");
a.href=url;
_ba.host=a.host;
var _bc=a.port;
if(_bc.length<=0){
var _bd=_ba.host.length-(_bc.length);
_ba.host=_ba.host.substring(0,_bd);
}
_ba.protocol=a.protocol;
_ba.port=((_bc=="80")&&(_b9.ignorePort80))?"":_bc;
_ba.hash=(_b9.ignoreHash)?"":a.hash;
var _be=a.search;
if(!_be){
var _bf=url.indexOf("?");
_be=(_bf!=-1)?url.substr(_bf):"";
}
_ba.args=OpenLayers.Util.getParameters(_be);
if(((_ba.protocol=="file:")&&(url.indexOf("file:")!=-1))||((_ba.protocol!="file:")&&(_ba.host!=""))){
_ba.pathname=a.pathname;
var _c0=_ba.pathname.indexOf("?");
if(_c0!=-1){
_ba.pathname=_ba.pathname.substring(0,_c0);
}
}else{
var _c1=OpenLayers.Util.removeTail(url);
var _c2=0;
do{
var _c3=_c1.indexOf("../");
if(_c3==0){
_c2++;
_c1=_c1.substr(3);
}else{
if(_c3>=0){
var _c4=_c1.substr(0,_c3-1);
var _c5=_c4.indexOf("/");
_c4=(_c5!=-1)?_c4.substr(0,_c5+1):"";
var _c6=_c1.substr(_c3+3);
_c1=_c4+_c6;
}
}
}while(_c3!=-1);
var _c7=document.createElement("a");
var _c8=window.location.href;
if(_b9.ignoreCase){
_c8=_c8.toLowerCase();
}
_c7.href=_c8;
_ba.protocol=_c7.protocol;
var _c9=(_c7.pathname.indexOf("/")!=-1)?"/":"\\";
var _ca=_c7.pathname.split(_c9);
_ca.pop();
while((_c2>0)&&(_ca.length>0)){
_ca.pop();
_c2--;
}
_c1=_ca.join("/")+"/"+_c1;
_ba.pathname=_c1;
}
if((_ba.protocol=="file:")||(_ba.protocol=="")){
_ba.host="localhost";
}
return _ba;
};
OpenLayers.Util.removeTail=function(url){
var _cc=null;
var _cd=url.indexOf("?");
var _ce=url.indexOf("#");
if(_cd==-1){
_cc=(_ce!=-1)?url.substr(0,_ce):url;
}else{
_cc=(_ce!=-1)?url.substr(0,Math.min(_cd,_ce)):url.substr(0,_cd);
}
return _cc;
};
OpenLayers.Util.getBrowserName=function(){
var _cf="";
var ua=navigator.userAgent.toLowerCase();
if(ua.indexOf("opera")!=-1){
_cf="opera";
}else{
if(ua.indexOf("msie")!=-1){
_cf="msie";
}else{
if(ua.indexOf("safari")!=-1){
_cf="safari";
}else{
if(ua.indexOf("mozilla")!=-1){
if(ua.indexOf("firefox")!=-1){
_cf="firefox";
}else{
_cf="mozilla";
}
}
}
}
}
return _cf;
};
OpenLayers.Util.getRenderedDimensions=function(_d1,_d2){
var w=h=null;
var _d4=document.createElement("div");
_d4.style.overflow="";
_d4.style.position="absolute";
_d4.style.left="-9999px";
if(_d2){
if(_d2.w){
w=_d4.style.width=_d2.w;
}else{
if(_d2.h){
h=_d4.style.height=_d2.h;
}
}
}
var _d5=document.createElement("div");
_d5.innerHTML=_d1;
_d4.appendChild(_d5);
document.body.appendChild(_d4);
if(!w){
w=parseInt(_d5.scrollWidth);
_d4.style.width=w+"px";
}
if(!h){
h=parseInt(_d5.scrollHeight);
}
_d4.removeChild(_d5);
document.body.removeChild(_d4);
return new OpenLayers.Size(w,h);
};
OpenLayers.Util.getScrollbarWidth=function(){
var _d6=OpenLayers.Util._scrollbarWidth;
if(_d6==null){
var scr=null;
var inn=null;
var _d9=0;
var _da=0;
scr=document.createElement("div");
scr.style.position="absolute";
scr.style.top="-1000px";
scr.style.left="-1000px";
scr.style.width="100px";
scr.style.height="50px";
scr.style.overflow="hidden";
inn=document.createElement("div");
inn.style.width="100%";
inn.style.height="200px";
scr.appendChild(inn);
document.body.appendChild(scr);
_d9=inn.offsetWidth;
scr.style.overflow="scroll";
_da=inn.offsetWidth;
document.body.removeChild(document.body.lastChild);
OpenLayers.Util._scrollbarWidth=(_d9-_da);
_d6=OpenLayers.Util._scrollbarWidth;
}
return _d6;
};
OpenLayers.String={startsWith:function(str,sub){
return (str.indexOf(sub)==0);
},contains:function(str,sub){
return (str.indexOf(sub)!=-1);
},trim:function(str){
return str.replace(/^\s*(.*?)\s*$/,"$1");
},camelize:function(str){
var _e1=str.split("-");
var _e2=_e1[0];
for(var i=1;i<_e1.length;i++){
var s=_e1[i];
_e2+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _e2;
},format:function(_e5,_e6,_e7){
if(!_e6){
_e6=window;
}
var _e8=_e5.split("${");
var _e9,_ea,_eb;
for(var i=1;i<_e8.length;i++){
_e9=_e8[i];
_ea=_e9.indexOf("}");
if(_ea>0){
_eb=_e6[_e9.substring(0,_ea)];
if(typeof _eb=="function"){
_eb=_e7?_eb.apply(null,_e7):_eb();
}
_e8[i]=_eb+_e9.substring(++_ea);
}else{
_e8[i]="${"+_e9;
}
}
return _e8.join("");
}};
if(!String.prototype.startsWith){
String.prototype.startsWith=function(_ed){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.String.startsWith"}));
return OpenLayers.String.startsWith(this,_ed);
};
}
if(!String.prototype.contains){
String.prototype.contains=function(str){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.String.contains"}));
return OpenLayers.String.contains(this,str);
};
}
if(!String.prototype.trim){
String.prototype.trim=function(){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.String.trim"}));
return OpenLayers.String.trim(this);
};
}
if(!String.prototype.camelize){
String.prototype.camelize=function(){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.String.camelize"}));
return OpenLayers.String.camelize(this);
};
}
OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(num,sig){
var fig=0;
if(sig>0){
fig=parseFloat(num.toPrecision(sig));
}
return fig;
},format:function(num,dec,_f4,_f5){
dec=(typeof dec!="undefined")?dec:0;
_f4=(typeof _f4!="undefined")?_f4:OpenLayers.Number.thousandsSeparator;
_f5=(typeof _f5!="undefined")?_f5:OpenLayers.Number.decimalSeparator;
if(dec!=null){
num=parseFloat(num.toFixed(dec));
}
var _f6=num.toString().split(".");
if(_f6.length==1&&dec==null){
dec=0;
}
var _f7=_f6[0];
if(_f4){
var _f8=/(-?[0-9]+)([0-9]{3})/;
while(_f8.test(_f7)){
_f7=_f7.replace(_f8,"$1"+_f4+"$2");
}
}
var str;
if(dec==0){
str=_f7;
}else{
var rem=_f6.length>1?_f6[1]:"0";
if(dec!=null){
rem=rem+new Array(dec-rem.length+1).join("0");
}
str=_f7+_f5+rem;
}
return str;
}};
if(!Number.prototype.limitSigDigs){
Number.prototype.limitSigDigs=function(sig){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.String.limitSigDigs"}));
return OpenLayers.Number.limitSigDigs(this,sig);
};
}
OpenLayers.Function={bind:function(_fc,_fd){
var _fe=Array.prototype.slice.apply(arguments,[2]);
return function(){
var _ff=_fe.concat(Array.prototype.slice.apply(arguments,[0]));
return _fc.apply(_fd,_ff);
};
},bindAsEventListener:function(func,_101){
return function(_102){
return func.call(_101,_102||window.event);
};
}};
if(!Function.prototype.bind){
Function.prototype.bind=function(){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.String.bind"}));
Array.prototype.unshift.apply(arguments,[this]);
return OpenLayers.Function.bind.apply(null,arguments);
};
}
if(!Function.prototype.bindAsEventListener){
Function.prototype.bindAsEventListener=function(_103){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.String.bindAsEventListener"}));
return OpenLayers.Function.bindAsEventListener(this,_103);
};
}
OpenLayers.Array={filter:function(_104,_105,_106){
var _107=[];
if(Array.prototype.filter){
_107=_104.filter(_105,_106);
}else{
var len=_104.length;
if(typeof _105!="function"){
throw new TypeError();
}
for(var i=0;i<len;i++){
if(i in _104){
var val=_104[i];
if(_105.call(_106,val,i,_104)){
_107.push(val);
}
}
}
}
return _107;
}};
OpenLayers.Class=function(){
var _10b=function(){
if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){
this.initialize.apply(this,arguments);
}
};
var _10c={};
var _10d;
for(var i=0;i<arguments.length;++i){
if(typeof arguments[i]=="function"){
_10d=arguments[i].prototype;
}else{
_10d=arguments[i];
}
OpenLayers.Util.extend(_10c,_10d);
}
_10b.prototype=_10c;
return _10b;
};
OpenLayers.Class.isPrototype=function(){
};
OpenLayers.Class.create=function(){
return function(){
if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){
this.initialize.apply(this,arguments);
}
};
};
OpenLayers.Class.inherit=function(){
var _10f=arguments[0];
var _110=new _10f(OpenLayers.Class.isPrototype);
for(var i=1;i<arguments.length;i++){
if(typeof arguments[i]=="function"){
var _112=arguments[i];
arguments[i]=new _112(OpenLayers.Class.isPrototype);
}
OpenLayers.Util.extend(_110,arguments[i]);
}
return _110;
};
OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,initialize:function(left,_114,_115,top){
if(left!=null){
this.left=parseFloat(left);
}
if(_114!=null){
this.bottom=parseFloat(_114);
}
if(_115!=null){
this.right=parseFloat(_115);
}
if(top!=null){
this.top=parseFloat(top);
}
},clone:function(){
return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top);
},equals:function(_117){
var _118=false;
if(_117!=null){
_118=((this.left==_117.left)&&(this.right==_117.right)&&(this.top==_117.top)&&(this.bottom==_117.bottom));
}
return _118;
},toString:function(){
return ("left-bottom=("+this.left+","+this.bottom+")"+" right-top=("+this.right+","+this.top+")");
},toArray:function(){
return [this.left,this.bottom,this.right,this.top];
},toBBOX:function(_119){
if(_119==null){
_119=6;
}
var mult=Math.pow(10,_119);
var bbox=Math.round(this.left*mult)/mult+","+Math.round(this.bottom*mult)/mult+","+Math.round(this.right*mult)/mult+","+Math.round(this.top*mult)/mult;
return bbox;
},toGeometry:function(){
return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])]);
},getWidth:function(){
return (this.right-this.left);
},getHeight:function(){
return (this.top-this.bottom);
},getSize:function(){
return new OpenLayers.Size(this.getWidth(),this.getHeight());
},getCenterPixel:function(){
return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2);
},getCenterLonLat:function(){
return new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2);
},add:function(x,y){
if((x==null)||(y==null)){
var msg=OpenLayers.i18n("boundsAddError");
OpenLayers.Console.error(msg);
return null;
}
return new OpenLayers.Bounds(this.left+x,this.bottom+y,this.right+x,this.top+y);
},extend:function(_11f){
var _120=null;
if(_11f){
switch(_11f.CLASS_NAME){
case "OpenLayers.LonLat":
_120=new OpenLayers.Bounds(_11f.lon,_11f.lat,_11f.lon,_11f.lat);
break;
case "OpenLayers.Geometry.Point":
_120=new OpenLayers.Bounds(_11f.x,_11f.y,_11f.x,_11f.y);
break;
case "OpenLayers.Bounds":
_120=_11f;
break;
}
if(_120){
if((this.left==null)||(_120.left<this.left)){
this.left=_120.left;
}
if((this.bottom==null)||(_120.bottom<this.bottom)){
this.bottom=_120.bottom;
}
if((this.right==null)||(_120.right>this.right)){
this.right=_120.right;
}
if((this.top==null)||(_120.top>this.top)){
this.top=_120.top;
}
}
}
},containsLonLat:function(ll,_122){
return this.contains(ll.lon,ll.lat,_122);
},containsPixel:function(px,_124){
return this.contains(px.x,px.y,_124);
},contains:function(x,y,_127){
if(_127==null){
_127=true;
}
var _128=false;
if(_127){
_128=((x>=this.left)&&(x<=this.right)&&(y>=this.bottom)&&(y<=this.top));
}else{
_128=((x>this.left)&&(x<this.right)&&(y>this.bottom)&&(y<this.top));
}
return _128;
},intersectsBounds:function(_129,_12a){
if(_12a==null){
_12a=true;
}
var _12b=(_129.bottom==this.bottom&&_129.top==this.top)?true:(((_129.bottom>this.bottom)&&(_129.bottom<this.top))||((this.bottom>_129.bottom)&&(this.bottom<_129.top)));
var _12c=(_129.bottom==this.bottom&&_129.top==this.top)?true:(((_129.top>this.bottom)&&(_129.top<this.top))||((this.top>_129.bottom)&&(this.top<_129.top)));
var _12d=(_129.right==this.right&&_129.left==this.left)?true:(((_129.right>this.left)&&(_129.right<this.right))||((this.right>_129.left)&&(this.right<_129.right)));
var _12e=(_129.right==this.right&&_129.left==this.left)?true:(((_129.left>this.left)&&(_129.left<this.right))||((this.left>_129.left)&&(this.left<_129.right)));
return (this.containsBounds(_129,true,_12a)||_129.containsBounds(this,true,_12a)||((_12c||_12b)&&(_12e||_12d)));
},containsBounds:function(_12f,_130,_131){
if(_130==null){
_130=false;
}
if(_131==null){
_131=true;
}
var _132;
var _133;
var _134;
var _135;
if(_131){
_132=(_12f.left>=this.left)&&(_12f.left<=this.right);
_133=(_12f.top>=this.bottom)&&(_12f.top<=this.top);
_134=(_12f.right>=this.left)&&(_12f.right<=this.right);
_135=(_12f.bottom>=this.bottom)&&(_12f.bottom<=this.top);
}else{
_132=(_12f.left>this.left)&&(_12f.left<this.right);
_133=(_12f.top>this.bottom)&&(_12f.top<this.top);
_134=(_12f.right>this.left)&&(_12f.right<this.right);
_135=(_12f.bottom>this.bottom)&&(_12f.bottom<this.top);
}
return (_130)?(_133||_135)&&(_132||_134):(_133&&_132&&_135&&_134);
},determineQuadrant:function(_136){
var _137="";
var _138=this.getCenterLonLat();
_137+=(_136.lat<_138.lat)?"b":"t";
_137+=(_136.lon<_138.lon)?"l":"r";
return _137;
},transform:function(_139,dest){
var ll=OpenLayers.Projection.transform({"x":this.left,"y":this.bottom},_139,dest);
var lr=OpenLayers.Projection.transform({"x":this.right,"y":this.bottom},_139,dest);
var ul=OpenLayers.Projection.transform({"x":this.left,"y":this.top},_139,dest);
var ur=OpenLayers.Projection.transform({"x":this.right,"y":this.top},_139,dest);
this.left=Math.min(ll.x,ul.x);
this.bottom=Math.min(ll.y,lr.y);
this.right=Math.max(lr.x,ur.x);
this.top=Math.max(ul.y,ur.y);
return this;
},wrapDateLine:function(_13f,_140){
_140=_140||{};
var _141=_140.leftTolerance||0;
var _142=_140.rightTolerance||0;
var _143=this.clone();
if(_13f){
while(_143.left<_13f.left&&(_143.right-_142)<=_13f.left){
_143=_143.add(_13f.getWidth(),0);
}
while((_143.left+_141)>=_13f.right&&_143.right>_13f.right){
_143=_143.add(-_13f.getWidth(),0);
}
}
return _143;
},CLASS_NAME:"OpenLayers.Bounds"});
OpenLayers.Bounds.fromString=function(str){
var _145=str.split(",");
return OpenLayers.Bounds.fromArray(_145);
};
OpenLayers.Bounds.fromArray=function(bbox){
return new OpenLayers.Bounds(parseFloat(bbox[0]),parseFloat(bbox[1]),parseFloat(bbox[2]),parseFloat(bbox[3]));
};
OpenLayers.Bounds.fromSize=function(size){
return new OpenLayers.Bounds(0,size.h,size.w,0);
};
OpenLayers.Bounds.oppositeQuadrant=function(_148){
var opp="";
opp+=(_148.charAt(0)=="t")?"b":"t";
opp+=(_148.charAt(1)=="l")?"r":"l";
return opp;
};
OpenLayers.Element={visible:function(_14a){
return OpenLayers.Util.getElement(_14a).style.display!="none";
},toggle:function(){
for(var i=0;i<arguments.length;i++){
var _14c=OpenLayers.Util.getElement(arguments[i]);
var _14d=OpenLayers.Element.visible(_14c)?"hide":"show";
OpenLayers.Element[_14d](_14c);
}
},hide:function(){
for(var i=0;i<arguments.length;i++){
var _14f=OpenLayers.Util.getElement(arguments[i]);
_14f.style.display="none";
}
},show:function(){
for(var i=0;i<arguments.length;i++){
var _151=OpenLayers.Util.getElement(arguments[i]);
_151.style.display="";
}
},remove:function(_152){
_152=OpenLayers.Util.getElement(_152);
_152.parentNode.removeChild(_152);
},getHeight:function(_153){
_153=OpenLayers.Util.getElement(_153);
return _153.offsetHeight;
},getDimensions:function(_154){
_154=OpenLayers.Util.getElement(_154);
if(OpenLayers.Element.getStyle(_154,"display")!="none"){
return {width:_154.offsetWidth,height:_154.offsetHeight};
}
var els=_154.style;
var _156=els.visibility;
var _157=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _158=_154.clientWidth;
var _159=_154.clientHeight;
els.display="none";
els.position=_157;
els.visibility=_156;
return {width:_158,height:_159};
},getStyle:function(_15a,_15b){
_15a=OpenLayers.Util.getElement(_15a);
var _15c=_15a.style[OpenLayers.String.camelize(_15b)];
if(!_15c){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_15a,null);
_15c=css?css.getPropertyValue(_15b):null;
}else{
if(_15a.currentStyle){
_15c=_15a.currentStyle[OpenLayers.String.camelize(_15b)];
}
}
}
var _15e=["left","top","right","bottom"];
if(window.opera&&(OpenLayers.Util.indexOf(_15e,_15b)!=-1)&&(OpenLayers.Element.getStyle(_15a,"position")=="static")){
_15c="auto";
}
return _15c=="auto"?null:_15c;
}};
OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(lon,lat){
this.lon=parseFloat(lon);
this.lat=parseFloat(lat);
},toString:function(){
return ("lon="+this.lon+",lat="+this.lat);
},toShortString:function(){
return (this.lon+", "+this.lat);
},clone:function(){
return new OpenLayers.LonLat(this.lon,this.lat);
},add:function(lon,lat){
if((lon==null)||(lat==null)){
var msg=OpenLayers.i18n("lonlatAddError");
OpenLayers.Console.error(msg);
return null;
}
return new OpenLayers.LonLat(this.lon+lon,this.lat+lat);
},equals:function(ll){
var _165=false;
if(ll!=null){
_165=((this.lon==ll.lon&&this.lat==ll.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(ll.lon)&&isNaN(ll.lat)));
}
return _165;
},transform:function(_166,dest){
var _168=OpenLayers.Projection.transform({"x":this.lon,"y":this.lat},_166,dest);
this.lon=_168.x;
this.lat=_168.y;
return this;
},wrapDateLine:function(_169){
var _16a=this.clone();
if(_169){
while(_16a.lon<_169.left){
_16a.lon+=_169.getWidth();
}
while(_16a.lon>_169.right){
_16a.lon-=_169.getWidth();
}
}
return _16a;
},CLASS_NAME:"OpenLayers.LonLat"});
OpenLayers.LonLat.fromString=function(str){
var pair=str.split(",");
return new OpenLayers.LonLat(parseFloat(pair[0]),parseFloat(pair[1]));
};
OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(x,y){
this.x=parseFloat(x);
this.y=parseFloat(y);
},toString:function(){
return ("x="+this.x+",y="+this.y);
},clone:function(){
return new OpenLayers.Pixel(this.x,this.y);
},equals:function(px){
var _170=false;
if(px!=null){
_170=((this.x==px.x&&this.y==px.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(px.x)&&isNaN(px.y)));
}
return _170;
},add:function(x,y){
if((x==null)||(y==null)){
var msg=OpenLayers.i18n("pixelAddError");
OpenLayers.Console.error(msg);
return null;
}
return new OpenLayers.Pixel(this.x+x,this.y+y);
},offset:function(px){
var _175=this.clone();
if(px){
_175=this.add(px.x,px.y);
}
return _175;
},CLASS_NAME:"OpenLayers.Pixel"});
OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(w,h){
this.w=parseFloat(w);
this.h=parseFloat(h);
},toString:function(){
return ("w="+this.w+",h="+this.h);
},clone:function(){
return new OpenLayers.Size(this.w,this.h);
},equals:function(sz){
var _179=false;
if(sz!=null){
_179=((this.w==sz.w&&this.h==sz.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(sz.w)&&isNaN(sz.h)));
}
return _179;
},CLASS_NAME:"OpenLayers.Size"});
OpenLayers.Console={log:function(){
},debug:function(){
},info:function(){
},warn:function(){
},error:function(){
},assert:function(){
},dir:function(){
},dirxml:function(){
},trace:function(){
},group:function(){
},groupEnd:function(){
},time:function(){
},timeEnd:function(){
},profile:function(){
},profileEnd:function(){
},count:function(){
},CLASS_NAME:"OpenLayers.Console"};
(function(){
if(window.console){
var _17a=document.getElementsByTagName("script");
for(var i=0;i<_17a.length;++i){
if(_17a[i].src.indexOf("firebug.js")!=-1){
OpenLayers.Util.extend(OpenLayers.Console,console);
break;
}
}
}
})();
OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:false,initialize:function(_17c){
this.easing=(_17c)?_17c:OpenLayers.Easing.Expo.easeOut;
},start:function(_17d,_17e,_17f,_180){
this.playing=true;
this.begin=_17d;
this.finish=_17e;
this.duration=_17f;
this.callbacks=_180.callbacks;
this.time=0;
if(this.interval){
window.clearInterval(this.interval);
this.interval=null;
}
if(this.callbacks&&this.callbacks.start){
this.callbacks.start.call(this,this.begin);
}
this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL);
},stop:function(){
if(!this.playing){
return;
}
if(this.callbacks&&this.callbacks.done){
this.callbacks.done.call(this,this.finish);
}
window.clearInterval(this.interval);
this.interval=null;
this.playing=false;
},play:function(){
var _181={};
for(var i in this.begin){
var b=this.begin[i];
var f=this.finish[i];
if(b==null||f==null||isNaN(b)||isNaN(f)){
OpenLayers.Console.error("invalid value for Tween");
}
var c=f-b;
_181[i]=this.easing.apply(this,[this.time,b,c,this.duration]);
}
this.time++;
if(this.callbacks&&this.callbacks.eachStep){
this.callbacks.eachStep.call(this,_181);
}
if(this.time>this.duration){
if(this.callbacks&&this.callbacks.done){
this.callbacks.done.call(this,this.finish);
this.playing=false;
}
window.clearInterval(this.interval);
this.interval=null;
}
},CLASS_NAME:"OpenLayers.Tween"});
OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};
OpenLayers.Easing.Linear={easeIn:function(t,b,c,d){
return c*t/d+b;
},easeOut:function(t,b,c,d){
return c*t/d+b;
},easeInOut:function(t,b,c,d){
return c*t/d+b;
},CLASS_NAME:"OpenLayers.Easing.Linear"};
OpenLayers.Easing.Expo={easeIn:function(t,b,c,d){
return (t==0)?b:c*Math.pow(2,10*(t/d-1))+b;
},easeOut:function(t,b,c,d){
return (t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;
},easeInOut:function(t,b,c,d){
if(t==0){
return b;
}
if(t==d){
return b+c;
}
if((t/=d/2)<1){
return c/2*Math.pow(2,10*(t-1))+b;
}
return c/2*(-Math.pow(2,-10*--t)+2)+b;
},CLASS_NAME:"OpenLayers.Easing.Expo"};
OpenLayers.Easing.Quad={easeIn:function(t,b,c,d){
return c*(t/=d)*t+b;
},easeOut:function(t,b,c,d){
return -c*(t/=d)*(t-2)+b;
},easeInOut:function(t,b,c,d){
if((t/=d/2)<1){
return c/2*t*t+b;
}
return -c/2*((--t)*(t-2)-1)+b;
},CLASS_NAME:"OpenLayers.Easing.Quad"};
OpenLayers.ProxyHost="";
OpenLayers.nullHandler=function(_1aa){
alert(OpenLayers.i18n("unhandledRequest",{"statusText":_1aa.statusText}));
};
OpenLayers.loadURL=function(uri,_1ac,_1ad,_1ae,_1af){
var _1b0=(_1ae)?OpenLayers.Function.bind(_1ae,_1ad):OpenLayers.nullHandler;
var _1b1=(_1af)?OpenLayers.Function.bind(_1af,_1ad):OpenLayers.nullHandler;
var _1b2=new OpenLayers.Ajax.Request(uri,{method:"get",parameters:_1ac,onComplete:_1b0,onFailure:_1b1});
return _1b2.transport;
};
OpenLayers.parseXMLString=function(text){
var _1b4=text.indexOf("<");
if(_1b4>0){
text=text.substring(_1b4);
}
var _1b5=OpenLayers.Util.Try(function(){
var _1b6=new ActiveXObject("Microsoft.XMLDOM");
_1b6.loadXML(text);
return _1b6;
},function(){
return new DOMParser().parseFromString(text,"text/xml");
},function(){
var req=new XMLHttpRequest();
req.open("GET","data:"+"text/xml"+";charset=utf-8,"+encodeURIComponent(text),false);
if(req.overrideMimeType){
req.overrideMimeType("text/xml");
}
req.send(null);
return req.responseXML;
});
return _1b5;
};
OpenLayers.Ajax={emptyFunction:function(){
},getTransport:function(){
return OpenLayers.Util.Try(function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
})||false;
},activeRequestCount:0};
OpenLayers.Ajax.Responders={responders:[],register:function(_1b8){
for(var i=0;i<this.responders.length;i++){
if(_1b8==this.responders[i]){
return;
}
}
this.responders.push(_1b8);
},unregister:function(_1ba){
OpenLayers.Util.removeItem(this.reponders,_1ba);
},dispatch:function(_1bb,_1bc,_1bd){
var _1be;
for(var i=0;i<this.responders.length;i++){
_1be=this.responders[i];
if(_1be[_1bb]&&typeof _1be[_1bb]=="function"){
try{
_1be[_1bb].apply(_1be,[_1bc,_1bd]);
}
catch(e){
}
}
}
}};
OpenLayers.Ajax.Responders.register({onCreate:function(){
OpenLayers.Ajax.activeRequestCount++;
},onComplete:function(){
OpenLayers.Ajax.activeRequestCount--;
}});
OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(_1c0){
this.options={method:"post",asynchronous:true,contentType:"application/xml",parameters:""};
OpenLayers.Util.extend(this.options,_1c0||{});
this.options.method=this.options.method.toLowerCase();
if(typeof this.options.parameters=="string"){
this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters);
}
}});
OpenLayers.Ajax.Request=OpenLayers.Class(OpenLayers.Ajax.Base,{_complete:false,initialize:function(url,_1c2){
OpenLayers.Ajax.Base.prototype.initialize.apply(this,[_1c2]);
if(OpenLayers.ProxyHost&&OpenLayers.String.startsWith(url,"http")){
url=OpenLayers.ProxyHost+encodeURIComponent(url);
}
this.transport=OpenLayers.Ajax.getTransport();
this.request(url);
},request:function(url){
this.url=url;
this.method=this.options.method;
var _1c4=OpenLayers.Util.extend({},this.options.parameters);
if(this.method!="get"&&this.method!="post"){
_1c4["_method"]=this.method;
this.method="post";
}
this.parameters=_1c4;
if(_1c4=OpenLayers.Util.getParameterString(_1c4)){
if(this.method=="get"){
this.url+=((this.url.indexOf("?")>-1)?"&":"?")+_1c4;
}else{
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
_1c4+="&_=";
}
}
}
try{
var _1c5=new OpenLayers.Ajax.Response(this);
if(this.options.onCreate){
this.options.onCreate(_1c5);
}
OpenLayers.Ajax.Responders.dispatch("onCreate",this,_1c5);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){
window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10);
}
this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);
this.setRequestHeaders();
this.body=this.method=="post"?(this.options.postBody||_1c4):null;
this.transport.send(this.body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},onStateChange:function(){
var _1c6=this.transport.readyState;
if(_1c6>1&&!((_1c6==4)&&this._complete)){
this.respondToReadyState(this.transport.readyState);
}
},setRequestHeaders:function(){
var _1c7={"X-Requested-With":"XMLHttpRequest","Accept":"text/javascript, text/html, application/xml, text/xml, */*","OpenLayers":true};
if(this.method=="post"){
_1c7["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){
_1c7["Connection"]="close";
}
}
if(typeof this.options.requestHeaders=="object"){
var _1c8=this.options.requestHeaders;
if(typeof _1c8.push=="function"){
for(var i=0,_1ca=_1c8.length;i<_1ca;i+=2){
_1c7[_1c8[i]]=_1c8[i+1];
}
}else{
for(var i in _1c8){
_1c7[i]=pair[i];
}
}
}
for(var name in _1c7){
this.transport.setRequestHeader(name,_1c7[name]);
}
},success:function(){
var _1cc=this.getStatus();
return !_1cc||(_1cc>=200&&_1cc<300);
},getStatus:function(){
try{
return this.transport.status||0;
}
catch(e){
return 0;
}
},respondToReadyState:function(_1cd){
var _1ce=OpenLayers.Ajax.Request.Events[_1cd];
var _1cf=new OpenLayers.Ajax.Response(this);
if(_1ce=="Complete"){
try{
this._complete=true;
(this.options["on"+_1cf.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(_1cf);
}
catch(e){
this.dispatchException(e);
}
var _1d0=_1cf.getHeader("Content-type");
}
try{
(this.options["on"+_1ce]||OpenLayers.Ajax.emptyFunction)(_1cf);
OpenLayers.Ajax.Responders.dispatch("on"+_1ce,this,_1cf);
}
catch(e){
this.dispatchException(e);
}
if(_1ce=="Complete"){
this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction;
}
},getHeader:function(name){
try{
return this.transport.getResponseHeader(name);
}
catch(e){
return null;
}
},dispatchException:function(_1d2){
var _1d3=this.options.onException;
if(_1d3){
_1d3(this,_1d2);
OpenLayers.Ajax.Responders.dispatch("onException",this,_1d2);
}else{
var _1d4=false;
var _1d5=OpenLayers.Ajax.Responders.responders;
for(var i=0;i<_1d5.length;i++){
if(_1d5[i].onException){
_1d4=true;
break;
}
}
if(_1d4){
OpenLayers.Ajax.Responders.dispatch("onException",this,_1d2);
}else{
throw _1d2;
}
}
}});
OpenLayers.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:"",initialize:function(_1d7){
this.request=_1d7;
var _1d8=this.transport=_1d7.transport,_1d9=this.readyState=_1d8.readyState;
if((_1d9>2&&!(!!(window.attachEvent&&!window.opera)))||_1d9==4){
this.status=this.getStatus();
this.statusText=this.getStatusText();
this.responseText=_1d8.responseText==null?"":String(_1d8.responseText);
}
if(_1d9==4){
var xml=_1d8.responseXML;
this.responseXML=xml===undefined?null:xml;
}
},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){
try{
return this.transport.statusText||"";
}
catch(e){
return "";
}
},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(name){
return this.transport.getResponseHeader(name);
}});
OpenLayers.Ajax.getElementsByTagNameNS=function(_1dc,_1dd,_1de,_1df){
var elem=null;
if(_1dc.getElementsByTagNameNS){
elem=_1dc.getElementsByTagNameNS(_1dd,_1df);
}else{
elem=_1dc.getElementsByTagName(_1de+":"+_1df);
}
return elem;
};
OpenLayers.Ajax.serializeXMLToString=function(_1e1){
var _1e2=new XMLSerializer();
var data=_1e2.serializeToString(_1e1);
return data;
};
OpenLayers.Event={observers:false,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(_1e4){
return _1e4.target||_1e4.srcElement;
},isLeftClick:function(_1e5){
return (((_1e5.which)&&(_1e5.which==1))||((_1e5.button)&&(_1e5.button==1)));
},stop:function(_1e6,_1e7){
if(!_1e7){
if(_1e6.preventDefault){
_1e6.preventDefault();
}else{
_1e6.returnValue=false;
}
}
if(_1e6.stopPropagation){
_1e6.stopPropagation();
}else{
_1e6.cancelBubble=true;
}
},findElement:function(_1e8,_1e9){
var _1ea=OpenLayers.Event.element(_1e8);
while(_1ea.parentNode&&(!_1ea.tagName||(_1ea.tagName.toUpperCase()!=_1e9.toUpperCase()))){
_1ea=_1ea.parentNode;
}
return _1ea;
},observe:function(_1eb,name,_1ed,_1ee){
var _1ef=OpenLayers.Util.getElement(_1eb);
_1ee=_1ee||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1ef.attachEvent)){
name="keydown";
}
if(!this.observers){
this.observers={};
}
if(!_1ef._eventCacheID){
var _1f0="eventCacheID_";
if(_1ef.id){
_1f0=_1ef.id+"_"+_1f0;
}
_1ef._eventCacheID=OpenLayers.Util.createUniqueID(_1f0);
}
var _1f1=_1ef._eventCacheID;
if(!this.observers[_1f1]){
this.observers[_1f1]=[];
}
this.observers[_1f1].push({"element":_1ef,"name":name,"observer":_1ed,"useCapture":_1ee});
if(_1ef.addEventListener){
_1ef.addEventListener(name,_1ed,_1ee);
}else{
if(_1ef.attachEvent){
_1ef.attachEvent("on"+name,_1ed);
}
}
},stopObservingElement:function(_1f2){
var _1f3=OpenLayers.Util.getElement(_1f2);
var _1f4=_1f3._eventCacheID;
this._removeElementObservers(OpenLayers.Event.observers[_1f4]);
},_removeElementObservers:function(_1f5){
if(_1f5){
for(var i=_1f5.length-1;i>=0;i--){
var _1f7=_1f5[i];
var args=new Array(_1f7.element,_1f7.name,_1f7.observer,_1f7.useCapture);
var _1f9=OpenLayers.Event.stopObserving.apply(this,args);
}
}
},stopObserving:function(_1fa,name,_1fc,_1fd){
_1fd=_1fd||false;
var _1fe=OpenLayers.Util.getElement(_1fa);
var _1ff=_1fe._eventCacheID;
if(name=="keypress"){
if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_1fe.detachEvent){
name="keydown";
}
}
var _200=false;
var _201=OpenLayers.Event.observers[_1ff];
if(_201){
var i=0;
while(!_200&&i<_201.length){
var _203=_201[i];
if((_203.name==name)&&(_203.observer==_1fc)&&(_203.useCapture==_1fd)){
_201.splice(i,1);
if(_201.length==0){
delete OpenLayers.Event.observers[_1ff];
}
_200=true;
break;
}
i++;
}
}
if(_200){
if(_1fe.removeEventListener){
_1fe.removeEventListener(name,_1fc,_1fd);
}else{
if(_1fe&&_1fe.detachEvent){
_1fe.detachEvent("on"+name,_1fc);
}
}
}
return _200;
},unloadCache:function(){
if(OpenLayers.Event&&OpenLayers.Event.observers){
for(var _204 in OpenLayers.Event.observers){
var _205=OpenLayers.Event.observers[_204];
OpenLayers.Event._removeElementObservers.apply(this,[_205]);
}
OpenLayers.Event.observers=false;
}
},CLASS_NAME:"OpenLayers.Event"};
OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);
if(window.Event){
OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event);
}else{
var Event=OpenLayers.Event;
}
OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","resize","focus","blur"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,initialize:function(_206,_207,_208,_209){
this.object=_206;
this.element=_207;
this.eventTypes=_208;
this.fallThrough=_209;
this.listeners={};
this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);
if(this.eventTypes!=null){
for(var i=0;i<this.eventTypes.length;i++){
this.addEventType(this.eventTypes[i]);
}
}
if(this.element!=null){
this.attachToElement(_207);
}
},destroy:function(){
if(this.element){
OpenLayers.Event.stopObservingElement(this.element);
}
this.element=null;
this.listeners=null;
this.object=null;
this.eventTypes=null;
this.fallThrough=null;
this.eventHandler=null;
},addEventType:function(_20b){
if(!this.listeners[_20b]){
this.listeners[_20b]=[];
}
},attachToElement:function(_20c){
for(var i=0;i<this.BROWSER_EVENTS.length;i++){
var _20e=this.BROWSER_EVENTS[i];
this.addEventType(_20e);
OpenLayers.Event.observe(_20c,_20e,this.eventHandler);
}
OpenLayers.Event.observe(_20c,"dragstart",OpenLayers.Event.stop);
},on:function(_20f){
for(var type in _20f){
if(type!="scope"){
this.register(type,_20f.scope,_20f[type]);
}
}
},register:function(type,obj,func){
if(func!=null&&((this.eventTypes&&OpenLayers.Util.indexOf(this.eventTypes,type)!=-1)||OpenLayers.Util.indexOf(this.BROWSER_EVENTS,type)!=-1)){
if(obj==null){
obj=this.object;
}
var _214=this.listeners[type];
if(_214!=null){
_214.push({obj:obj,func:func});
}
}
},registerPriority:function(type,obj,func){
if(func!=null){
if(obj==null){
obj=this.object;
}
var _218=this.listeners[type];
if(_218!=null){
_218.unshift({obj:obj,func:func});
}
}
},un:function(_219){
for(var type in _219){
if(type!="scope"){
this.unregister(type,_219.scope,_219[type]);
}
}
},unregister:function(type,obj,func){
if(obj==null){
obj=this.object;
}
var _21e=this.listeners[type];
if(_21e!=null){
for(var i=0;i<_21e.length;i++){
if(_21e[i].obj==obj&&_21e[i].func==func){
_21e.splice(i,1);
break;
}
}
}
},remove:function(type){
if(this.listeners[type]!=null){
this.listeners[type]=[];
}
},triggerEvent:function(type,evt){
if(evt==null){
evt={};
}
evt.object=this.object;
evt.element=this.element;
if(!evt.type){
evt.type=type;
}
var _223=(this.listeners[type])?this.listeners[type].slice():null;
if((_223!=null)&&(_223.length>0)){
var _224;
for(var i=0;i<_223.length;i++){
var _226=_223[i];
_224=_226.func.apply(_226.obj,[evt]);
if((_224!=undefined)&&(_224==false)){
break;
}
}
if(!this.fallThrough){
OpenLayers.Event.stop(evt,true);
}
}
return _224;
},handleBrowserEvent:function(evt){
evt.xy=this.getMousePosition(evt);
this.triggerEvent(evt.type,evt);
},getMousePosition:function(evt){
if(!this.element.offsets){
this.element.offsets=OpenLayers.Util.pagePosition(this.element);
this.element.offsets[0]+=(document.documentElement.scrollLeft||document.body.scrollLeft);
this.element.offsets[1]+=(document.documentElement.scrollTop||document.body.scrollTop);
}
return new OpenLayers.Pixel((evt.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))-this.element.offsets[0]-(document.documentElement.clientLeft||0),(evt.clientY+(document.documentElement.scrollTop||document.body.scrollTop))-this.element.offsets[1]-(document.documentElement.clientTop||0));
},CLASS_NAME:"OpenLayers.Events"});
OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(_229,_22a){
OpenLayers.Util.extend(this,_22a);
this.projCode=_229;
if(window.Proj4js){
this.proj=new Proj4js.Proj(_229);
}
},getCode:function(){
return this.proj?this.proj.srsCode:this.projCode;
},getUnits:function(){
return this.proj?this.proj.units:null;
},toString:function(){
return this.getCode();
},equals:function(_22b){
if(_22b&&_22b.getCode){
return this.getCode()==_22b.getCode();
}else{
return false;
}
},destroy:function(){
delete this.proj;
delete this.projCode;
},CLASS_NAME:"OpenLayers.Projection"});
OpenLayers.Projection.transforms={};
OpenLayers.Projection.addTransform=function(from,to,_22e){
if(!OpenLayers.Projection.transforms[from]){
OpenLayers.Projection.transforms[from]={};
}
OpenLayers.Projection.transforms[from][to]=_22e;
};
OpenLayers.Projection.transform=function(_22f,_230,dest){
if(_230.proj&&dest.proj){
_22f=Proj4js.transform(_230.proj,dest.proj,_22f);
}else{
if(_230&&dest&&OpenLayers.Projection.transforms[_230.getCode()]&&OpenLayers.Projection.transforms[_230.getCode()][dest.getCode()]){
OpenLayers.Projection.transforms[_230.getCode()][dest.getCode()](_22f);
}
}
return _22f;
};
OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Popup:750,Control:1000},EVENT_TYPES:["preaddlayer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events:null,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:"degrees",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,paddingForPopups:null,initialize:function(div,_233){
this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT);
this.maxExtent=new OpenLayers.Bounds(-180,-90,180,90);
this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15);
this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css";
OpenLayers.Util.extend(this,_233);
this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");
this.div=OpenLayers.Util.getElement(div);
var id=this.div.id+"_OpenLayers_ViewPort";
this.viewPortDiv=OpenLayers.Util.createDiv(id,null,null,null,"relative",null,"hidden");
this.viewPortDiv.style.width="100%";
this.viewPortDiv.style.height="100%";
this.viewPortDiv.className="olMapViewport";
this.div.appendChild(this.viewPortDiv);
id=this.div.id+"_OpenLayers_Container";
this.layerContainerDiv=OpenLayers.Util.createDiv(id);
this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE["Popup"]-1;
this.viewPortDiv.appendChild(this.layerContainerDiv);
this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough);
this.updateSize();
if(this.eventListeners instanceof Object){
this.events.on(this.eventListeners);
}
this.events.register("movestart",this,this.updateSize);
if(OpenLayers.String.contains(navigator.appName,"Microsoft")){
this.events.register("resize",this,this.updateSize);
}else{
this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);
OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy);
}
if(this.theme){
var _235=true;
var _236=document.getElementsByTagName("link");
for(var i=0;i<_236.length;++i){
if(OpenLayers.Util.isEquivalentUrl(_236.item(i).href,this.theme)){
_235=false;
break;
}
}
if(_235){
var _238=document.createElement("link");
_238.setAttribute("rel","stylesheet");
_238.setAttribute("type","text/css");
_238.setAttribute("href",this.theme);
document.getElementsByTagName("head")[0].appendChild(_238);
}
}
this.layers=[];
if(this.controls==null){
if(OpenLayers.Control!=null){
this.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()];
}else{
this.controls=[];
}
}
for(var i=0;i<this.controls.length;i++){
this.addControlToMap(this.controls[i]);
}
this.popups=[];
this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);
OpenLayers.Event.observe(window,"unload",this.unloadDestroy);
},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){
if(!this.unloadDestroy){
return false;
}
OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);
this.unloadDestroy=null;
if(this.updateSizeDestroy){
OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy);
}else{
this.events.unregister("resize",this,this.updateSize);
}
this.paddingForPopups=null;
if(this.controls!=null){
for(var i=this.controls.length-1;i>=0;--i){
this.controls[i].destroy();
}
this.controls=null;
}
if(this.layers!=null){
for(var i=this.layers.length-1;i>=0;--i){
this.layers[i].destroy(false);
}
this.layers=null;
}
if(this.viewPortDiv){
this.div.removeChild(this.viewPortDiv);
}
this.viewPortDiv=null;
if(this.eventListeners){
this.events.un(this.eventListeners);
this.eventListeners=null;
}
this.events.destroy();
this.events=null;
},setOptions:function(_23a){
OpenLayers.Util.extend(this,_23a);
},getTileSize:function(){
return this.tileSize;
},getBy:function(_23b,_23c,_23d){
var test=(typeof _23d.test=="function");
var _23f=OpenLayers.Array.filter(this[_23b],function(item){
return item[_23c]==_23d||(test&&_23d.test(item[_23c]));
});
return _23f;
},getLayersBy:function(_241,_242){
return this.getBy("layers",_241,_242);
},getLayersByName:function(_243){
return this.getLayersBy("name",_243);
},getLayersByClass:function(_244){
return this.getLayersBy("CLASS_NAME",_244);
},getControlsBy:function(_245,_246){
return this.getBy("controls",_245,_246);
},getControlsByClass:function(_247){
return this.getControlsBy("CLASS_NAME",_247);
},getLayer:function(id){
var _249=null;
for(var i=0;i<this.layers.length;i++){
var _24b=this.layers[i];
if(_24b.id==id){
_249=_24b;
break;
}
}
return _249;
},setLayerZIndex:function(_24c,zIdx){
_24c.setZIndex(this.Z_INDEX_BASE[_24c.isBaseLayer?"BaseLayer":"Overlay"]+zIdx*5);
},resetLayersZIndex:function(){
for(var i=0;i<this.layers.length;i++){
var _24f=this.layers[i];
this.setLayerZIndex(_24f,i);
}
},addLayer:function(_250){
for(var i=0;i<this.layers.length;i++){
if(this.layers[i]==_250){
var msg=OpenLayers.i18n("layerAlreadyAdded",{"layerName":_250.name});
OpenLayers.Console.warn(msg);
return false;
}
}
this.events.triggerEvent("preaddlayer",{layer:_250});
_250.div.className="olLayerDiv";
_250.div.style.overflow="";
this.setLayerZIndex(_250,this.layers.length);
if(_250.isFixed){
this.viewPortDiv.appendChild(_250.div);
}else{
this.layerContainerDiv.appendChild(_250.div);
}
this.layers.push(_250);
_250.setMap(this);
if(_250.isBaseLayer){
if(this.baseLayer==null){
this.setBaseLayer(_250);
}else{
_250.setVisibility(false);
}
}else{
_250.redraw();
}
this.events.triggerEvent("addlayer",{layer:_250});
},addLayers:function(_253){
for(var i=0;i<_253.length;i++){
this.addLayer(_253[i]);
}
},removeLayer:function(_255,_256){
if(_256==null){
_256=true;
}
if(_255.isFixed){
this.viewPortDiv.removeChild(_255.div);
}else{
this.layerContainerDiv.removeChild(_255.div);
}
OpenLayers.Util.removeItem(this.layers,_255);
_255.removeMap(this);
_255.map=null;
if(this.baseLayer==_255){
this.baseLayer=null;
if(_256){
for(var i=0;i<this.layers.length;i++){
var _258=this.layers[i];
if(_258.isBaseLayer){
this.setBaseLayer(_258);
break;
}
}
}
}
this.resetLayersZIndex();
this.events.triggerEvent("removelayer",{layer:_255});
},getNumLayers:function(){
return this.layers.length;
},getLayerIndex:function(_259){
return OpenLayers.Util.indexOf(this.layers,_259);
},setLayerIndex:function(_25a,idx){
var base=this.getLayerIndex(_25a);
if(idx<0){
idx=0;
}else{
if(idx>this.layers.length){
idx=this.layers.length;
}
}
if(base!=idx){
this.layers.splice(base,1);
this.layers.splice(idx,0,_25a);
for(var i=0;i<this.layers.length;i++){
this.setLayerZIndex(this.layers[i],i);
}
this.events.triggerEvent("changelayer",{layer:_25a,property:"order"});
}
},raiseLayer:function(_25e,_25f){
var idx=this.getLayerIndex(_25e)+_25f;
this.setLayerIndex(_25e,idx);
},setBaseLayer:function(_261){
var _262=null;
if(this.baseLayer){
_262=this.baseLayer.getExtent();
}
if(_261!=this.baseLayer){
if(OpenLayers.Util.indexOf(this.layers,_261)!=-1){
if(this.baseLayer!=null){
this.baseLayer.setVisibility(false);
}
this.baseLayer=_261;
this.viewRequestID++;
this.baseLayer.visibility=true;
var _263=this.getCenter();
if(_263!=null){
var _264=(_262)?_262.getCenterLonLat():_263;
var _265=(_262)?this.getZoomForExtent(_262,true):this.getZoomForResolution(this.resolution,true);
this.setCenter(_264,_265,false,true);
}
this.events.triggerEvent("changebaselayer",{layer:this.baseLayer});
}
}
},addControl:function(_266,px){
this.controls.push(_266);
this.addControlToMap(_266,px);
},addControlToMap:function(_268,px){
_268.outsideViewport=(_268.div!=null);
if(this.displayProjection&&!_268.displayProjection){
_268.displayProjection=this.displayProjection;
}
_268.setMap(this);
var div=_268.draw(px);
if(div){
if(!_268.outsideViewport){
div.style.zIndex=this.Z_INDEX_BASE["Control"]+this.controls.length;
this.viewPortDiv.appendChild(div);
}
}
},getControl:function(id){
var _26c=null;
for(var i=0;i<this.controls.length;i++){
var _26e=this.controls[i];
if(_26e.id==id){
_26c=_26e;
break;
}
}
return _26c;
},removeControl:function(_26f){
if((_26f)&&(_26f==this.getControl(_26f.id))){
if(_26f.div&&(_26f.div.parentNode==this.viewPortDiv)){
this.viewPortDiv.removeChild(_26f.div);
}
OpenLayers.Util.removeItem(this.controls,_26f);
}
},addPopup:function(_270,_271){
if(_271){
for(var i=this.popups.length-1;i>=0;--i){
this.removePopup(this.popups[i]);
}
}
_270.map=this;
this.popups.push(_270);
var _273=_270.draw();
if(_273){
_273.style.zIndex=this.Z_INDEX_BASE["Popup"]+this.popups.length;
this.layerContainerDiv.appendChild(_273);
}
},removePopup:function(_274){
OpenLayers.Util.removeItem(this.popups,_274);
if(_274.div){
try{
this.layerContainerDiv.removeChild(_274.div);
}
catch(e){
}
}
_274.map=null;
},getSize:function(){
var size=null;
if(this.size!=null){
size=this.size.clone();
}
return size;
},updateSize:function(){
this.events.element.offsets=null;
var _276=this.getCurrentSize();
var _277=this.getSize();
if(_277==null){
this.size=_277=_276;
}
if(!_276.equals(_277)){
this.size=_276;
for(var i=0;i<this.layers.length;i++){
this.layers[i].onMapResize();
}
if(this.baseLayer!=null){
var _279=new OpenLayers.Pixel(_276.w/2,_276.h/2);
var _27a=this.getLonLatFromViewPortPx(_279);
var zoom=this.getZoom();
this.zoom=null;
this.setCenter(this.getCenter(),zoom);
}
}
},getCurrentSize:function(){
var size=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);
if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){
var dim=OpenLayers.Element.getDimensions(this.div);
size.w=dim.width;
size.h=dim.height;
}
if(size.w==0&&size.h==0||isNaN(size.w)&&isNaN(size.h)){
size.w=parseInt(this.div.style.width);
size.h=parseInt(this.div.style.height);
}
return size;
},calculateBounds:function(_27e,_27f){
var _280=null;
if(_27e==null){
_27e=this.getCenter();
}
if(_27f==null){
_27f=this.getResolution();
}
if((_27e!=null)&&(_27f!=null)){
var size=this.getSize();
var _282=size.w*_27f;
var _283=size.h*_27f;
_280=new OpenLayers.Bounds(_27e.lon-_282/2,_27e.lat-_283/2,_27e.lon+_282/2,_27e.lat+_283/2);
}
return _280;
},getCenter:function(){
return this.center;
},getZoom:function(){
return this.zoom;
},pan:function(dx,dy,_286){
if(!_286){
_286={};
}
OpenLayers.Util.applyDefaults(_286,{animate:true,dragging:false});
var _287=this.getViewPortPxFromLonLat(this.getCenter());
var _288=_287.add(dx,dy);
if(!_286.dragging||!_288.equals(_287)){
var _289=this.getLonLatFromViewPortPx(_288);
if(_286.animate){
this.panTo(_289);
}else{
this.setCenter(_289,null,_286.dragging);
}
}
},panTo:function(_28a){
if(this.panMethod&&this.getExtent().containsLonLat(_28a)){
if(!this.panTween){
this.panTween=new OpenLayers.Tween(this.panMethod);
}
var _28b=this.getCenter();
var from={lon:_28b.lon,lat:_28b.lat};
var to={lon:_28a.lon,lat:_28a.lat};
this.panTween.start(from,to,50,{callbacks:{start:OpenLayers.Function.bind(function(_28e){
this.events.triggerEvent("movestart");
},this),eachStep:OpenLayers.Function.bind(function(_28f){
_28f=new OpenLayers.LonLat(_28f.lon,_28f.lat);
this.moveTo(_28f,this.zoom,{"dragging":true,"noEvent":true});
},this),done:OpenLayers.Function.bind(function(_290){
_290=new OpenLayers.LonLat(_290.lon,_290.lat);
this.moveTo(_290,this.zoom,{"noEvent":true});
this.events.triggerEvent("moveend");
},this)}});
}else{
this.setCenter(_28a);
}
},setCenter:function(_291,zoom,_293,_294){
this.moveTo(_291,zoom,{"dragging":_293,"forceZoomChange":_294,"caller":"setCenter"});
},moveTo:function(_295,zoom,_297){
if(!_297){
_297={};
}
var _298=_297.dragging;
var _299=_297.forceZoomChange;
var _29a=_297.noEvent;
if(this.panTween&&_297.caller=="setCenter"){
this.panTween.stop();
}
if(!this.center&&!this.isValidLonLat(_295)){
_295=this.maxExtent.getCenterLonLat();
}
if(this.restrictedExtent!=null){
if(_295==null){
_295=this.getCenter();
}
if(zoom==null){
zoom=this.getZoom();
}
var _29b=this.getResolutionForZoom(zoom);
var _29c=this.calculateBounds(_295,_29b);
if(!this.restrictedExtent.containsBounds(_29c)){
var _29d=this.restrictedExtent.getCenterLonLat();
if(_29c.getWidth()>this.restrictedExtent.getWidth()){
_295=new OpenLayers.LonLat(_29d.lon,_295.lat);
}else{
if(_29c.left<this.restrictedExtent.left){
_295=_295.add(this.restrictedExtent.left-_29c.left,0);
}else{
if(_29c.right>this.restrictedExtent.right){
_295=_295.add(this.restrictedExtent.right-_29c.right,0);
}
}
}
if(_29c.getHeight()>this.restrictedExtent.getHeight()){
_295=new OpenLayers.LonLat(_295.lon,_29d.lat);
}else{
if(_29c.bottom<this.restrictedExtent.bottom){
_295=_295.add(0,this.restrictedExtent.bottom-_29c.bottom);
}else{
if(_29c.top>this.restrictedExtent.top){
_295=_295.add(0,this.restrictedExtent.top-_29c.top);
}
}
}
}
}
var _29e=_299||((this.isValidZoomLevel(zoom))&&(zoom!=this.getZoom()));
var _29f=(this.isValidLonLat(_295))&&(!_295.equals(this.center));
if(_29e||_29f||!_298){
if(!this.dragging&&!_29a){
this.events.triggerEvent("movestart");
}
if(_29f){
if((!_29e)&&(this.center)){
this.centerLayerContainer(_295);
}
this.center=_295.clone();
}
if((_29e)||(this.layerContainerOrigin==null)){
this.layerContainerOrigin=this.center.clone();
this.layerContainerDiv.style.left="0px";
this.layerContainerDiv.style.top="0px";
}
if(_29e){
this.zoom=zoom;
this.resolution=this.getResolutionForZoom(zoom);
this.viewRequestID++;
}
var _2a0=this.getExtent();
this.baseLayer.moveTo(_2a0,_29e,_298);
_2a0=this.baseLayer.getExtent();
for(var i=0;i<this.layers.length;i++){
var _2a2=this.layers[i];
if(!_2a2.isBaseLayer){
var _2a3=_2a2.calculateInRange();
if(_2a2.inRange!=_2a3){
_2a2.inRange=_2a3;
if(!_2a3){
_2a2.display(false);
}
this.events.triggerEvent("changelayer",{layer:_2a2,property:"visibility"});
}
if(_2a3&&_2a2.visibility){
_2a2.moveTo(_2a0,_29e,_298);
}
}
}
if(_29e){
for(var i=0;i<this.popups.length;i++){
this.popups[i].updatePosition();
}
}
this.events.triggerEvent("move");
if(_29e){
this.events.triggerEvent("zoomend");
}
}
if(!_298&&!_29a){
this.events.triggerEvent("moveend");
}
this.dragging=!!_298;
},centerLayerContainer:function(_2a4){
var _2a5=this.getViewPortPxFromLonLat(this.layerContainerOrigin);
var _2a6=this.getViewPortPxFromLonLat(_2a4);
if((_2a5!=null)&&(_2a6!=null)){
this.layerContainerDiv.style.left=Math.round(_2a5.x-_2a6.x)+"px";
this.layerContainerDiv.style.top=Math.round(_2a5.y-_2a6.y)+"px";
}
},isValidZoomLevel:function(_2a7){
return ((_2a7!=null)&&(_2a7>=0)&&(_2a7<this.getNumZoomLevels()));
},isValidLonLat:function(_2a8){
var _2a9=false;
if(_2a8!=null){
var _2aa=this.getMaxExtent();
_2a9=_2aa.containsLonLat(_2a8);
}
return _2a9;
},getProjection:function(){
var _2ab=this.getProjectionObject();
return _2ab?_2ab.getCode():null;
},getProjectionObject:function(){
var _2ac=null;
if(this.baseLayer!=null){
_2ac=this.baseLayer.projection;
}
return _2ac;
},getMaxResolution:function(){
var _2ad=null;
if(this.baseLayer!=null){
_2ad=this.baseLayer.maxResolution;
}
return _2ad;
},getMaxExtent:function(){
var _2ae=null;
if(this.baseLayer!=null){
_2ae=this.baseLayer.maxExtent;
}
return _2ae;
},getNumZoomLevels:function(){
var _2af=null;
if(this.baseLayer!=null){
_2af=this.baseLayer.numZoomLevels;
}
return _2af;
},getExtent:function(){
var _2b0=null;
if(this.baseLayer!=null){
_2b0=this.baseLayer.getExtent();
}
return _2b0;
},getResolution:function(){
var _2b1=null;
if(this.baseLayer!=null){
_2b1=this.baseLayer.getResolution();
}
return _2b1;
},getScale:function(){
var _2b2=null;
if(this.baseLayer!=null){
var res=this.getResolution();
var _2b4=this.baseLayer.units;
_2b2=OpenLayers.Util.getScaleFromResolution(res,_2b4);
}
return _2b2;
},getZoomForExtent:function(_2b5,_2b6){
var zoom=null;
if(this.baseLayer!=null){
zoom=this.baseLayer.getZoomForExtent(_2b5,_2b6);
}
return zoom;
},getResolutionForZoom:function(zoom){
var _2b9=null;
if(this.baseLayer){
_2b9=this.baseLayer.getResolutionForZoom(zoom);
}
return _2b9;
},getZoomForResolution:function(_2ba,_2bb){
var zoom=null;
if(this.baseLayer!=null){
zoom=this.baseLayer.getZoomForResolution(_2ba,_2bb);
}
return zoom;
},zoomTo:function(zoom){
if(this.isValidZoomLevel(zoom)){
this.setCenter(null,zoom);
}
},zoomIn:function(){
this.zoomTo(this.getZoom()+1);
},zoomOut:function(){
this.zoomTo(this.getZoom()-1);
},zoomToExtent:function(_2be){
var _2bf=_2be.getCenterLonLat();
if(this.baseLayer.wrapDateLine){
var _2c0=this.getMaxExtent();
_2be=_2be.clone();
while(_2be.right<_2be.left){
_2be.right+=_2c0.getWidth();
}
_2bf=_2be.getCenterLonLat().wrapDateLine(_2c0);
}
this.setCenter(_2bf,this.getZoomForExtent(_2be));
},zoomToMaxExtent:function(){
this.zoomToExtent(this.getMaxExtent());
},zoomToScale:function(_2c1){
var res=OpenLayers.Util.getResolutionFromScale(_2c1,this.baseLayer.units);
var size=this.getSize();
var _2c4=size.w*res;
var _2c5=size.h*res;
var _2c6=this.getCenter();
var _2c7=new OpenLayers.Bounds(_2c6.lon-_2c4/2,_2c6.lat-_2c5/2,_2c6.lon+_2c4/2,_2c6.lat+_2c5/2);
this.zoomToExtent(_2c7);
},getLonLatFromViewPortPx:function(_2c8){
var _2c9=null;
if(this.baseLayer!=null){
_2c9=this.baseLayer.getLonLatFromViewPortPx(_2c8);
}
return _2c9;
},getViewPortPxFromLonLat:function(_2ca){
var px=null;
if(this.baseLayer!=null){
px=this.baseLayer.getViewPortPxFromLonLat(_2ca);
}
return px;
},getLonLatFromPixel:function(px){
return this.getLonLatFromViewPortPx(px);
},getPixelFromLonLat:function(_2cd){
var px=this.getViewPortPxFromLonLat(_2cd);
px.x=Math.round(px.x);
px.y=Math.round(px.y);
return px;
},getViewPortPxFromLayerPx:function(_2cf){
var _2d0=null;
if(_2cf!=null){
var dX=parseInt(this.layerContainerDiv.style.left);
var dY=parseInt(this.layerContainerDiv.style.top);
_2d0=_2cf.add(dX,dY);
}
return _2d0;
},getLayerPxFromViewPortPx:function(_2d3){
var _2d4=null;
if(_2d3!=null){
var dX=-parseInt(this.layerContainerDiv.style.left);
var dY=-parseInt(this.layerContainerDiv.style.top);
_2d4=_2d3.add(dX,dY);
if(isNaN(_2d4.x)||isNaN(_2d4.y)){
_2d4=null;
}
}
return _2d4;
},getLonLatFromLayerPx:function(px){
px=this.getViewPortPxFromLayerPx(px);
return this.getLonLatFromViewPortPx(px);
},getLayerPxFromLonLat:function(_2d8){
var px=this.getPixelFromLonLat(_2d8);
return this.getLayerPxFromViewPortPx(px);
},CLASS_NAME:"OpenLayers.Map"});
OpenLayers.Map.TILE_WIDTH=256;
OpenLayers.Map.TILE_HEIGHT=256;
OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged"],events:null,map:null,isBaseLayer:false,alpha:false,displayInLayerSwitcher:true,visibility:true,attribution:null,inRange:false,imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:false,wrapDateLine:false,transitionEffect:null,SUPPORTED_TRANSITIONS:["resize"],initialize:function(name,_2db){
this.addOptions(_2db);
this.name=name;
if(this.id==null){
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.div=OpenLayers.Util.createDiv(this.id);
this.div.style.width="100%";
this.div.style.height="100%";
this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES);
if(this.eventListeners instanceof Object){
this.events.on(this.eventListeners);
}
}
if(this.wrapDateLine){
this.displayOutsideMaxExtent=true;
}
},destroy:function(_2dc){
if(_2dc==null){
_2dc=true;
}
if(this.map!=null){
this.map.removeLayer(this,_2dc);
}
this.projection=null;
this.map=null;
this.name=null;
this.div=null;
this.options=null;
if(this.events){
if(this.eventListeners){
this.events.un(this.eventListeners);
}
this.events.destroy();
}
this.eventListeners=null;
this.events=null;
},clone:function(obj){
if(obj==null){
obj=new OpenLayers.Layer(this.name,this.options);
}
OpenLayers.Util.applyDefaults(obj,this);
obj.map=null;
return obj;
},setName:function(_2de){
if(_2de!=this.name){
this.name=_2de;
if(this.map!=null){
this.map.events.triggerEvent("changelayer",{layer:this,property:"name"});
}
}
},addOptions:function(_2df){
if(this.options==null){
this.options={};
}
OpenLayers.Util.extend(this.options,_2df);
OpenLayers.Util.extend(this,_2df);
},onMapResize:function(){
},redraw:function(){
var _2e0=false;
if(this.map){
this.inRange=this.calculateInRange();
var _2e1=this.getExtent();
if(_2e1&&this.inRange&&this.visibility){
this.moveTo(_2e1,true,false);
_2e0=true;
}
}
return _2e0;
},moveTo:function(_2e2,_2e3,_2e4){
var _2e5=this.visibility;
if(!this.isBaseLayer){
_2e5=_2e5&&this.inRange;
}
this.display(_2e5);
},setMap:function(map){
if(this.map==null){
this.map=map;
this.maxExtent=this.maxExtent||this.map.maxExtent;
this.projection=this.projection||this.map.projection;
if(this.projection&&typeof this.projection=="string"){
this.projection=new OpenLayers.Projection(this.projection);
}
this.units=this.projection.getUnits()||this.units||this.map.units;
this.initResolutions();
if(!this.isBaseLayer){
this.inRange=this.calculateInRange();
var show=((this.visibility)&&(this.inRange));
this.div.style.display=show?"":"none";
}
this.setTileSize();
}
},removeMap:function(map){
},getImageSize:function(){
return (this.imageSize||this.tileSize);
},setTileSize:function(size){
var _2ea=(size)?size:((this.tileSize)?this.tileSize:this.map.getTileSize());
this.tileSize=_2ea;
if(this.gutter){
this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);
this.imageSize=new OpenLayers.Size(_2ea.w+(2*this.gutter),_2ea.h+(2*this.gutter));
}
},getVisibility:function(){
return this.visibility;
},setVisibility:function(_2eb){
if(_2eb!=this.visibility){
this.visibility=_2eb;
this.display(_2eb);
this.redraw();
if(this.map!=null){
this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"});
}
this.events.triggerEvent("visibilitychanged");
}
},display:function(_2ec){
var _2ed=this.calculateInRange();
if(_2ec!=(this.div.style.display!="none")){
this.div.style.display=(_2ec&&_2ed)?"block":"none";
}
},calculateInRange:function(){
var _2ee=false;
if(this.map){
var _2ef=this.map.getResolution();
_2ee=((_2ef>=this.minResolution)&&(_2ef<=this.maxResolution));
}
return _2ee;
},setIsBaseLayer:function(_2f0){
if(_2f0!=this.isBaseLayer){
this.isBaseLayer=_2f0;
if(this.map!=null){
this.map.events.triggerEvent("changebaselayer",{layer:this});
}
}
},initResolutions:function(){
var _2f1=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");
var _2f2={};
for(var i=0;i<_2f1.length;i++){
var _2f4=_2f1[i];
_2f2[_2f4]=this.options[_2f4]||this.map[_2f4];
}
if(this.options.minScale!=null&&this.options.maxScale!=null&&this.options.scales==null){
_2f2.scales=null;
}
if(this.options.minResolution!=null&&this.options.maxResolution!=null&&this.options.resolutions==null){
_2f2.resolutions=null;
}
if((!_2f2.numZoomLevels)&&(_2f2.maxZoomLevel)){
_2f2.numZoomLevels=_2f2.maxZoomLevel+1;
}
if((_2f2.scales!=null)||(_2f2.resolutions!=null)){
if(_2f2.scales!=null){
_2f2.resolutions=[];
for(var i=0;i<_2f2.scales.length;i++){
var _2f5=_2f2.scales[i];
_2f2.resolutions[i]=OpenLayers.Util.getResolutionFromScale(_2f5,_2f2.units);
}
}
_2f2.numZoomLevels=_2f2.resolutions.length;
}else{
if(_2f2.minScale){
_2f2.maxResolution=OpenLayers.Util.getResolutionFromScale(_2f2.minScale,_2f2.units);
}else{
if(_2f2.maxResolution=="auto"){
var _2f6=this.map.getSize();
var wRes=_2f2.maxExtent.getWidth()/_2f6.w;
var hRes=_2f2.maxExtent.getHeight()/_2f6.h;
_2f2.maxResolution=Math.max(wRes,hRes);
}
}
if(_2f2.maxScale!=null){
_2f2.minResolution=OpenLayers.Util.getResolutionFromScale(_2f2.maxScale,_2f2.units);
}else{
if((_2f2.minResolution=="auto")&&(_2f2.minExtent!=null)){
var _2f6=this.map.getSize();
var wRes=_2f2.minExtent.getWidth()/_2f6.w;
var hRes=_2f2.minExtent.getHeight()/_2f6.h;
_2f2.minResolution=Math.max(wRes,hRes);
}
}
if(_2f2.minResolution!=null&&this.options.numZoomLevels==undefined){
var _2f9=_2f2.maxResolution/_2f2.minResolution;
_2f2.numZoomLevels=Math.floor(Math.log(_2f9)/Math.log(2))+1;
}
_2f2.resolutions=new Array(_2f2.numZoomLevels);
var base=2;
if(typeof _2f2.minResolution=="number"&&_2f2.numZoomLevels>1){
base=Math.pow((_2f2.maxResolution/_2f2.minResolution),(1/(_2f2.numZoomLevels-1)));
}
for(var i=0;i<_2f2.numZoomLevels;i++){
var res=_2f2.maxResolution/Math.pow(base,i);
_2f2.resolutions[i]=res;
}
}
_2f2.resolutions.sort(function(a,b){
return (b-a);
});
this.resolutions=_2f2.resolutions;
this.maxResolution=_2f2.resolutions[0];
var _2fe=_2f2.resolutions.length-1;
this.minResolution=_2f2.resolutions[_2fe];
this.scales=[];
for(var i=0;i<_2f2.resolutions.length;i++){
this.scales[i]=OpenLayers.Util.getScaleFromResolution(_2f2.resolutions[i],_2f2.units);
}
this.minScale=this.scales[0];
this.maxScale=this.scales[this.scales.length-1];
this.numZoomLevels=_2f2.numZoomLevels;
},getResolution:function(){
var zoom=this.map.getZoom();
return this.getResolutionForZoom(zoom);
},getExtent:function(){
return this.map.calculateBounds();
},getZoomForExtent:function(_300,_301){
var _302=this.map.getSize();
var _303=Math.max(_300.getWidth()/_302.w,_300.getHeight()/_302.h);
return this.getZoomForResolution(_303,_301);
},getDataExtent:function(){
},getResolutionForZoom:function(zoom){
zoom=Math.max(0,Math.min(zoom,this.resolutions.length-1));
var _305;
if(this.map.fractionalZoom){
var low=Math.floor(zoom);
var high=Math.ceil(zoom);
_305=this.resolutions[high]+((zoom-low)*(this.resolutions[low]-this.resolutions[high]));
}else{
_305=this.resolutions[Math.round(zoom)];
}
return _305;
},getZoomForResolution:function(_308,_309){
var zoom;
if(this.map.fractionalZoom){
var _30b=0;
var _30c=this.resolutions.length-1;
var _30d=this.resolutions[_30b];
var _30e=this.resolutions[_30c];
var res;
for(var i=0;i<this.resolutions.length;++i){
res=this.resolutions[i];
if(res>=_308){
_30d=res;
_30b=i;
}
if(res<=_308){
_30e=res;
_30c=i;
break;
}
}
var dRes=_30d-_30e;
if(dRes>0){
zoom=_30b+((_308-_30e)/dRes);
}else{
zoom=_30b;
}
}else{
var diff;
var _313=Number.POSITIVE_INFINITY;
for(var i=0;i<this.resolutions.length;i++){
if(_309){
diff=Math.abs(this.resolutions[i]-_308);
if(diff>_313){
break;
}
_313=diff;
}else{
if(this.resolutions[i]<_308){
break;
}
}
}
zoom=Math.max(0,i-1);
}
return zoom;
},getLonLatFromViewPortPx:function(_314){
var _315=null;
if(_314!=null){
var size=this.map.getSize();
var _317=this.map.getCenter();
if(_317){
var res=this.map.getResolution();
var _319=_314.x-(size.w/2);
var _31a=_314.y-(size.h/2);
_315=new OpenLayers.LonLat(_317.lon+_319*res,_317.lat-_31a*res);
if(this.wrapDateLine){
_315=_315.wrapDateLine(this.maxExtent);
}
}
}
return _315;
},getViewPortPxFromLonLat:function(_31b){
var px=null;
if(_31b!=null){
var _31d=this.map.getResolution();
var _31e=this.map.getExtent();
px=new OpenLayers.Pixel((1/_31d*(_31b.lon-_31e.left)),(1/_31d*(_31e.top-_31b.lat)));
}
return px;
},setOpacity:function(_31f){
if(_31f!=this.opacity){
this.opacity=_31f;
for(var i=0;i<this.div.childNodes.length;++i){
var _321=this.div.childNodes[i].firstChild;
OpenLayers.Util.modifyDOMElement(_321,null,null,null,null,null,null,_31f);
}
}
},setZIndex:function(_322){
this.div.style.zIndex=_322;
},adjustBounds:function(_323){
if(this.gutter){
var _324=this.gutter*this.map.getResolution();
_323=new OpenLayers.Bounds(_323.left-_324,_323.bottom-_324,_323.right+_324,_323.top+_324);
}
if(this.wrapDateLine){
var _325={"rightTolerance":this.getResolution()};
_323=_323.wrapDateLine(this.maxExtent,_325);
}
return _323;
},CLASS_NAME:"OpenLayers.Layer"});
OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(url,size,_328,_329){
this.url=url;
this.size=(size)?size:new OpenLayers.Size(20,20);
this.offset=_328?_328:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));
this.calculateOffset=_329;
var id=OpenLayers.Util.createUniqueID("OL_Icon_");
this.imageDiv=OpenLayers.Util.createAlphaImageDiv(id);
},destroy:function(){
OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);
this.imageDiv.innerHTML="";
this.imageDiv=null;
},clone:function(){
return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset);
},setSize:function(size){
if(size!=null){
this.size=size;
}
this.draw();
},setUrl:function(url){
if(url!=null){
this.url=url;
}
this.draw();
},draw:function(px){
OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");
this.moveTo(px);
return this.imageDiv;
},setOpacity:function(_32e){
OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,_32e);
},moveTo:function(px){
if(px!=null){
this.px=px;
}
if(this.imageDiv!=null){
if(this.px==null){
this.display(false);
}else{
if(this.calculateOffset){
this.offset=this.calculateOffset(this.size);
}
var _330=this.px.offset(this.offset);
OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,_330);
}
}
},display:function(_331){
this.imageDiv.style.display=(_331)?"":"none";
},CLASS_NAME:"OpenLayers.Icon"});
OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(_332,icon){
this.lonlat=_332;
var _334=(icon)?icon:OpenLayers.Marker.defaultIcon();
if(this.icon==null){
this.icon=_334;
}else{
this.icon.url=_334.url;
this.icon.size=_334.size;
this.icon.offset=_334.offset;
this.icon.calculateOffset=_334.calculateOffset;
}
this.events=new OpenLayers.Events(this,this.icon.imageDiv,null);
},destroy:function(){
this.map=null;
this.events.destroy();
this.events=null;
if(this.icon!=null){
this.icon.destroy();
this.icon=null;
}
},draw:function(px){
return this.icon.draw(px);
},moveTo:function(px){
if((px!=null)&&(this.icon!=null)){
this.icon.moveTo(px);
}
this.lonlat=this.map.getLonLatFromLayerPx(px);
},onScreen:function(){
var _337=false;
if(this.map){
var _338=this.map.getExtent();
_337=_338.containsLonLat(this.lonlat);
}
return _337;
},inflate:function(_339){
if(this.icon){
var _33a=new OpenLayers.Size(this.icon.size.w*_339,this.icon.size.h*_339);
this.icon.setSize(_33a);
}
},setOpacity:function(_33b){
this.icon.setOpacity(_33b);
},setUrl:function(url){
this.icon.setUrl(url);
},display:function(_33d){
this.icon.display(_33d);
},CLASS_NAME:"OpenLayers.Marker"});
OpenLayers.Marker.defaultIcon=function(){
var url=OpenLayers.Util.getImagesLocation()+"marker.png";
var size=new OpenLayers.Size(21,25);
var _340=function(size){
return new OpenLayers.Pixel(-(size.w/2),-size.h);
};
return new OpenLayers.Icon(url,size,null,_340);
};
OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,size:null,contentHTML:"",backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,padding:0,fixPadding:function(){
if(typeof this.padding=="number"){
this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding);
}
},panMapIfOutOfView:false,map:null,initialize:function(id,_343,size,_345,_346,_347){
if(id==null){
id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
}
this.id=id;
this.lonlat=_343;
this.size=(size!=null)?size:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);
if(_345!=null){
this.contentHTML=_345;
}
this.backgroundColor=OpenLayers.Popup.COLOR;
this.opacity=OpenLayers.Popup.OPACITY;
this.border=OpenLayers.Popup.BORDER;
this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");
this.div.className="olPopup";
var _348=this.id+"_GroupDiv";
this.groupDiv=OpenLayers.Util.createDiv(_348,null,null,null,"relative",null,"hidden");
var id=this.div.id+"_contentDiv";
this.contentDiv=OpenLayers.Util.createDiv(id,null,this.size.clone(),null,"relative");
this.contentDiv.className="olPopupContent";
this.groupDiv.appendChild(this.contentDiv);
this.div.appendChild(this.groupDiv);
if(_346){
this.addCloseBox(_347);
}
this.registerEvents();
},destroy:function(){
this.id=null;
this.lonlat=null;
this.size=null;
this.contentHTML=null;
this.backgroundColor=null;
this.opacity=null;
this.border=null;
this.events.destroy();
this.events=null;
if(this.closeDiv){
OpenLayers.Event.stopObservingElement(this.closeDiv);
this.groupDiv.removeChild(this.closeDiv);
}
this.closeDiv=null;
this.div.removeChild(this.groupDiv);
this.groupDiv=null;
if(this.map!=null){
this.map.removePopup(this);
}
this.map=null;
this.div=null;
this.autoSize=null;
this.minSize=null;
this.maxSize=null;
this.padding=null;
this.panMapIfOutOfView=null;
},draw:function(px){
if(px==null){
if((this.lonlat!=null)&&(this.map!=null)){
px=this.map.getLayerPxFromLonLat(this.lonlat);
}
}
if(OpenLayers.Util.getBrowserName()=="firefox"){
this.map.events.register("movestart",this,function(){
var _34a=document.defaultView.getComputedStyle(this.contentDiv,null);
var _34b=_34a.getPropertyValue("overflow");
if(_34b!="hidden"){
this.contentDiv._oldOverflow=_34b;
this.contentDiv.style.overflow="hidden";
}
});
this.map.events.register("moveend",this,function(){
var _34c=this.contentDiv._oldOverflow;
if(_34c){
this.contentDiv.style.overflow=_34c;
this.contentDiv._oldOverflow=null;
}
});
}
this.moveTo(px);
if(!this.autoSize){
this.setSize(this.size);
}
this.setBackgroundColor();
this.setOpacity();
this.setBorder();
this.setContentHTML();
if(this.panMapIfOutOfView){
this.panIntoView();
}
return this.div;
},updatePosition:function(){
if((this.lonlat)&&(this.map)){
var px=this.map.getLayerPxFromLonLat(this.lonlat);
if(px){
this.moveTo(px);
}
}
},moveTo:function(px){
if((px!=null)&&(this.div!=null)){
this.div.style.left=px.x+"px";
this.div.style.top=px.y+"px";
}
},visible:function(){
return OpenLayers.Element.visible(this.div);
},toggle:function(){
if(this.visible()){
this.hide();
}else{
this.show();
}
},show:function(){
OpenLayers.Element.show(this.div);
if(this.panMapIfOutOfView){
this.panIntoView();
}
},hide:function(){
OpenLayers.Element.hide(this.div);
},setSize:function(size){
this.size=size;
var _350=this.size.clone();
var _351=this.getContentDivPadding();
var _352=_351.left+_351.right;
var _353=_351.top+_351.bottom;
this.fixPadding();
_352+=this.padding.left+this.padding.right;
_353+=this.padding.top+this.padding.bottom;
if(this.closeDiv){
var _354=parseInt(this.closeDiv.style.width);
_352+=_354+_351.right;
}
this.size.w+=_352;
this.size.h+=_353;
if(OpenLayers.Util.getBrowserName()=="msie"){
_350.w+=_351.left+_351.right;
_350.h+=_351.bottom+_351.top;
}
if(this.div!=null){
this.div.style.width=this.size.w+"px";
this.div.style.height=this.size.h+"px";
}
if(this.contentDiv!=null){
this.contentDiv.style.width=_350.w+"px";
this.contentDiv.style.height=_350.h+"px";
}
},setBackgroundColor:function(_355){
if(_355!=undefined){
this.backgroundColor=_355;
}
if(this.div!=null){
this.div.style.backgroundColor=this.backgroundColor;
}
},setOpacity:function(_356){
if(_356!=undefined){
this.opacity=_356;
}
if(this.div!=null){
this.div.style.opacity=this.opacity;
this.div.style.filter="alpha(opacity="+this.opacity*100+")";
}
},setBorder:function(_357){
if(_357!=undefined){
this.border=_357;
}
if(this.div!=null){
this.div.style.border=this.border;
}
},setContentHTML:function(_358){
if(_358!=null){
this.contentHTML=_358;
}
if(this.autoSize){
var _359=OpenLayers.Util.getRenderedDimensions(this.contentHTML);
var _35a=this.getSafeContentSize(_359);
var _35b=null;
if(_35a.equals(_359)){
_35b=_359;
}else{
var _35c=new OpenLayers.Size();
_35c.w=(_35a.w<_359.w)?_35a.w:null;
_35c.h=(_35a.h<_359.h)?_35a.h:null;
if(_35c.w&&_35c.h){
_35b=_35a;
}else{
var _35d=OpenLayers.Util.getRenderedDimensions(this.contentHTML,_35c);
var _35e=OpenLayers.Element.getStyle(this.contentDiv,"overflow");
if((_35e!="hidden")&&(_35d.equals(_35a))){
var _35f=OpenLayers.Util.getScrollbarWidth();
if(_35c.w){
_35d.h+=_35f;
}else{
_35d.w+=_35f;
}
}
_35b=this.getSafeContentSize(_35d);
}
}
this.setSize(_35b);
}
if(this.contentDiv!=null){
this.contentDiv.innerHTML=this.contentHTML;
}
},getSafeContentSize:function(size){
var _361=size.clone();
var _362=this.getContentDivPadding();
var _363=_362.left+_362.right;
var _364=_362.top+_362.bottom;
this.fixPadding();
_363+=this.padding.left+this.padding.right;
_364+=this.padding.top+this.padding.bottom;
if(this.closeDiv){
var _365=parseInt(this.closeDiv.style.width);
_363+=_365+_362.right;
}
if(this.minSize){
_361.w=Math.max(_361.w,(this.minSize.w-_363));
_361.h=Math.max(_361.h,(this.minSize.h-_364));
}
if(this.maxSize){
_361.w=Math.min(_361.w,(this.maxSize.w-_363));
_361.h=Math.min(_361.h,(this.maxSize.h-_364));
}
if(this.map&&this.map.size){
var maxY=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-_364;
var maxX=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-_363;
_361.w=Math.min(_361.w,maxX);
_361.h=Math.min(_361.h,maxY);
}
return _361;
},getContentDivPadding:function(){
var _368=this._contentDivPadding;
if(!_368){
this.div.style.display="none";
document.body.appendChild(this.div);
_368=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top"));
this._contentDivPadding=_368;
document.body.removeChild(this.div);
this.div.style.display="";
}
return _368;
},addCloseBox:function(_369){
this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));
this.closeDiv.className="olPopupCloseBox";
var _36a=this.getContentDivPadding();
this.closeDiv.style.right=_36a.right+"px";
this.closeDiv.style.top=_36a.top+"px";
this.groupDiv.appendChild(this.closeDiv);
var _36b=_369||function(e){
this.hide();
OpenLayers.Event.stop(e);
};
OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(_36b,this));
},panIntoView:function(){
var _36d=this.map.getSize();
var _36e=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));
var _36f=_36e.clone();
if(_36e.x<this.map.paddingForPopups.left){
_36f.x=this.map.paddingForPopups.left;
}else{
if((_36e.x+this.size.w)>(_36d.w-this.map.paddingForPopups.right)){
_36f.x=_36d.w-this.map.paddingForPopups.right-this.size.w;
}
}
if(_36e.y<this.map.paddingForPopups.top){
_36f.y=this.map.paddingForPopups.top;
}else{
if((_36e.y+this.size.h)>(_36d.h-this.map.paddingForPopups.bottom)){
_36f.y=_36d.h-this.map.paddingForPopups.bottom-this.size.h;
}
}
var dx=_36e.x-_36f.x;
var dy=_36e.y-_36f.y;
this.map.pan(dx,dy);
},registerEvents:function(){
this.events=new OpenLayers.Events(this,this.div,null,true);
this.events.on({"mousedown":this.onmousedown,"mousemove":this.onmousemove,"mouseup":this.onmouseup,"click":this.onclick,"mouseout":this.onmouseout,"dblclick":this.ondblclick,scope:this});
},onmousedown:function(evt){
this.mousedown=true;
OpenLayers.Event.stop(evt,true);
},onmousemove:function(evt){
if(this.mousedown){
OpenLayers.Event.stop(evt,true);
}
},onmouseup:function(evt){
if(this.mousedown){
this.mousedown=false;
OpenLayers.Event.stop(evt,true);
}
},onclick:function(evt){
OpenLayers.Event.stop(evt,true);
},onmouseout:function(evt){
this.mousedown=false;
},ondblclick:function(evt){
OpenLayers.Event.stop(evt,true);
},CLASS_NAME:"OpenLayers.Popup"});
OpenLayers.Popup.WIDTH=200;
OpenLayers.Popup.HEIGHT=200;
OpenLayers.Popup.COLOR="white";
OpenLayers.Popup.OPACITY=1;
OpenLayers.Popup.BORDER="0px";
OpenLayers.Tile=OpenLayers.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:false,isBackBuffer:false,lastRatio:1,isFirstDraw:true,backBufferTile:null,initialize:function(_378,_379,_37a,url,size){
this.layer=_378;
this.position=_379.clone();
this.bounds=_37a.clone();
this.url=url;
this.size=size.clone();
this.id=OpenLayers.Util.createUniqueID("Tile_");
this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);
},unload:function(){
if(this.isLoading){
this.isLoading=false;
this.events.triggerEvent("unload");
}
},destroy:function(){
if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){
this.layer.events.unregister("loadend",this,this.resetBackBuffer);
this.events.unregister("loadend",this,this.resetBackBuffer);
}else{
this.events.unregister("loadend",this,this.showTile);
}
this.layer=null;
this.bounds=null;
this.size=null;
this.position=null;
this.events.destroy();
this.events=null;
if(this.backBufferTile){
this.backBufferTile.destroy();
this.backBufferTile=null;
}
},clone:function(obj){
if(obj==null){
obj=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size);
}
OpenLayers.Util.applyDefaults(obj,this);
return obj;
},draw:function(){
var _37e=this.layer.maxExtent;
var _37f=(_37e&&this.bounds.intersectsBounds(_37e,false));
var _380=(_37f||this.layer.displayOutsideMaxExtent);
if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){
if(_380){
if(!this.backBufferTile){
this.backBufferTile=this.clone();
this.backBufferTile.hide();
this.backBufferTile.isBackBuffer=true;
this.events.register("loadend",this,this.resetBackBuffer);
this.layer.events.register("loadend",this,this.resetBackBuffer);
}
this.startTransition();
}else{
if(this.backBufferTile){
this.backBufferTile.clear();
}
}
}else{
if(_380&&this.isFirstDraw){
this.events.register("loadend",this,this.showTile);
this.isFirstDraw=false;
}
}
this.shouldDraw=_380;
this.clear();
return _380;
},moveTo:function(_381,_382,_383){
if(_383==null){
_383=true;
}
this.bounds=_381.clone();
this.position=_382.clone();
if(_383){
this.draw();
}
},clear:function(){
},getBoundsFromBaseLayer:function(_384){
var msg=OpenLayers.i18n("reprojectDeprecated",{"layerName":this.layer.name});
OpenLayers.Console.warn(msg);
var _386=this.layer.map.getLonLatFromLayerPx(_384);
var _387=_384.clone();
_387.x+=this.size.w;
_387.y+=this.size.h;
var _388=this.layer.map.getLonLatFromLayerPx(_387);
if(_386.lon>_388.lon){
if(_386.lon<0){
_386.lon=-180-(_386.lon+180);
}else{
_388.lon=180+_388.lon+180;
}
}
var _389=new OpenLayers.Bounds(_386.lon,_388.lat,_388.lon,_386.lat);
return _389;
},startTransition:function(){
},resetBackBuffer:function(){
this.showTile();
if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){
this.isFirstDraw=false;
var _38a=this.layer.maxExtent;
var _38b=(_38a&&this.bounds.intersectsBounds(_38a,false));
if(_38b){
this.backBufferTile.position=this.position;
this.backBufferTile.bounds=this.bounds;
this.backBufferTile.size=this.size;
this.backBufferTile.imageSize=this.layer.imageSize||this.size;
this.backBufferTile.imageOffset=this.layer.imageOffset;
this.backBufferTile.resolution=this.layer.getResolution();
this.backBufferTile.renderTile();
}
}
},showTile:function(){
if(this.shouldDraw){
this.show();
}
},show:function(){
},hide:function(){
},CLASS_NAME:"OpenLayers.Tile"});
OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,initialize:function(_38c,_38d,_38e,url,size){
OpenLayers.Tile.prototype.initialize.apply(this,arguments);
this.url=url;
this.frame=document.createElement("div");
this.frame.style.overflow="hidden";
this.frame.style.position="absolute";
this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack();
},destroy:function(){
if(this.imgDiv!=null){
if(this.layerAlphaHack){
OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id);
}else{
OpenLayers.Event.stopObservingElement(this.imgDiv.id);
}
if(this.imgDiv.parentNode==this.frame){
this.frame.removeChild(this.imgDiv);
this.imgDiv.map=null;
}
}
this.imgDiv=null;
if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){
this.layer.div.removeChild(this.frame);
}
this.frame=null;
OpenLayers.Tile.prototype.destroy.apply(this,arguments);
},clone:function(obj){
if(obj==null){
obj=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size);
}
obj=OpenLayers.Tile.prototype.clone.apply(this,[obj]);
obj.imgDiv=null;
return obj;
},draw:function(){
if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){
this.bounds=this.getBoundsFromBaseLayer(this.position);
}
if(!OpenLayers.Tile.prototype.draw.apply(this,arguments)){
return false;
}
if(this.isLoading){
this.events.triggerEvent("reload");
}else{
this.isLoading=true;
this.events.triggerEvent("loadstart");
}
return this.renderTile();
},renderTile:function(){
if(this.imgDiv==null){
this.initImgDiv();
}
this.imgDiv.viewRequestID=this.layer.map.viewRequestID;
this.url=this.layer.getURL(this.bounds);
OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);
var _392=this.layer.getImageSize();
if(this.layerAlphaHack){
OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,_392,this.url);
}else{
OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,_392);
this.imgDiv.src=this.url;
}
return true;
},clear:function(){
if(this.imgDiv){
this.hide();
if(OpenLayers.Tile.Image.useBlankTile){
this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif";
}
}
},initImgDiv:function(){
var _393=this.layer.imageOffset;
var size=this.layer.getImageSize();
if(this.layerAlphaHack){
this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,_393,size,null,"relative",null,null,null,true);
}else{
this.imgDiv=OpenLayers.Util.createImage(null,_393,size,null,"relative",null,null,true);
}
this.imgDiv.className="olTileImage";
this.frame.style.zIndex=this.isBackBuffer?0:1;
this.frame.appendChild(this.imgDiv);
this.layer.div.appendChild(this.frame);
if(this.layer.opacity!=null){
OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity);
}
this.imgDiv.map=this.layer.map;
var _395=function(){
if(this.isLoading){
this.isLoading=false;
this.events.triggerEvent("loadend");
}
};
if(this.layerAlphaHack){
OpenLayers.Event.observe(this.imgDiv.childNodes[0],"load",OpenLayers.Function.bind(_395,this));
}else{
OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(_395,this));
}
var _396=function(){
if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){
_395.call(this);
}
};
OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(_396,this));
},checkImgURL:function(){
if(this.layer){
var _397=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;
if(!OpenLayers.Util.isEquivalentUrl(_397,this.url)){
this.hide();
}
}
},startTransition:function(){
if(!this.backBufferTile||!this.backBufferTile.imgDiv){
return;
}
var _398=1;
if(this.backBufferTile.resolution){
_398=this.backBufferTile.resolution/this.layer.getResolution();
}
if(_398!=this.lastRatio){
if(this.layer.transitionEffect=="resize"){
var _399=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);
var size=new OpenLayers.Size(this.backBufferTile.size.w*_398,this.backBufferTile.size.h*_398);
var px=this.layer.map.getLayerPxFromLonLat(_399);
OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,px,size);
var _39c=this.backBufferTile.imageSize;
_39c=new OpenLayers.Size(_39c.w*_398,_39c.h*_398);
var _39d=this.backBufferTile.imageOffset;
if(_39d){
_39d=new OpenLayers.Pixel(_39d.x*_398,_39d.y*_398);
}
OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,_39d,_39c);
this.backBufferTile.show();
}
}else{
if(this.layer.singleTile){
this.backBufferTile.show();
}else{
this.backBufferTile.hide();
}
}
this.lastRatio=_398;
},show:function(){
this.frame.style.display="";
if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){
if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){
this.frame.scrollLeft=this.frame.scrollLeft;
}
}
},hide:function(){
this.frame.style.display="none";
},CLASS_NAME:"OpenLayers.Tile.Image"});
OpenLayers.Tile.Image.useBlankTile=(OpenLayers.Util.getBrowserName()=="safari"||OpenLayers.Util.getBrowserName()=="opera");
OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:true,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(name,url,_3a0,size,_3a2){
this.url=url;
this.extent=_3a0;
this.size=size;
OpenLayers.Layer.prototype.initialize.apply(this,[name,_3a2]);
this.aspectRatio=(this.extent.getHeight()/this.size.h)/(this.extent.getWidth()/this.size.w);
},destroy:function(){
if(this.tile){
this.tile.destroy();
this.tile=null;
}
OpenLayers.Layer.prototype.destroy.apply(this,arguments);
},clone:function(obj){
if(obj==null){
obj=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.options);
}
obj=OpenLayers.Layer.prototype.clone.apply(this,[obj]);
return obj;
},setMap:function(map){
if(this.options.maxResolution==null){
this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w;
}
OpenLayers.Layer.prototype.setMap.apply(this,arguments);
},moveTo:function(_3a5,_3a6,_3a7){
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
var _3a8=(this.tile==null);
if(_3a6||_3a8){
this.setTileSize();
var ul=new OpenLayers.LonLat(this.extent.left,this.extent.top);
var ulPx=this.map.getLayerPxFromLonLat(ul);
if(_3a8){
this.tile=new OpenLayers.Tile.Image(this,ulPx,this.extent,null,this.tileSize);
}else{
this.tile.size=this.tileSize.clone();
this.tile.position=ulPx.clone();
}
this.tile.draw();
}
},setTileSize:function(){
var _3ab=this.extent.getWidth()/this.map.getResolution();
var _3ac=this.extent.getHeight()/this.map.getResolution();
this.tileSize=new OpenLayers.Size(_3ab,_3ac);
},setUrl:function(_3ad){
this.url=_3ad;
this.tile.draw();
},getURL:function(_3ae){
return this.url;
},CLASS_NAME:"OpenLayers.Layer.Image"});
OpenLayers.Layer.SphericalMercator={getExtent:function(){
var _3af=null;
if(this.sphericalMercator){
_3af=this.map.calculateBounds();
}else{
_3af=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this);
}
return _3af;
},initMercatorParameters:function(){
this.RESOLUTIONS=[];
var _3b0=156543.0339;
for(var zoom=0;zoom<=this.MAX_ZOOM_LEVEL;++zoom){
this.RESOLUTIONS[zoom]=_3b0/Math.pow(2,zoom);
}
this.units="m";
this.projection="EPSG:900913";
},forwardMercator:function(lon,lat){
var x=lon*20037508.34/180;
var y=Math.log(Math.tan((90+lat)*Math.PI/360))/(Math.PI/180);
y=y*20037508.34/180;
return new OpenLayers.LonLat(x,y);
},inverseMercator:function(x,y){
var lon=(x/20037508.34)*180;
var lat=(y/20037508.34)*180;
lat=180/Math.PI*(2*Math.atan(Math.exp(lat*Math.PI/180))-Math.PI/2);
return new OpenLayers.LonLat(lon,lat);
},projectForward:function(_3ba){
var _3bb=OpenLayers.Layer.SphericalMercator.forwardMercator(_3ba.x,_3ba.y);
_3ba.x=_3bb.lon;
_3ba.y=_3bb.lat;
return _3ba;
},projectInverse:function(_3bc){
var _3bd=OpenLayers.Layer.SphericalMercator.inverseMercator(_3bc.x,_3bc.y);
_3bc.x=_3bd.lon;
_3bc.y=_3bd.lat;
return _3bc;
}};
OpenLayers.Projection.addTransform("EPSG:4326","EPSG:900913",OpenLayers.Layer.SphericalMercator.projectForward);
OpenLayers.Projection.addTransform("EPSG:900913","EPSG:4326",OpenLayers.Layer.SphericalMercator.projectInverse);
OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:true,isBaseLayer:true,isFixed:true,pane:null,mapObject:null,initialize:function(name,_3bf){
OpenLayers.Layer.prototype.initialize.apply(this,arguments);
if(this.pane==null){
this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane");
}
},destroy:function(){
this.mapObject=null;
OpenLayers.Layer.prototype.destroy.apply(this,arguments);
},setMap:function(map){
OpenLayers.Layer.prototype.setMap.apply(this,arguments);
this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;
this.pane.style.display=this.div.style.display;
this.pane.style.width="100%";
this.pane.style.height="100%";
if(OpenLayers.Util.getBrowserName()=="msie"){
this.pane.style.background="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)";
}
if(this.isFixed){
this.map.viewPortDiv.appendChild(this.pane);
}else{
this.map.layerContainerDiv.appendChild(this.pane);
}
this.loadMapObject();
if(this.mapObject==null){
this.loadWarningMessage();
}
},removeMap:function(map){
if(this.pane&&this.pane.parentNode){
this.pane.parentNode.removeChild(this.pane);
this.pane=null;
}
OpenLayers.Layer.prototype.removeMap.apply(this,arguments);
},loadWarningMessage:function(){
this.div.style.backgroundColor="darkblue";
var _3c2=this.map.getSize();
var msgW=Math.min(_3c2.w,300);
var msgH=Math.min(_3c2.h,200);
var size=new OpenLayers.Size(msgW,msgH);
var _3c6=new OpenLayers.Pixel(_3c2.w/2,_3c2.h/2);
var _3c7=_3c6.add(-size.w/2,-size.h/2);
var div=OpenLayers.Util.createDiv(this.name+"_warning",_3c7,size,null,null,null,"auto");
div.style.padding="7px";
div.style.backgroundColor="yellow";
div.innerHTML=this.getWarningHTML();
this.div.appendChild(div);
},getWarningHTML:function(){
return "";
},display:function(_3c9){
OpenLayers.Layer.prototype.display.apply(this,arguments);
this.pane.style.display=this.div.style.display;
},setZIndex:function(_3ca){
OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);
this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;
},moveTo:function(_3cb,_3cc,_3cd){
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
if(this.mapObject!=null){
var _3ce=this.map.getCenter();
var _3cf=this.map.getZoom();
if(_3ce!=null){
var _3d0=this.getMapObjectCenter();
var _3d1=this.getOLLonLatFromMapObjectLonLat(_3d0);
var _3d2=this.getMapObjectZoom();
var _3d3=this.getOLZoomFromMapObjectZoom(_3d2);
if(!(_3ce.equals(_3d1))||!(_3cf==_3d3)){
if(_3cd&&this.dragPanMapObject&&this.smoothDragPan){
var _3d4=this.map.getViewPortPxFromLonLat(_3d1);
var _3d5=this.map.getViewPortPxFromLonLat(_3ce);
this.dragPanMapObject(_3d5.x-_3d4.x,_3d4.y-_3d5.y);
}else{
var _3d6=this.getMapObjectLonLatFromOLLonLat(_3ce);
var zoom=this.getMapObjectZoomFromOLZoom(_3cf);
this.setMapObjectCenter(_3d6,zoom,_3cd);
}
}
}
}
},getLonLatFromViewPortPx:function(_3d8){
var _3d9=null;
if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){
var _3da=this.getMapObjectPixelFromOLPixel(_3d8);
var _3db=this.getMapObjectLonLatFromMapObjectPixel(_3da);
_3d9=this.getOLLonLatFromMapObjectLonLat(_3db);
}
return _3d9;
},getViewPortPxFromLonLat:function(_3dc){
var _3dd=null;
if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){
var _3de=this.getMapObjectLonLatFromOLLonLat(_3dc);
var _3df=this.getMapObjectPixelFromMapObjectLonLat(_3de);
_3dd=this.getOLPixelFromMapObjectPixel(_3df);
}
return _3dd;
},getOLLonLatFromMapObjectLonLat:function(_3e0){
var _3e1=null;
if(_3e0!=null){
var lon=this.getLongitudeFromMapObjectLonLat(_3e0);
var lat=this.getLatitudeFromMapObjectLonLat(_3e0);
_3e1=new OpenLayers.LonLat(lon,lat);
}
return _3e1;
},getMapObjectLonLatFromOLLonLat:function(_3e4){
var _3e5=null;
if(_3e4!=null){
_3e5=this.getMapObjectLonLatFromLonLat(_3e4.lon,_3e4.lat);
}
return _3e5;
},getOLPixelFromMapObjectPixel:function(_3e6){
var _3e7=null;
if(_3e6!=null){
var x=this.getXFromMapObjectPixel(_3e6);
var y=this.getYFromMapObjectPixel(_3e6);
_3e7=new OpenLayers.Pixel(x,y);
}
return _3e7;
},getMapObjectPixelFromOLPixel:function(_3ea){
var _3eb=null;
if(_3ea!=null){
_3eb=this.getMapObjectPixelFromXY(_3ea.x,_3ea.y);
}
return _3eb;
},CLASS_NAME:"OpenLayers.Layer.EventPane"});
OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){
},initResolutions:function(){
var _3ec=new Array("minZoomLevel","maxZoomLevel","numZoomLevels");
for(var i=0;i<_3ec.length;i++){
var _3ee=_3ec[i];
this[_3ee]=(this.options[_3ee]!=null)?this.options[_3ee]:this.map[_3ee];
}
if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){
this.minZoomLevel=this.MIN_ZOOM_LEVEL;
}
var _3ef=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;
if(this.numZoomLevels!=null){
this.numZoomLevels=Math.min(this.numZoomLevels,_3ef);
}else{
if(this.maxZoomLevel!=null){
var _3f0=this.maxZoomLevel-this.minZoomLevel+1;
this.numZoomLevels=Math.min(_3f0,_3ef);
}else{
this.numZoomLevels=_3ef;
}
}
this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;
if(this.RESOLUTIONS!=null){
var _3f1=0;
this.resolutions=[];
for(var i=this.minZoomLevel;i<=this.maxZoomLevel;i++){
this.resolutions[_3f1++]=this.RESOLUTIONS[i];
}
this.maxResolution=this.resolutions[0];
this.minResolution=this.resolutions[this.resolutions.length-1];
}
},getResolution:function(){
if(this.resolutions!=null){
return OpenLayers.Layer.prototype.getResolution.apply(this,arguments);
}else{
var _3f2=null;
var _3f3=this.map.getSize();
var _3f4=this.getExtent();
if((_3f3!=null)&&(_3f4!=null)){
_3f2=Math.max(_3f4.getWidth()/_3f3.w,_3f4.getHeight()/_3f3.h);
}
return _3f2;
}
},getExtent:function(){
var _3f5=null;
var size=this.map.getSize();
var tlPx=new OpenLayers.Pixel(0,0);
var tlLL=this.getLonLatFromViewPortPx(tlPx);
var brPx=new OpenLayers.Pixel(size.w,size.h);
var brLL=this.getLonLatFromViewPortPx(brPx);
if((tlLL!=null)&&(brLL!=null)){
_3f5=new OpenLayers.Bounds(tlLL.lon,brLL.lat,brLL.lon,tlLL.lat);
}
return _3f5;
},getZoomForResolution:function(_3fb){
if(this.resolutions!=null){
return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments);
}else{
var _3fc=OpenLayers.Layer.prototype.getExtent.apply(this,[]);
return this.getZoomForExtent(_3fc);
}
},getOLZoomFromMapObjectZoom:function(_3fd){
var zoom=null;
if(_3fd!=null){
zoom=_3fd-this.minZoomLevel;
}
return zoom;
},getMapObjectZoomFromOLZoom:function(_3ff){
var zoom=null;
if(_3ff!=null){
zoom=_3ff+this.minZoomLevel;
}
return zoom;
},CLASS_NAME:"FixedZoomLevels.js"});
OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:19,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062,0.00001072883605957031,0.00000536441802978515,0.00000268220901489257],type:null,sphericalMercator:false,dragObject:null,initialize:function(name,_402){
OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);
OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);
this.addContainerPxFunction();
if(this.sphericalMercator){
OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);
this.initMercatorParameters();
}
},loadMapObject:function(){
try{
this.mapObject=new GMap2(this.div);
if(typeof this.mapObject.getDragObject=="function"){
this.dragObject=this.mapObject.getDragObject();
}else{
this.dragPanMapObject=null;
}
var _403=this.div.lastChild;
this.div.removeChild(_403);
this.pane.appendChild(_403);
_403.className="olLayerGooglePoweredBy gmnoprint";
_403.style.left="";
_403.style.bottom="";
var _404=this.div.lastChild;
this.div.removeChild(_404);
this.pane.appendChild(_404);
_404.className="olLayerGoogleCopyright";
_404.style.right="";
_404.style.bottom="";
}
catch(e){
OpenLayers.Console.error(e);
}
},setMap:function(map){
OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);
if(this.type!=null){
this.map.events.register("moveend",this,this.setMapType);
}
},setMapType:function(){
if(this.mapObject.getCenter()!=null){
if(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)==-1){
this.mapObject.addMapType(this.type);
}
this.mapObject.setMapType(this.type);
this.map.events.unregister("moveend",this,this.setMapType);
}
},onMapResize:function(){
this.mapObject.checkResize();
},getOLBoundsFromMapObjectBounds:function(_406){
var _407=null;
if(_406!=null){
var sw=_406.getSouthWest();
var ne=_406.getNorthEast();
if(this.sphericalMercator){
sw=this.forwardMercator(sw.lng(),sw.lat());
ne=this.forwardMercator(ne.lng(),ne.lat());
}else{
sw=new OpenLayers.LonLat(sw.lng(),sw.lat());
ne=new OpenLayers.LonLat(ne.lng(),ne.lat());
}
_407=new OpenLayers.Bounds(sw.lon,sw.lat,ne.lon,ne.lat);
}
return _407;
},getMapObjectBoundsFromOLBounds:function(_40a){
var _40b=null;
if(_40a!=null){
var sw=this.sphericalMercator?this.inverseMercator(_40a.bottom,_40a.left):new OpenLayers.LonLat(_40a.bottom,_40a.left);
var ne=this.sphericalMercator?this.inverseMercator(_40a.top,_40a.right):new OpenLayers.LonLat(_40a.top,_40a.right);
_40b=new GLatLngBounds(new GLatLng(sw.lat,sw.lon),new GLatLng(ne.lat,ne.lon));
}
return _40b;
},addContainerPxFunction:function(){
if((typeof GMap2!="undefined")&&!GMap2.prototype.fromLatLngToContainerPixel){
GMap2.prototype.fromLatLngToContainerPixel=function(_40e){
var _40f=this.fromLatLngToDivPixel(_40e);
var div=this.getContainer().firstChild.firstChild;
_40f.x+=div.offsetLeft;
_40f.y+=div.offsetTop;
return _40f;
};
}
},getWarningHTML:function(){
return OpenLayers.i18n("googleWarning");
},setMapObjectCenter:function(_411,zoom){
this.mapObject.setCenter(_411,zoom);
},dragPanMapObject:function(dX,dY){
this.dragObject.moveBy(new GSize(-dX,dY));
},getMapObjectCenter:function(){
return this.mapObject.getCenter();
},getMapObjectZoom:function(){
return this.mapObject.getZoom();
},getMapObjectLonLatFromMapObjectPixel:function(_415){
return this.mapObject.fromContainerPixelToLatLng(_415);
},getMapObjectPixelFromMapObjectLonLat:function(_416){
return this.mapObject.fromLatLngToContainerPixel(_416);
},getMapObjectZoomFromMapObjectBounds:function(_417){
return this.mapObject.getBoundsZoomLevel(_417);
},getLongitudeFromMapObjectLonLat:function(_418){
return this.sphericalMercator?this.forwardMercator(_418.lng(),_418.lat()).lon:_418.lng();
},getLatitudeFromMapObjectLonLat:function(_419){
var lat=this.sphericalMercator?this.forwardMercator(_419.lng(),_419.lat()).lat:_419.lat();
return lat;
},getMapObjectLonLatFromLonLat:function(lon,lat){
var _41d;
if(this.sphericalMercator){
var _41e=this.inverseMercator(lon,lat);
_41d=new GLatLng(_41e.lat,_41e.lon);
}else{
_41d=new GLatLng(lat,lon);
}
return _41d;
},getXFromMapObjectPixel:function(_41f){
return _41f.x;
},getYFromMapObjectPixel:function(_420){
return _420.y;
},getMapObjectPixelFromXY:function(x,y){
return new GPoint(x,y);
},CLASS_NAME:"OpenLayers.Layer.Google"});
OpenLayers.Layer.VirtualEarth=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125],type:null,sphericalMercator:false,initialize:function(name,_424){
OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);
OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);
if(this.sphericalMercator){
OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);
this.initMercatorParameters();
}
},loadMapObject:function(){
var _425=OpenLayers.Util.createDiv(this.name);
var sz=this.map.getSize();
_425.style.width=sz.w;
_425.style.height=sz.h;
this.div.appendChild(_425);
try{
this.mapObject=new VEMap(this.name);
}
catch(e){
}
if(this.mapObject!=null){
try{
this.mapObject.LoadMap(null,null,this.type,true);
this.mapObject.AttachEvent("onmousedown",function(){
return true;
});
}
catch(e){
}
this.mapObject.HideDashboard();
}
if(!this.mapObject||!this.mapObject.vemapcontrol||!this.mapObject.vemapcontrol.PanMap||(typeof this.mapObject.vemapcontrol.PanMap!="function")){
this.dragPanMapObject=null;
}
},getWarningHTML:function(){
return OpenLayers.i18n("getLayerWarning",{"layerType":"VE","layerLib":"VirtualEarth"});
},setMapObjectCenter:function(_427,zoom){
this.mapObject.SetCenterAndZoom(_427,zoom);
},getMapObjectCenter:function(){
return this.mapObject.GetCenter();
},dragPanMapObject:function(dX,dY){
this.mapObject.vemapcontrol.PanMap(dX,-dY);
},getMapObjectZoom:function(){
return this.mapObject.GetZoomLevel();
},getMapObjectLonLatFromMapObjectPixel:function(_42b){
return this.mapObject.PixelToLatLong(_42b.x,_42b.y);
},getMapObjectPixelFromMapObjectLonLat:function(_42c){
return this.mapObject.LatLongToPixel(_42c);
},getLongitudeFromMapObjectLonLat:function(_42d){
return this.sphericalMercator?this.forwardMercator(_42d.Longitude,_42d.Latitude).lon:_42d.Longitude;
},getLatitudeFromMapObjectLonLat:function(_42e){
return this.sphericalMercator?this.forwardMercator(_42e.Longitude,_42e.Latitude).lat:_42e.Latitude;
},getMapObjectLonLatFromLonLat:function(lon,lat){
var _431;
if(this.sphericalMercator){
var _432=this.inverseMercator(lon,lat);
_431=new VELatLong(_432.lat,_432.lon);
}else{
_431=new VELatLong(lat,lon);
}
return _431;
},getXFromMapObjectPixel:function(_433){
return _433.x;
},getYFromMapObjectPixel:function(_434){
return _434.y;
},getMapObjectPixelFromXY:function(x,y){
return new Msn.VE.Pixel(x,y);
},CLASS_NAME:"OpenLayers.Layer.VirtualEarth"});
OpenLayers.Layer.Yahoo=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:15,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125],type:null,sphericalMercator:false,initialize:function(name,_438){
OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);
OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);
if(this.sphericalMercator){
OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);
this.initMercatorParameters();
}
},loadMapObject:function(){
try{
var size=this.getMapObjectSizeFromOLSize(this.map.getSize());
this.mapObject=new YMap(this.div,this.type,size);
this.mapObject.disableKeyControls();
this.mapObject.disableDragMap();
if(!this.mapObject.moveByXY||(typeof this.mapObject.moveByXY!="function")){
this.dragPanMapObject=null;
}
}
catch(e){
}
},onMapResize:function(){
try{
var size=this.getMapObjectSizeFromOLSize(this.map.getSize());
this.mapObject.resizeTo(size);
}
catch(e){
}
},setMap:function(map){
OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);
this.map.events.register("moveend",this,this.fixYahooEventPane);
},fixYahooEventPane:function(){
var _43c=OpenLayers.Util.getElement("ygddfdiv");
if(_43c!=null){
if(_43c.parentNode!=null){
_43c.parentNode.removeChild(_43c);
}
this.map.events.unregister("moveend",this,this.fixYahooEventPane);
}
},getWarningHTML:function(){
return OpenLayers.i18n("getLayerWarning",{"layerType":"Yahoo","layerLib":"Yahoo"});
},getOLZoomFromMapObjectZoom:function(_43d){
var zoom=null;
if(_43d!=null){
zoom=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[_43d]);
zoom=18-zoom;
}
return zoom;
},getMapObjectZoomFromOLZoom:function(_43f){
var zoom=null;
if(_43f!=null){
zoom=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[_43f]);
zoom=18-zoom;
}
return zoom;
},setMapObjectCenter:function(_441,zoom){
this.mapObject.drawZoomAndCenter(_441,zoom);
},getMapObjectCenter:function(){
return this.mapObject.getCenterLatLon();
},dragPanMapObject:function(dX,dY){
this.mapObject.moveByXY({"x":-dX,"y":dY});
},getMapObjectZoom:function(){
return this.mapObject.getZoomLevel();
},getMapObjectLonLatFromMapObjectPixel:function(_445){
return this.mapObject.convertXYLatLon(_445);
},getMapObjectPixelFromMapObjectLonLat:function(_446){
return this.mapObject.convertLatLonXY(_446);
},getLongitudeFromMapObjectLonLat:function(_447){
return this.sphericalMercator?this.forwardMercator(_447.Lon,_447.Lat).lon:_447.Lon;
},getLatitudeFromMapObjectLonLat:function(_448){
return this.sphericalMercator?this.forwardMercator(_448.Lon,_448.Lat).lat:_448.Lat;
},getMapObjectLonLatFromLonLat:function(lon,lat){
var _44b;
if(this.sphericalMercator){
var _44c=this.inverseMercator(lon,lat);
_44b=new YGeoPoint(_44c.lat,_44c.lon);
}else{
_44b=new YGeoPoint(lat,lon);
}
return _44b;
},getXFromMapObjectPixel:function(_44d){
return _44d.x;
},getYFromMapObjectPixel:function(_44e){
return _44e.y;
},getMapObjectPixelFromXY:function(x,y){
return new YCoordPoint(x,y);
},getMapObjectSizeFromOLSize:function(_451){
return new YSize(_451.w,_451.h);
},CLASS_NAME:"OpenLayers.Layer.Yahoo"});
OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(name,url,_454,_455){
var _456=arguments;
_456=[name,_455];
OpenLayers.Layer.prototype.initialize.apply(this,_456);
this.url=url;
this.params=OpenLayers.Util.extend({},_454);
},destroy:function(){
this.url=null;
this.params=null;
OpenLayers.Layer.prototype.destroy.apply(this,arguments);
},clone:function(obj){
if(obj==null){
obj=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options);
}
obj=OpenLayers.Layer.prototype.clone.apply(this,[obj]);
return obj;
},setUrl:function(_458){
this.url=_458;
},mergeNewParams:function(_459){
this.params=OpenLayers.Util.extend(this.params,_459);
return this.redraw();
},redraw:function(_45a){
if(_45a){
return this.mergeNewParams({"_olSalt":Math.random()});
}else{
return OpenLayers.Layer.prototype.redraw.apply(this,[]);
}
},selectUrl:function(_45b,urls){
var _45d=1;
for(var i=0;i<_45b.length;i++){
_45d*=_45b.charCodeAt(i)*this.URL_HASH_FACTOR;
_45d-=Math.floor(_45d);
}
return urls[Math.floor(_45d*urls.length)];
},getFullRequestString:function(_45f,_460){
var url=_460||this.url;
var _462=OpenLayers.Util.extend({},this.params);
_462=OpenLayers.Util.extend(_462,_45f);
var _463=OpenLayers.Util.getParameterString(_462);
if(url instanceof Array){
url=this.selectUrl(_463,url);
}
var _464=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(url));
for(var key in _462){
if(key.toUpperCase() in _464){
delete _462[key];
}
}
_463=OpenLayers.Util.getParameterString(_462);
var _466=url;
if(_463!=""){
var _467=url.charAt(url.length-1);
if((_467=="&")||(_467=="?")){
_466+=_463;
}else{
if(url.indexOf("?")==-1){
_466+="?"+_463;
}else{
_466+="&"+_463;
}
}
}
return _466;
},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});
OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,grid:null,singleTile:false,ratio:1.5,buffer:2,numLoadingTiles:0,initialize:function(name,url,_46a,_46b){
OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);
this.events.addEventType("tileloaded");
this.grid=[];
},destroy:function(){
this.clearGrid();
this.grid=null;
this.tileSize=null;
OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments);
},clearGrid:function(){
if(this.grid){
for(var iRow=0;iRow<this.grid.length;iRow++){
var row=this.grid[iRow];
for(var iCol=0;iCol<row.length;iCol++){
var tile=row[iCol];
this.removeTileMonitoringHooks(tile);
tile.destroy();
}
}
this.grid=[];
}
},clone:function(obj){
if(obj==null){
obj=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options);
}
obj=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[obj]);
if(this.tileSize!=null){
obj.tileSize=this.tileSize.clone();
}
obj.grid=[];
return obj;
},moveTo:function(_471,_472,_473){
OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);
_471=_471||this.map.getExtent();
if(_471!=null){
var _474=!this.grid.length||_472;
var _475=this.getTilesBounds();
if(this.singleTile){
if(_474||(!_473&&!_475.containsBounds(_471))){
this.initSingleTile(_471);
}
}else{
if(_474||!_475.containsBounds(_471,true)){
this.initGriddedTiles(_471);
}else{
this.moveGriddedTiles(_471);
}
}
}
},setTileSize:function(size){
if(this.singleTile){
size=this.map.getSize().clone();
size.h=parseInt(size.h*this.ratio);
size.w=parseInt(size.w*this.ratio);
}
OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[size]);
},getGridBounds:function(){
var msg="The getGridBounds() function is deprecated. It will be "+"removed in 3.0. Please use getTilesBounds() instead.";
OpenLayers.Console.warn(msg);
return this.getTilesBounds();
},getTilesBounds:function(){
var _478=null;
if(this.grid.length){
var _479=this.grid.length-1;
var _47a=this.grid[_479][0];
var _47b=this.grid[0].length-1;
var _47c=this.grid[0][_47b];
_478=new OpenLayers.Bounds(_47a.bounds.left,_47a.bounds.bottom,_47c.bounds.right,_47c.bounds.top);
}
return _478;
},initSingleTile:function(_47d){
var _47e=_47d.getCenterLonLat();
var _47f=_47d.getWidth()*this.ratio;
var _480=_47d.getHeight()*this.ratio;
var _481=new OpenLayers.Bounds(_47e.lon-(_47f/2),_47e.lat-(_480/2),_47e.lon+(_47f/2),_47e.lat+(_480/2));
var ul=new OpenLayers.LonLat(_481.left,_481.top);
var px=this.map.getLayerPxFromLonLat(ul);
if(!this.grid.length){
this.grid[0]=[];
}
var tile=this.grid[0][0];
if(!tile){
tile=this.addTile(_481,px);
this.addTileMonitoringHooks(tile);
tile.draw();
this.grid[0][0]=tile;
}else{
tile.moveTo(_481,px);
}
this.removeExcessTiles(1,1);
},calculateGridLayout:function(_485,_486,_487){
var _488=_487*this.tileSize.w;
var _489=_487*this.tileSize.h;
var _48a=_485.left-_486.left;
var _48b=Math.floor(_48a/_488)-this.buffer;
var _48c=_48a/_488-_48b;
var _48d=-_48c*this.tileSize.w;
var _48e=_486.left+_48b*_488;
var _48f=_485.top-(_486.bottom+_489);
var _490=Math.ceil(_48f/_489)+this.buffer;
var _491=_490-_48f/_489;
var _492=-_491*this.tileSize.h;
var _493=_486.bottom+_490*_489;
return {tilelon:_488,tilelat:_489,tileoffsetlon:_48e,tileoffsetlat:_493,tileoffsetx:_48d,tileoffsety:_492};
},initGriddedTiles:function(_494){
var _495=this.map.getSize();
var _496=Math.ceil(_495.h/this.tileSize.h)+Math.max(1,2*this.buffer);
var _497=Math.ceil(_495.w/this.tileSize.w)+Math.max(1,2*this.buffer);
var _498=this.map.getMaxExtent();
var _499=this.map.getResolution();
var _49a=this.calculateGridLayout(_494,_498,_499);
var _49b=Math.round(_49a.tileoffsetx);
var _49c=Math.round(_49a.tileoffsety);
var _49d=_49a.tileoffsetlon;
var _49e=_49a.tileoffsetlat;
var _49f=_49a.tilelon;
var _4a0=_49a.tilelat;
this.origin=new OpenLayers.Pixel(_49b,_49c);
var _4a1=_49b;
var _4a2=_49d;
var _4a3=0;
var _4a4=parseInt(this.map.layerContainerDiv.style.left);
var _4a5=parseInt(this.map.layerContainerDiv.style.top);
do{
var row=this.grid[_4a3++];
if(!row){
row=[];
this.grid.push(row);
}
_49d=_4a2;
_49b=_4a1;
var _4a7=0;
do{
var _4a8=new OpenLayers.Bounds(_49d,_49e,_49d+_49f,_49e+_4a0);
var x=_49b;
x-=_4a4;
var y=_49c;
y-=_4a5;
var px=new OpenLayers.Pixel(x,y);
var tile=row[_4a7++];
if(!tile){
tile=this.addTile(_4a8,px);
this.addTileMonitoringHooks(tile);
row.push(tile);
}else{
tile.moveTo(_4a8,px,false);
}
_49d+=_49f;
_49b+=this.tileSize.w;
}while((_49d<=_494.right+_49f*this.buffer)||_4a7<_497);
_49e-=_4a0;
_49c+=this.tileSize.h;
}while((_49e>=_494.bottom-_4a0*this.buffer)||_4a3<_496);
this.removeExcessTiles(_4a3,_4a7);
this.spiralTileLoad();
},spiralTileLoad:function(){
var _4ad=[];
var _4ae=["right","down","left","up"];
var iRow=0;
var _4b0=-1;
var _4b1=OpenLayers.Util.indexOf(_4ae,"right");
var _4b2=0;
while(_4b2<_4ae.length){
var _4b3=iRow;
var _4b4=_4b0;
switch(_4ae[_4b1]){
case "right":
_4b4++;
break;
case "down":
_4b3++;
break;
case "left":
_4b4--;
break;
case "up":
_4b3--;
break;
}
var tile=null;
if((_4b3<this.grid.length)&&(_4b3>=0)&&(_4b4<this.grid[0].length)&&(_4b4>=0)){
tile=this.grid[_4b3][_4b4];
}
if((tile!=null)&&(!tile.queued)){
_4ad.unshift(tile);
tile.queued=true;
_4b2=0;
iRow=_4b3;
_4b0=_4b4;
}else{
_4b1=(_4b1+1)%4;
_4b2++;
}
}
for(var i=0;i<_4ad.length;i++){
var tile=_4ad[i];
tile.draw();
tile.queued=false;
}
},addTile:function(_4b7,_4b8){
},addTileMonitoringHooks:function(tile){
tile.onLoadStart=function(){
if(this.numLoadingTiles==0){
this.events.triggerEvent("loadstart");
}
this.numLoadingTiles++;
};
tile.events.register("loadstart",this,tile.onLoadStart);
tile.onLoadEnd=function(){
this.numLoadingTiles--;
this.events.triggerEvent("tileloaded");
if(this.numLoadingTiles==0){
this.events.triggerEvent("loadend");
}
};
tile.events.register("loadend",this,tile.onLoadEnd);
tile.events.register("unload",this,tile.onLoadEnd);
},removeTileMonitoringHooks:function(tile){
tile.unload();
tile.events.un({"loadstart":tile.onLoadStart,"loadend":tile.onLoadEnd,"unload":tile.onLoadEnd,scope:this});
},moveGriddedTiles:function(_4bb){
var _4bc=this.buffer||1;
while(true){
var _4bd=this.grid[0][0].position;
var _4be=this.map.getViewPortPxFromLayerPx(_4bd);
if(_4be.x>-this.tileSize.w*(_4bc-1)){
this.shiftColumn(true);
}else{
if(_4be.x<-this.tileSize.w*_4bc){
this.shiftColumn(false);
}else{
if(_4be.y>-this.tileSize.h*(_4bc-1)){
this.shiftRow(true);
}else{
if(_4be.y<-this.tileSize.h*_4bc){
this.shiftRow(false);
}else{
break;
}
}
}
}
}
},shiftRow:function(_4bf){
var _4c0=(_4bf)?0:(this.grid.length-1);
var grid=this.grid;
var _4c2=grid[_4c0];
var _4c3=this.map.getResolution();
var _4c4=(_4bf)?-this.tileSize.h:this.tileSize.h;
var _4c5=_4c3*-_4c4;
var row=(_4bf)?grid.pop():grid.shift();
for(var i=0;i<_4c2.length;i++){
var _4c8=_4c2[i];
var _4c9=_4c8.bounds.clone();
var _4ca=_4c8.position.clone();
_4c9.bottom=_4c9.bottom+_4c5;
_4c9.top=_4c9.top+_4c5;
_4ca.y=_4ca.y+_4c4;
row[i].moveTo(_4c9,_4ca);
}
if(_4bf){
grid.unshift(row);
}else{
grid.push(row);
}
},shiftColumn:function(_4cb){
var _4cc=(_4cb)?-this.tileSize.w:this.tileSize.w;
var _4cd=this.map.getResolution();
var _4ce=_4cd*_4cc;
for(var i=0;i<this.grid.length;i++){
var row=this.grid[i];
var _4d1=(_4cb)?0:(row.length-1);
var _4d2=row[_4d1];
var _4d3=_4d2.bounds.clone();
var _4d4=_4d2.position.clone();
_4d3.left=_4d3.left+_4ce;
_4d3.right=_4d3.right+_4ce;
_4d4.x=_4d4.x+_4cc;
var tile=_4cb?this.grid[i].pop():this.grid[i].shift();
tile.moveTo(_4d3,_4d4);
if(_4cb){
row.unshift(tile);
}else{
row.push(tile);
}
}
},removeExcessTiles:function(rows,_4d7){
while(this.grid.length>rows){
var row=this.grid.pop();
for(var i=0,l=row.length;i<l;i++){
var tile=row[i];
this.removeTileMonitoringHooks(tile);
tile.destroy();
}
}
while(this.grid[0].length>_4d7){
for(var i=0,l=this.grid.length;i<l;i++){
var row=this.grid[i];
var tile=row.pop();
this.removeTileMonitoringHooks(tile);
tile.destroy();
}
}
},onMapResize:function(){
if(this.singleTile){
this.clearGrid();
this.setTileSize();
}
},getTileBounds:function(_4dc){
var _4dd=this.map.getMaxExtent();
var _4de=this.getResolution();
var _4df=_4de*this.tileSize.w;
var _4e0=_4de*this.tileSize.h;
var _4e1=this.getLonLatFromViewPortPx(_4dc);
var _4e2=_4dd.left+(_4df*Math.floor((_4e1.lon-_4dd.left)/_4df));
var _4e3=_4dd.bottom+(_4e0*Math.floor((_4e1.lat-_4dd.bottom)/_4e0));
return new OpenLayers.Bounds(_4e2,_4e3,_4e2+_4df,_4e3+_4e0);
},CLASS_NAME:"OpenLayers.Layer.Grid"});
OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,units:null,resolution:OpenLayers.DOTS_PER_INCH,DEFAULT_PARAMS:{i:"jpeg",map:""},initialize:function(name,url,_4e6,_4e7){
var _4e8=[];
_4e8.push(name,url,_4e6,_4e7);
OpenLayers.Layer.Grid.prototype.initialize.apply(this,_4e8);
this.params=(_4e6?_4e6:{});
if(_4e6){
OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);
}
},getURL:function(_4e9){
_4e9=this.adjustBounds(_4e9);
var _4ea=this.map.getResolution();
var _4eb=Math.round((this.map.getScale()*10000))/10000;
var pX=Math.round(_4e9.left/_4ea);
var pY=-Math.round(_4e9.top/_4ea);
return this.getFullRequestString({t:pY,l:pX,s:_4eb});
},addTile:function(_4ee,_4ef){
var url=this.getURL(_4ee);
return new OpenLayers.Tile.Image(this,_4ef,_4ee,url,this.tileSize);
},calculateGridLayout:function(_4f1,_4f2,_4f3){
var _4f4=_4f3*this.tileSize.w;
var _4f5=_4f3*this.tileSize.h;
var _4f6=_4f1.left;
var _4f7=Math.floor(_4f6/_4f4)-this.buffer;
var _4f8=_4f6/_4f4-_4f7;
var _4f9=-_4f8*this.tileSize.w;
var _4fa=_4f7*_4f4;
var _4fb=_4f1.top;
var _4fc=Math.ceil(_4fb/_4f5)+this.buffer;
var _4fd=_4fc-_4fb/_4f5;
var _4fe=-(_4fd+1)*this.tileSize.h;
var _4ff=_4fc*_4f5;
return {tilelon:_4f4,tilelat:_4f5,tileoffsetlon:_4fa,tileoffsetlat:_4ff,tileoffsetx:_4f9,tileoffsety:_4fe};
},clone:function(obj){
if(obj==null){
obj=new OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.options);
}
obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);
if(this.tileSize!=null){
obj.tileSize=this.tileSize.clone();
}
obj.grid=[];
return obj;
},getTileBounds:function(_501){
var _502=this.getResolution();
var _503=_502*this.tileSize.w;
var _504=_502*this.tileSize.h;
var _505=this.getLonLatFromViewPortPx(_501);
var _506=_503*Math.floor(_505.lon/_503);
var _507=_504*Math.floor(_505.lat/_504);
return new OpenLayers.Bounds(_506,_507,_506+_503,_507+_504);
},CLASS_NAME:"OpenLayers.Layer.KaMap"});
OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(name,_509){
OpenLayers.Layer.prototype.initialize.apply(this,arguments);
this.markers=[];
},destroy:function(){
this.clearMarkers();
this.markers=null;
OpenLayers.Layer.prototype.destroy.apply(this,arguments);
},setOpacity:function(_50a){
if(_50a!=this.opacity){
this.opacity=_50a;
for(var i=0;i<this.markers.length;i++){
this.markers[i].setOpacity(this.opacity);
}
}
},moveTo:function(_50c,_50d,_50e){
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
if(_50d||!this.drawn){
for(var i=0;i<this.markers.length;i++){
this.drawMarker(this.markers[i]);
}
this.drawn=true;
}
},addMarker:function(_510){
this.markers.push(_510);
if(this.opacity!=null){
_510.setOpacity(this.opacity);
}
if(this.map&&this.map.getExtent()){
_510.map=this.map;
this.drawMarker(_510);
}
},removeMarker:function(_511){
if(this.markers&&this.markers.length){
OpenLayers.Util.removeItem(this.markers,_511);
if((_511.icon!=null)&&(_511.icon.imageDiv!=null)&&(_511.icon.imageDiv.parentNode==this.div)){
this.div.removeChild(_511.icon.imageDiv);
_511.drawn=false;
}
}
},clearMarkers:function(){
if(this.markers!=null){
while(this.markers.length>0){
this.removeMarker(this.markers[0]);
}
}
},drawMarker:function(_512){
var px=this.map.getLayerPxFromLonLat(_512.lonlat);
if(px==null){
_512.display(false);
}else{
var _514=_512.draw(px);
if(!_512.drawn){
this.div.appendChild(_514);
_512.drawn=true;
}
}
},getDataExtent:function(){
var _515=null;
if(this.markers&&(this.markers.length>0)){
var _515=new OpenLayers.Bounds();
for(var i=0;i<this.markers.length;i++){
var _517=this.markers[i];
_515.extend(_517.lonlat);
}
}
return _515;
},CLASS_NAME:"OpenLayers.Layer.Markers"});
OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",exceptions:"application/vnd.ogc.se_inimage",format:"image/jpeg"},reproject:false,isBaseLayer:true,encodeBBOX:false,initialize:function(name,url,_51a,_51b){
var _51c=[];
_51a=OpenLayers.Util.upperCaseObject(_51a);
_51c.push(name,url,_51a,_51b);
OpenLayers.Layer.Grid.prototype.initialize.apply(this,_51c);
OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));
if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){
if((_51b==null)||(!_51b.isBaseLayer)){
this.isBaseLayer=false;
}
if(this.params.FORMAT=="image/jpeg"){
this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png";
}
}
},destroy:function(){
OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);
},clone:function(obj){
if(obj==null){
obj=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options);
}
obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);
return obj;
},getURL:function(_51e){
_51e=this.adjustBounds(_51e);
var _51f=this.getImageSize();
var _520={"BBOX":this.encodeBBOX?_51e.toBBOX():_51e.toArray(),"WIDTH":_51f.w,"HEIGHT":_51f.h};
var _521=this.getFullRequestString(_520);
return _521;
},addTile:function(_522,_523){
return new OpenLayers.Tile.Image(this,_523,_522,null,this.tileSize);
},mergeNewParams:function(_524){
var _525=OpenLayers.Util.upperCaseObject(_524);
var _526=[_525];
return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,_526);
},getFullRequestString:function(_527,_528){
var _529=this.map.getProjection();
this.params.SRS=(_529=="none")?null:_529;
return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments);
},CLASS_NAME:"OpenLayers.Layer.WMS"});
OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,tileOrigin:null,format:"image/png",initialize:function(name,url,_52c,_52d){
this.layername=_52c;
OpenLayers.Layer.Grid.prototype.initialize.apply(this,[name,url,{},_52d]);
this.extension=this.format.split("/")[1].toLowerCase();
this.extension=(this.extension=="jpg")?"jpeg":this.extension;
},clone:function(obj){
if(obj==null){
obj=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.options);
}
obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);
return obj;
},getURL:function(_52f){
var res=this.map.getResolution();
var bbox=this.maxExtent;
var size=this.tileSize;
var _533=Math.round((_52f.left-bbox.left)/(res*size.w));
var _534=Math.round((_52f.bottom-bbox.bottom)/(res*size.h));
var _535=this.map.zoom;
function zeroPad(_536,_537){
_536=String(_536);
var _538=[];
for(var i=0;i<_537;++i){
_538.push("0");
}
return _538.join("").substring(0,_537-_536.length)+_536;
};
var _53a=[this.layername,zeroPad(_535,2),zeroPad(parseInt(_533/1000000),3),zeroPad((parseInt(_533/1000)%1000),3),zeroPad((parseInt(_533)%1000),3),zeroPad(parseInt(_534/1000000),3),zeroPad((parseInt(_534/1000)%1000),3),zeroPad((parseInt(_534)%1000),3)+"."+this.extension];
var path=_53a.join("/");
var url=this.url;
if(url instanceof Array){
url=this.selectUrl(path,url);
}
url=(url.charAt(url.length-1)=="/")?url:url+"/";
return url+path;
},addTile:function(_53d,_53e){
var url=this.getURL(_53d);
return new OpenLayers.Tile.Image(this,_53e,_53d,url,this.tileSize);
},setMap:function(map){
OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);
if(!this.tileOrigin){
this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom);
}
},CLASS_NAME:"OpenLayers.Layer.TileCache"});
OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,anchor:null,initialize:function(id,_542,size,_544,_545,_546,_547){
var _548=new Array(id,_542,size,_544,_546,_547);
OpenLayers.Popup.prototype.initialize.apply(this,_548);
this.anchor=(_545!=null)?_545:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)};
},destroy:function(){
this.anchor=null;
this.relativePosition=null;
OpenLayers.Popup.prototype.destroy.apply(this,arguments);
},show:function(){
this.updatePosition();
OpenLayers.Popup.prototype.show.apply(this,arguments);
},moveTo:function(px){
var _54a=this.relativePosition;
this.relativePosition=this.calculateRelativePosition(px);
var _54b=this.calculateNewPx(px);
var _54c=new Array(_54b);
OpenLayers.Popup.prototype.moveTo.apply(this,_54c);
if(this.relativePosition!=_54a){
this.updateRelativePosition();
}
},setSize:function(size){
OpenLayers.Popup.prototype.setSize.apply(this,arguments);
if((this.lonlat)&&(this.map)){
var px=this.map.getLayerPxFromLonLat(this.lonlat);
this.moveTo(px);
}
},calculateRelativePosition:function(px){
var _550=this.map.getLonLatFromLayerPx(px);
var _551=this.map.getExtent();
var _552=_551.determineQuadrant(_550);
return OpenLayers.Bounds.oppositeQuadrant(_552);
},updateRelativePosition:function(){
},calculateNewPx:function(px){
var _554=px.offset(this.anchor.offset);
var top=(this.relativePosition.charAt(0)=="t");
_554.y+=(top)?-this.size.h:this.anchor.size.h;
var left=(this.relativePosition.charAt(1)=="l");
_554.x+=(left)?-this.size.w:this.anchor.size.w;
return _554;
},CLASS_NAME:"OpenLayers.Popup.Anchored"});
OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(id,_558,size,_55a,_55b,_55c,_55d){
this.padding=new OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);
OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);
},draw:function(px){
OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);
this.setContentHTML();
this.setBackgroundColor();
this.setOpacity();
return this.div;
},updateRelativePosition:function(){
this.setRicoCorners();
},setSize:function(size){
OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);
this.setRicoCorners();
},setBackgroundColor:function(_560){
if(_560!=undefined){
this.backgroundColor=_560;
}
if(this.div!=null){
if(this.contentDiv!=null){
this.div.style.background="transparent";
OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor);
}
}
},setOpacity:function(_561){
OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,_561);
if(this.div!=null){
if(this.groupDiv!=null){
OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity);
}
}
},setBorder:function(_562){
this.border=0;
},setRicoCorners:function(){
var _563=this.getCornersToRound(this.relativePosition);
var _564={corners:_563,color:this.backgroundColor,bgColor:"transparent",blend:false};
if(!this.rounded){
OpenLayers.Rico.Corner.round(this.div,_564);
this.rounded=true;
}else{
OpenLayers.Rico.Corner.reRound(this.groupDiv,_564);
this.setBackgroundColor();
this.setOpacity();
}
},getCornersToRound:function(){
var _565=["tl","tr","bl","br"];
var _566=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);
OpenLayers.Util.removeItem(_565,_566);
return _565.join(" ");
},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});
OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;
OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(_567,_568,data){
this.layer=_567;
this.lonlat=_568;
this.data=(data!=null)?data:{};
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
},destroy:function(){
if((this.layer!=null)&&(this.layer.map!=null)){
if(this.popup!=null){
this.layer.map.removePopup(this.popup);
}
}
this.layer=null;
this.id=null;
this.lonlat=null;
this.data=null;
if(this.marker!=null){
this.destroyMarker(this.marker);
this.marker=null;
}
if(this.popup!=null){
this.destroyPopup(this.popup);
this.popup=null;
}
},onScreen:function(){
var _56a=false;
if((this.layer!=null)&&(this.layer.map!=null)){
var _56b=this.layer.map.getExtent();
_56a=_56b.containsLonLat(this.lonlat);
}
return _56a;
},createMarker:function(){
if(this.lonlat!=null){
this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon);
}
return this.marker;
},destroyMarker:function(){
this.marker.destroy();
},createPopup:function(_56c){
if(this.lonlat!=null){
var id=this.id+"_popup";
var _56e=(this.marker)?this.marker.icon:null;
if(!this.popup){
this.popup=new this.popupClass(id,this.lonlat,this.data.popupSize,this.data.popupContentHTML,_56e,_56c);
}
if(this.data.overflow!=null){
this.popup.contentDiv.style.overflow=this.data.overflow;
}
this.popup.feature=this;
}
return this.popup;
},destroyPopup:function(){
if(this.popup){
this.popup.feature=null;
this.popup.destroy();
this.popup=null;
}
},CLASS_NAME:"OpenLayers.Feature"});
OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};
OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,state:null,style:null,renderIntent:"default",initialize:function(_56f,_570,_571){
OpenLayers.Feature.prototype.initialize.apply(this,[null,null,_570]);
this.lonlat=null;
this.geometry=_56f;
this.state=null;
this.attributes={};
if(_570){
this.attributes=OpenLayers.Util.extend(this.attributes,_570);
}
this.style=_571?_571:null;
},destroy:function(){
if(this.layer){
this.layer.removeFeatures(this);
this.layer=null;
}
this.geometry=null;
OpenLayers.Feature.prototype.destroy.apply(this,arguments);
},clone:function(){
return new OpenLayers.Feature.Vector(this.geometry.clone(),this.attributes,this.style);
},onScreen:function(_572){
var _573=false;
if(this.layer&&this.layer.map){
var _574=this.layer.map.getExtent();
if(_572){
var _575=this.geometry.getBounds();
_573=_574.intersectsBounds(_575);
}else{
var _576=_574.toGeometry();
_573=_576.intersects(this.geometry);
}
}
return _573;
},createMarker:function(){
return null;
},destroyMarker:function(){
},createPopup:function(){
return null;
},atPoint:function(_577,_578,_579){
var _57a=false;
if(this.geometry){
_57a=this.geometry.atPoint(_577,_578,_579);
}
return _57a;
},destroyPopup:function(){
},toState:function(_57b){
if(_57b==OpenLayers.State.UPDATE){
switch(this.state){
case OpenLayers.State.UNKNOWN:
case OpenLayers.State.DELETE:
this.state=_57b;
break;
case OpenLayers.State.UPDATE:
case OpenLayers.State.INSERT:
break;
}
}else{
if(_57b==OpenLayers.State.INSERT){
switch(this.state){
case OpenLayers.State.UNKNOWN:
break;
default:
this.state=_57b;
break;
}
}else{
if(_57b==OpenLayers.State.DELETE){
switch(this.state){
case OpenLayers.State.INSERT:
break;
case OpenLayers.State.DELETE:
break;
case OpenLayers.State.UNKNOWN:
case OpenLayers.State.UPDATE:
this.state=_57b;
break;
}
}else{
if(_57b==OpenLayers.State.UNKNOWN){
this.state=_57b;
}
}
}
}
},CLASS_NAME:"OpenLayers.Feature.Vector"});
OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:""},"select":{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},"temporary":{fillColor:"yellow",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"yellow",strokeOpacity:1,strokeLinecap:"round",strokeWidth:4,hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:""}};
OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(_57c,_57d,_57e){
OpenLayers.Util.extend(this,_57e);
this.control=_57c;
this.callbacks=_57d;
if(_57c.map){
this.setMap(_57c.map);
}
OpenLayers.Util.extend(this,_57e);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
},setMap:function(map){
this.map=map;
},checkModifiers:function(evt){
if(this.keyMask==null){
return true;
}
var _581=(evt.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(evt.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(evt.altKey?OpenLayers.Handler.MOD_ALT:0);
return (_581==this.keyMask);
},activate:function(){
if(this.active){
return false;
}
var _582=OpenLayers.Events.prototype.BROWSER_EVENTS;
for(var i=0;i<_582.length;i++){
if(this[_582[i]]){
this.register(_582[i],this[_582[i]]);
}
}
this.active=true;
return true;
},deactivate:function(){
if(!this.active){
return false;
}
var _584=OpenLayers.Events.prototype.BROWSER_EVENTS;
for(var i=0;i<_584.length;i++){
if(this[_584[i]]){
this.unregister(_584[i],this[_584[i]]);
}
}
this.active=false;
return true;
},callback:function(name,args){
if(name&&this.callbacks[name]){
this.callbacks[name].apply(this.control,args);
}
},register:function(name,_589){
this.map.events.registerPriority(name,this,_589);
this.map.events.registerPriority(name,this,this.setEvent);
},unregister:function(name,_58b){
this.map.events.unregister(name,this,_58b);
this.map.events.unregister(name,this,this.setEvent);
},setEvent:function(evt){
this.evt=evt;
return true;
},destroy:function(){
this.deactivate();
this.control=this.map=null;
},CLASS_NAME:"OpenLayers.Handler"});
OpenLayers.Handler.MOD_NONE=0;
OpenLayers.Handler.MOD_SHIFT=1;
OpenLayers.Handler.MOD_CTRL=2;
OpenLayers.Handler.MOD_ALT=4;
OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:true,"double":false,pixelTolerance:0,stopSingle:false,stopDouble:false,timerId:null,down:null,initialize:function(_58d,_58e,_58f){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
if(this.pixelTolerance!=null){
this.mousedown=function(evt){
this.down=evt.xy;
return true;
};
}
},mousedown:null,dblclick:function(evt){
if(this.passesTolerance(evt)){
if(this["double"]){
this.callback("dblclick",[evt]);
}
this.clearTimer();
}
return !this.stopDouble;
},click:function(evt){
if(this.passesTolerance(evt)){
if(this.timerId!=null){
this.clearTimer();
}else{
var _593=this.single?OpenLayers.Util.extend({},evt):null;
this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,_593),this.delay);
}
}
return !this.stopSingle;
},passesTolerance:function(evt){
var _595=true;
if(this.pixelTolerance!=null&&this.down){
var dpx=Math.sqrt(Math.pow(this.down.x-evt.xy.x,2)+Math.pow(this.down.y-evt.xy.y,2));
if(dpx>this.pixelTolerance){
_595=false;
}
}
return _595;
},clearTimer:function(){
if(this.timerId!=null){
window.clearTimeout(this.timerId);
this.timerId=null;
}
},delayedCall:function(evt){
this.timerId=null;
if(evt){
this.callback("click",[evt]);
}
},deactivate:function(){
var _598=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.clearTimer();
this.down=null;
_598=true;
}
return _598;
},CLASS_NAME:"OpenLayers.Handler.Click"});
OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(_599,_59a,_59b){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
},mousemove:function(evt){
if(this.passesTolerance(evt.xy)){
this.clearTimer();
this.callback("move",[evt]);
this.px=evt.xy;
evt=OpenLayers.Util.extend({},evt);
this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,evt),this.delay);
}
return !this.stopMove;
},mouseout:function(evt){
if(OpenLayers.Util.mouseLeft(evt,this.map.div)){
this.clearTimer();
this.callback("move",[evt]);
}
return true;
},passesTolerance:function(px){
var _59f=true;
if(this.pixelTolerance&&this.px){
var dpx=Math.sqrt(Math.pow(this.px.x-px.x,2)+Math.pow(this.px.y-px.y,2));
if(dpx<this.pixelTolerance){
_59f=false;
}
}
return _59f;
},clearTimer:function(){
if(this.timerId!=null){
window.clearTimeout(this.timerId);
this.timerId=null;
}
},delayedCall:function(evt){
this.callback("pause",[evt]);
},deactivate:function(){
var _5a2=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.clearTimer();
_5a2=true;
}
return _5a2;
},CLASS_NAME:"OpenLayers.Handler.Hover"});
OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,drawing:false,mouseDown:false,lastDown:null,lastUp:null,initialize:function(_5a3,_5a4,_5a5){
this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
},activate:function(){
if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){
return false;
}
var _5a6={displayInLayerSwitcher:false,calculateInRange:function(){
return true;
}};
this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,_5a6);
this.map.addLayer(this.layer);
return true;
},createFeature:function(){
this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point());
},deactivate:function(){
if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
return false;
}
if(this.drawing){
this.cancel();
}
if(this.layer.map!=null){
this.layer.destroy(false);
}
this.layer=null;
return true;
},destroyFeature:function(){
if(this.point){
this.point.destroy();
}
this.point=null;
},finalize:function(){
this.layer.renderer.clear();
this.drawing=false;
this.mouseDown=false;
this.lastDown=null;
this.lastUp=null;
this.callback("done",[this.geometryClone()]);
this.destroyFeature();
},cancel:function(){
this.layer.renderer.clear();
this.drawing=false;
this.mouseDown=false;
this.lastDown=null;
this.lastUp=null;
this.callback("cancel",[this.geometryClone()]);
this.destroyFeature();
},click:function(evt){
OpenLayers.Event.stop(evt);
return false;
},dblclick:function(evt){
OpenLayers.Event.stop(evt);
return false;
},drawFeature:function(){
this.layer.drawFeature(this.point,this.style);
},geometryClone:function(){
return this.point.geometry.clone();
},mousedown:function(evt){
if(!this.checkModifiers(evt)){
return true;
}
if(this.lastDown&&this.lastDown.equals(evt.xy)){
return true;
}
if(this.lastDown==null){
this.createFeature();
}
this.lastDown=evt.xy;
this.drawing=true;
var _5aa=this.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_5aa.lon;
this.point.geometry.y=_5aa.lat;
this.drawFeature();
return false;
},mousemove:function(evt){
if(this.drawing){
var _5ac=this.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_5ac.lon;
this.point.geometry.y=_5ac.lat;
this.point.geometry.clearBounds();
this.drawFeature();
}
return true;
},mouseup:function(evt){
if(this.drawing){
this.finalize();
return false;
}else{
return true;
}
},CLASS_NAME:"OpenLayers.Handler.Point"});
OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(_5ae,_5af,_5b0){
OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments);
},createFeature:function(){
this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString());
this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point());
},destroyFeature:function(){
OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);
if(this.line){
this.line.destroy();
}
this.line=null;
},addPoint:function(){
this.line.geometry.addComponent(this.point.geometry.clone(),this.line.geometry.components.length);
this.callback("point",[this.point.geometry]);
},freehandMode:function(evt){
return (this.freehandToggle&&evt[this.freehandToggle])?!this.freehand:this.freehand;
},modifyFeature:function(){
var _5b2=this.line.geometry.components.length-1;
this.line.geometry.components[_5b2].x=this.point.geometry.x;
this.line.geometry.components[_5b2].y=this.point.geometry.y;
this.line.geometry.components[_5b2].clearBounds();
},drawFeature:function(){
this.layer.drawFeature(this.line,this.style);
this.layer.drawFeature(this.point,this.style);
},geometryClone:function(){
return this.line.geometry.clone();
},mousedown:function(evt){
if(this.lastDown&&this.lastDown.equals(evt.xy)){
return false;
}
if(this.lastDown==null){
this.createFeature();
}
this.mouseDown=true;
this.lastDown=evt.xy;
var _5b4=this.control.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_5b4.lon;
this.point.geometry.y=_5b4.lat;
if((this.lastUp==null)||!this.lastUp.equals(evt.xy)){
this.addPoint();
}
this.drawFeature();
this.drawing=true;
return false;
},mousemove:function(evt){
if(this.drawing){
var _5b6=this.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_5b6.lon;
this.point.geometry.y=_5b6.lat;
if(this.mouseDown&&this.freehandMode(evt)){
this.addPoint();
}else{
this.modifyFeature();
}
this.drawFeature();
}
return true;
},mouseup:function(evt){
this.mouseDown=false;
if(this.drawing){
if(this.freehandMode(evt)){
this.finalize();
}else{
if(this.lastUp==null){
this.addPoint();
}
this.lastUp=evt.xy;
}
return false;
}
return true;
},dblclick:function(evt){
if(!this.freehandMode(evt)){
var _5b9=this.line.geometry.components.length-1;
this.line.geometry.removeComponent(this.line.geometry.components[_5b9]);
this.finalize();
}
return false;
},CLASS_NAME:"OpenLayers.Handler.Path"});
OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(_5ba,_5bb,_5bc){
OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments);
},createFeature:function(){
this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon());
this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing());
this.polygon.geometry.addComponent(this.line.geometry);
this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point());
},destroyFeature:function(){
OpenLayers.Handler.Path.prototype.destroyFeature.apply(this);
if(this.polygon){
this.polygon.destroy();
}
this.polygon=null;
},modifyFeature:function(){
var _5bd=this.line.geometry.components.length-2;
this.line.geometry.components[_5bd].x=this.point.geometry.x;
this.line.geometry.components[_5bd].y=this.point.geometry.y;
this.line.geometry.components[_5bd].clearBounds();
},drawFeature:function(){
this.layer.drawFeature(this.polygon,this.style);
this.layer.drawFeature(this.point,this.style);
},geometryClone:function(){
return this.polygon.geometry.clone();
},dblclick:function(evt){
if(!this.freehandMode(evt)){
var _5bf=this.line.geometry.components.length-2;
this.line.geometry.removeComponent(this.line.geometry.components[_5bf]);
this.finalize();
}
return false;
},CLASS_NAME:"OpenLayers.Handler.Polygon"});
OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{"click":{"in":"click","out":"clickout"},"mousemove":{"in":"over","out":"out"},"dblclick":{"in":"dblclick","out":null},"mousedown":{"in":null,"out":null},"mouseup":{"in":null,"out":null}},feature:null,lastFeature:null,down:null,up:null,clickoutTolerance:4,geometryTypes:null,stopClick:true,stopDown:true,stopUp:true,layerIndex:null,initialize:function(_5c0,_5c1,_5c2,_5c3){
OpenLayers.Handler.prototype.initialize.apply(this,[_5c0,_5c2,_5c3]);
this.layer=_5c1;
},mousedown:function(evt){
this.down=evt.xy;
return this.handle(evt)?!this.stopDown:true;
},mouseup:function(evt){
this.up=evt.xy;
return this.handle(evt)?!this.stopUp:true;
},click:function(evt){
return this.handle(evt)?!this.stopClick:true;
},mousemove:function(evt){
this.handle(evt);
return true;
},dblclick:function(evt){
return !this.handle(evt);
},geometryTypeMatches:function(_5c9){
return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,_5c9.geometry.CLASS_NAME)>-1;
},handle:function(evt){
var type=evt.type;
var _5cc=false;
var _5cd=!!(this.feature);
var _5ce=(type=="click"||type=="dblclick");
this.feature=this.layer.getFeatureFromEvent(evt);
if(this.feature){
var _5cf=(this.feature!=this.lastFeature);
if(this.geometryTypeMatches(this.feature)){
if(_5cd&&_5cf){
this.triggerCallback(type,"out",[this.lastFeature]);
this.triggerCallback(type,"in",[this.feature]);
}else{
if(!_5cd||_5ce){
this.triggerCallback(type,"in",[this.feature]);
}
}
this.lastFeature=this.feature;
_5cc=true;
}else{
if(_5cd&&_5cf||(_5ce&&this.lastFeature)){
this.triggerCallback(type,"out",[this.lastFeature]);
}
this.feature=null;
}
}else{
if(_5cd||(_5ce&&this.lastFeature)){
this.triggerCallback(type,"out",[this.lastFeature]);
}
}
return _5cc;
},triggerCallback:function(type,mode,args){
var key=this.EVENTMAP[type][mode];
if(key){
if(type=="click"&&mode=="out"&&this.up&&this.down){
var dpx=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));
if(dpx<=this.clickoutTolerance){
this.callback(key,args);
}
}else{
this.callback(key,args);
}
}
},activate:function(){
var _5d5=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
this.layerIndex=this.layer.div.style.zIndex;
this.layer.div.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
_5d5=true;
}
return _5d5;
},deactivate:function(){
var _5d6=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
if(this.layer&&this.layer.div){
this.layer.div.style.zIndex=this.layerIndex;
}
this.feature=null;
this.lastFeature=null;
this.down=null;
this.up=null;
_5d6=true;
}
return _5d6;
},CLASS_NAME:"OpenLayers.Handler.Feature"});
OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,last:null,start:null,oldOnselectstart:null,initialize:function(_5d7,_5d8,_5d9){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
},down:function(evt){
},move:function(evt){
},up:function(evt){
},out:function(evt){
},mousedown:function(evt){
var _5df=true;
this.dragging=false;
if(this.checkModifiers(evt)&&OpenLayers.Event.isLeftClick(evt)){
this.started=true;
this.start=evt.xy;
this.last=evt.xy;
this.map.div.style.cursor="move";
this.down(evt);
this.callback("down",[evt.xy]);
OpenLayers.Event.stop(evt);
if(!this.oldOnselectstart){
this.oldOnselectstart=(document.onselectstart)?document.onselectstart:function(){
return true;
};
document.onselectstart=function(){
return false;
};
}
_5df=!this.stopDown;
}else{
this.started=false;
this.start=null;
this.last=null;
}
return _5df;
},mousemove:function(evt){
if(this.started){
if(evt.xy.x!=this.last.x||evt.xy.y!=this.last.y){
this.dragging=true;
this.move(evt);
this.callback("move",[evt.xy]);
if(!this.oldOnselectstart){
this.oldOnselectstart=document.onselectstart;
document.onselectstart=function(){
return false;
};
}
this.last=evt.xy;
}
}
return true;
},mouseup:function(evt){
if(this.started){
var _5e2=(this.start!=this.last);
this.started=false;
this.dragging=false;
this.map.div.style.cursor="";
this.up(evt);
this.callback("up",[evt.xy]);
if(_5e2){
this.callback("done",[evt.xy]);
}
document.onselectstart=this.oldOnselectstart;
}
return true;
},mouseout:function(evt){
if(this.started&&OpenLayers.Util.mouseLeft(evt,this.map.div)){
var _5e4=(this.start!=this.last);
this.started=false;
this.dragging=false;
this.map.div.style.cursor="";
this.out(evt);
this.callback("out",[]);
if(_5e4){
this.callback("done",[evt.xy]);
}
if(document.onselectstart){
document.onselectstart=this.oldOnselectstart;
}
}
return true;
},click:function(evt){
return (this.start==this.last);
},activate:function(){
var _5e6=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
this.dragging=false;
_5e6=true;
}
return _5e6;
},deactivate:function(){
var _5e7=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.started=false;
this.dragging=false;
this.start=null;
this.last=null;
_5e7=true;
}
return _5e7;
},CLASS_NAME:"OpenLayers.Handler.Drag"});
OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",persist:false,irregular:false,angle:null,fixedRadius:false,feature:null,layer:null,origin:null,initialize:function(_5e8,_5e9,_5ea){
this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});
OpenLayers.Handler.prototype.initialize.apply(this,[_5e8,_5e9,_5ea]);
this.options=(_5ea)?_5ea:new Object();
},setOptions:function(_5eb){
OpenLayers.Util.extend(this.options,_5eb);
OpenLayers.Util.extend(this,_5eb);
},activate:function(){
var _5ec=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
var _5ed={displayInLayerSwitcher:false};
this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,_5ed);
this.map.addLayer(this.layer);
_5ec=true;
}
return _5ec;
},deactivate:function(){
var _5ee=false;
if(OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)){
if(this.dragging){
this.cancel();
}
if(this.layer.map!=null){
this.layer.destroy(false);
if(this.feature){
this.feature.destroy();
}
}
this.layer=null;
this.feature=null;
_5ee=true;
}
return _5ee;
},down:function(evt){
this.fixedRadius=!!(this.radius);
var _5f0=this.map.getLonLatFromPixel(evt.xy);
this.origin=new OpenLayers.Geometry.Point(_5f0.lon,_5f0.lat);
if(!this.fixedRadius||this.irregular){
this.radius=this.map.getResolution();
}
if(this.persist){
this.clear();
}
this.feature=new OpenLayers.Feature.Vector();
this.createGeometry();
this.layer.addFeatures([this.feature],{silent:true});
this.layer.drawFeature(this.feature,this.style);
},move:function(evt){
var _5f2=this.map.getLonLatFromPixel(evt.xy);
var _5f3=new OpenLayers.Geometry.Point(_5f2.lon,_5f2.lat);
if(this.irregular){
var ry=Math.sqrt(2)*Math.abs(_5f3.y-this.origin.y)/2;
this.radius=Math.max(this.map.getResolution()/2,ry);
}else{
if(this.fixedRadius){
this.origin=_5f3;
}else{
this.calculateAngle(_5f3,evt);
this.radius=Math.max(this.map.getResolution()/2,_5f3.distanceTo(this.origin));
}
}
this.modifyGeometry();
if(this.irregular){
var dx=_5f3.x-this.origin.x;
var dy=_5f3.y-this.origin.y;
var _5f7;
if(dy==0){
_5f7=dx/(this.radius*Math.sqrt(2));
}else{
_5f7=dx/dy;
}
this.feature.geometry.resize(1,this.origin,_5f7);
this.feature.geometry.move(dx/2,dy/2);
}
this.layer.drawFeature(this.feature,this.style);
},up:function(evt){
this.finalize();
},out:function(evt){
this.finalize();
},createGeometry:function(){
this.angle=Math.PI*((1/this.sides)-(1/2));
if(this.snapAngle){
this.angle+=this.snapAngle*(Math.PI/180);
}
this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle);
},modifyGeometry:function(){
var _5fa,dx,dy,_5fd;
var ring=this.feature.geometry.components[0];
if(ring.components.length!=(this.sides+1)){
this.createGeometry();
ring=this.feature.geometry.components[0];
}
for(var i=0;i<this.sides;++i){
_5fd=ring.components[i];
_5fa=this.angle+(i*2*Math.PI/this.sides);
_5fd.x=this.origin.x+(this.radius*Math.cos(_5fa));
_5fd.y=this.origin.y+(this.radius*Math.sin(_5fa));
_5fd.clearBounds();
}
},calculateAngle:function(_600,evt){
var _602=Math.atan2(_600.y-this.origin.y,_600.x-this.origin.x);
if(this.snapAngle&&(this.snapToggle&&!evt[this.snapToggle])){
var _603=(Math.PI/180)*this.snapAngle;
this.angle=Math.round(_602/_603)*_603;
}else{
this.angle=_602;
}
},cancel:function(){
this.callback("cancel",null);
this.finalize();
},finalize:function(){
this.origin=null;
this.radius=this.options.radius;
},clear:function(){
this.layer.renderer.clear();
this.layer.destroyFeatures();
},callback:function(name,args){
if(this.callbacks[name]){
this.callbacks[name].apply(this.control,[this.feature.geometry.clone()]);
}
if(!this.persist&&(name=="done"||name=="cancel")){
this.clear();
}
},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});
OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",initialize:function(_606,_607,_608){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
var _607={"down":this.startBox,"move":this.moveBox,"out":this.removeBox,"up":this.endBox};
this.dragHandler=new OpenLayers.Handler.Drag(this,_607,{keyMask:this.keyMask});
},setMap:function(map){
OpenLayers.Handler.prototype.setMap.apply(this,arguments);
if(this.dragHandler){
this.dragHandler.setMap(map);
}
},startBox:function(xy){
this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.dragHandler.start);
this.zoomBox.className=this.boxDivClassName;
this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.zoomBox);
this.map.div.style.cursor="crosshair";
},moveBox:function(xy){
var _60c=Math.abs(this.dragHandler.start.x-xy.x);
var _60d=Math.abs(this.dragHandler.start.y-xy.y);
this.zoomBox.style.width=Math.max(1,_60c)+"px";
this.zoomBox.style.height=Math.max(1,_60d)+"px";
if(xy.x<this.dragHandler.start.x){
this.zoomBox.style.left=xy.x+"px";
}
if(xy.y<this.dragHandler.start.y){
this.zoomBox.style.top=xy.y+"px";
}
},endBox:function(end){
var _60f;
if(Math.abs(this.dragHandler.start.x-end.x)>5||Math.abs(this.dragHandler.start.y-end.y)>5){
var _610=this.dragHandler.start;
var top=Math.min(_610.y,end.y);
var _612=Math.max(_610.y,end.y);
var left=Math.min(_610.x,end.x);
var _614=Math.max(_610.x,end.x);
_60f=new OpenLayers.Bounds(left,_612,_614,top);
}else{
_60f=this.dragHandler.start.clone();
}
this.removeBox();
this.map.div.style.cursor="";
this.callback("done",[_60f]);
},removeBox:function(){
this.map.viewPortDiv.removeChild(this.zoomBox);
this.zoomBox=null;
},activate:function(){
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
this.dragHandler.activate();
return true;
}else{
return false;
}
},deactivate:function(){
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.dragHandler.deactivate();
return true;
}else{
return false;
}
},CLASS_NAME:"OpenLayers.Handler.Box"});
OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,initialize:function(_615,_616,_617){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);
},destroy:function(){
OpenLayers.Handler.prototype.destroy.apply(this,arguments);
this.wheelListener=null;
},onWheelEvent:function(e){
if(!this.map||!this.checkModifiers(e)){
return;
}
var _619=false;
var _61a=false;
var _61b=false;
var elem=OpenLayers.Event.element(e);
while((elem!=null)&&!_61b&&!_619){
if(!_619){
try{
if(elem.currentStyle){
_61d=elem.currentStyle["overflow"];
}else{
var _61e=document.defaultView.getComputedStyle(elem,null);
var _61d=_61e.getPropertyValue("overflow");
}
_619=(_61d&&(_61d=="auto")||(_61d=="scroll"));
}
catch(err){
}
}
if(!_61a){
for(var i=0;i<this.map.layers.length;i++){
if(elem==this.map.layers[i].div||elem==this.map.layers[i].pane){
_61a=true;
break;
}
}
}
_61b=(elem==this.map.div);
elem=elem.parentNode;
}
if(!_619&&_61b){
if(_61a){
this.wheelZoom(e);
}
OpenLayers.Event.stop(e);
}
},wheelZoom:function(e){
var _621=0;
if(!e){
e=window.event;
}
if(e.wheelDelta){
_621=e.wheelDelta/120;
if(window.opera&&window.opera.version()<9.2){
_621=-_621;
}
}else{
if(e.detail){
_621=-e.detail/3;
}
}
if(_621){
if(this.mousePosition){
e.xy=this.mousePosition;
}
if(!e.xy){
e.xy=this.map.getPixelFromLonLat(this.map.getCenter());
}
if(_621<0){
this.callback("down",[e,_621]);
}else{
this.callback("up",[e,_621]);
}
}
},mousemove:function(evt){
this.mousePosition=evt.xy;
},activate:function(evt){
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
var _624=this.wheelListener;
OpenLayers.Event.observe(window,"DOMMouseScroll",_624);
OpenLayers.Event.observe(window,"mousewheel",_624);
OpenLayers.Event.observe(document,"mousewheel",_624);
return true;
}else{
return false;
}
},deactivate:function(evt){
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
var _626=this.wheelListener;
OpenLayers.Event.stopObserving(window,"DOMMouseScroll",_626);
OpenLayers.Event.stopObserving(window,"mousewheel",_626);
OpenLayers.Event.stopObserving(document,"mousewheel",_626);
return true;
}else{
return false;
}
},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});
OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keypress","keyup"],eventListener:null,initialize:function(_627,_628,_629){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this);
},destroy:function(){
this.deactivate();
this.eventListener=null;
OpenLayers.Handler.prototype.destroy.apply(this,arguments);
},activate:function(){
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
for(var i=0;i<this.KEY_EVENTS.length;i++){
OpenLayers.Event.observe(window,this.KEY_EVENTS[i],this.eventListener);
}
return true;
}else{
return false;
}
},deactivate:function(){
var _62b=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
for(var i=0;i<this.KEY_EVENTS.length;i++){
OpenLayers.Event.stopObserving(window,this.KEY_EVENTS[i],this.eventListener);
}
_62b=true;
}
return _62b;
},handleKeyEvent:function(evt){
if(this.checkModifiers(evt)){
this.callback(evt.type,[evt.charCode||evt.keyCode]);
}
},CLASS_NAME:"OpenLayers.Handler.Keyboard"});
OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactivate"],initialize:function(_62e){
this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");
OpenLayers.Util.extend(this,_62e);
this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);
if(this.eventListeners instanceof Object){
this.events.on(this.eventListeners);
}
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
},destroy:function(){
if(this.events){
if(this.eventListeners){
this.events.un(this.eventListeners);
}
this.events.destroy();
this.events=null;
}
this.eventListeners=null;
if(this.handler){
this.handler.destroy();
this.handler=null;
}
if(this.handlers){
for(var key in this.handlers){
if(this.handlers.hasOwnProperty(key)&&typeof this.handlers[key].destroy=="function"){
this.handlers[key].destroy();
}
}
this.handlers=null;
}
if(this.map){
this.map.removeControl(this);
this.map=null;
}
},setMap:function(map){
this.map=map;
if(this.handler){
this.handler.setMap(map);
}
},draw:function(px){
if(this.div==null){
this.div=OpenLayers.Util.createDiv(this.id);
this.div.className=this.displayClass;
if(!this.allowSelection){
this.div.className+=" olControlNoSelect";
this.div.setAttribute("unselectable","on",0);
this.div.onselectstart=function(){
return (false);
};
}
if(this.title!=""){
this.div.title=this.title;
}
}
if(px!=null){
this.position=px.clone();
}
this.moveTo(this.position);
return this.div;
},moveTo:function(px){
if((px!=null)&&(this.div!=null)){
this.div.style.left=px.x+"px";
this.div.style.top=px.y+"px";
}
},activate:function(){
if(this.active){
return false;
}
if(this.handler){
this.handler.activate();
}
this.active=true;
this.events.triggerEvent("activate");
return true;
},deactivate:function(){
if(this.active){
if(this.handler){
this.handler.deactivate();
}
this.active=false;
this.events.triggerEvent("deactivate");
return true;
}
return false;
},CLASS_NAME:"OpenLayers.Control"});
OpenLayers.Control.TYPE_BUTTON=1;
OpenLayers.Control.TYPE_TOGGLE=2;
OpenLayers.Control.TYPE_TOOL=3;
OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",initialize:function(_633){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},destroy:function(){
this.map.events.un({"removelayer":this.updateAttribution,"addlayer":this.updateAttribution,"changelayer":this.updateAttribution,"changebaselayer":this.updateAttribution,scope:this});
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
this.map.events.on({"changebaselayer":this.updateAttribution,"changelayer":this.updateAttribution,"addlayer":this.updateAttribution,"removelayer":this.updateAttribution,scope:this});
this.updateAttribution();
return this.div;
},updateAttribution:function(){
var _634=[];
if(this.map&&this.map.layers){
for(var i=0;i<this.map.layers.length;i++){
var _636=this.map.layers[i];
if(_636.attribution&&_636.getVisibility()){
_634.push(_636.attribution);
}
}
this.div.innerHTML=_634.join(this.separator);
}
},CLASS_NAME:"OpenLayers.Control.Attribution"});
OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){
},CLASS_NAME:"OpenLayers.Control.Button"});
OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:false,draw:function(){
this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask});
},zoomBox:function(_637){
if(_637 instanceof OpenLayers.Bounds){
if(!this.out){
var _638=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_637.left,_637.bottom));
var _639=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_637.right,_637.top));
var _63a=new OpenLayers.Bounds(_638.lon,_638.lat,_639.lon,_639.lat);
}else{
var _63b=Math.abs(_637.right-_637.left);
var _63c=Math.abs(_637.top-_637.bottom);
var _63d=Math.min((this.map.size.h/_63c),(this.map.size.w/_63b));
var _63e=this.map.getExtent();
var _63f=this.map.getLonLatFromPixel(_637.getCenterPixel());
var xmin=_63f.lon-(_63e.getWidth()/2)*_63d;
var xmax=_63f.lon+(_63e.getWidth()/2)*_63d;
var ymin=_63f.lat-(_63e.getHeight()/2)*_63d;
var ymax=_63f.lat+(_63e.getHeight()/2)*_63d;
var _63a=new OpenLayers.Bounds(xmin,ymin,xmax,ymax);
}
this.map.zoomToExtent(_63a);
}else{
if(!this.out){
this.map.setCenter(this.map.getLonLatFromPixel(_637),this.map.getZoom()+1);
}else{
this.map.setCenter(this.map.getLonLatFromPixel(_637),this.map.getZoom()-1);
}
}
},CLASS_NAME:"OpenLayers.Control.ZoomBox"});
OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){
if(this.map){
this.map.zoomToMaxExtent();
}
},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});
OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,draw:function(){
this.handler=new OpenLayers.Handler.Drag(this,{"move":this.panMap,"done":this.panMapDone});
},panMap:function(xy){
this.panned=true;
this.map.pan(this.handler.last.x-xy.x,this.handler.last.y-xy.y,{dragging:this.handler.dragging,animate:false});
},panMapDone:function(xy){
if(this.panned){
this.panMap(xy);
this.panned=false;
}
},CLASS_NAME:"OpenLayers.Control.DragPan"});
OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,zoomBox:null,zoomWheelEnabled:true,initialize:function(_646){
this.handlers={};
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},destroy:function(){
this.deactivate();
if(this.dragPan){
this.dragPan.destroy();
}
this.dragPan=null;
if(this.zoomBox){
this.zoomBox.destroy();
}
this.zoomBox=null;
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},activate:function(){
this.dragPan.activate();
if(this.zoomWheelEnabled){
this.handlers.wheel.activate();
}
this.handlers.click.activate();
this.zoomBox.activate();
return OpenLayers.Control.prototype.activate.apply(this,arguments);
},deactivate:function(){
this.zoomBox.deactivate();
this.dragPan.deactivate();
this.handlers.click.deactivate();
this.handlers.wheel.deactivate();
return OpenLayers.Control.prototype.deactivate.apply(this,arguments);
},draw:function(){
this.handlers.click=new OpenLayers.Handler.Click(this,{"dblclick":this.defaultDblClick},{"double":true,"stopDouble":true});
this.dragPan=new OpenLayers.Control.DragPan({map:this.map});
this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:OpenLayers.Handler.MOD_SHIFT});
this.dragPan.draw();
this.zoomBox.draw();
this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{"up":this.wheelUp,"down":this.wheelDown});
this.activate();
},defaultDblClick:function(evt){
var _648=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_648,this.map.zoom+1);
},wheelChange:function(evt,_64a){
var _64b=this.map.getZoom()+_64a;
if(!this.map.isValidZoomLevel(_64b)){
return;
}
var size=this.map.getSize();
var _64d=size.w/2-evt.xy.x;
var _64e=evt.xy.y-size.h/2;
var _64f=this.map.baseLayer.getResolutionForZoom(_64b);
var _650=this.map.getLonLatFromPixel(evt.xy);
var _651=new OpenLayers.LonLat(_650.lon+_64d*_64f,_650.lat+_64e*_64f);
this.map.setCenter(_651,_64b);
},wheelUp:function(evt){
this.wheelChange(evt,1);
},wheelDown:function(evt){
this.wheelChange(evt,-1);
},disableZoomWheel:function(){
this.zoomWheelEnabled=false;
this.handlers.wheel.deactivate();
},enableZoomWheel:function(){
this.zoomWheelEnabled=true;
if(this.active){
this.handlers.wheel.activate();
}
},CLASS_NAME:"OpenLayers.Control.Navigation"});
OpenLayers.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:false,wheelObserver:null,initialize:function(){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},destroy:function(){
if(this.handler){
this.handler.destroy();
}
this.handler=null;
this.map.events.un({"click":this.defaultClick,"dblclick":this.defaultDblClick,"mousedown":this.defaultMouseDown,"mouseup":this.defaultMouseUp,"mousemove":this.defaultMouseMove,"mouseout":this.defaultMouseOut,scope:this});
OpenLayers.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);
OpenLayers.Event.stopObserving(window,"mousewheel",this.wheelObserver);
OpenLayers.Event.stopObserving(document,"mousewheel",this.wheelObserver);
this.wheelObserver=null;
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
this.map.events.on({"click":this.defaultClick,"dblclick":this.defaultDblClick,"mousedown":this.defaultMouseDown,"mouseup":this.defaultMouseUp,"mousemove":this.defaultMouseMove,"mouseout":this.defaultMouseOut,scope:this});
this.registerWheelEvents();
},registerWheelEvents:function(){
this.wheelObserver=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);
OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserver);
OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);
OpenLayers.Event.observe(document,"mousewheel",this.wheelObserver);
},defaultClick:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
var _655=!this.performedDrag;
this.performedDrag=false;
return _655;
},defaultDblClick:function(evt){
var _657=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_657,this.map.zoom+1);
OpenLayers.Event.stop(evt);
return false;
},defaultMouseDown:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
this.mouseDragStart=evt.xy.clone();
this.performedDrag=false;
if(evt.shiftKey){
this.map.div.style.cursor="crosshair";
this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");
this.zoomBox.style.backgroundColor="white";
this.zoomBox.style.filter="alpha(opacity=50)";
this.zoomBox.style.opacity="0.50";
this.zoomBox.style.fontSize="1px";
this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.zoomBox);
}
document.onselectstart=function(){
return false;
};
OpenLayers.Event.stop(evt);
},defaultMouseMove:function(evt){
this.mousePosition=evt.xy.clone();
if(this.mouseDragStart!=null){
if(this.zoomBox){
var _65a=Math.abs(this.mouseDragStart.x-evt.xy.x);
var _65b=Math.abs(this.mouseDragStart.y-evt.xy.y);
this.zoomBox.style.width=Math.max(1,_65a)+"px";
this.zoomBox.style.height=Math.max(1,_65b)+"px";
if(evt.xy.x<this.mouseDragStart.x){
this.zoomBox.style.left=evt.xy.x+"px";
}
if(evt.xy.y<this.mouseDragStart.y){
this.zoomBox.style.top=evt.xy.y+"px";
}
}else{
var _65a=this.mouseDragStart.x-evt.xy.x;
var _65b=this.mouseDragStart.y-evt.xy.y;
var size=this.map.getSize();
var _65d=new OpenLayers.Pixel(size.w/2+_65a,size.h/2+_65b);
var _65e=this.map.getLonLatFromViewPortPx(_65d);
this.map.setCenter(_65e,null,true);
this.mouseDragStart=evt.xy.clone();
this.map.div.style.cursor="move";
}
this.performedDrag=true;
}
},defaultMouseUp:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
if(this.zoomBox){
this.zoomBoxEnd(evt);
}else{
if(this.performedDrag){
this.map.setCenter(this.map.center);
}
}
document.onselectstart=null;
this.mouseDragStart=null;
this.map.div.style.cursor="";
},defaultMouseOut:function(evt){
if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(evt,this.map.div)){
if(this.zoomBox){
this.removeZoomBox();
}
this.mouseDragStart=null;
}
},defaultWheelUp:function(evt){
if(this.map.getZoom()<=this.map.getNumZoomLevels()){
this.map.setCenter(this.map.getLonLatFromPixel(evt.xy),this.map.getZoom()+1);
}
},defaultWheelDown:function(evt){
if(this.map.getZoom()>0){
this.map.setCenter(this.map.getLonLatFromPixel(evt.xy),this.map.getZoom()-1);
}
},zoomBoxEnd:function(evt){
if(this.mouseDragStart!=null){
if(Math.abs(this.mouseDragStart.x-evt.xy.x)>5||Math.abs(this.mouseDragStart.y-evt.xy.y)>5){
var _664=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
var end=this.map.getLonLatFromViewPortPx(evt.xy);
var top=Math.max(_664.lat,end.lat);
var _667=Math.min(_664.lat,end.lat);
var left=Math.min(_664.lon,end.lon);
var _669=Math.max(_664.lon,end.lon);
var _66a=new OpenLayers.Bounds(left,_667,_669,top);
this.map.zoomToExtent(_66a);
}else{
var end=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(new OpenLayers.LonLat((end.lon),(end.lat)),this.map.getZoom()+1);
}
this.removeZoomBox();
}
},removeZoomBox:function(){
this.map.viewPortDiv.removeChild(this.zoomBox);
this.zoomBox=null;
},onWheelEvent:function(e){
var _66c=false;
var elem=OpenLayers.Event.element(e);
while(elem!=null){
if(this.map&&elem==this.map.div){
_66c=true;
break;
}
elem=elem.parentNode;
}
if(_66c){
var _66e=0;
if(!e){
e=window.event;
}
if(e.wheelDelta){
_66e=e.wheelDelta/120;
if(window.opera&&window.opera.version()<9.2){
_66e=-_66e;
}
}else{
if(e.detail){
_66e=-e.detail/3;
}
}
if(_66e){
e.xy=this.mousePosition;
if(_66e<0){
this.defaultWheelDown(e);
}else{
this.defaultWheelUp(e);
}
}
OpenLayers.Event.stop(e);
}
},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});
OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:"",separator:", ",suffix:"",numdigits:5,granularity:10,lastXy:null,displayProjection:null,initialize:function(_66f){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},destroy:function(){
if(this.map){
this.map.events.unregister("mousemove",this,this.redraw);
}
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.element){
this.div.left="";
this.div.top="";
this.element=this.div;
}
this.redraw();
return this.div;
},redraw:function(evt){
var _671;
if(evt==null){
_671=new OpenLayers.LonLat(0,0);
}else{
if(this.lastXy==null||Math.abs(evt.xy.x-this.lastXy.x)>this.granularity||Math.abs(evt.xy.y-this.lastXy.y)>this.granularity){
this.lastXy=evt.xy;
return;
}
_671=this.map.getLonLatFromPixel(evt.xy);
if(!_671){
return;
}
if(this.displayProjection){
_671.transform(this.map.getProjectionObject(),this.displayProjection);
}
this.lastXy=evt.xy;
}
var _672=this.formatOutput(_671);
if(_672!=this.element.innerHTML){
this.element.innerHTML=_672;
}
},formatOutput:function(_673){
var _674=parseInt(this.numdigits);
var _675=this.prefix+_673.lon.toFixed(_674)+this.separator+_673.lat.toFixed(_674)+this.suffix;
return _675;
},setMap:function(){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
this.map.events.register("mousemove",this,this.redraw);
},CLASS_NAME:"OpenLayers.Control.MousePosition"});
OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,handlers:null,initialize:function(_676){
this.layers=[];
this.handlers={};
OpenLayers.Control.prototype.initialize.apply(this,[_676]);
},destroy:function(){
if(!this.mapDiv){
return;
}
this.handlers.click.destroy();
this.mapDiv.removeChild(this.extentRectangle);
this.extentRectangle=null;
this.rectEvents.destroy();
this.rectEvents=null;
this.ovmap.destroy();
this.ovmap=null;
this.element.removeChild(this.mapDiv);
this.mapDiv=null;
this.div.removeChild(this.element);
this.element=null;
if(this.maximizeDiv){
OpenLayers.Event.stopObservingElement(this.maximizeDiv);
this.div.removeChild(this.maximizeDiv);
this.maximizeDiv=null;
}
if(this.minimizeDiv){
OpenLayers.Event.stopObservingElement(this.minimizeDiv);
this.div.removeChild(this.minimizeDiv);
this.minimizeDiv=null;
}
this.map.events.un({"moveend":this.update,"changebaselayer":this.baseLayerDraw,scope:this});
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!(this.layers.length>0)){
if(this.map.baseLayer){
var _677=this.map.baseLayer.clone();
this.layers=[_677];
}else{
this.map.events.register("changebaselayer",this,this.baseLayerDraw);
return this.div;
}
}
this.element=document.createElement("div");
this.element.className=this.displayClass+"Element";
this.element.style.display="none";
this.mapDiv=document.createElement("div");
this.mapDiv.style.width=this.size.w+"px";
this.mapDiv.style.height=this.size.h+"px";
this.mapDiv.style.position="relative";
this.mapDiv.style.overflow="hidden";
this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap");
this.extentRectangle=document.createElement("div");
this.extentRectangle.style.position="absolute";
this.extentRectangle.style.zIndex=1000;
this.extentRectangle.className=this.displayClass+"ExtentRectangle";
this.mapDiv.appendChild(this.extentRectangle);
this.element.appendChild(this.mapDiv);
this.div.appendChild(this.element);
if(!this.outsideViewport){
this.div.className+=" "+this.displayClass+"Container";
var _678=OpenLayers.Util.getImagesLocation();
var img=_678+"layer-switcher-maximize.png";
this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),img,"absolute");
this.maximizeDiv.style.display="none";
this.maximizeDiv.className=this.displayClass+"MaximizeButton";
OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));
this.div.appendChild(this.maximizeDiv);
var img=_678+"layer-switcher-minimize.png";
this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),img,"absolute");
this.minimizeDiv.style.display="none";
this.minimizeDiv.className=this.displayClass+"MinimizeButton";
OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));
this.div.appendChild(this.minimizeDiv);
var _67a=["dblclick","mousedown"];
for(var i=0;i<_67a.length;i++){
OpenLayers.Event.observe(this.maximizeDiv,_67a[i],OpenLayers.Event.stop);
OpenLayers.Event.observe(this.minimizeDiv,_67a[i],OpenLayers.Event.stop);
}
this.minimizeControl();
}else{
this.element.style.display="";
}
if(this.map.getExtent()){
this.update();
}
this.map.events.register("moveend",this,this.update);
return this.div;
},baseLayerDraw:function(){
this.draw();
this.map.events.unregister("changebaselayer",this,this.baseLayerDraw);
},rectDrag:function(px){
var _67d=this.handlers.drag.last.x-px.x;
var _67e=this.handlers.drag.last.y-px.y;
if(_67d!=0||_67e!=0){
var _67f=this.rectPxBounds.top;
var _680=this.rectPxBounds.left;
var _681=Math.abs(this.rectPxBounds.getHeight());
var _682=this.rectPxBounds.getWidth();
var _683=Math.max(0,(_67f-_67e));
_683=Math.min(_683,this.ovmap.size.h-this.hComp-_681);
var _684=Math.max(0,(_680-_67d));
_684=Math.min(_684,this.ovmap.size.w-this.wComp-_682);
this.setRectPxBounds(new OpenLayers.Bounds(_684,_683+_681,_684+_682,_683));
}
},mapDivClick:function(evt){
var _686=this.rectPxBounds.getCenterPixel();
var _687=evt.xy.x-_686.x;
var _688=evt.xy.y-_686.y;
var top=this.rectPxBounds.top;
var left=this.rectPxBounds.left;
var _68b=Math.abs(this.rectPxBounds.getHeight());
var _68c=this.rectPxBounds.getWidth();
var _68d=Math.max(0,(top+_688));
_68d=Math.min(_68d,this.ovmap.size.h-_68b);
var _68e=Math.max(0,(left+_687));
_68e=Math.min(_68e,this.ovmap.size.w-_68c);
this.setRectPxBounds(new OpenLayers.Bounds(_68e,_68d+_68b,_68e+_68c,_68d));
this.updateMapToRect();
},maximizeControl:function(e){
this.element.style.display="";
this.showToggle(false);
if(e!=null){
OpenLayers.Event.stop(e);
}
},minimizeControl:function(e){
this.element.style.display="none";
this.showToggle(true);
if(e!=null){
OpenLayers.Event.stop(e);
}
},showToggle:function(_691){
this.maximizeDiv.style.display=_691?"":"none";
this.minimizeDiv.style.display=_691?"none":"";
},update:function(){
if(this.ovmap==null){
this.createMap();
}
if(!this.isSuitableOverview()){
this.updateOverview();
}
this.updateRectToMap();
},isSuitableOverview:function(){
var _692=this.map.getExtent();
var _693=this.map.maxExtent;
var _694=new OpenLayers.Bounds(Math.max(_692.left,_693.left),Math.max(_692.bottom,_693.bottom),Math.min(_692.right,_693.right),Math.min(_692.top,_693.top));
var _695=this.ovmap.getResolution()/this.map.getResolution();
return ((_695>this.minRatio)&&(_695<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(_694)));
},updateOverview:function(){
var _696=this.map.getResolution();
var _697=this.ovmap.getResolution();
var _698=_697/_696;
if(_698>this.maxRatio){
_697=this.minRatio*_696;
}else{
if(_698<=this.minRatio){
_697=this.maxRatio*_696;
}
}
this.ovmap.setCenter(this.map.center,this.ovmap.getZoomForResolution(_697));
this.updateRectToMap();
},createMap:function(){
var _699=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);
this.ovmap=new OpenLayers.Map(this.mapDiv,_699);
OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);
this.ovmap.addLayers(this.layers);
this.ovmap.zoomToMaxExtent();
this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));
this.wComp=(this.wComp)?this.wComp:2;
this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));
this.hComp=(this.hComp)?this.hComp:2;
this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});
this.handlers.click=new OpenLayers.Handler.Click(this,{"click":this.mapDivClick},{"single":true,"double":false,"stopSingle":true,"stopDouble":true,"pixelTolerance":1,map:this.ovmap});
this.handlers.click.activate();
this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true);
this.rectEvents.register("mouseover",this,function(e){
if(!this.handlers.drag.active&&!this.map.dragging){
this.handlers.drag.activate();
}
});
this.rectEvents.register("mouseout",this,function(e){
if(!this.handlers.drag.dragging){
this.handlers.drag.deactivate();
}
});
},updateRectToMap:function(){
if(this.map.units!="degrees"){
if(this.ovmap.getProjection()&&(this.map.getProjection()!=this.ovmap.getProjection())){
alert(OpenLayers.i18n("sameProjection"));
}
}
var _69c=this.getRectBoundsFromMapBounds(this.map.getExtent());
if(_69c){
this.setRectPxBounds(_69c);
}
},updateMapToRect:function(){
var _69d=this.getMapBoundsFromRectBounds(this.rectPxBounds);
this.map.panTo(_69d.getCenterLonLat());
},setRectPxBounds:function(_69e){
var top=Math.max(_69e.top,0);
var left=Math.max(_69e.left,0);
var _6a1=Math.min(_69e.top+Math.abs(_69e.getHeight()),this.ovmap.size.h-this.hComp);
var _6a2=Math.min(_69e.left+_69e.getWidth(),this.ovmap.size.w-this.wComp);
var _6a3=Math.max(_6a2-left,0);
var _6a4=Math.max(_6a1-top,0);
if(_6a3<this.minRectSize||_6a4<this.minRectSize){
this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;
var _6a5=left+(_6a3/2)-(this.minRectSize/2);
var rTop=top+(_6a4/2)-(this.minRectSize/2);
this.extentRectangle.style.top=Math.round(rTop)+"px";
this.extentRectangle.style.left=Math.round(_6a5)+"px";
this.extentRectangle.style.height=this.minRectSize+"px";
this.extentRectangle.style.width=this.minRectSize+"px";
}else{
this.extentRectangle.className=this.displayClass+"ExtentRectangle";
this.extentRectangle.style.top=Math.round(top)+"px";
this.extentRectangle.style.left=Math.round(left)+"px";
this.extentRectangle.style.height=Math.round(_6a4)+"px";
this.extentRectangle.style.width=Math.round(_6a3)+"px";
}
this.rectPxBounds=new OpenLayers.Bounds(Math.round(left),Math.round(_6a1),Math.round(_6a2),Math.round(top));
},getRectBoundsFromMapBounds:function(_6a7){
var _6a8=new OpenLayers.LonLat(_6a7.left,_6a7.bottom);
var _6a9=new OpenLayers.LonLat(_6a7.right,_6a7.top);
var _6aa=this.getOverviewPxFromLonLat(_6a8);
var _6ab=this.getOverviewPxFromLonLat(_6a9);
var _6ac=null;
if(_6aa&&_6ab){
_6ac=new OpenLayers.Bounds(_6aa.x,_6aa.y,_6ab.x,_6ab.y);
}
return _6ac;
},getMapBoundsFromRectBounds:function(_6ad){
var _6ae=new OpenLayers.Pixel(_6ad.left,_6ad.bottom);
var _6af=new OpenLayers.Pixel(_6ad.right,_6ad.top);
var _6b0=this.getLonLatFromOverviewPx(_6ae);
var _6b1=this.getLonLatFromOverviewPx(_6af);
return new OpenLayers.Bounds(_6b0.lon,_6b0.lat,_6b1.lon,_6b1.lat);
},getLonLatFromOverviewPx:function(_6b2){
var size=this.ovmap.size;
var res=this.ovmap.getResolution();
var _6b5=this.ovmap.getExtent().getCenterLonLat();
var _6b6=_6b2.x-(size.w/2);
var _6b7=_6b2.y-(size.h/2);
return new OpenLayers.LonLat(_6b5.lon+_6b6*res,_6b5.lat-_6b7*res);
},getOverviewPxFromLonLat:function(_6b8){
var res=this.ovmap.getResolution();
var _6ba=this.ovmap.getExtent();
var px=null;
if(_6ba){
px=new OpenLayers.Pixel(Math.round(1/res*(_6b8.lon-_6ba.left)),Math.round(1/res*(_6ba.top-_6b8.lat)));
}
return px;
},CLASS_NAME:"OpenLayers.Control.OverviewMap"});
OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{slideFactor:75,initialize:function(){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},destroy:function(){
if(this.handler){
this.handler.destroy();
}
this.handler=null;
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
this.handler=new OpenLayers.Handler.Keyboard(this,{"keypress":this.defaultKeyPress});
this.activate();
},defaultKeyPress:function(code){
switch(code){
case OpenLayers.Event.KEY_LEFT:
this.map.pan(-this.slideFactor,0);
break;
case OpenLayers.Event.KEY_RIGHT:
this.map.pan(this.slideFactor,0);
break;
case OpenLayers.Event.KEY_UP:
this.map.pan(0,-this.slideFactor);
break;
case OpenLayers.Event.KEY_DOWN:
this.map.pan(0,this.slideFactor);
break;
case 33:
var size=this.map.getSize();
this.map.pan(0,-0.75*size.h);
break;
case 34:
var size=this.map.getSize();
this.map.pan(0,0.75*size.h);
break;
case 35:
var size=this.map.getSize();
this.map.pan(0.75*size.w,0);
break;
case 36:
var size=this.map.getSize();
this.map.pan(-0.75*size.w,0);
break;
case 43:
this.map.zoomIn();
break;
case 45:
this.map.zoomOut();
break;
case 107:
this.map.zoomIn();
break;
case 109:
this.map.zoomOut();
break;
}
},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});
OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,buttons:null,position:null,initialize:function(_6be){
this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},destroy:function(){
OpenLayers.Control.prototype.destroy.apply(this,arguments);
while(this.buttons.length){
var btn=this.buttons.shift();
btn.map=null;
OpenLayers.Event.stopObservingElement(btn);
}
this.buttons=null;
this.position=null;
},draw:function(px){
OpenLayers.Control.prototype.draw.apply(this,arguments);
px=this.position;
this.buttons=[];
var sz=new OpenLayers.Size(18,18);
var _6c2=new OpenLayers.Pixel(px.x+sz.w/2,px.y);
this._addButton("panup","north-mini.png",_6c2,sz);
px.y=_6c2.y+sz.h;
this._addButton("panleft","west-mini.png",px,sz);
this._addButton("panright","east-mini.png",px.add(sz.w,0),sz);
this._addButton("pandown","south-mini.png",_6c2.add(0,sz.h*2),sz);
this._addButton("zoomin","zoom-plus-mini.png",_6c2.add(0,sz.h*3+5),sz);
this._addButton("zoomworld","zoom-world-mini.png",_6c2.add(0,sz.h*4+5),sz);
this._addButton("zoomout","zoom-minus-mini.png",_6c2.add(0,sz.h*5+5),sz);
return this.div;
},_addButton:function(id,img,xy,sz){
var _6c7=OpenLayers.Util.getImagesLocation()+img;
var btn=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_PanZoom_"+id,xy,sz,_6c7,"absolute");
this.div.appendChild(btn);
OpenLayers.Event.observe(btn,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,btn));
OpenLayers.Event.observe(btn,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,btn));
OpenLayers.Event.observe(btn,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,btn));
btn.action=id;
btn.map=this.map;
btn.slideFactor=this.slideFactor;
this.buttons.push(btn);
return btn;
},doubleClick:function(evt){
OpenLayers.Event.stop(evt);
return false;
},buttonDown:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
switch(this.action){
case "panup":
this.map.pan(0,-this.slideFactor);
break;
case "pandown":
this.map.pan(0,this.slideFactor);
break;
case "panleft":
this.map.pan(-this.slideFactor,0);
break;
case "panright":
this.map.pan(this.slideFactor,0);
break;
case "zoomin":
this.map.zoomIn();
break;
case "zoomout":
this.map.zoomOut();
break;
case "zoomworld":
this.map.zoomToMaxExtent();
break;
}
OpenLayers.Event.stop(evt);
},CLASS_NAME:"OpenLayers.Control.PanZoom"});
OpenLayers.Control.PanZoom.X=4;
OpenLayers.Control.PanZoom.Y=4;
OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:false,initialize:function(){
OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments);
},destroy:function(){
this.div.removeChild(this.slider);
this.slider=null;
this.sliderEvents.destroy();
this.sliderEvents=null;
this.div.removeChild(this.zoombarDiv);
this.zoomBarDiv=null;
this.divEvents.destroy();
this.divEvents=null;
this.map.events.un({"zoomend":this.moveZoomBar,"changebaselayer":this.redraw,scope:this});
OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments);
},setMap:function(map){
OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);
this.map.events.register("changebaselayer",this,this.redraw);
},redraw:function(){
if(this.div!=null){
this.div.innerHTML="";
}
this.draw();
},draw:function(px){
OpenLayers.Control.prototype.draw.apply(this,arguments);
px=this.position.clone();
this.buttons=[];
var sz=new OpenLayers.Size(18,18);
var _6ce=new OpenLayers.Pixel(px.x+sz.w/2,px.y);
var _6cf=sz.w;
if(this.zoomWorldIcon){
_6ce=new OpenLayers.Pixel(px.x+sz.w,px.y);
}
this._addButton("panup","north-mini.png",_6ce,sz);
px.y=_6ce.y+sz.h;
this._addButton("panleft","west-mini.png",px,sz);
if(this.zoomWorldIcon){
this._addButton("zoomworld","zoom-world-mini.png",px.add(sz.w,0),sz);
_6cf*=2;
}
this._addButton("panright","east-mini.png",px.add(_6cf,0),sz);
this._addButton("pandown","south-mini.png",_6ce.add(0,sz.h*2),sz);
this._addButton("zoomin","zoom-plus-mini.png",_6ce.add(0,sz.h*3+5),sz);
_6ce=this._addZoomBar(_6ce.add(0,sz.h*4+5));
this._addButton("zoomout","zoom-minus-mini.png",_6ce,sz);
return this.div;
},_addZoomBar:function(_6d0){
var _6d1=OpenLayers.Util.getImagesLocation();
var id="OpenLayers_Control_PanZoomBar_Slider"+this.map.id;
var _6d3=this.map.getNumZoomLevels()-1-this.map.getZoom();
var _6d4=OpenLayers.Util.createAlphaImageDiv(id,_6d0.add(-1,_6d3*this.zoomStopHeight),new OpenLayers.Size(20,9),_6d1+"slider.png","absolute");
this.slider=_6d4;
this.sliderEvents=new OpenLayers.Events(this,_6d4,null,true);
this.sliderEvents.on({"mousedown":this.zoomBarDown,"mousemove":this.zoomBarDrag,"mouseup":this.zoomBarUp,"dblclick":this.doubleClick,"click":this.doubleClick});
var sz=new OpenLayers.Size();
sz.h=this.zoomStopHeight*this.map.getNumZoomLevels();
sz.w=this.zoomStopWidth;
var div=null;
if(OpenLayers.Util.alphaHack()){
var id="OpenLayers_Control_PanZoomBar"+this.map.id;
div=OpenLayers.Util.createAlphaImageDiv(id,_6d0,new OpenLayers.Size(sz.w,this.zoomStopHeight),_6d1+"zoombar.png","absolute",null,"crop");
div.style.height=sz.h;
}else{
div=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,_6d0,sz,_6d1+"zoombar.png");
}
this.zoombarDiv=div;
this.divEvents=new OpenLayers.Events(this,div,null,true);
this.divEvents.on({"mousedown":this.divClick,"mousemove":this.passEventToSlider,"dblclick":this.doubleClick,"click":this.doubleClick});
this.div.appendChild(div);
this.startTop=parseInt(div.style.top);
this.div.appendChild(_6d4);
this.map.events.register("zoomend",this,this.moveZoomBar);
_6d0=_6d0.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());
return _6d0;
},passEventToSlider:function(evt){
this.sliderEvents.handleBrowserEvent(evt);
},divClick:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
var y=evt.xy.y;
var top=OpenLayers.Util.pagePosition(evt.object)[1];
var _6db=(y-top)/this.zoomStopHeight;
if(!this.map.fractionalZoom){
_6db=Math.floor(_6db);
}
var zoom=(this.map.getNumZoomLevels()-1)-_6db;
zoom=Math.min(Math.max(zoom,0),this.map.getNumZoomLevels()-1);
this.map.zoomTo(zoom);
OpenLayers.Event.stop(evt);
},zoomBarDown:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
this.map.events.on({"mousemove":this.passEventToSlider,"mouseup":this.passEventToSlider,scope:this});
this.mouseDragStart=evt.xy.clone();
this.zoomStart=evt.xy.clone();
this.div.style.cursor="move";
this.zoombarDiv.offsets=null;
OpenLayers.Event.stop(evt);
},zoomBarDrag:function(evt){
if(this.mouseDragStart!=null){
var _6df=this.mouseDragStart.y-evt.xy.y;
var _6e0=OpenLayers.Util.pagePosition(this.zoombarDiv);
if((evt.clientY-_6e0[1])>0&&(evt.clientY-_6e0[1])<parseInt(this.zoombarDiv.style.height)-2){
var _6e1=parseInt(this.slider.style.top)-_6df;
this.slider.style.top=_6e1+"px";
}
this.mouseDragStart=evt.xy.clone();
OpenLayers.Event.stop(evt);
}
},zoomBarUp:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
if(this.zoomStart){
this.div.style.cursor="";
this.map.events.un({"mouseup":this.passEventToSlider,"mousemove":this.passEventToSlider,scope:this});
var _6e3=this.zoomStart.y-evt.xy.y;
var _6e4=this.map.zoom;
if(this.map.fractionalZoom){
_6e4+=_6e3/this.zoomStopHeight;
_6e4=Math.min(Math.max(_6e4,0),this.map.getNumZoomLevels()-1);
}else{
_6e4+=Math.round(_6e3/this.zoomStopHeight);
}
this.map.zoomTo(_6e4);
this.moveZoomBar();
this.mouseDragStart=null;
OpenLayers.Event.stop(evt);
}
},moveZoomBar:function(){
var _6e5=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;
this.slider.style.top=_6e5+"px";
},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});
OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(_6e6){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},setMap:function(map){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
for(var i=0;i<this.map.controls.length;i++){
var _6e9=this.map.controls[i];
if((_6e9!=this)&&(_6e9.CLASS_NAME=="OpenLayers.Control.ArgParser")){
if(_6e9.displayProjection!=this.displayProjection){
this.displayProjection=_6e9.displayProjection;
}
break;
}
}
if(i==this.map.controls.length){
var args=OpenLayers.Util.getParameters();
if(args.layers){
this.layers=args.layers;
this.map.events.register("addlayer",this,this.configureLayers);
this.configureLayers();
}
if(args.lat&&args.lon){
this.center=new OpenLayers.LonLat(parseFloat(args.lon),parseFloat(args.lat));
if(args.zoom){
this.zoom=parseInt(args.zoom);
}
this.map.events.register("changebaselayer",this,this.setCenter);
this.setCenter();
}
}
},setCenter:function(){
if(this.map.baseLayer){
this.map.events.unregister("changebaselayer",this,this.setCenter);
if(this.displayProjection){
this.center.transform(this.displayProjection,this.map.getProjectionObject());
}
this.map.setCenter(this.center,this.zoom);
}
},configureLayers:function(){
if(this.layers.length==this.map.layers.length){
this.map.events.unregister("addlayer",this,this.configureLayers);
for(var i=0;i<this.layers.length;i++){
var _6ec=this.map.layers[i];
var c=this.layers.charAt(i);
if(c=="B"){
this.map.setBaseLayer(_6ec);
}else{
if((c=="T")||(c=="F")){
_6ec.setVisibility(c=="T");
}
}
}
}
},CLASS_NAME:"OpenLayers.Control.ArgParser"});
OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{element:null,base:"",displayProjection:null,initialize:function(_6ee,base,_6f0){
OpenLayers.Control.prototype.initialize.apply(this,[_6f0]);
this.element=OpenLayers.Util.getElement(_6ee);
this.base=base||document.location.href;
},destroy:function(){
if(this.element.parentNode==this.div){
this.div.removeChild(this.element);
}
this.element=null;
this.map.events.unregister("moveend",this,this.updateLink);
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},setMap:function(map){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
for(var i=0;i<this.map.controls.length;i++){
var _6f3=this.map.controls[i];
if(_6f3.CLASS_NAME=="OpenLayers.Control.ArgParser"){
if(_6f3.displayProjection!=this.displayProjection){
this.displayProjection=_6f3.displayProjection;
}
break;
}
}
if(i==this.map.controls.length){
this.map.addControl(new OpenLayers.Control.ArgParser({"displayProjection":this.displayProjection}));
}
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.element){
this.element=document.createElement("a");
this.element.innerHTML=OpenLayers.i18n("permalink");
this.element.href="";
this.div.appendChild(this.element);
}
this.map.events.on({"moveend":this.updateLink,"changelayer":this.updateLink,"changebaselayer":this.updateLink,scope:this});
return this.div;
},updateLink:function(){
var _6f4=this.map.getCenter();
if(!_6f4){
return;
}
var _6f5=OpenLayers.Util.getParameters(this.base);
_6f5.zoom=this.map.getZoom();
var lat=_6f4.lat;
var lon=_6f4.lon;
if(this.displayProjection){
var _6f8=OpenLayers.Projection.transform({x:lon,y:lat},this.map.getProjectionObject(),this.displayProjection);
lon=_6f8.x;
lat=_6f8.y;
}
_6f5.lat=Math.round(lat*100000)/100000;
_6f5.lon=Math.round(lon*100000)/100000;
_6f5.layers="";
for(var i=0;i<this.map.layers.length;i++){
var _6fa=this.map.layers[i];
if(_6fa.isBaseLayer){
_6f5.layers+=(_6fa==this.map.baseLayer)?"B":"0";
}else{
_6f5.layers+=(_6fa.getVisibility())?"T":"F";
}
}
var href=this.base;
if(href.indexOf("?")!=-1){
href=href.substring(0,href.indexOf("?"));
}
href+="?"+OpenLayers.Util.getParameterString(_6f5);
this.element.href=href;
},CLASS_NAME:"OpenLayers.Control.Permalink"});
OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(_6fc,_6fd){
OpenLayers.Control.prototype.initialize.apply(this,[_6fd]);
this.element=OpenLayers.Util.getElement(_6fc);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.element){
this.element=document.createElement("div");
this.div.appendChild(this.element);
}
this.map.events.register("moveend",this,this.updateScale);
this.updateScale();
return this.div;
},updateScale:function(){
var _6fe=this.map.getScale();
if(!_6fe){
return;
}
if(_6fe>=9500&&_6fe<=950000){
_6fe=Math.round(_6fe/1000)+"K";
}else{
if(_6fe>=950000){
_6fe=Math.round(_6fe/1000000)+"M";
}else{
_6fe=Math.round(_6fe);
}
}
this.element.innerHTML=OpenLayers.i18n("scale",{"scaleDenom":_6fe});
},CLASS_NAME:"OpenLayers.Control.Scale"});
OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,initialize:function(_6ff){
OpenLayers.Control.prototype.initialize.apply(this,[_6ff]);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.eTop){
this.div.style.display="block";
this.div.style.position="absolute";
this.eTop=document.createElement("div");
this.eTop.className=this.displayClass+"Top";
var _700=this.topInUnits.length;
this.div.appendChild(this.eTop);
if((this.topOutUnits=="")||(this.topInUnits=="")){
this.eTop.style.visibility="hidden";
}else{
this.eTop.style.visibility="visible";
}
this.eBottom=document.createElement("div");
this.eBottom.className=this.displayClass+"Bottom";
this.div.appendChild(this.eBottom);
if((this.bottomOutUnits=="")||(this.bottomInUnits=="")){
this.eBottom.style.visibility="hidden";
}else{
this.eBottom.style.visibility="visible";
}
}
this.map.events.register("moveend",this,this.update);
this.update();
return this.div;
},getBarLen:function(_701){
var _702=parseInt(Math.log(_701)/Math.log(10));
var _703=Math.pow(10,_702);
var _704=parseInt(_701/_703);
var _705;
if(_704>5){
_705=5;
}else{
if(_704>2){
_705=2;
}else{
_705=1;
}
}
return _705*_703;
},update:function(){
var res=this.map.getResolution();
if(!res){
return;
}
var _707=this.map.units;
var _708=OpenLayers.INCHES_PER_UNIT;
var _709=this.maxWidth*res*_708[_707];
var _70a;
var _70b;
if(_709>100000){
_70a=this.topOutUnits;
_70b=this.bottomOutUnits;
}else{
_70a=this.topInUnits;
_70b=this.bottomInUnits;
}
var _70c=_709/_708[_70a];
var _70d=_709/_708[_70b];
var _70e=this.getBarLen(_70c);
var _70f=this.getBarLen(_70d);
_70c=_70e/_708[_707]*_708[_70a];
_70d=_70f/_708[_707]*_708[_70b];
var _710=_70c/res;
var _711=_70d/res;
this.eTop.style.width=Math.round(_710)+"px";
this.eBottom.style.width=Math.round(_711)+"px";
this.eTop.innerHTML=_70e+" "+_70a;
this.eBottom.innerHTML=_70f+" "+_70b;
},CLASS_NAME:"OpenLayers.Control.ScaleLine"});
OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{activeColor:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:true,initialize:function(_712){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
this.layerStates=[];
},destroy:function(){
OpenLayers.Event.stopObservingElement(this.div);
OpenLayers.Event.stopObservingElement(this.minimizeDiv);
OpenLayers.Event.stopObservingElement(this.maximizeDiv);
this.clearLayersArray("base");
this.clearLayersArray("data");
this.map.events.un({"addlayer":this.redraw,"changelayer":this.redraw,"removelayer":this.redraw,"changebaselayer":this.redraw,scope:this});
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},setMap:function(map){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
this.map.events.on({"addlayer":this.redraw,"changelayer":this.redraw,"removelayer":this.redraw,"changebaselayer":this.redraw,scope:this});
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this);
this.loadContents();
if(!this.outsideViewport){
this.minimizeControl();
}
this.redraw();
return this.div;
},clearLayersArray:function(_714){
var _715=this[_714+"Layers"];
if(_715){
for(var i=0;i<_715.length;i++){
var _717=_715[i];
OpenLayers.Event.stopObservingElement(_717.inputElem);
OpenLayers.Event.stopObservingElement(_717.labelSpan);
}
}
this[_714+"LayersDiv"].innerHTML="";
this[_714+"Layers"]=[];
},checkRedraw:function(){
var _718=false;
if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){
_718=true;
}else{
for(var i=0;i<this.layerStates.length;i++){
var _71a=this.layerStates[i];
var _71b=this.map.layers[i];
if((_71a.name!=_71b.name)||(_71a.inRange!=_71b.inRange)||(_71a.id!=_71b.id)||(_71a.visibility!=_71b.visibility)){
_718=true;
break;
}
}
}
return _718;
},redraw:function(){
if(!this.checkRedraw()){
return this.div;
}
this.clearLayersArray("base");
this.clearLayersArray("data");
var _71c=false;
var _71d=false;
this.layerStates=new Array(this.map.layers.length);
for(var i=0;i<this.map.layers.length;i++){
var _71f=this.map.layers[i];
this.layerStates[i]={"name":_71f.name,"visibility":_71f.visibility,"inRange":_71f.inRange,"id":_71f.id};
}
var _720=this.map.layers.slice();
if(!this.ascending){
_720.reverse();
}
for(var i=0;i<_720.length;i++){
var _71f=_720[i];
var _721=_71f.isBaseLayer;
if(_71f.displayInLayerSwitcher){
if(_721){
_71d=true;
}else{
_71c=true;
}
var _722=(_721)?(_71f==this.map.baseLayer):_71f.getVisibility();
var _723=document.createElement("input");
_723.id="input_"+_71f.name;
_723.name=(_721)?"baseLayers":_71f.name;
_723.type=(_721)?"radio":"checkbox";
_723.value=_71f.name;
_723.checked=_722;
_723.defaultChecked=_722;
if(!_721&&!_71f.inRange){
_723.disabled=true;
}
var _724={"inputElem":_723,"layer":_71f,"layerSwitcher":this};
OpenLayers.Event.observe(_723,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,_724));
var _725=document.createElement("span");
if(!_721&&!_71f.inRange){
_725.style.color="gray";
}
_725.innerHTML=_71f.name;
_725.style.verticalAlign=(_721)?"bottom":"baseline";
OpenLayers.Event.observe(_725,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,_724));
var br=document.createElement("br");
var _727=(_721)?this.baseLayers:this.dataLayers;
_727.push({"layer":_71f,"inputElem":_723,"labelSpan":_725});
var _728=(_721)?this.baseLayersDiv:this.dataLayersDiv;
_728.appendChild(_723);
_728.appendChild(_725);
_728.appendChild(br);
}
}
this.dataLbl.style.display=(_71c)?"":"none";
this.baseLbl.style.display=(_71d)?"":"none";
return this.div;
},onInputClick:function(e){
if(!this.inputElem.disabled){
if(this.inputElem.type=="radio"){
this.inputElem.checked=true;
this.layer.map.setBaseLayer(this.layer);
}else{
this.inputElem.checked=!this.inputElem.checked;
this.layerSwitcher.updateMap();
}
}
OpenLayers.Event.stop(e);
},onLayerClick:function(e){
this.updateMap();
},updateMap:function(){
for(var i=0;i<this.baseLayers.length;i++){
var _72c=this.baseLayers[i];
if(_72c.inputElem.checked){
this.map.setBaseLayer(_72c.layer,false);
}
}
for(var i=0;i<this.dataLayers.length;i++){
var _72c=this.dataLayers[i];
_72c.layer.setVisibility(_72c.inputElem.checked);
}
},maximizeControl:function(e){
this.div.style.width="20em";
this.div.style.height="";
this.showControls(false);
if(e!=null){
OpenLayers.Event.stop(e);
}
},minimizeControl:function(e){
this.div.style.width="0px";
this.div.style.height="0px";
this.showControls(true);
if(e!=null){
OpenLayers.Event.stop(e);
}
},showControls:function(_72f){
this.maximizeDiv.style.display=_72f?"":"none";
this.minimizeDiv.style.display=_72f?"none":"";
this.layersDiv.style.display=_72f?"none":"";
},loadContents:function(){
this.div.style.position="absolute";
this.div.style.top="25px";
this.div.style.right="0px";
this.div.style.left="";
this.div.style.fontFamily="sans-serif";
this.div.style.fontWeight="bold";
this.div.style.marginTop="3px";
this.div.style.marginLeft="3px";
this.div.style.marginBottom="3px";
this.div.style.fontSize="smaller";
this.div.style.color="white";
this.div.style.backgroundColor="transparent";
OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUp,this));
OpenLayers.Event.observe(this.div,"click",this.ignoreEvent);
OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseDown,this));
OpenLayers.Event.observe(this.div,"dblclick",this.ignoreEvent);
this.layersDiv=document.createElement("div");
this.layersDiv.id="layersDiv";
this.layersDiv.style.paddingTop="5px";
this.layersDiv.style.paddingLeft="10px";
this.layersDiv.style.paddingBottom="5px";
this.layersDiv.style.paddingRight="75px";
this.layersDiv.style.backgroundColor=this.activeColor;
this.layersDiv.style.width="100%";
this.layersDiv.style.height="100%";
this.baseLbl=document.createElement("div");
this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");
this.baseLbl.style.marginTop="3px";
this.baseLbl.style.marginLeft="3px";
this.baseLbl.style.marginBottom="3px";
this.baseLayersDiv=document.createElement("div");
this.baseLayersDiv.style.paddingLeft="10px";
this.dataLbl=document.createElement("div");
this.dataLbl.innerHTML=OpenLayers.i18n("overlays");
this.dataLbl.style.marginTop="3px";
this.dataLbl.style.marginLeft="3px";
this.dataLbl.style.marginBottom="3px";
this.dataLayersDiv=document.createElement("div");
this.dataLayersDiv.style.paddingLeft="10px";
if(this.ascending){
this.layersDiv.appendChild(this.baseLbl);
this.layersDiv.appendChild(this.baseLayersDiv);
this.layersDiv.appendChild(this.dataLbl);
this.layersDiv.appendChild(this.dataLayersDiv);
}else{
this.layersDiv.appendChild(this.dataLbl);
this.layersDiv.appendChild(this.dataLayersDiv);
this.layersDiv.appendChild(this.baseLbl);
this.layersDiv.appendChild(this.baseLayersDiv);
}
this.div.appendChild(this.layersDiv);
OpenLayers.Rico.Corner.round(this.div,{corners:"tl bl",bgColor:"transparent",color:this.activeColor,blend:false});
OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,0.75);
var _730=OpenLayers.Util.getImagesLocation();
var sz=new OpenLayers.Size(18,18);
var img=_730+"layer-switcher-maximize.png";
this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,sz,img,"absolute");
this.maximizeDiv.style.top="5px";
this.maximizeDiv.style.right="0px";
this.maximizeDiv.style.left="";
this.maximizeDiv.style.display="none";
OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));
this.div.appendChild(this.maximizeDiv);
var img=_730+"layer-switcher-minimize.png";
var sz=new OpenLayers.Size(18,18);
this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,sz,img,"absolute");
this.minimizeDiv.style.top="5px";
this.minimizeDiv.style.right="0px";
this.minimizeDiv.style.left="";
this.minimizeDiv.style.display="none";
OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));
this.div.appendChild(this.minimizeDiv);
},ignoreEvent:function(evt){
OpenLayers.Event.stop(evt);
},mouseDown:function(evt){
this.isMouseDown=true;
this.ignoreEvent(evt);
},mouseUp:function(evt){
if(this.isMouseDown){
this.isMouseDown=false;
this.ignoreEvent(evt);
}
},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});
OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,featureAdded:function(){
},handlerOptions:null,initialize:function(_736,_737,_738){
OpenLayers.Control.prototype.initialize.apply(this,[_738]);
this.callbacks=OpenLayers.Util.extend({done:this.drawFeature},this.callbacks);
this.layer=_736;
this.handler=new _737(this,this.callbacks,this.handlerOptions);
},drawFeature:function(_739){
var _73a=new OpenLayers.Feature.Vector(_739);
this.layer.addFeatures([_73a]);
this.featureAdded(_73a);
},CLASS_NAME:"OpenLayers.Control.DrawFeature"});
OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(_73b,_73c){
},onDrag:function(_73d,_73e){
},onComplete:function(_73f,_740){
},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(_741,_742){
OpenLayers.Control.prototype.initialize.apply(this,[_742]);
this.layer=_741;
this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks)),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})};
},destroy:function(){
this.layer=null;
OpenLayers.Control.prototype.destroy.apply(this,[]);
},activate:function(){
return (this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments));
},deactivate:function(){
this.handlers.drag.deactivate();
this.handlers.feature.deactivate();
this.feature=null;
this.dragging=false;
this.lastPixel=null;
return OpenLayers.Control.prototype.deactivate.apply(this,arguments);
},overFeature:function(_743){
if(!this.handlers.drag.dragging){
this.feature=_743;
this.handlers.drag.activate();
this.over=true;
this.map.div.style.cursor="move";
}else{
if(this.feature.id==_743.id){
this.over=true;
}else{
this.over=false;
}
}
},downFeature:function(_744){
this.lastPixel=_744;
this.onStart(this.feature,_744);
},moveFeature:function(_745){
var res=this.map.getResolution();
this.feature.geometry.move(res*(_745.x-this.lastPixel.x),res*(this.lastPixel.y-_745.y));
this.layer.drawFeature(this.feature);
this.lastPixel=_745;
this.onDrag(this.feature,_745);
},upFeature:function(_747){
if(!this.over){
this.handlers.drag.deactivate();
this.feature=null;
this.map.div.style.cursor="default";
}
},doneDragging:function(_748){
this.onComplete(this.feature,_748);
},outFeature:function(_749){
if(!this.handlers.drag.dragging){
this.over=false;
this.handlers.drag.deactivate();
this.map.div.style.cursor="default";
this.feature=null;
}else{
if(this.feature.id==_749.id){
this.over=false;
}
}
},cancel:function(){
this.handlers.drag.deactivate();
this.over=false;
},setMap:function(map){
this.handlers.drag.setMap(map);
this.handlers.feature.setMap(map);
OpenLayers.Control.prototype.setMap.apply(this,arguments);
},CLASS_NAME:"OpenLayers.Control.DragFeature"});
OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,clickout:true,toggle:true,layer:null,feature:null,vertices:null,virtualVertices:null,selectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,mode:null,radiusHandle:null,dragHandle:null,onModificationStart:function(){
},onModification:function(){
},onModificationEnd:function(){
},initialize:function(_74b,_74c){
this.layer=_74b;
this.vertices=[];
this.virtualVertices=[];
this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer());
this.virtualStyle.fillOpacity=0.3;
this.virtualStyle.strokeOpacity=0.3;
this.deleteCodes=[46,100];
this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;
OpenLayers.Control.prototype.initialize.apply(this,[_74c]);
if(!(this.deleteCodes instanceof Array)){
this.deleteCodes=[this.deleteCodes];
}
var _74d=this;
var _74e={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle};
this.selectControl=new OpenLayers.Control.SelectFeature(_74b,_74e);
this.layer.events.on({"featureselected":this.selectFeature,"featureunselected":this.unselectFeature,scope:this});
var _74f={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(_750,_751){
_74d.dragStart.apply(_74d,[_750,_751]);
},onDrag:function(_752){
_74d.dragVertex.apply(_74d,[_752]);
},onComplete:function(_753){
_74d.dragComplete.apply(_74d,[_753]);
}};
this.dragControl=new OpenLayers.Control.DragFeature(_74b,_74f);
var _754={keypress:this.handleKeypress};
this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,_754)};
},destroy:function(){
this.layer.events.un({"featureselected":this.selectFeature,"featureunselected":this.unselectFeature,scope:this});
this.layer=null;
this.selectControl.destroy();
this.dragControl.destroy();
OpenLayers.Control.prototype.destroy.apply(this,[]);
},activate:function(){
return (this.selectControl.activate()&&this.handlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments));
},deactivate:function(){
var _755=false;
if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){
this.layer.removeFeatures(this.vertices);
this.layer.removeFeatures(this.virtualVertices);
this.vertices=[];
this.dragControl.deactivate();
if(this.feature&&this.feature.geometry){
this.selectControl.unselect.apply(this.selectControl,[this.feature]);
}
this.selectControl.deactivate();
this.handlers.keyboard.deactivate();
_755=true;
}
return _755;
},selectFeature:function(_756){
this.feature=_756.feature;
this.resetVertices();
this.dragControl.activate();
this.onModificationStart(this.feature);
this.layer.events.triggerEvent("beforefeaturemodified",{feature:this.feature});
},unselectFeature:function(_757){
this.layer.removeFeatures(this.vertices);
this.vertices=[];
this.layer.destroyFeatures(this.virtualVertices);
this.virtualVertices=[];
if(this.dragHandle){
this.layer.destroyFeatures([this.dragHandle]);
delete this.dragHandle;
}
if(this.radiusHandle){
this.layer.destroyFeatures([this.radiusHandle]);
delete this.radiusHandle;
}
this.feature=null;
this.dragControl.deactivate();
this.onModificationEnd(_757.feature);
this.layer.events.triggerEvent("afterfeaturemodified",{feature:_757.feature});
},dragStart:function(_758,_759){
if(_758!=this.feature&&!_758.geometry.parent&&_758!=this.dragHandle&&_758!=this.radiusHandle){
if(this.feature){
this.selectControl.clickFeature.apply(this.selectControl,[this.feature]);
}
if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,_758.geometry.CLASS_NAME)!=-1){
this.selectControl.clickFeature.apply(this.selectControl,[_758]);
this.dragControl.overFeature.apply(this.dragControl,[_758]);
this.dragControl.lastPixel=_759;
this.dragControl.handlers.drag.started=true;
this.dragControl.handlers.drag.start=_759;
this.dragControl.handlers.drag.last=_759;
}
}
},dragVertex:function(_75a){
if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){
if(this.feature!=_75a){
this.feature=_75a;
}
}else{
if(_75a._index){
_75a.geometry.parent.addComponent(_75a.geometry,_75a._index);
delete _75a._index;
OpenLayers.Util.removeItem(this.virtualVertices,_75a);
this.vertices.push(_75a);
}else{
if(_75a==this.dragHandle){
this.layer.removeFeatures(this.vertices);
this.vertices=[];
if(this.radiusHandle){
this.layer.destroyFeatures([this.radiusHandle]);
this.radiusHandle=null;
}
}
}
if(this.virtualVertices.length>0){
this.layer.destroyFeatures(this.virtualVertices);
this.virtualVertices=[];
}
this.layer.drawFeature(this.feature,this.selectControl.renderIntent);
}
this.layer.drawFeature(_75a);
},dragComplete:function(_75b){
this.resetVertices();
this.onModification(this.feature);
this.layer.events.triggerEvent("featuremodified",{feature:this.feature});
},resetVertices:function(){
if(this.dragControl.feature){
this.dragControl.outFeature(this.dragControl.feature);
}
if(this.vertices.length>0){
this.layer.removeFeatures(this.vertices);
this.vertices=[];
}
if(this.virtualVertices.length>0){
this.layer.removeFeatures(this.virtualVertices);
this.virtualVertices=[];
}
if(this.dragHandle){
this.layer.destroyFeatures([this.dragHandle]);
this.dragHandle=null;
}
if(this.radiusHandle){
this.layer.destroyFeatures([this.radiusHandle]);
this.radiusHandle=null;
}
if(this.feature&&this.feature.geometry.CLASS_NAME!="OpenLayers.Geometry.Point"){
if((this.mode&OpenLayers.Control.ModifyFeature.DRAG)){
this.collectDragHandle();
}
if((this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE))){
this.collectRadiusHandle();
}
if((this.mode&OpenLayers.Control.ModifyFeature.RESHAPE)){
this.collectVertices();
}
}
},handleKeypress:function(code){
if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,code)!=-1){
var _75d=this.dragControl.feature;
if(_75d&&OpenLayers.Util.indexOf(this.vertices,_75d)!=-1&&!this.dragControl.handlers.drag.dragging&&_75d.geometry.parent){
_75d.geometry.parent.removeComponent(_75d.geometry);
this.layer.drawFeature(this.feature,this.selectControl.renderIntent);
this.resetVertices();
this.onModification(this.feature);
this.layer.events.triggerEvent("featuremodified",{feature:this.feature});
}
}
},collectVertices:function(){
this.vertices=[];
this.virtualVertices=[];
var _75e=this;
function collectComponentVertices(_75f){
var i,_761,_762;
if(_75f.CLASS_NAME=="OpenLayers.Geometry.Point"){
_761=new OpenLayers.Feature.Vector(_75f);
_75e.vertices.push(_761);
}else{
var _763=_75f.components.length;
if(_75f.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){
_763-=1;
}
for(i=0;i<_763;++i){
_762=_75f.components[i];
if(_762.CLASS_NAME=="OpenLayers.Geometry.Point"){
_761=new OpenLayers.Feature.Vector(_762);
_75e.vertices.push(_761);
}else{
collectComponentVertices(_762);
}
}
if(_75f.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){
for(i=0;i<_75f.components.length-1;++i){
var _764=_75f.components[i];
var _765=_75f.components[i+1];
if(_764.CLASS_NAME=="OpenLayers.Geometry.Point"&&_765.CLASS_NAME=="OpenLayers.Geometry.Point"){
var x=(_764.x+_765.x)/2;
var y=(_764.y+_765.y)/2;
var _768=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(x,y),null,_75e.virtualStyle);
_768.geometry.parent=_75f;
_768._index=i+1;
_75e.virtualVertices.push(_768);
}
}
}
}
};
collectComponentVertices.call(this,this.feature.geometry);
this.layer.addFeatures(this.vertices,{silent:true});
this.layer.addFeatures(this.virtualVertices,{silent:true});
},collectDragHandle:function(){
var _769=this.feature.geometry;
var _76a=_769.getBounds().getCenterLonLat();
var _76b=new OpenLayers.Geometry.Point(_76a.lon,_76a.lat);
var _76c=new OpenLayers.Feature.Vector(_76b);
_76b.move=function(x,y){
OpenLayers.Geometry.Point.prototype.move.call(this,x,y);
_769.move(x,y);
};
this.dragHandle=_76c;
this.layer.addFeatures([this.dragHandle],{silent:true});
},collectRadiusHandle:function(){
var _76f=this.feature.geometry;
var _770=_76f.getBounds();
var _771=_770.getCenterLonLat();
var _772=new OpenLayers.Geometry.Point(_771.lon,_771.lat);
var _773=new OpenLayers.Geometry.Point(_770.right,_770.bottom);
var _774=new OpenLayers.Feature.Vector(_773);
var _775=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);
var _776=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);
_773.move=function(x,y){
OpenLayers.Geometry.Point.prototype.move.call(this,x,y);
var dx1=this.x-_772.x;
var dy1=this.y-_772.y;
var dx0=dx1-x;
var dy0=dy1-y;
if(_776){
var a0=Math.atan2(dy0,dx0);
var a1=Math.atan2(dy1,dx1);
var _77f=a1-a0;
_77f*=180/Math.PI;
_76f.rotate(_77f,_772);
}
if(_775){
var l0=Math.sqrt((dx0*dx0)+(dy0*dy0));
var l1=Math.sqrt((dx1*dx1)+(dy1*dy1));
_76f.resize(l1/l0,_772);
}
};
this.radiusHandle=_774;
this.layer.addFeatures([this.radiusHandle],{silent:true});
},setMap:function(map){
this.selectControl.setMap(map);
this.dragControl.setMap(map);
OpenLayers.Control.prototype.setMap.apply(this,arguments);
},CLASS_NAME:"OpenLayers.Control.ModifyFeature"});
OpenLayers.Control.ModifyFeature.RESHAPE=1;
OpenLayers.Control.ModifyFeature.RESIZE=2;
OpenLayers.Control.ModifyFeature.ROTATE=4;
OpenLayers.Control.ModifyFeature.DRAG=8;
OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,defaultControl:null,initialize:function(_783){
OpenLayers.Control.prototype.initialize.apply(this,[_783]);
this.controls=[];
},destroy:function(){
OpenLayers.Control.prototype.destroy.apply(this,arguments);
for(var i=this.controls.length-1;i>=0;i--){
if(this.controls[i].events){
this.controls[i].events.un({"activate":this.redraw,"deactivate":this.redraw,scope:this});
}
OpenLayers.Event.stopObservingElement(this.controls[i].panel_div);
this.controls[i].panel_div=null;
}
},activate:function(){
if(OpenLayers.Control.prototype.activate.apply(this,arguments)){
for(var i=0;i<this.controls.length;i++){
if(this.controls[i]==this.defaultControl){
this.controls[i].activate();
}
}
this.redraw();
return true;
}else{
return false;
}
},deactivate:function(){
if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){
for(var i=0;i<this.controls.length;i++){
this.controls[i].deactivate();
}
return true;
}else{
return false;
}
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
for(var i=0;i<this.controls.length;i++){
this.map.addControl(this.controls[i]);
this.controls[i].deactivate();
this.controls[i].events.on({"activate":this.redraw,"deactivate":this.redraw,scope:this});
}
this.activate();
return this.div;
},redraw:function(){
this.div.innerHTML="";
if(this.active){
for(var i=0;i<this.controls.length;i++){
var _789=this.controls[i].panel_div;
if(this.controls[i].active){
_789.className=this.controls[i].displayClass+"ItemActive";
}else{
_789.className=this.controls[i].displayClass+"ItemInactive";
}
this.div.appendChild(_789);
}
}
},activateControl:function(_78a){
if(!this.active){
return false;
}
if(_78a.type==OpenLayers.Control.TYPE_BUTTON){
_78a.trigger();
return;
}
if(_78a.type==OpenLayers.Control.TYPE_TOGGLE){
if(_78a.active){
_78a.deactivate();
}else{
_78a.activate();
}
return;
}
for(var i=0;i<this.controls.length;i++){
if(this.controls[i]!=_78a){
if(this.controls[i].type!=OpenLayers.Control.TYPE_TOGGLE){
this.controls[i].deactivate();
}
}
}
_78a.activate();
},addControls:function(_78c){
if(!(_78c instanceof Array)){
_78c=[_78c];
}
this.controls=this.controls.concat(_78c);
for(var i=0;i<_78c.length;i++){
var _78e=document.createElement("div");
var _78f=document.createTextNode(" ");
_78c[i].panel_div=_78e;
if(_78c[i].title!=""){
_78c[i].panel_div.title=_78c[i].title;
}
OpenLayers.Event.observe(_78c[i].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,_78c[i]));
OpenLayers.Event.observe(_78c[i].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop));
}
if(this.map){
for(var i=0;i<_78c.length;i++){
this.map.addControl(_78c[i]);
_78c[i].deactivate();
_78c[i].events.on({"activate":this.redraw,"deactivate":this.redraw,scope:this});
}
this.redraw();
}
},onClick:function(ctrl,evt){
OpenLayers.Event.stop(evt?evt:window.event);
this.activateControl(ctrl);
},getControlsBy:function(_792,_793){
var test=(typeof _793.test=="function");
var _795=OpenLayers.Array.filter(this.controls,function(item){
return item[_792]==_793||(test&&_793.test(item[_792]));
});
return _795;
},getControlsByName:function(_797){
return this.getControlsBy("name",_797);
},getControlsByClass:function(_798){
return this.getControlsBy("CLASS_NAME",_798);
},CLASS_NAME:"OpenLayers.Control.Panel"});
OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,onSelect:function(){
},onUnselect:function(){
},geometryTypes:null,layer:null,callbacks:null,selectStyle:null,renderIntent:"select",handler:null,initialize:function(_799,_79a){
OpenLayers.Control.prototype.initialize.apply(this,[_79a]);
this.layer=_799;
this.callbacks=OpenLayers.Util.extend({click:this.clickFeature,clickout:this.clickoutFeature,over:this.overFeature,out:this.outFeature},this.callbacks);
var _79b={geometryTypes:this.geometryTypes};
this.handler=new OpenLayers.Handler.Feature(this,_799,this.callbacks,_79b);
},unselectAll:function(_79c){
var _79d;
for(var i=this.layer.selectedFeatures.length-1;i>=0;--i){
_79d=this.layer.selectedFeatures[i];
if(!_79c||_79c.except!=_79d){
this.unselect(_79d);
}
}
},clickFeature:function(_79f){
if(!this.hover){
var _7a0=(OpenLayers.Util.indexOf(this.layer.selectedFeatures,_79f)>-1);
if(_7a0){
if(this.toggleSelect()){
this.unselect(_79f);
}else{
if(!this.multipleSelect()){
this.unselectAll({except:_79f});
}
}
}else{
if(!this.multipleSelect()){
this.unselectAll({except:_79f});
}
this.select(_79f);
}
}
},multipleSelect:function(){
return this.multiple||this.handler.evt[this.multipleKey];
},toggleSelect:function(){
return this.toggle||this.handler.evt[this.toggleKey];
},clickoutFeature:function(_7a1){
if(!this.hover&&this.clickout){
this.unselectAll();
}
},overFeature:function(_7a2){
if(this.hover&&(OpenLayers.Util.indexOf(this.layer.selectedFeatures,_7a2)==-1)){
this.select(_7a2);
}
},outFeature:function(_7a3){
if(this.hover){
this.unselect(_7a3);
}
},select:function(_7a4){
this.layer.selectedFeatures.push(_7a4);
var _7a5=this.selectStyle||this.renderIntent;
this.layer.drawFeature(_7a4,_7a5);
this.layer.events.triggerEvent("featureselected",{feature:_7a4});
this.onSelect(_7a4);
},unselect:function(_7a6){
this.layer.drawFeature(_7a6,"default");
OpenLayers.Util.removeItem(this.layer.selectedFeatures,_7a6);
this.layer.events.triggerEvent("featureunselected",{feature:_7a6});
this.onUnselect(_7a6);
},setMap:function(map){
this.handler.setMap(map);
OpenLayers.Control.prototype.setMap.apply(this,arguments);
},CLASS_NAME:"OpenLayers.Control.SelectFeature"});
OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,activateOnDraw:true,clearOnDeactivate:false,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:false,initialize:function(_7a8){
OpenLayers.Control.prototype.initialize.apply(this,[_7a8]);
this.registry=OpenLayers.Util.extend({"moveend":function(){
return {center:this.map.getCenter(),resolution:this.map.getResolution()};
}},this.registry);
this.clear();
var _7a9={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+"Previous"};
OpenLayers.Util.extend(_7a9,this.previousOptions);
this.previous=new OpenLayers.Control.Button(_7a9);
var _7aa={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+"Next"};
OpenLayers.Util.extend(_7aa,this.nextOptions);
this.next=new OpenLayers.Control.Button(_7aa);
},onPreviousChange:function(_7ab,_7ac){
if(_7ab&&!this.previous.active){
this.previous.activate();
}else{
if(!_7ab&&this.previous.active){
this.previous.deactivate();
}
}
},onNextChange:function(_7ad,_7ae){
if(_7ad&&!this.next.active){
this.next.activate();
}else{
if(!_7ad&&this.next.active){
this.next.deactivate();
}
}
},destroy:function(){
OpenLayers.Control.prototype.destroy.apply(this);
this.previous.destroy();
this.next.destroy();
this.deactivate();
for(var prop in this){
this[prop]=null;
}
},setMap:function(map){
this.map=map;
this.next.setMap(map);
this.previous.setMap(map);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
this.next.draw();
this.previous.draw();
if(this.activateOnDraw){
this.activate();
}
},previousTrigger:function(){
var _7b1=this.previousStack.shift();
var _7b2=this.previousStack.shift();
if(_7b2!=undefined){
this.nextStack.unshift(_7b1);
this.previousStack.unshift(_7b2);
this.restoring=true;
this.restore(_7b2);
this.restoring=false;
this.onNextChange(this.nextStack[0],this.nextStack.length);
this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);
}else{
this.previousStack.unshift(_7b1);
}
return _7b2;
},nextTrigger:function(){
var _7b3=this.nextStack.shift();
if(_7b3!=undefined){
this.previousStack.unshift(_7b3);
this.restoring=true;
this.restore(_7b3);
this.restoring=false;
this.onNextChange(this.nextStack[0],this.nextStack.length);
this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);
}
return _7b3;
},clear:function(){
this.previousStack=[];
this.nextStack=[];
},restore:function(_7b4){
var zoom=this.map.getZoomForResolution(_7b4.resolution);
this.map.setCenter(_7b4.center,zoom);
},setListeners:function(){
this.listeners={};
for(var type in this.registry){
this.listeners[type]=OpenLayers.Function.bind(function(){
if(!this.restoring){
var _7b7=this.registry[type].apply(this,arguments);
this.previousStack.unshift(_7b7);
if(this.previousStack.length>1){
this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);
}
if(this.previousStack.length>(this.limit+1)){
this.previousStack.pop();
}
if(this.nextStack.length>0){
this.nextStack=[];
this.onNextChange(null,0);
}
}
return true;
},this);
}
},activate:function(){
var _7b8=false;
if(this.map){
if(OpenLayers.Control.prototype.activate.apply(this)){
if(this.listeners==null){
this.setListeners();
}
for(var type in this.listeners){
this.map.events.register(type,this,this.listeners[type]);
}
_7b8=true;
if(this.previousStack.length==0){
this.initStack();
}
}
}
return _7b8;
},initStack:function(){
if(this.map.getCenter()){
this.listeners.moveend();
}
},deactivate:function(){
var _7ba=false;
if(this.map){
if(OpenLayers.Control.prototype.deactivate.apply(this)){
for(var type in this.listeners){
this.map.events.unregister(type,this,this.listeners[type]);
}
if(this.clearOnDeactivate){
this.clear();
}
_7ba=true;
}
}
return _7ba;
},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});
OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
},destroy:function(){
this.id=null;
this.bounds=null;
},clone:function(){
return new OpenLayers.Geometry();
},setBounds:function(_7bc){
if(_7bc){
this.bounds=_7bc.clone();
}
},clearBounds:function(){
this.bounds=null;
if(this.parent){
this.parent.clearBounds();
}
},extendBounds:function(_7bd){
var _7be=this.getBounds();
if(!_7be){
this.setBounds(_7bd);
}else{
this.bounds.extend(_7bd);
}
},getBounds:function(){
if(this.bounds==null){
this.calculateBounds();
}
return this.bounds;
},calculateBounds:function(){
},atPoint:function(_7bf,_7c0,_7c1){
var _7c2=false;
var _7c3=this.getBounds();
if((_7c3!=null)&&(_7bf!=null)){
var dX=(_7c0!=null)?_7c0:0;
var dY=(_7c1!=null)?_7c1:0;
var _7c6=new OpenLayers.Bounds(this.bounds.left-dX,this.bounds.bottom-dY,this.bounds.right+dX,this.bounds.top+dY);
_7c2=_7c6.containsLonLat(_7bf);
}
return _7c2;
},getLength:function(){
return 0;
},getArea:function(){
return 0;
},toString:function(){
return OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this));
},CLASS_NAME:"OpenLayers.Geometry"});
OpenLayers.Geometry.segmentsIntersect=function(seg1,seg2,_7c9){
var _7ca=false;
var _7cb=seg1.x1-seg2.x1;
var _7cc=seg1.y1-seg2.y1;
var _7cd=seg1.x2-seg1.x1;
var _7ce=seg1.y2-seg1.y1;
var _7cf=seg2.y2-seg2.y1;
var _7d0=seg2.x2-seg2.x1;
var d=(_7cf*_7cd)-(_7d0*_7ce);
var n1=(_7d0*_7cc)-(_7cf*_7cb);
var n2=(_7cd*_7cc)-(_7ce*_7cb);
if(d==0){
if(n1==0&&n2==0){
_7ca=true;
}
}else{
var _7d4=n1/d;
var _7d5=n2/d;
if(_7d4>=0&&_7d4<=1&&_7d5>=0&&_7d5<=1){
if(!_7c9){
_7ca=true;
}else{
var x=seg1.x1+(_7d4*_7cd);
var y=seg1.y1+(_7d4*_7ce);
_7ca=new OpenLayers.Geometry.Point(x,y);
}
}
}
return _7ca;
};
OpenLayers.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(x,y,_7da,_7db){
OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
this.x=x;
this.y=y;
this.width=_7da;
this.height=_7db;
},calculateBounds:function(){
this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height);
},getLength:function(){
var _7dc=(2*this.width)+(2*this.height);
return _7dc;
},getArea:function(){
var area=this.width*this.height;
return area;
},CLASS_NAME:"OpenLayers.Geometry.Rectangle"});
OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(_7de){
OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
this.components=[];
if(_7de!=null){
this.addComponents(_7de);
}
},destroy:function(){
this.components.length=0;
this.components=null;
},clone:function(){
var _7df=eval("new "+this.CLASS_NAME+"()");
for(var i=0;i<this.components.length;i++){
_7df.addComponent(this.components[i].clone());
}
OpenLayers.Util.applyDefaults(_7df,this);
return _7df;
},getComponentsString:function(){
var _7e1=[];
for(var i=0;i<this.components.length;i++){
_7e1.push(this.components[i].toShortString());
}
return _7e1.join(",");
},calculateBounds:function(){
this.bounds=null;
if(this.components&&this.components.length>0){
this.setBounds(this.components[0].getBounds());
for(var i=1;i<this.components.length;i++){
this.extendBounds(this.components[i].getBounds());
}
}
},addComponents:function(_7e4){
if(!(_7e4 instanceof Array)){
_7e4=[_7e4];
}
for(var i=0;i<_7e4.length;i++){
this.addComponent(_7e4[i]);
}
},addComponent:function(_7e6,_7e7){
var _7e8=false;
if(_7e6){
if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,_7e6.CLASS_NAME)>-1)){
if(_7e7!=null&&(_7e7<this.components.length)){
var _7e9=this.components.slice(0,_7e7);
var _7ea=this.components.slice(_7e7,this.components.length);
_7e9.push(_7e6);
this.components=_7e9.concat(_7ea);
}else{
this.components.push(_7e6);
}
_7e6.parent=this;
this.clearBounds();
_7e8=true;
}
}
return _7e8;
},removeComponents:function(_7eb){
if(!(_7eb instanceof Array)){
_7eb=[_7eb];
}
for(var i=_7eb.length-1;i>=0;--i){
this.removeComponent(_7eb[i]);
}
},removeComponent:function(_7ed){
OpenLayers.Util.removeItem(this.components,_7ed);
this.clearBounds();
},getLength:function(){
var _7ee=0;
for(var i=0;i<this.components.length;i++){
_7ee+=this.components[i].getLength();
}
return _7ee;
},getArea:function(){
var area=0;
for(var i=0;i<this.components.length;i++){
area+=this.components[i].getArea();
}
return area;
},move:function(x,y){
for(var i=0;i<this.components.length;i++){
this.components[i].move(x,y);
}
},rotate:function(_7f5,_7f6){
for(var i=0;i<this.components.length;++i){
this.components[i].rotate(_7f5,_7f6);
}
},resize:function(_7f8,_7f9,_7fa){
for(var i=0;i<this.components.length;++i){
this.components[i].resize(_7f8,_7f9,_7fa);
}
},equals:function(_7fc){
var _7fd=true;
if(!_7fc||!_7fc.CLASS_NAME||(this.CLASS_NAME!=_7fc.CLASS_NAME)){
_7fd=false;
}else{
if(!(_7fc.components instanceof Array)||(_7fc.components.length!=this.components.length)){
_7fd=false;
}else{
for(var i=0;i<this.components.length;++i){
if(!this.components[i].equals(_7fc.components[i])){
_7fd=false;
break;
}
}
}
}
return _7fd;
},transform:function(_7ff,dest){
if(_7ff&&dest){
for(var i=0;i<this.components.length;i++){
var _802=this.components[i];
_802.transform(_7ff,dest);
}
}
return this;
},intersects:function(_803){
var _804=false;
for(var i=0;i<this.components.length;++i){
_804=_803.intersects(this.components[i]);
if(_804){
break;
}
}
return _804;
},CLASS_NAME:"OpenLayers.Geometry.Collection"});
OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(x,y){
OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
this.x=parseFloat(x);
this.y=parseFloat(y);
},clone:function(obj){
if(obj==null){
obj=new OpenLayers.Geometry.Point(this.x,this.y);
}
OpenLayers.Util.applyDefaults(obj,this);
return obj;
},calculateBounds:function(){
this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y);
},distanceTo:function(_809){
var _80a=0;
if((this.x!=null)&&(this.y!=null)&&(_809!=null)&&(_809.x!=null)&&(_809.y!=null)){
var dx2=Math.pow(this.x-_809.x,2);
var dy2=Math.pow(this.y-_809.y,2);
_80a=Math.sqrt(dx2+dy2);
}
return _80a;
},equals:function(geom){
var _80e=false;
if(geom!=null){
_80e=((this.x==geom.x&&this.y==geom.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(geom.x)&&isNaN(geom.y)));
}
return _80e;
},toShortString:function(){
return (this.x+", "+this.y);
},move:function(x,y){
this.x=this.x+x;
this.y=this.y+y;
this.clearBounds();
},rotate:function(_811,_812){
_811*=Math.PI/180;
var _813=this.distanceTo(_812);
var _814=_811+Math.atan2(this.y-_812.y,this.x-_812.x);
this.x=_812.x+(_813*Math.cos(_814));
this.y=_812.y+(_813*Math.sin(_814));
this.clearBounds();
},resize:function(_815,_816,_817){
_817=(_817==undefined)?1:_817;
this.x=_816.x+(_815*_817*(this.x-_816.x));
this.y=_816.y+(_815*(this.y-_816.y));
this.clearBounds();
},intersects:function(_818){
var _819=false;
if(_818.CLASS_NAME=="OpenLayers.Geometry.Point"){
_819=this.equals(_818);
}else{
_819=_818.intersects(this);
}
return _819;
},transform:function(_81a,dest){
if((_81a&&dest)){
OpenLayers.Projection.transform(this,_81a,dest);
}
return this;
},CLASS_NAME:"OpenLayers.Geometry.Point"});
OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(_81c){
OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments);
},addPoint:function(_81d,_81e){
this.addComponent(_81d,_81e);
},removePoint:function(_81f){
this.removeComponent(_81f);
},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});
OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(_820){
OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments);
},getLength:function(){
var _821=0;
if(this.components&&(this.components.length>1)){
for(var i=1;i<this.components.length;i++){
_821+=this.components[i-1].distanceTo(this.components[i]);
}
}
return _821;
},CLASS_NAME:"OpenLayers.Geometry.Curve"});
OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(_823){
OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments);
},removeComponent:function(_824){
if(this.components&&(this.components.length>2)){
OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);
}
},intersects:function(_825){
var _826=false;
var type=_825.CLASS_NAME;
if(type=="OpenLayers.Geometry.LineString"||type=="OpenLayers.Geometry.LinearRing"||type=="OpenLayers.Geometry.Point"){
var _828=this.getSortedSegments();
var _829;
if(type=="OpenLayers.Geometry.Point"){
_829=[{x1:_825.x,y1:_825.y,x2:_825.x,y2:_825.y}];
}else{
_829=_825.getSortedSegments();
}
var seg1,_82b,_82c,_82d,_82e,seg2,_830,_831;
outer:
for(var i=0;i<_828.length;++i){
seg1=_828[i];
_82b=seg1.x1;
_82c=seg1.x2;
_82d=seg1.y1;
_82e=seg1.y2;
inner:
for(var j=0;j<_829.length;++j){
seg2=_829[j];
if(seg2.x1>_82c){
break;
}
if(seg2.x2<_82b){
continue;
}
_830=seg2.y1;
_831=seg2.y2;
if(Math.min(_830,_831)>Math.max(_82d,_82e)){
continue;
}
if(Math.max(_830,_831)<Math.min(_82d,_82e)){
continue;
}
if(OpenLayers.Geometry.segmentsIntersect(seg1,seg2)){
_826=true;
break outer;
}
}
}
}else{
_826=_825.intersects(this);
}
return _826;
},getSortedSegments:function(){
var _834=this.components.length-1;
var _835=new Array(_834);
for(var i=0;i<_834;++i){
point1=this.components[i];
point2=this.components[i+1];
if(point1.x<point2.x){
_835[i]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y};
}else{
_835[i]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y};
}
}
function byX1(seg1,seg2){
return seg1.x1-seg2.x1;
};
return _835.sort(byX1);
},CLASS_NAME:"OpenLayers.Geometry.LineString"});
OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(_839){
OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments);
},addComponent:function(_83a,_83b){
var _83c=false;
var _83d=this.components.pop();
if(_83b!=null||!_83a.equals(_83d)){
_83c=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments);
}
var _83e=this.components[0];
OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[_83e]);
return _83c;
},removeComponent:function(_83f){
if(this.components.length>4){
this.components.pop();
OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);
var _840=this.components[0];
OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[_840]);
}
},move:function(x,y){
for(var i=0;i<this.components.length-1;i++){
this.components[i].move(x,y);
}
},rotate:function(_844,_845){
for(var i=0;i<this.components.length-1;++i){
this.components[i].rotate(_844,_845);
}
},resize:function(_847,_848,_849){
for(var i=0;i<this.components.length-1;++i){
this.components[i].resize(_847,_848,_849);
}
},transform:function(_84b,dest){
if(_84b&&dest){
for(var i=0;i<this.components.length-1;i++){
var _84e=this.components[i];
_84e.transform(_84b,dest);
}
}
return this;
},getArea:function(){
var area=0;
if(this.components&&(this.components.length>2)){
var sum=0;
for(var i=0;i<this.components.length-1;i++){
var b=this.components[i];
var c=this.components[i+1];
sum+=(b.x+c.x)*(c.y-b.y);
}
area=-sum/2;
}
return area;
},containsPoint:function(_854){
var _855=OpenLayers.Number.limitSigDigs;
var digs=14;
var px=_855(_854.x,digs);
var py=_855(_854.y,digs);
function getX(y,x1,y1,x2,y2){
return (((x1-x2)*y)+((x2*y1)-(x1*y2)))/(y1-y2);
};
var _85e=this.components.length-1;
var _85f,end,x1,y1,x2,y2,cx,cy;
var _867=0;
for(var i=0;i<_85e;++i){
_85f=this.components[i];
x1=_855(_85f.x,digs);
y1=_855(_85f.y,digs);
end=this.components[i+1];
x2=_855(end.x,digs);
y2=_855(end.y,digs);
if(y1==y2){
if(py==y1){
if(x1<=x2&&(px>=x1&&px<=x2)||x1>=x2&&(px<=x1&&px>=x2)){
_867=-1;
break;
}
}
continue;
}
cx=_855(getX(py,x1,y1,x2,y2),digs);
if(cx==px){
if(y1<y2&&(py>=y1&&py<=y2)||y1>y2&&(py<=y1&&py>=y2)){
_867=-1;
break;
}
}
if(cx<=px){
continue;
}
if(x1!=x2&&(cx<Math.min(x1,x2)||cx>Math.max(x1,x2))){
continue;
}
if(y1<y2&&(py>=y1&&py<y2)||y1>y2&&(py<y1&&py>=y2)){
++_867;
}
}
var _869=(_867==-1)?1:!!(_867&1);
return _869;
},intersects:function(_86a){
var _86b=false;
if(_86a.CLASS_NAME=="OpenLayers.Geometry.Point"){
_86b=this.containsPoint(_86a);
}else{
if(_86a.CLASS_NAME=="OpenLayers.Geometry.LineString"){
_86b=_86a.intersects(this);
}else{
if(_86a.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){
_86b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[_86a]);
}else{
for(var i=0;i<_86a.components.length;++i){
_86b=_86a.components[i].intersects(this);
if(_86b){
break;
}
}
}
}
}
return _86b;
},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});
OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(_86d){
OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments);
},getArea:function(){
var area=0;
if(this.components&&(this.components.length>0)){
area+=Math.abs(this.components[0].getArea());
for(var i=1;i<this.components.length;i++){
area-=Math.abs(this.components[i].getArea());
}
}
return area;
},containsPoint:function(_870){
var _871=this.components.length;
var _872=false;
if(_871>0){
_872=this.components[0].containsPoint(_870);
if(_872!==1){
if(_872&&_871>1){
var hole;
for(var i=1;i<_871;++i){
hole=this.components[i].containsPoint(_870);
if(hole){
if(hole===1){
_872=1;
}else{
_872=false;
}
break;
}
}
}
}
}
return _872;
},intersects:function(_875){
var _876=false;
var i;
if(_875.CLASS_NAME=="OpenLayers.Geometry.Point"){
_876=this.containsPoint(_875);
}else{
if(_875.CLASS_NAME=="OpenLayers.Geometry.LineString"||_875.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){
for(i=0;i<this.components.length;++i){
_876=_875.intersects(this.components[i]);
if(_876){
break;
}
}
if(!_876){
for(i=0;i<_875.components.length;++i){
_876=this.containsPoint(_875.components[i]);
if(_876){
break;
}
}
}
}else{
for(i=0;i<_875.components.length;++i){
_876=this.intersects(_875.components[i]);
if(_876){
break;
}
}
}
}
if(!_876&&_875.CLASS_NAME=="OpenLayers.Geometry.Polygon"){
var ring=this.components[0];
for(i=0;i<ring.components.length;++i){
_876=_875.containsPoint(ring.components[i]);
if(_876){
break;
}
}
}
return _876;
},CLASS_NAME:"OpenLayers.Geometry.Polygon"});
OpenLayers.Geometry.Polygon.createRegularPolygon=function(_879,_87a,_87b,_87c){
var _87d=Math.PI*((1/_87b)-(1/2));
if(_87c){
_87d+=(_87c/180)*Math.PI;
}
var _87e,x,y;
var _881=[];
for(var i=0;i<_87b;++i){
_87e=_87d+(i*2*Math.PI/_87b);
x=_879.x+(_87a*Math.cos(_87e));
y=_879.y+(_87a*Math.sin(_87e));
_881.push(new OpenLayers.Geometry.Point(x,y));
}
var ring=new OpenLayers.Geometry.LinearRing(_881);
return new OpenLayers.Geometry.Polygon([ring]);
};
OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(_884){
OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments);
},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});
OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(_885){
OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments);
},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});
OpenLayers.Geometry.Surface=OpenLayers.Class(OpenLayers.Geometry,{initialize:function(){
OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
},CLASS_NAME:"OpenLayers.Geometry.Surface"});
OpenLayers.Renderer=OpenLayers.Class({container:null,extent:null,size:null,resolution:null,map:null,initialize:function(_886){
this.container=OpenLayers.Util.getElement(_886);
},destroy:function(){
this.container=null;
this.extent=null;
this.size=null;
this.resolution=null;
this.map=null;
},supported:function(){
return false;
},setExtent:function(_887){
this.extent=_887.clone();
this.resolution=null;
},setSize:function(size){
this.size=size.clone();
this.resolution=null;
},getResolution:function(){
this.resolution=this.resolution||this.map.getResolution();
return this.resolution;
},drawFeature:function(_889,_88a){
if(_88a==null){
_88a=_889.style;
}
if(_889.geometry){
this.drawGeometry(_889.geometry,_88a,_889.id);
}
},drawGeometry:function(_88b,_88c,_88d){
},clear:function(){
},getFeatureIdFromEvent:function(evt){
},eraseFeatures:function(_88f){
if(!(_88f instanceof Array)){
_88f=[_88f];
}
for(var i=0;i<_88f.length;++i){
this.eraseGeometry(_88f[i].geometry);
}
},eraseGeometry:function(_891){
},CLASS_NAME:"OpenLayers.Renderer"});
OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,xmlns:null,minimumSymbolizer:{strokeLinecap:"round",strokeOpacity:1,fillOpacity:1,pointRadius:0},initialize:function(_892){
OpenLayers.Renderer.prototype.initialize.apply(this,arguments);
this.rendererRoot=this.createRenderRoot();
this.root=this.createRoot();
this.rendererRoot.appendChild(this.root);
this.container.appendChild(this.rendererRoot);
},destroy:function(){
this.clear();
this.rendererRoot=null;
this.root=null;
this.xmlns=null;
OpenLayers.Renderer.prototype.destroy.apply(this,arguments);
},clear:function(){
if(this.root){
while(this.root.childNodes.length>0){
this.root.removeChild(this.root.firstChild);
}
}
},getNodeType:function(_893,_894){
},drawGeometry:function(_895,_896,_897){
var _898=_895.CLASS_NAME;
if((_898=="OpenLayers.Geometry.Collection")||(_898=="OpenLayers.Geometry.MultiPoint")||(_898=="OpenLayers.Geometry.MultiLineString")||(_898=="OpenLayers.Geometry.MultiPolygon")){
for(var i=0;i<_895.components.length;i++){
this.drawGeometry(_895.components[i],_896,_897);
}
return;
}
if(_896.display!="none"){
var _89a=this.getNodeType(_895,_896);
var node=this.nodeFactory(_895.id,_89a);
node._featureId=_897;
node._geometryClass=_895.CLASS_NAME;
node._style=_896;
node=this.drawGeometryNode(node,_895);
if(node.parentNode!=this.root){
this.root.appendChild(node);
}
this.postDraw(node);
}else{
node=OpenLayers.Util.getElement(_895.id);
if(node){
node.parentNode.removeChild(node);
}
}
},drawGeometryNode:function(node,_89d,_89e){
_89e=_89e||node._style;
OpenLayers.Util.applyDefaults(_89e,this.minimumSymbolizer);
var _89f={"isFilled":true,"isStroked":!!_89e.strokeWidth};
switch(_89d.CLASS_NAME){
case "OpenLayers.Geometry.Point":
this.drawPoint(node,_89d);
break;
case "OpenLayers.Geometry.LineString":
_89f.isFilled=false;
this.drawLineString(node,_89d);
break;
case "OpenLayers.Geometry.LinearRing":
this.drawLinearRing(node,_89d);
break;
case "OpenLayers.Geometry.Polygon":
this.drawPolygon(node,_89d);
break;
case "OpenLayers.Geometry.Surface":
this.drawSurface(node,_89d);
break;
case "OpenLayers.Geometry.Rectangle":
this.drawRectangle(node,_89d);
break;
default:
break;
}
node._style=_89e;
node._options=_89f;
return this.setStyle(node,_89e,_89f,_89d);
},postDraw:function(node){
},drawPoint:function(node,_8a2){
},drawLineString:function(node,_8a4){
},drawLinearRing:function(node,_8a6){
},drawPolygon:function(node,_8a8){
},drawRectangle:function(node,_8aa){
},drawCircle:function(node,_8ac){
},drawSurface:function(node,_8ae){
},getFeatureIdFromEvent:function(evt){
var node=evt.target||evt.srcElement;
return node._featureId;
},eraseGeometry:function(_8b1){
if((_8b1.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(_8b1.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(_8b1.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")){
for(var i=0;i<_8b1.components.length;i++){
this.eraseGeometry(_8b1.components[i]);
}
}else{
var _8b3=OpenLayers.Util.getElement(_8b1.id);
if(_8b3&&_8b3.parentNode){
_8b3.parentNode.removeChild(_8b3);
}
}
},nodeFactory:function(id,type){
var node=OpenLayers.Util.getElement(id);
if(node){
if(!this.nodeTypeCompare(node,type)){
node.parentNode.removeChild(node);
node=this.nodeFactory(id,type);
}
}else{
node=this.createNode(type,id);
}
return node;
},CLASS_NAME:"OpenLayers.Renderer.Elements"});
OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",MAX_PIXEL:15000,localResolution:null,initialize:function(_8b7){
if(!this.supported()){
return;
}
OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);
},destroy:function(){
OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments);
},supported:function(){
var _8b8="http://www.w3.org/TR/SVG11/feature#";
return (document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(_8b8+"SVG","1.1")||document.implementation.hasFeature(_8b8+"BasicStructure","1.1")));
},inValidRange:function(x,y){
return (x>=-this.MAX_PIXEL&&x<=this.MAX_PIXEL&&y>=-this.MAX_PIXEL&&y<=this.MAX_PIXEL);
},setExtent:function(_8bb){
OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);
var _8bc=this.getResolution();
if(!this.localResolution||_8bc!=this.localResolution){
this.left=-_8bb.left/_8bc;
this.top=_8bb.top/_8bc;
}
var left=0;
var top=0;
if(this.localResolution&&_8bc==this.localResolution){
left=(this.left)-(-_8bb.left/_8bc);
top=(this.top)-(_8bb.top/_8bc);
}
this.localResolution=_8bc;
var _8bf=left+" "+top+" "+_8bb.getWidth()/_8bc+" "+_8bb.getHeight()/_8bc;
this.rendererRoot.setAttributeNS(null,"viewBox",_8bf);
},setSize:function(size){
OpenLayers.Renderer.prototype.setSize.apply(this,arguments);
this.rendererRoot.setAttributeNS(null,"width",this.size.w);
this.rendererRoot.setAttributeNS(null,"height",this.size.h);
},getNodeType:function(_8c1,_8c2){
var _8c3=null;
switch(_8c1.CLASS_NAME){
case "OpenLayers.Geometry.Point":
_8c3=_8c2.externalGraphic?"image":"circle";
break;
case "OpenLayers.Geometry.Rectangle":
_8c3="rect";
break;
case "OpenLayers.Geometry.LineString":
_8c3="polyline";
break;
case "OpenLayers.Geometry.LinearRing":
_8c3="polygon";
break;
case "OpenLayers.Geometry.Polygon":
case "OpenLayers.Geometry.Curve":
case "OpenLayers.Geometry.Surface":
_8c3="path";
break;
default:
break;
}
return _8c3;
},setStyle:function(node,_8c5,_8c6){
_8c5=_8c5||node._style;
_8c6=_8c6||node._options;
var r=parseFloat(node.getAttributeNS(null,"r"));
if(node._geometryClass=="OpenLayers.Geometry.Point"&&r){
if(_8c5.externalGraphic){
var x=parseFloat(node.getAttributeNS(null,"cx"));
var y=parseFloat(node.getAttributeNS(null,"cy"));
if(_8c5.graphicWidth&&_8c5.graphicHeight){
node.setAttributeNS(null,"preserveAspectRatio","none");
}
var _8ca=_8c5.graphicWidth||_8c5.graphicHeight;
var _8cb=_8c5.graphicHeight||_8c5.graphicWidth;
_8ca=_8ca?_8ca:_8c5.pointRadius*2;
_8cb=_8cb?_8cb:_8c5.pointRadius*2;
var _8cc=(_8c5.graphicXOffset!=undefined)?_8c5.graphicXOffset:-(0.5*_8ca);
var _8cd=(_8c5.graphicYOffset!=undefined)?_8c5.graphicYOffset:-(0.5*_8cb);
var _8ce=_8c5.graphicOpacity||_8c5.fillOpacity;
node.setAttributeNS(null,"x",(x+_8cc).toFixed());
node.setAttributeNS(null,"y",(y+_8cd).toFixed());
node.setAttributeNS(null,"width",_8ca);
node.setAttributeNS(null,"height",_8cb);
node.setAttributeNS("http://www.w3.org/1999/xlink","href",_8c5.externalGraphic);
node.setAttributeNS(null,"style","opacity: "+_8ce);
}else{
node.setAttributeNS(null,"r",_8c5.pointRadius);
}
}
if(_8c6.isFilled){
node.setAttributeNS(null,"fill",_8c5.fillColor);
node.setAttributeNS(null,"fill-opacity",_8c5.fillOpacity);
}else{
node.setAttributeNS(null,"fill","none");
}
if(_8c6.isStroked){
node.setAttributeNS(null,"stroke",_8c5.strokeColor);
node.setAttributeNS(null,"stroke-opacity",_8c5.strokeOpacity);
node.setAttributeNS(null,"stroke-width",_8c5.strokeWidth);
node.setAttributeNS(null,"stroke-linecap",_8c5.strokeLinecap);
}else{
node.setAttributeNS(null,"stroke","none");
}
if(_8c5.pointerEvents){
node.setAttributeNS(null,"pointer-events",_8c5.pointerEvents);
}
if(_8c5.cursor!=null){
node.setAttributeNS(null,"cursor",_8c5.cursor);
}
return node;
},createNode:function(type,id){
var node=document.createElementNS(this.xmlns,type);
if(id){
node.setAttributeNS(null,"id",id);
}
return node;
},nodeTypeCompare:function(node,type){
return (type==node.nodeName);
},createRenderRoot:function(){
return this.nodeFactory(this.container.id+"_svgRoot","svg");
},createRoot:function(){
return this.nodeFactory(this.container.id+"_root","g");
},drawPoint:function(node,_8d5){
this.drawCircle(node,_8d5,1);
},drawCircle:function(node,_8d7,_8d8){
var _8d9=this.getResolution();
var x=(_8d7.x/_8d9+this.left);
var y=(this.top-_8d7.y/_8d9);
if(this.inValidRange(x,y)){
node.setAttributeNS(null,"cx",x);
node.setAttributeNS(null,"cy",y);
node.setAttributeNS(null,"r",_8d8);
}else{
node.setAttributeNS(null,"cx","");
node.setAttributeNS(null,"cy","");
node.setAttributeNS(null,"r",0);
}
},drawLineString:function(node,_8dd){
node.setAttributeNS(null,"points",this.getComponentsString(_8dd.components));
},drawLinearRing:function(node,_8df){
node.setAttributeNS(null,"points",this.getComponentsString(_8df.components));
},drawPolygon:function(node,_8e1){
var d="";
var draw=true;
for(var j=0;j<_8e1.components.length;j++){
var _8e5=_8e1.components[j];
d+=" M";
for(var i=0;i<_8e5.components.length;i++){
var _8e7=this.getShortString(_8e5.components[i]);
if(_8e7){
d+=" "+_8e7;
}else{
draw=false;
}
}
}
d+=" z";
if(draw){
node.setAttributeNS(null,"d",d);
node.setAttributeNS(null,"fill-rule","evenodd");
}else{
node.setAttributeNS(null,"d","");
}
},drawRectangle:function(node,_8e9){
var _8ea=this.getResolution();
var x=(_8e9.x/_8ea+this.left);
var y=(this.top-_8e9.y/_8ea);
if(this.inValidRange(x,y)){
node.setAttributeNS(null,"x",x);
node.setAttributeNS(null,"y",y);
node.setAttributeNS(null,"width",_8e9.width/_8ea);
node.setAttributeNS(null,"height",_8e9.height/_8ea);
}else{
node.setAttributeNS(null,"x","");
node.setAttributeNS(null,"y","");
node.setAttributeNS(null,"width",0);
node.setAttributeNS(null,"height",0);
}
},drawSurface:function(node,_8ee){
var d=null;
var draw=true;
for(var i=0;i<_8ee.components.length;i++){
if((i%3)==0&&(i/3)==0){
var _8f2=this.getShortString(_8ee.components[i]);
if(!_8f2){
draw=false;
}
d="M "+_8f2;
}else{
if((i%3)==1){
var _8f2=this.getShortString(_8ee.components[i]);
if(!_8f2){
draw=false;
}
d+=" C "+_8f2;
}else{
var _8f2=this.getShortString(_8ee.components[i]);
if(!_8f2){
draw=false;
}
d+=" "+_8f2;
}
}
}
d+=" Z";
if(draw){
node.setAttributeNS(null,"d",d);
}else{
node.setAttributeNS(null,"d","");
}
},getComponentsString:function(_8f3){
var _8f4=[];
for(var i=0;i<_8f3.length;i++){
var _8f6=this.getShortString(_8f3[i]);
if(_8f6){
_8f4.push(_8f6);
}
}
return _8f4.join(",");
},getShortString:function(_8f7){
var _8f8=this.getResolution();
var x=(_8f7.x/_8f8+this.left);
var y=(this.top-_8f7.y/_8f8);
if(this.inValidRange(x,y)){
return x+","+y;
}else{
return false;
}
},CLASS_NAME:"OpenLayers.Renderer.SVG"});
OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",initialize:function(_8fb){
if(!this.supported()){
return;
}
if(!document.namespaces.olv){
document.namespaces.add("olv",this.xmlns);
var _8fc=document.createStyleSheet();
_8fc.addRule("olv\\:*","behavior: url(#default#VML); "+"position: absolute; display: inline-block;");
}
OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);
},destroy:function(){
OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments);
},supported:function(){
return !!(document.namespaces);
},setExtent:function(_8fd){
OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);
var _8fe=this.getResolution();
var org=_8fd.left/_8fe+" "+_8fd.top/_8fe;
this.root.setAttribute("coordorigin",org);
var size=_8fd.getWidth()/_8fe+" "+-_8fd.getHeight()/_8fe;
this.root.setAttribute("coordsize",size);
},setSize:function(size){
OpenLayers.Renderer.prototype.setSize.apply(this,arguments);
this.rendererRoot.style.width=this.size.w;
this.rendererRoot.style.height=this.size.h;
this.root.style.width=this.size.w;
this.root.style.height=this.size.h;
},getNodeType:function(_902,_903){
var _904=null;
switch(_902.CLASS_NAME){
case "OpenLayers.Geometry.Point":
_904=_903.externalGraphic?"olv:rect":"olv:oval";
break;
case "OpenLayers.Geometry.Rectangle":
_904="olv:rect";
break;
case "OpenLayers.Geometry.LineString":
case "OpenLayers.Geometry.LinearRing":
case "OpenLayers.Geometry.Polygon":
case "OpenLayers.Geometry.Curve":
case "OpenLayers.Geometry.Surface":
_904="olv:shape";
break;
default:
break;
}
return _904;
},setStyle:function(node,_906,_907,_908){
_906=_906||node._style;
_907=_907||node._options;
if(node._geometryClass=="OpenLayers.Geometry.Point"){
if(_906.externalGraphic){
var _909=_906.graphicWidth||_906.graphicHeight;
var _90a=_906.graphicHeight||_906.graphicWidth;
_909=_909?_909:_906.pointRadius*2;
_90a=_90a?_90a:_906.pointRadius*2;
var _90b=this.getResolution();
var _90c=(_906.graphicXOffset!=undefined)?_906.graphicXOffset:-(0.5*_909);
var _90d=(_906.graphicYOffset!=undefined)?_906.graphicYOffset:-(0.5*_90a);
node.style.left=((_908.x/_90b)+_90c).toFixed();
node.style.top=((_908.y/_90b)-(_90d+_90a)).toFixed();
node.style.width=_909;
node.style.height=_90a;
_906.fillColor="none";
_907.isStroked=false;
}else{
this.drawCircle(node,_908,_906.pointRadius);
}
}
if(_907.isFilled){
node.setAttribute("fillcolor",_906.fillColor);
}else{
node.setAttribute("filled","false");
}
var _90e=node.getElementsByTagName("fill");
var fill=(_90e.length==0)?null:_90e[0];
if(!_907.isFilled){
if(fill){
node.removeChild(fill);
}
}else{
if(!fill){
fill=this.createNode("olv:fill",node.id+"_fill");
}
fill.setAttribute("opacity",_906.fillOpacity);
if(node._geometryClass=="OpenLayers.Geometry.Point"&&_906.externalGraphic){
if(_906.graphicOpacity){
fill.setAttribute("opacity",_906.graphicOpacity);
}
fill.setAttribute("src",_906.externalGraphic);
fill.setAttribute("type","frame");
node.style.flip="y";
if(!(_906.graphicWidth&&_906.graphicHeight)){
fill.aspect="atmost";
}
}
if(fill.parentNode!=node){
node.appendChild(fill);
}
}
if(_907.isStroked){
node.setAttribute("strokecolor",_906.strokeColor);
node.setAttribute("strokeweight",_906.strokeWidth+"px");
}else{
node.setAttribute("stroked","false");
}
var _910=node.getElementsByTagName("stroke");
var _911=(_910.length==0)?null:_910[0];
if(!_907.isStroked){
if(_911){
node.removeChild(_911);
}
}else{
if(!_911){
_911=this.createNode("olv:stroke",node.id+"_stroke");
node.appendChild(_911);
}
_911.setAttribute("opacity",_906.strokeOpacity);
_911.setAttribute("endcap",!_906.strokeLinecap||_906.strokeLinecap=="butt"?"flat":_906.strokeLinecap);
}
if(_906.cursor!=null){
node.style.cursor=_906.cursor;
}
return node;
},postDraw:function(node){
var _913=node._style.fillColor;
var _914=node._style.strokeColor;
if(_913=="none"&&node.getAttribute("fillcolor")!=_913){
node.setAttribute("fillcolor",_913);
}
if(_914=="none"&&node.getAttribute("strokecolor")!=_914){
node.setAttribute("strokecolor",_914);
}
},setNodeDimension:function(node,_916){
var bbox=_916.getBounds();
if(bbox){
var _918=this.getResolution();
var _919=new OpenLayers.Bounds((bbox.left/_918).toFixed(),(bbox.bottom/_918).toFixed(),(bbox.right/_918).toFixed(),(bbox.top/_918).toFixed());
node.style.left=_919.left;
node.style.top=_919.top;
node.style.width=_919.getWidth();
node.style.height=_919.getHeight();
node.coordorigin=_919.left+" "+_919.top;
node.coordsize=_919.getWidth()+" "+_919.getHeight();
}
},createNode:function(type,id){
var node=document.createElement(type);
if(id){
node.setAttribute("id",id);
}
node.setAttribute("unselectable","on",0);
node.onselectstart=function(){
return (false);
};
return node;
},nodeTypeCompare:function(node,type){
var _91f=type;
var _920=_91f.indexOf(":");
if(_920!=-1){
_91f=_91f.substr(_920+1);
}
var _921=node.nodeName;
_920=_921.indexOf(":");
if(_920!=-1){
_921=_921.substr(_920+1);
}
return (_91f==_921);
},createRenderRoot:function(){
return this.nodeFactory(this.container.id+"_vmlRoot","div");
},createRoot:function(){
return this.nodeFactory(this.container.id+"_root","olv:group");
},drawPoint:function(node,_923){
this.drawCircle(node,_923,1);
},drawCircle:function(node,_925,_926){
if(!isNaN(_925.x)&&!isNaN(_925.y)){
var _927=this.getResolution();
node.style.left=(_925.x/_927).toFixed()-_926;
node.style.top=(_925.y/_927).toFixed()-_926;
var _928=_926*2;
node.style.width=_928;
node.style.height=_928;
}
},drawLineString:function(node,_92a){
this.drawLine(node,_92a,false);
},drawLinearRing:function(node,_92c){
this.drawLine(node,_92c,true);
},drawLine:function(node,_92e,_92f){
this.setNodeDimension(node,_92e);
var _930=this.getResolution();
var _931=_92e.components.length;
var _932=new Array(_931);
var comp,x,y;
for(var i=0;i<_931;i++){
comp=_92e.components[i];
x=(comp.x/_930);
y=(comp.y/_930);
_932[i]=" "+x.toFixed()+","+y.toFixed()+" l ";
}
var end=(_92f)?" x e":" e";
node.path="m"+_932.join("")+end;
},drawPolygon:function(node,_939){
this.setNodeDimension(node,_939);
var _93a=this.getResolution();
var path=[];
var _93c,i,comp,x,y;
for(var j=0;j<_939.components.length;j++){
_93c=_939.components[j];
path.push("m");
for(i=0;i<_93c.components.length;i++){
comp=_93c.components[i];
x=comp.x/_93a;
y=comp.y/_93a;
path.push(" "+x.toFixed()+","+y.toFixed());
if(i==0){
path.push(" l");
}
}
path.push(" x ");
}
path.push("e");
node.path=path.join("");
},drawRectangle:function(node,_943){
var _944=this.getResolution();
node.style.left=_943.x/_944;
node.style.top=_943.y/_944;
node.style.width=_943.width/_944;
node.style.height=_943.height/_944;
},drawSurface:function(node,_946){
this.setNodeDimension(node,_946);
var _947=this.getResolution();
var path=[];
var comp,x,y;
for(var i=0;i<_946.components.length;i++){
comp=_946.components[i];
x=comp.x/_947;
y=comp.y/_947;
if((i%3)==0&&(i/3)==0){
path.push("m");
}else{
if((i%3)==1){
path.push(" c");
}
}
path.push(" "+x+","+y);
}
path.push(" x e");
node.path=path.join("");
},CLASS_NAME:"OpenLayers.Renderer.VML"});
OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","featureadded","featuresadded","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified"],isBaseLayer:false,isFixed:false,isVector:true,features:null,selectedFeatures:null,reportError:true,style:null,styleMap:null,renderers:["SVG","VML"],renderer:null,geometryType:null,drawn:false,initialize:function(name,_94e){
this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES);
OpenLayers.Layer.prototype.initialize.apply(this,arguments);
if(!this.renderer||!this.renderer.supported()){
this.assignRenderer();
}
if(!this.renderer||!this.renderer.supported()){
this.renderer=null;
this.displayError();
}
if(!this.styleMap){
this.styleMap=new OpenLayers.StyleMap();
}
this.features=[];
this.selectedFeatures=[];
},destroy:function(){
OpenLayers.Layer.prototype.destroy.apply(this,arguments);
this.destroyFeatures();
this.features=null;
this.selectedFeatures=null;
if(this.renderer){
this.renderer.destroy();
}
this.renderer=null;
this.geometryType=null;
this.drawn=null;
},assignRenderer:function(){
for(var i=0;i<this.renderers.length;i++){
var _950=OpenLayers.Renderer[this.renderers[i]];
if(_950&&_950.prototype.supported()){
this.renderer=new _950(this.div);
break;
}
}
},displayError:function(){
if(this.reportError){
alert(OpenLayers.i18n("browserNotSupported",{"renderers":this.renderers.join("\n")}));
}
},setMap:function(map){
OpenLayers.Layer.prototype.setMap.apply(this,arguments);
if(!this.renderer){
this.map.removeLayer(this);
}else{
this.renderer.map=this.map;
this.renderer.setSize(this.map.getSize());
}
},onMapResize:function(){
OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);
this.renderer.setSize(this.map.getSize());
},moveTo:function(_952,_953,_954){
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
if(!_954){
this.renderer.root.style.visibility="hidden";
if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){
this.div.scrollLeft=this.div.scrollLeft;
}
this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";
this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";
var _955=this.map.getExtent();
this.renderer.setExtent(_955);
this.renderer.root.style.visibility="visible";
}
if(!this.drawn||_953){
this.drawn=true;
for(var i=0;i<this.features.length;i++){
var _957=this.features[i];
this.drawFeature(_957);
}
}
},addFeatures:function(_958,_959){
if(!(_958 instanceof Array)){
_958=[_958];
}
var _95a=!_959||!_959.silent;
for(var i=0;i<_958.length;i++){
var _95c=_958[i];
if(this.geometryType&&!(_95c.geometry instanceof this.geometryType)){
var _95d=OpenLayers.i18n("componentShouldBe",{"geomType":this.geometryType.prototype.CLASS_NAME});
throw _95d;
}
this.features.push(_95c);
_95c.layer=this;
if(!_95c.style&&this.style){
_95c.style=OpenLayers.Util.extend({},this.style);
}
if(_95a){
this.events.triggerEvent("beforefeatureadded",{feature:_95c});
this.preFeatureInsert(_95c);
}
if(this.drawn){
this.drawFeature(_95c);
}
if(_95a){
this.events.triggerEvent("featureadded",{feature:_95c});
this.onFeatureInsert(_95c);
}
}
if(_95a){
this.events.triggerEvent("featuresadded",{features:_958});
}
},removeFeatures:function(_95e){
if(!(_95e instanceof Array)){
_95e=[_95e];
}
for(var i=_95e.length-1;i>=0;i--){
var _960=_95e[i];
this.features=OpenLayers.Util.removeItem(this.features,_960);
if(_960.geometry){
this.renderer.eraseGeometry(_960.geometry);
}
if(OpenLayers.Util.indexOf(this.selectedFeatures,_960)!=-1){
OpenLayers.Util.removeItem(this.selectedFeatures,_960);
}
}
},destroyFeatures:function(_961){
var all=(_961==undefined);
if(all){
_961=this.features;
this.selectedFeatures=[];
}
this.eraseFeatures(_961);
var _963;
for(var i=_961.length-1;i>=0;i--){
_963=_961[i];
if(!all){
OpenLayers.Util.removeItem(this.selectedFeatures,_963);
}
_963.destroy();
}
},drawFeature:function(_965,_966){
if(typeof _966!="object"){
var _967=typeof _966=="string"?_966:_965.renderIntent;
_966=_965.style||this.style;
if(!_966){
_966=this.styleMap.createSymbolizer(_965,_967);
}
}
this.renderer.drawFeature(_965,_966);
},eraseFeatures:function(_968){
this.renderer.eraseFeatures(_968);
},getFeatureFromEvent:function(evt){
if(!this.renderer){
OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));
return null;
}
var _96a=this.renderer.getFeatureIdFromEvent(evt);
return this.getFeatureById(_96a);
},getFeatureById:function(_96b){
var _96c=null;
for(var i=0;i<this.features.length;++i){
if(this.features[i].id==_96b){
_96c=this.features[i];
break;
}
}
return _96c;
},onFeatureInsert:function(_96e){
},preFeatureInsert:function(_96f){
},CLASS_NAME:"OpenLayers.Layer.Vector"});
OpenLayers.Style=OpenLayers.Class({name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,propertyStyles:null,initialize:function(_970,_971){
this.rules=[];
this.setDefaultStyle(_970||OpenLayers.Feature.Vector.style["default"]);
OpenLayers.Util.extend(this,_971);
},destroy:function(){
for(var i=0;i<this.rules.length;i++){
this.rules[i].destroy();
this.rules[i]=null;
}
this.rules=null;
this.defaultStyle=null;
},createSymbolizer:function(_973){
var _974=this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),_973);
var _975=this.rules;
var rule,_977;
var _978=[];
var _979=false;
for(var i=0;i<_975.length;i++){
rule=_975[i];
var _97b=rule.evaluate(_973);
if(_97b){
if(rule instanceof OpenLayers.Rule&&rule.elseFilter){
_978.push(rule);
}else{
_979=true;
this.applySymbolizer(rule,_974,_973);
}
}
}
if(_979==false&&_978.length>0){
_979=true;
for(var i=0;i<_978.length;i++){
this.applySymbolizer(_978[i],_974,_973);
}
}
if(_975.length>0&&_979==false){
_974.display="none";
}else{
_974.display="";
}
return _974;
},applySymbolizer:function(rule,_97d,_97e){
var _97f=_97e.geometry?this.getSymbolizerPrefix(_97e.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];
var _980=rule.symbolizer[_97f]||rule.symbolizer;
return this.createLiterals(OpenLayers.Util.extend(_97d,_980),_97e);
},createLiterals:function(_981,_982){
var _983=this.context||_982.attributes||_982.data;
for(var i in this.propertyStyles){
_981[i]=OpenLayers.Style.createLiteral(_981[i],_983,_982);
}
return _981;
},findPropertyStyles:function(){
var _985={};
var _986=this.defaultStyle;
this.addPropertyStyles(_985,_986);
var _987=this.rules;
var _988,_989;
for(var i=0;i<_987.length;i++){
var _988=_987[i].symbolizer;
for(var key in _988){
_989=_988[key];
if(typeof _989=="object"){
this.addPropertyStyles(_985,_989);
}else{
this.addPropertyStyles(_985,_988);
break;
}
}
}
return _985;
},addPropertyStyles:function(_98c,_98d){
var _98e;
for(var key in _98d){
_98e=_98d[key];
if(typeof _98e=="string"&&_98e.match(/\$\{\w+\}/)){
_98c[key]=true;
}
}
return _98c;
},addRules:function(_990){
this.rules=this.rules.concat(_990);
this.propertyStyles=this.findPropertyStyles();
},setDefaultStyle:function(_991){
this.defaultStyle=_991;
this.propertyStyles=this.findPropertyStyles();
},getSymbolizerPrefix:function(_992){
var _993=OpenLayers.Style.SYMBOLIZER_PREFIXES;
for(var i=0;i<_993.length;i++){
if(_992.CLASS_NAME.indexOf(_993[i])!=-1){
return _993[i];
}
}
},CLASS_NAME:"OpenLayers.Style"});
OpenLayers.Style.createLiteral=function(_995,_996,_997){
if(typeof _995=="string"&&_995.indexOf("${")!=-1){
_995=OpenLayers.String.format(_995,_996,[_997]);
_995=(isNaN(_995)||!_995)?_995:parseFloat(_995);
}
return _995;
};
OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon"];
OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(_998,_999){
this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),"select":new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"]),"temporary":new OpenLayers.Style(OpenLayers.Feature.Vector.style["temporary"])};
if(_998 instanceof OpenLayers.Style){
this.styles["default"]=_998;
this.styles["select"]=_998;
this.styles["temporary"]=_998;
}else{
if(typeof _998=="object"){
for(var key in _998){
if(_998[key] instanceof OpenLayers.Style){
this.styles[key]=_998[key];
}else{
if(typeof _998[key]=="object"){
this.styles[key]=new OpenLayers.Style(_998[key]);
}else{
this.styles["default"]=new OpenLayers.Style(_998);
this.styles["select"]=new OpenLayers.Style(_998);
this.styles["temporary"]=new OpenLayers.Style(_998);
break;
}
}
}
}
}
OpenLayers.Util.extend(this,_999);
},destroy:function(){
for(var key in this.styles){
this.styles[key].destroy();
}
this.styles=null;
},createSymbolizer:function(_99c,_99d){
if(!_99c){
_99c=new OpenLayers.Feature.Vector();
}
if(!this.styles[_99d]){
_99d="default";
}
_99c.renderIntent=_99d;
var _99e={};
if(this.extendDefault&&_99d!="default"){
_99e=this.styles["default"].createSymbolizer(_99c);
}
return OpenLayers.Util.extend(_99e,this.styles[_99d].createSymbolizer(_99c));
},addUniqueValueRules:function(_99f,_9a0,_9a1){
var _9a2=[];
for(var _9a3 in _9a1){
_9a2.push(new OpenLayers.Rule({symbolizer:_9a1[_9a3],filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:_9a0,value:_9a3})}));
}
this.styles[_99f].addRules(_9a2);
},CLASS_NAME:"OpenLayers.StyleMap"});
OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(_9a4,_9a5){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);
if(_9a4){
this.position=_9a4;
}
if(_9a5){
this.direction=_9a5;
}
this.measureDivs=[];
},destroy:function(){
for(var _9a6 in this.buttons){
var btn=this.buttons[_9a6];
btn.map=null;
btn.events.destroy();
}
OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,arguments);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
OpenLayers.Control.MouseDefaults.prototype.draw.apply(this,arguments);
this.buttons={};
var sz=new OpenLayers.Size(28,28);
var _9a9=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);
this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",_9a9,sz,"Shift->Drag to zoom to area");
_9a9=_9a9.add((this.direction=="vertical"?0:sz.w),(this.direction=="vertical"?sz.h:0));
this._addButton("pan","panning-hand-off.png","panning-hand-on.png",_9a9,sz,"Drag the map to pan.");
_9a9=_9a9.add((this.direction=="vertical"?0:sz.w),(this.direction=="vertical"?sz.h:0));
this.switchModeTo("pan");
return this.div;
},_addButton:function(id,img,_9ac,xy,sz,_9af){
var _9b0=OpenLayers.Util.getImagesLocation()+img;
var _9b1=OpenLayers.Util.getImagesLocation()+_9ac;
var btn=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+id,xy,sz,_9b0,"absolute");
this.div.appendChild(btn);
btn.imgLocation=_9b0;
btn.activeImgLocation=_9b1;
btn.events=new OpenLayers.Events(this,btn,null,true);
btn.events.on({"mousedown":this.buttonDown,"mouseup":this.buttonUp,"dblclick":OpenLayers.Event.stop,scope:this});
btn.action=id;
btn.title=_9af;
btn.alt=_9af;
btn.map=this.map;
this.buttons[id]=btn;
return btn;
},buttonDown:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
this.buttonClicked=evt.element.action;
OpenLayers.Event.stop(evt);
},buttonUp:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
if(this.buttonClicked!=null){
if(this.buttonClicked==evt.element.action){
this.switchModeTo(evt.element.action);
}
OpenLayers.Event.stop(evt);
this.buttonClicked=null;
}
},defaultDblClick:function(evt){
this.switchModeTo("pan");
this.performedDrag=false;
var _9b6=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_9b6,this.map.zoom+1);
OpenLayers.Event.stop(evt);
return false;
},defaultMouseDown:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
this.mouseDragStart=evt.xy.clone();
this.performedDrag=false;
this.startViaKeyboard=false;
if(evt.shiftKey&&this.mode!="zoombox"){
this.switchModeTo("zoombox");
this.startViaKeyboard=true;
}else{
if(evt.altKey&&this.mode!="measure"){
this.switchModeTo("measure");
}else{
if(!this.mode){
this.switchModeTo("pan");
}
}
}
switch(this.mode){
case "zoombox":
this.map.div.style.cursor="crosshair";
this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");
this.zoomBox.style.backgroundColor="white";
this.zoomBox.style.filter="alpha(opacity=50)";
this.zoomBox.style.opacity="0.50";
this.zoomBox.style.fontSize="1px";
this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.zoomBox);
this.performedDrag=true;
break;
case "measure":
var _9b8="";
if(this.measureStart){
var _9b9=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
_9b8=OpenLayers.Util.distVincenty(this.measureStart,_9b9);
_9b8=Math.round(_9b8*100)/100;
_9b8=_9b8+"km";
this.measureStartBox=this.measureBox;
}
this.measureStart=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
this.measureBox=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),-2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");
this.measureBox.style.width="4px";
this.measureBox.style.height="4px";
this.measureBox.style.fontSize="1px";
this.measureBox.style.backgroundColor="red";
this.measureBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.layerContainerDiv.appendChild(this.measureBox);
if(_9b8){
this.measureBoxDistance=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");
this.measureBoxDistance.innerHTML=_9b8;
this.measureBoxDistance.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.layerContainerDiv.appendChild(this.measureBoxDistance);
this.measureDivs.push(this.measureBoxDistance);
}
this.measureBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.layerContainerDiv.appendChild(this.measureBox);
this.measureDivs.push(this.measureBox);
break;
default:
this.map.div.style.cursor="move";
break;
}
document.onselectstart=function(){
return false;
};
OpenLayers.Event.stop(evt);
},switchModeTo:function(mode){
if(mode!=this.mode){
if(this.mode&&this.buttons[this.mode]){
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode],null,null,null,this.buttons[this.mode].imgLocation);
}
if(this.mode=="measure"&&mode!="measure"){
for(var i=0;i<this.measureDivs.length;i++){
if(this.measureDivs[i]){
this.map.layerContainerDiv.removeChild(this.measureDivs[i]);
}
}
this.measureDivs=[];
this.measureStart=null;
}
this.mode=mode;
if(this.buttons[mode]){
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode],null,null,null,this.buttons[mode].activeImgLocation);
}
switch(this.mode){
case "zoombox":
this.map.div.style.cursor="crosshair";
break;
default:
this.map.div.style.cursor="";
break;
}
}
},leaveMode:function(){
this.switchModeTo("pan");
},defaultMouseMove:function(evt){
if(this.mouseDragStart!=null){
switch(this.mode){
case "zoombox":
var _9bd=Math.abs(this.mouseDragStart.x-evt.xy.x);
var _9be=Math.abs(this.mouseDragStart.y-evt.xy.y);
this.zoomBox.style.width=Math.max(1,_9bd)+"px";
this.zoomBox.style.height=Math.max(1,_9be)+"px";
if(evt.xy.x<this.mouseDragStart.x){
this.zoomBox.style.left=evt.xy.x+"px";
}
if(evt.xy.y<this.mouseDragStart.y){
this.zoomBox.style.top=evt.xy.y+"px";
}
break;
default:
var _9bd=this.mouseDragStart.x-evt.xy.x;
var _9be=this.mouseDragStart.y-evt.xy.y;
var size=this.map.getSize();
var _9c0=new OpenLayers.Pixel(size.w/2+_9bd,size.h/2+_9be);
var _9c1=this.map.getLonLatFromViewPortPx(_9c0);
this.map.setCenter(_9c1,null,true);
this.mouseDragStart=evt.xy.clone();
}
this.performedDrag=true;
}
},defaultMouseUp:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
switch(this.mode){
case "zoombox":
this.zoomBoxEnd(evt);
if(this.startViaKeyboard){
this.leaveMode();
}
break;
case "pan":
if(this.performedDrag){
this.map.setCenter(this.map.center);
}
}
document.onselectstart=null;
this.mouseDragStart=null;
this.map.div.style.cursor="default";
},defaultMouseOut:function(evt){
if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(evt,this.map.div)){
if(this.zoomBox){
this.removeZoomBox();
if(this.startViaKeyboard){
this.leaveMode();
}
}
this.mouseDragStart=null;
this.map.div.style.cursor="default";
}
},defaultClick:function(evt){
if(this.performedDrag){
this.performedDrag=false;
return false;
}
},CLASS_NAME:"OpenLayers.Control.MouseToolbar"});
OpenLayers.Control.MouseToolbar.X=6;
OpenLayers.Control.MouseToolbar.Y=300;
OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(_9c5){
OpenLayers.Control.Panel.prototype.initialize.apply(this,[_9c5]);
this.addControls([new OpenLayers.Control.Navigation(),new OpenLayers.Control.ZoomBox()]);
},draw:function(){
var div=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);
this.activateControl(this.controls[0]);
return div;
},CLASS_NAME:"OpenLayers.Control.NavToolbar"});
OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(_9c7,_9c8){
OpenLayers.Control.Panel.prototype.initialize.apply(this,[_9c8]);
this.addControls([new OpenLayers.Control.Navigation()]);
var _9c9=[new OpenLayers.Control.DrawFeature(_9c7,OpenLayers.Handler.Point,{"displayClass":"olControlDrawFeaturePoint"}),new OpenLayers.Control.DrawFeature(_9c7,OpenLayers.Handler.Path,{"displayClass":"olControlDrawFeaturePath"}),new OpenLayers.Control.DrawFeature(_9c7,OpenLayers.Handler.Polygon,{"displayClass":"olControlDrawFeaturePolygon"})];
for(var i=0;i<_9c9.length;i++){
_9c9[i].featureAdded=function(_9cb){
_9cb.state=OpenLayers.State.INSERT;
};
}
this.addControls(_9c9);
},draw:function(){
var div=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);
this.activateControl(this.controls[0]);
return div;
},CLASS_NAME:"OpenLayers.Control.EditingToolbar"});
OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){
if(!OpenLayers.Lang.code){
OpenLayers.Lang.setCode();
}
return OpenLayers.Lang.code;
},setCode:function(code){
var lang;
if(!code){
code=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language;
}
var _9cf=code.split("-");
_9cf[0]=_9cf[0].toLowerCase();
if(typeof OpenLayers.Lang[_9cf[0]]=="object"){
lang=_9cf[0];
}
if(_9cf[1]){
var _9d0=_9cf[0]+"-"+_9cf[1].toUpperCase();
if(typeof OpenLayers.Lang[_9d0]=="object"){
lang=_9d0;
}
}
if(!lang){
OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+_9cf.join("-")+" dictionary, falling back to default language");
lang=OpenLayers.Lang.defaultCode;
}
OpenLayers.Lang.code=lang;
},translate:function(key,_9d2){
var _9d3=OpenLayers.Lang[OpenLayers.Lang.getCode()];
var _9d4=_9d3[key];
if(!_9d4){
_9d4=key;
}
if(_9d2){
_9d4=OpenLayers.String.format(_9d4,_9d2);
}
return _9d4;
}};
OpenLayers.i18n=OpenLayers.Lang.translate;
OpenLayers.Lang.en={"unhandledRequest":"Unhandled request return ${statusText}","permalink":"Permalink","overlays":"Overlays","baseLayer":"Base Layer","sameProjection":"The overview map only works when it is in the same projection as the main map","readNotImplemented":"Read not implemented.","writeNotImplemented":"Write not implemented.","noFID":"Can't update a feature for which there is no FID.","errorLoadingGML":"Error in loading GML file ${url}","browserNotSupported":"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}","componentShouldBe":"addFeatures : component should be an ${geomType}","getFeatureError":"getFeatureFromEvent called on layer with no renderer. This usually means you "+"destroyed a layer, but not some handler which is associated with it.","minZoomLevelError":"The minZoomLevel property is only intended for use "+"with the FixedZoomLevels-descendent layers. That this "+"wfs layer checks for minZoomLevel is a relic of the"+"past. We cannot, however, remove it without possibly "+"breaking OL based applications that may depend on it."+" Therefore we are deprecating it -- the minZoomLevel "+"check below will be removed at 3.0. Please instead "+"use min/max resolution setting as described here: "+"http://trac.openlayers.org/wiki/SettingZoomLevels","commitSuccess":"WFS Transaction: SUCCESS ${response}","commitFailed":"WFS Transaction: FAILED ${response}","googleWarning":"The Google Layer was unable to load correctly.<br><br>"+"To get rid of this message, select a new BaseLayer "+"in the layer switcher in the upper-right corner.<br><br>"+"Most likely, this is because the Google Maps library "+"script was either not included, or does not contain the "+"correct API key for your site.<br><br>"+"Developers: For help getting this working correctly, "+"<a href='http://trac.openlayers.org/wiki/Google' "+"target='_blank'>click here</a>","getLayerWarning":"The ${layerType} Layer was unable to load correctly.<br><br>"+"To get rid of this message, select a new BaseLayer "+"in the layer switcher in the upper-right corner.<br><br>"+"Most likely, this is because the ${layerLib} library "+"script was either not correctly included.<br><br>"+"Developers: For help getting this working correctly, "+"<a href='http://trac.openlayers.org/wiki/${layerLib}' "+"target='_blank'>click here</a>","scale":"Scale = 1 : ${scaleDenom}","layerAlreadyAdded":"You tried to add the layer: ${layerName} to the map, but it has already been added","reprojectDeprecated":"You are using the 'reproject' option "+"on the ${layerName} layer. This option is deprecated: "+"its use was designed to support displaying data over commercial "+"basemaps, but that functionality should now be achieved by using "+"Spherical Mercator support. More information is available from "+"http://trac.openlayers.org/wiki/SphericalMercator.","methodDeprecated":"This method has been deprecated and will be removed in 3.0. "+"Please use ${newMethod} instead.","boundsAddError":"You must pass both x and y values to the add function.","lonlatAddError":"You must pass both lon and lat values to the add function.","pixelAddError":"You must pass both x and y values to the add function.","unsupportedGeometryType":"Unsupported geometry type: ${geomType}","pagePositionFailed":"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.","end":""};

