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(){
if(this.visibility){
this.mapObject.checkResize();
}else{
this.windowResized=true;
}
},display:function(_406){
OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments);
if(this.div.style.display=="block"&&this.windowResized){
this.mapObject.checkResize();
this.windowResized=false;
}
},getOLBoundsFromMapObjectBounds:function(_407){
var _408=null;
if(_407!=null){
var sw=_407.getSouthWest();
var ne=_407.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());
}
_408=new OpenLayers.Bounds(sw.lon,sw.lat,ne.lon,ne.lat);
}
return _408;
},getMapObjectBoundsFromOLBounds:function(_40b){
var _40c=null;
if(_40b!=null){
var sw=this.sphericalMercator?this.inverseMercator(_40b.bottom,_40b.left):new OpenLayers.LonLat(_40b.bottom,_40b.left);
var ne=this.sphericalMercator?this.inverseMercator(_40b.top,_40b.right):new OpenLayers.LonLat(_40b.top,_40b.right);
_40c=new GLatLngBounds(new GLatLng(sw.lat,sw.lon),new GLatLng(ne.lat,ne.lon));
}
return _40c;
},addContainerPxFunction:function(){
if((typeof GMap2!="undefined")&&!GMap2.prototype.fromLatLngToContainerPixel){
GMap2.prototype.fromLatLngToContainerPixel=function(_40f){
var _410=this.fromLatLngToDivPixel(_40f);
var div=this.getContainer().firstChild.firstChild;
_410.x+=div.offsetLeft;
_410.y+=div.offsetTop;
return _410;
};
}
},getWarningHTML:function(){
return OpenLayers.i18n("googleWarning");
},setMapObjectCenter:function(_412,zoom){
this.mapObject.setCenter(_412,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(_416){
return this.mapObject.fromContainerPixelToLatLng(_416);
},getMapObjectPixelFromMapObjectLonLat:function(_417){
return this.mapObject.fromLatLngToContainerPixel(_417);
},getMapObjectZoomFromMapObjectBounds:function(_418){
return this.mapObject.getBoundsZoomLevel(_418);
},getLongitudeFromMapObjectLonLat:function(_419){
return this.sphericalMercator?this.forwardMercator(_419.lng(),_419.lat()).lon:_419.lng();
},getLatitudeFromMapObjectLonLat:function(_41a){
var lat=this.sphericalMercator?this.forwardMercator(_41a.lng(),_41a.lat()).lat:_41a.lat();
return lat;
},getMapObjectLonLatFromLonLat:function(lon,lat){
var _41e;
if(this.sphericalMercator){
var _41f=this.inverseMercator(lon,lat);
_41e=new GLatLng(_41f.lat,_41f.lon);
}else{
_41e=new GLatLng(lat,lon);
}
return _41e;
},getXFromMapObjectPixel:function(_420){
return _420.x;
},getYFromMapObjectPixel:function(_421){
return _421.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,_425){
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 _426=OpenLayers.Util.createDiv(this.name);
var sz=this.map.getSize();
_426.style.width=sz.w;
_426.style.height=sz.h;
this.div.appendChild(_426);
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(_428,zoom){
this.mapObject.SetCenterAndZoom(_428,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(_42c){
return this.mapObject.PixelToLatLong(_42c.x,_42c.y);
},getMapObjectPixelFromMapObjectLonLat:function(_42d){
return this.mapObject.LatLongToPixel(_42d);
},getLongitudeFromMapObjectLonLat:function(_42e){
return this.sphericalMercator?this.forwardMercator(_42e.Longitude,_42e.Latitude).lon:_42e.Longitude;
},getLatitudeFromMapObjectLonLat:function(_42f){
return this.sphericalMercator?this.forwardMercator(_42f.Longitude,_42f.Latitude).lat:_42f.Latitude;
},getMapObjectLonLatFromLonLat:function(lon,lat){
var _432;
if(this.sphericalMercator){
var _433=this.inverseMercator(lon,lat);
_432=new VELatLong(_433.lat,_433.lon);
}else{
_432=new VELatLong(lat,lon);
}
return _432;
},getXFromMapObjectPixel:function(_434){
return _434.x;
},getYFromMapObjectPixel:function(_435){
return _435.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,_439){
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 _43d=OpenLayers.Util.getElement("ygddfdiv");
if(_43d!=null){
if(_43d.parentNode!=null){
_43d.parentNode.removeChild(_43d);
}
this.map.events.unregister("moveend",this,this.fixYahooEventPane);
}
},getWarningHTML:function(){
return OpenLayers.i18n("getLayerWarning",{"layerType":"Yahoo","layerLib":"Yahoo"});
},getOLZoomFromMapObjectZoom:function(_43e){
var zoom=null;
if(_43e!=null){
zoom=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[_43e]);
zoom=18-zoom;
}
return zoom;
},getMapObjectZoomFromOLZoom:function(_440){
var zoom=null;
if(_440!=null){
zoom=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[_440]);
zoom=18-zoom;
}
return zoom;
},setMapObjectCenter:function(_442,zoom){
this.mapObject.drawZoomAndCenter(_442,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(_446){
return this.mapObject.convertXYLatLon(_446);
},getMapObjectPixelFromMapObjectLonLat:function(_447){
return this.mapObject.convertLatLonXY(_447);
},getLongitudeFromMapObjectLonLat:function(_448){
return this.sphericalMercator?this.forwardMercator(_448.Lon,_448.Lat).lon:_448.Lon;
},getLatitudeFromMapObjectLonLat:function(_449){
return this.sphericalMercator?this.forwardMercator(_449.Lon,_449.Lat).lat:_449.Lat;
},getMapObjectLonLatFromLonLat:function(lon,lat){
var _44c;
if(this.sphericalMercator){
var _44d=this.inverseMercator(lon,lat);
_44c=new YGeoPoint(_44d.lat,_44d.lon);
}else{
_44c=new YGeoPoint(lat,lon);
}
return _44c;
},getXFromMapObjectPixel:function(_44e){
return _44e.x;
},getYFromMapObjectPixel:function(_44f){
return _44f.y;
},getMapObjectPixelFromXY:function(x,y){
return new YCoordPoint(x,y);
},getMapObjectSizeFromOLSize:function(_452){
return new YSize(_452.w,_452.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,_455,_456){
var _457=arguments;
_457=[name,_456];
OpenLayers.Layer.prototype.initialize.apply(this,_457);
this.url=url;
this.params=OpenLayers.Util.extend({},_455);
},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(_459){
this.url=_459;
},mergeNewParams:function(_45a){
this.params=OpenLayers.Util.extend(this.params,_45a);
return this.redraw();
},redraw:function(_45b){
if(_45b){
return this.mergeNewParams({"_olSalt":Math.random()});
}else{
return OpenLayers.Layer.prototype.redraw.apply(this,[]);
}
},selectUrl:function(_45c,urls){
var _45e=1;
for(var i=0;i<_45c.length;i++){
_45e*=_45c.charCodeAt(i)*this.URL_HASH_FACTOR;
_45e-=Math.floor(_45e);
}
return urls[Math.floor(_45e*urls.length)];
},getFullRequestString:function(_460,_461){
var url=_461||this.url;
var _463=OpenLayers.Util.extend({},this.params);
_463=OpenLayers.Util.extend(_463,_460);
var _464=OpenLayers.Util.getParameterString(_463);
if(url instanceof Array){
url=this.selectUrl(_464,url);
}
var _465=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(url));
for(var key in _463){
if(key.toUpperCase() in _465){
delete _463[key];
}
}
_464=OpenLayers.Util.getParameterString(_463);
var _467=url;
if(_464!=""){
var _468=url.charAt(url.length-1);
if((_468=="&")||(_468=="?")){
_467+=_464;
}else{
if(url.indexOf("?")==-1){
_467+="?"+_464;
}else{
_467+="&"+_464;
}
}
}
return _467;
},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,_46b,_46c){
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(_472,_473,_474){
OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);
_472=_472||this.map.getExtent();
if(_472!=null){
var _475=!this.grid.length||_473;
var _476=this.getTilesBounds();
if(this.singleTile){
if(_475||(!_474&&!_476.containsBounds(_472))){
this.initSingleTile(_472);
}
}else{
if(_475||!_476.containsBounds(_472,true)){
this.initGriddedTiles(_472);
}else{
this.moveGriddedTiles(_472);
}
}
}
},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 _479=null;
if(this.grid.length){
var _47a=this.grid.length-1;
var _47b=this.grid[_47a][0];
var _47c=this.grid[0].length-1;
var _47d=this.grid[0][_47c];
_479=new OpenLayers.Bounds(_47b.bounds.left,_47b.bounds.bottom,_47d.bounds.right,_47d.bounds.top);
}
return _479;
},initSingleTile:function(_47e){
var _47f=_47e.getCenterLonLat();
var _480=_47e.getWidth()*this.ratio;
var _481=_47e.getHeight()*this.ratio;
var _482=new OpenLayers.Bounds(_47f.lon-(_480/2),_47f.lat-(_481/2),_47f.lon+(_480/2),_47f.lat+(_481/2));
var ul=new OpenLayers.LonLat(_482.left,_482.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(_482,px);
this.addTileMonitoringHooks(tile);
tile.draw();
this.grid[0][0]=tile;
}else{
tile.moveTo(_482,px);
}
this.removeExcessTiles(1,1);
},calculateGridLayout:function(_486,_487,_488){
var _489=_488*this.tileSize.w;
var _48a=_488*this.tileSize.h;
var _48b=_486.left-_487.left;
var _48c=Math.floor(_48b/_489)-this.buffer;
var _48d=_48b/_489-_48c;
var _48e=-_48d*this.tileSize.w;
var _48f=_487.left+_48c*_489;
var _490=_486.top-(_487.bottom+_48a);
var _491=Math.ceil(_490/_48a)+this.buffer;
var _492=_491-_490/_48a;
var _493=-_492*this.tileSize.h;
var _494=_487.bottom+_491*_48a;
return {tilelon:_489,tilelat:_48a,tileoffsetlon:_48f,tileoffsetlat:_494,tileoffsetx:_48e,tileoffsety:_493};
},initGriddedTiles:function(_495){
var _496=this.map.getSize();
var _497=Math.ceil(_496.h/this.tileSize.h)+Math.max(1,2*this.buffer);
var _498=Math.ceil(_496.w/this.tileSize.w)+Math.max(1,2*this.buffer);
var _499=this.map.getMaxExtent();
var _49a=this.map.getResolution();
var _49b=this.calculateGridLayout(_495,_499,_49a);
var _49c=Math.round(_49b.tileoffsetx);
var _49d=Math.round(_49b.tileoffsety);
var _49e=_49b.tileoffsetlon;
var _49f=_49b.tileoffsetlat;
var _4a0=_49b.tilelon;
var _4a1=_49b.tilelat;
this.origin=new OpenLayers.Pixel(_49c,_49d);
var _4a2=_49c;
var _4a3=_49e;
var _4a4=0;
var _4a5=parseInt(this.map.layerContainerDiv.style.left);
var _4a6=parseInt(this.map.layerContainerDiv.style.top);
do{
var row=this.grid[_4a4++];
if(!row){
row=[];
this.grid.push(row);
}
_49e=_4a3;
_49c=_4a2;
var _4a8=0;
do{
var _4a9=new OpenLayers.Bounds(_49e,_49f,_49e+_4a0,_49f+_4a1);
var x=_49c;
x-=_4a5;
var y=_49d;
y-=_4a6;
var px=new OpenLayers.Pixel(x,y);
var tile=row[_4a8++];
if(!tile){
tile=this.addTile(_4a9,px);
this.addTileMonitoringHooks(tile);
row.push(tile);
}else{
tile.moveTo(_4a9,px,false);
}
_49e+=_4a0;
_49c+=this.tileSize.w;
}while((_49e<=_495.right+_4a0*this.buffer)||_4a8<_498);
_49f-=_4a1;
_49d+=this.tileSize.h;
}while((_49f>=_495.bottom-_4a1*this.buffer)||_4a4<_497);
this.removeExcessTiles(_4a4,_4a8);
this.spiralTileLoad();
},spiralTileLoad:function(){
var _4ae=[];
var _4af=["right","down","left","up"];
var iRow=0;
var _4b1=-1;
var _4b2=OpenLayers.Util.indexOf(_4af,"right");
var _4b3=0;
while(_4b3<_4af.length){
var _4b4=iRow;
var _4b5=_4b1;
switch(_4af[_4b2]){
case "right":
_4b5++;
break;
case "down":
_4b4++;
break;
case "left":
_4b5--;
break;
case "up":
_4b4--;
break;
}
var tile=null;
if((_4b4<this.grid.length)&&(_4b4>=0)&&(_4b5<this.grid[0].length)&&(_4b5>=0)){
tile=this.grid[_4b4][_4b5];
}
if((tile!=null)&&(!tile.queued)){
_4ae.unshift(tile);
tile.queued=true;
_4b3=0;
iRow=_4b4;
_4b1=_4b5;
}else{
_4b2=(_4b2+1)%4;
_4b3++;
}
}
for(var i=0;i<_4ae.length;i++){
var tile=_4ae[i];
tile.draw();
tile.queued=false;
}
},addTile:function(_4b8,_4b9){
},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(_4bc){
var _4bd=this.buffer||1;
while(true){
var _4be=this.grid[0][0].position;
var _4bf=this.map.getViewPortPxFromLayerPx(_4be);
if(_4bf.x>-this.tileSize.w*(_4bd-1)){
this.shiftColumn(true);
}else{
if(_4bf.x<-this.tileSize.w*_4bd){
this.shiftColumn(false);
}else{
if(_4bf.y>-this.tileSize.h*(_4bd-1)){
this.shiftRow(true);
}else{
if(_4bf.y<-this.tileSize.h*_4bd){
this.shiftRow(false);
}else{
break;
}
}
}
}
}
},shiftRow:function(_4c0){
var _4c1=(_4c0)?0:(this.grid.length-1);
var grid=this.grid;
var _4c3=grid[_4c1];
var _4c4=this.map.getResolution();
var _4c5=(_4c0)?-this.tileSize.h:this.tileSize.h;
var _4c6=_4c4*-_4c5;
var row=(_4c0)?grid.pop():grid.shift();
for(var i=0;i<_4c3.length;i++){
var _4c9=_4c3[i];
var _4ca=_4c9.bounds.clone();
var _4cb=_4c9.position.clone();
_4ca.bottom=_4ca.bottom+_4c6;
_4ca.top=_4ca.top+_4c6;
_4cb.y=_4cb.y+_4c5;
row[i].moveTo(_4ca,_4cb);
}
if(_4c0){
grid.unshift(row);
}else{
grid.push(row);
}
},shiftColumn:function(_4cc){
var _4cd=(_4cc)?-this.tileSize.w:this.tileSize.w;
var _4ce=this.map.getResolution();
var _4cf=_4ce*_4cd;
for(var i=0;i<this.grid.length;i++){
var row=this.grid[i];
var _4d2=(_4cc)?0:(row.length-1);
var _4d3=row[_4d2];
var _4d4=_4d3.bounds.clone();
var _4d5=_4d3.position.clone();
_4d4.left=_4d4.left+_4cf;
_4d4.right=_4d4.right+_4cf;
_4d5.x=_4d5.x+_4cd;
var tile=_4cc?this.grid[i].pop():this.grid[i].shift();
tile.moveTo(_4d4,_4d5);
if(_4cc){
row.unshift(tile);
}else{
row.push(tile);
}
}
},removeExcessTiles:function(rows,_4d8){
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>_4d8){
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(_4dd){
var _4de=this.map.getMaxExtent();
var _4df=this.getResolution();
var _4e0=_4df*this.tileSize.w;
var _4e1=_4df*this.tileSize.h;
var _4e2=this.getLonLatFromViewPortPx(_4dd);
var _4e3=_4de.left+(_4e0*Math.floor((_4e2.lon-_4de.left)/_4e0));
var _4e4=_4de.bottom+(_4e1*Math.floor((_4e2.lat-_4de.bottom)/_4e1));
return new OpenLayers.Bounds(_4e3,_4e4,_4e3+_4e0,_4e4+_4e1);
},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,_4e7,_4e8){
var _4e9=[];
_4e9.push(name,url,_4e7,_4e8);
OpenLayers.Layer.Grid.prototype.initialize.apply(this,_4e9);
this.params=(_4e7?_4e7:{});
if(_4e7){
OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);
}
},getURL:function(_4ea){
_4ea=this.adjustBounds(_4ea);
var _4eb=this.map.getResolution();
var _4ec=Math.round((this.map.getScale()*10000))/10000;
var pX=Math.round(_4ea.left/_4eb);
var pY=-Math.round(_4ea.top/_4eb);
return this.getFullRequestString({t:pY,l:pX,s:_4ec});
},addTile:function(_4ef,_4f0){
var url=this.getURL(_4ef);
return new OpenLayers.Tile.Image(this,_4f0,_4ef,url,this.tileSize);
},calculateGridLayout:function(_4f2,_4f3,_4f4){
var _4f5=_4f4*this.tileSize.w;
var _4f6=_4f4*this.tileSize.h;
var _4f7=_4f2.left;
var _4f8=Math.floor(_4f7/_4f5)-this.buffer;
var _4f9=_4f7/_4f5-_4f8;
var _4fa=-_4f9*this.tileSize.w;
var _4fb=_4f8*_4f5;
var _4fc=_4f2.top;
var _4fd=Math.ceil(_4fc/_4f6)+this.buffer;
var _4fe=_4fd-_4fc/_4f6;
var _4ff=-(_4fe+1)*this.tileSize.h;
var _500=_4fd*_4f6;
return {tilelon:_4f5,tilelat:_4f6,tileoffsetlon:_4fb,tileoffsetlat:_500,tileoffsetx:_4fa,tileoffsety:_4ff};
},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(_502){
var _503=this.getResolution();
var _504=_503*this.tileSize.w;
var _505=_503*this.tileSize.h;
var _506=this.getLonLatFromViewPortPx(_502);
var _507=_504*Math.floor(_506.lon/_504);
var _508=_505*Math.floor(_506.lat/_505);
return new OpenLayers.Bounds(_507,_508,_507+_504,_508+_505);
},CLASS_NAME:"OpenLayers.Layer.KaMap"});
OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(name,_50a){
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(_50b){
if(_50b!=this.opacity){
this.opacity=_50b;
for(var i=0;i<this.markers.length;i++){
this.markers[i].setOpacity(this.opacity);
}
}
},moveTo:function(_50d,_50e,_50f){
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
if(_50e||!this.drawn){
for(var i=0;i<this.markers.length;i++){
this.drawMarker(this.markers[i]);
}
this.drawn=true;
}
},addMarker:function(_511){
this.markers.push(_511);
if(this.opacity!=null){
_511.setOpacity(this.opacity);
}
if(this.map&&this.map.getExtent()){
_511.map=this.map;
this.drawMarker(_511);
}
},removeMarker:function(_512){
if(this.markers&&this.markers.length){
OpenLayers.Util.removeItem(this.markers,_512);
if((_512.icon!=null)&&(_512.icon.imageDiv!=null)&&(_512.icon.imageDiv.parentNode==this.div)){
this.div.removeChild(_512.icon.imageDiv);
_512.drawn=false;
}
}
},clearMarkers:function(){
if(this.markers!=null){
while(this.markers.length>0){
this.removeMarker(this.markers[0]);
}
}
},drawMarker:function(_513){
var px=this.map.getLayerPxFromLonLat(_513.lonlat);
if(px==null){
_513.display(false);
}else{
var _515=_513.draw(px);
if(!_513.drawn){
this.div.appendChild(_515);
_513.drawn=true;
}
}
},getDataExtent:function(){
var _516=null;
if(this.markers&&(this.markers.length>0)){
var _516=new OpenLayers.Bounds();
for(var i=0;i<this.markers.length;i++){
var _518=this.markers[i];
_516.extend(_518.lonlat);
}
}
return _516;
},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,_51b,_51c){
var _51d=[];
_51b=OpenLayers.Util.upperCaseObject(_51b);
_51d.push(name,url,_51b,_51c);
OpenLayers.Layer.Grid.prototype.initialize.apply(this,_51d);
OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));
if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){
if((_51c==null)||(!_51c.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(_51f){
_51f=this.adjustBounds(_51f);
var _520=this.getImageSize();
var _521={"BBOX":this.encodeBBOX?_51f.toBBOX():_51f.toArray(),"WIDTH":_520.w,"HEIGHT":_520.h};
var _522=this.getFullRequestString(_521);
return _522;
},addTile:function(_523,_524){
return new OpenLayers.Tile.Image(this,_524,_523,null,this.tileSize);
},mergeNewParams:function(_525){
var _526=OpenLayers.Util.upperCaseObject(_525);
var _527=[_526];
return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,_527);
},getFullRequestString:function(_528,_529){
var _52a=this.map.getProjection();
this.params.SRS=(_52a=="none")?null:_52a;
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,_52d,_52e){
this.layername=_52d;
OpenLayers.Layer.Grid.prototype.initialize.apply(this,[name,url,{},_52e]);
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(_530){
var res=this.map.getResolution();
var bbox=this.maxExtent;
var size=this.tileSize;
var _534=Math.round((_530.left-bbox.left)/(res*size.w));
var _535=Math.round((_530.bottom-bbox.bottom)/(res*size.h));
var _536=this.map.zoom;
function zeroPad(_537,_538){
_537=String(_537);
var _539=[];
for(var i=0;i<_538;++i){
_539.push("0");
}
return _539.join("").substring(0,_538-_537.length)+_537;
};
var _53b=[this.layername,zeroPad(_536,2),zeroPad(parseInt(_534/1000000),3),zeroPad((parseInt(_534/1000)%1000),3),zeroPad((parseInt(_534)%1000),3),zeroPad(parseInt(_535/1000000),3),zeroPad((parseInt(_535/1000)%1000),3),zeroPad((parseInt(_535)%1000),3)+"."+this.extension];
var path=_53b.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(_53e,_53f){
var url=this.getURL(_53e);
return new OpenLayers.Tile.Image(this,_53f,_53e,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,_543,size,_545,_546,_547,_548){
var _549=new Array(id,_543,size,_545,_547,_548);
OpenLayers.Popup.prototype.initialize.apply(this,_549);
this.anchor=(_546!=null)?_546:{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 _54b=this.relativePosition;
this.relativePosition=this.calculateRelativePosition(px);
var _54c=this.calculateNewPx(px);
var _54d=new Array(_54c);
OpenLayers.Popup.prototype.moveTo.apply(this,_54d);
if(this.relativePosition!=_54b){
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 _551=this.map.getLonLatFromLayerPx(px);
var _552=this.map.getExtent();
var _553=_552.determineQuadrant(_551);
return OpenLayers.Bounds.oppositeQuadrant(_553);
},updateRelativePosition:function(){
},calculateNewPx:function(px){
var _555=px.offset(this.anchor.offset);
var top=(this.relativePosition.charAt(0)=="t");
_555.y+=(top)?-this.size.h:this.anchor.size.h;
var left=(this.relativePosition.charAt(1)=="l");
_555.x+=(left)?-this.size.w:this.anchor.size.w;
return _555;
},CLASS_NAME:"OpenLayers.Popup.Anchored"});
OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(id,_559,size,_55b,_55c,_55d,_55e){
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(_561){
if(_561!=undefined){
this.backgroundColor=_561;
}
if(this.div!=null){
if(this.contentDiv!=null){
this.div.style.background="transparent";
OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor);
}
}
},setOpacity:function(_562){
OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,_562);
if(this.div!=null){
if(this.groupDiv!=null){
OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity);
}
}
},setBorder:function(_563){
this.border=0;
},setRicoCorners:function(){
var _564=this.getCornersToRound(this.relativePosition);
var _565={corners:_564,color:this.backgroundColor,bgColor:"transparent",blend:false};
if(!this.rounded){
OpenLayers.Rico.Corner.round(this.div,_565);
this.rounded=true;
}else{
OpenLayers.Rico.Corner.reRound(this.groupDiv,_565);
this.setBackgroundColor();
this.setOpacity();
}
},getCornersToRound:function(){
var _566=["tl","tr","bl","br"];
var _567=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);
OpenLayers.Util.removeItem(_566,_567);
return _566.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(_568,_569,data){
this.layer=_568;
this.lonlat=_569;
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 _56b=false;
if((this.layer!=null)&&(this.layer.map!=null)){
var _56c=this.layer.map.getExtent();
_56b=_56c.containsLonLat(this.lonlat);
}
return _56b;
},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(_56d){
if(this.lonlat!=null){
var id=this.id+"_popup";
var _56f=(this.marker)?this.marker.icon:null;
if(!this.popup){
this.popup=new this.popupClass(id,this.lonlat,this.data.popupSize,this.data.popupContentHTML,_56f,_56d);
}
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(_570,_571,_572){
OpenLayers.Feature.prototype.initialize.apply(this,[null,null,_571]);
this.lonlat=null;
this.geometry=_570;
this.state=null;
this.attributes={};
if(_571){
this.attributes=OpenLayers.Util.extend(this.attributes,_571);
}
this.style=_572?_572: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(_573){
var _574=false;
if(this.layer&&this.layer.map){
var _575=this.layer.map.getExtent();
if(_573){
var _576=this.geometry.getBounds();
_574=_575.intersectsBounds(_576);
}else{
var _577=_575.toGeometry();
_574=_577.intersects(this.geometry);
}
}
return _574;
},createMarker:function(){
return null;
},destroyMarker:function(){
},createPopup:function(){
return null;
},atPoint:function(_578,_579,_57a){
var _57b=false;
if(this.geometry){
_57b=this.geometry.atPoint(_578,_579,_57a);
}
return _57b;
},destroyPopup:function(){
},toState:function(_57c){
if(_57c==OpenLayers.State.UPDATE){
switch(this.state){
case OpenLayers.State.UNKNOWN:
case OpenLayers.State.DELETE:
this.state=_57c;
break;
case OpenLayers.State.UPDATE:
case OpenLayers.State.INSERT:
break;
}
}else{
if(_57c==OpenLayers.State.INSERT){
switch(this.state){
case OpenLayers.State.UNKNOWN:
break;
default:
this.state=_57c;
break;
}
}else{
if(_57c==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=_57c;
break;
}
}else{
if(_57c==OpenLayers.State.UNKNOWN){
this.state=_57c;
}
}
}
}
},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(_57d,_57e,_57f){
OpenLayers.Util.extend(this,_57f);
this.control=_57d;
this.callbacks=_57e;
if(_57d.map){
this.setMap(_57d.map);
}
OpenLayers.Util.extend(this,_57f);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
},setMap:function(map){
this.map=map;
},checkModifiers:function(evt){
if(this.keyMask==null){
return true;
}
var _582=(evt.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(evt.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(evt.altKey?OpenLayers.Handler.MOD_ALT:0);
return (_582==this.keyMask);
},activate:function(){
if(this.active){
return false;
}
var _583=OpenLayers.Events.prototype.BROWSER_EVENTS;
for(var i=0;i<_583.length;i++){
if(this[_583[i]]){
this.register(_583[i],this[_583[i]]);
}
}
this.active=true;
return true;
},deactivate:function(){
if(!this.active){
return false;
}
var _585=OpenLayers.Events.prototype.BROWSER_EVENTS;
for(var i=0;i<_585.length;i++){
if(this[_585[i]]){
this.unregister(_585[i],this[_585[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,_58a){
this.map.events.registerPriority(name,this,_58a);
this.map.events.registerPriority(name,this,this.setEvent);
},unregister:function(name,_58c){
this.map.events.unregister(name,this,_58c);
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(_58e,_58f,_590){
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 _594=this.single?OpenLayers.Util.extend({},evt):null;
this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,_594),this.delay);
}
}
return !this.stopSingle;
},passesTolerance:function(evt){
var _596=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){
_596=false;
}
}
return _596;
},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 _599=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.clearTimer();
this.down=null;
_599=true;
}
return _599;
},CLASS_NAME:"OpenLayers.Handler.Click"});
OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(_59a,_59b,_59c){
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 _5a0=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){
_5a0=false;
}
}
return _5a0;
},clearTimer:function(){
if(this.timerId!=null){
window.clearTimeout(this.timerId);
this.timerId=null;
}
},delayedCall:function(evt){
this.callback("pause",[evt]);
},deactivate:function(){
var _5a3=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.clearTimer();
_5a3=true;
}
return _5a3;
},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(_5a4,_5a5,_5a6){
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 _5a7={displayInLayerSwitcher:false,calculateInRange:function(){
return true;
}};
this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,_5a7);
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 _5ab=this.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_5ab.lon;
this.point.geometry.y=_5ab.lat;
this.drawFeature();
return false;
},mousemove:function(evt){
if(this.drawing){
var _5ad=this.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_5ad.lon;
this.point.geometry.y=_5ad.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(_5af,_5b0,_5b1){
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 _5b3=this.line.geometry.components.length-1;
this.line.geometry.components[_5b3].x=this.point.geometry.x;
this.line.geometry.components[_5b3].y=this.point.geometry.y;
this.line.geometry.components[_5b3].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 _5b5=this.control.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_5b5.lon;
this.point.geometry.y=_5b5.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 _5b7=this.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_5b7.lon;
this.point.geometry.y=_5b7.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 _5ba=this.line.geometry.components.length-1;
this.line.geometry.removeComponent(this.line.geometry.components[_5ba]);
this.finalize();
}
return false;
},CLASS_NAME:"OpenLayers.Handler.Path"});
OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(_5bb,_5bc,_5bd){
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 _5be=this.line.geometry.components.length-2;
this.line.geometry.components[_5be].x=this.point.geometry.x;
this.line.geometry.components[_5be].y=this.point.geometry.y;
this.line.geometry.components[_5be].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 _5c0=this.line.geometry.components.length-2;
this.line.geometry.removeComponent(this.line.geometry.components[_5c0]);
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(_5c1,_5c2,_5c3,_5c4){
OpenLayers.Handler.prototype.initialize.apply(this,[_5c1,_5c3,_5c4]);
this.layer=_5c2;
},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(_5ca){
return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,_5ca.geometry.CLASS_NAME)>-1;
},handle:function(evt){
var type=evt.type;
var _5cd=false;
var _5ce=!!(this.feature);
var _5cf=(type=="click"||type=="dblclick");
this.feature=this.layer.getFeatureFromEvent(evt);
if(this.feature){
var _5d0=(this.feature!=this.lastFeature);
if(this.geometryTypeMatches(this.feature)){
if(_5ce&&_5d0){
this.triggerCallback(type,"out",[this.lastFeature]);
this.triggerCallback(type,"in",[this.feature]);
}else{
if(!_5ce||_5cf){
this.triggerCallback(type,"in",[this.feature]);
}
}
this.lastFeature=this.feature;
_5cd=true;
}else{
if(_5ce&&_5d0||(_5cf&&this.lastFeature)){
this.triggerCallback(type,"out",[this.lastFeature]);
}
this.feature=null;
}
}else{
if(_5ce||(_5cf&&this.lastFeature)){
this.triggerCallback(type,"out",[this.lastFeature]);
}
}
return _5cd;
},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 _5d6=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;
_5d6=true;
}
return _5d6;
},deactivate:function(){
var _5d7=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;
_5d7=true;
}
return _5d7;
},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(_5d8,_5d9,_5da){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
},down:function(evt){
},move:function(evt){
},up:function(evt){
},out:function(evt){
},mousedown:function(evt){
var _5e0=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;
};
}
_5e0=!this.stopDown;
}else{
this.started=false;
this.start=null;
this.last=null;
}
return _5e0;
},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 _5e3=(this.start!=this.last);
this.started=false;
this.dragging=false;
this.map.div.style.cursor="";
this.up(evt);
this.callback("up",[evt.xy]);
if(_5e3){
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 _5e5=(this.start!=this.last);
this.started=false;
this.dragging=false;
this.map.div.style.cursor="";
this.out(evt);
this.callback("out",[]);
if(_5e5){
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 _5e7=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
this.dragging=false;
_5e7=true;
}
return _5e7;
},deactivate:function(){
var _5e8=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.started=false;
this.dragging=false;
this.start=null;
this.last=null;
_5e8=true;
}
return _5e8;
},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(_5e9,_5ea,_5eb){
this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});
OpenLayers.Handler.prototype.initialize.apply(this,[_5e9,_5ea,_5eb]);
this.options=(_5eb)?_5eb:new Object();
},setOptions:function(_5ec){
OpenLayers.Util.extend(this.options,_5ec);
OpenLayers.Util.extend(this,_5ec);
},activate:function(){
var _5ed=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
var _5ee={displayInLayerSwitcher:false};
this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,_5ee);
this.map.addLayer(this.layer);
_5ed=true;
}
return _5ed;
},deactivate:function(){
var _5ef=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;
_5ef=true;
}
return _5ef;
},down:function(evt){
this.fixedRadius=!!(this.radius);
var _5f1=this.map.getLonLatFromPixel(evt.xy);
this.origin=new OpenLayers.Geometry.Point(_5f1.lon,_5f1.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 _5f3=this.map.getLonLatFromPixel(evt.xy);
var _5f4=new OpenLayers.Geometry.Point(_5f3.lon,_5f3.lat);
if(this.irregular){
var ry=Math.sqrt(2)*Math.abs(_5f4.y-this.origin.y)/2;
this.radius=Math.max(this.map.getResolution()/2,ry);
}else{
if(this.fixedRadius){
this.origin=_5f4;
}else{
this.calculateAngle(_5f4,evt);
this.radius=Math.max(this.map.getResolution()/2,_5f4.distanceTo(this.origin));
}
}
this.modifyGeometry();
if(this.irregular){
var dx=_5f4.x-this.origin.x;
var dy=_5f4.y-this.origin.y;
var _5f8;
if(dy==0){
_5f8=dx/(this.radius*Math.sqrt(2));
}else{
_5f8=dx/dy;
}
this.feature.geometry.resize(1,this.origin,_5f8);
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 _5fb,dx,dy,_5fe;
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){
_5fe=ring.components[i];
_5fb=this.angle+(i*2*Math.PI/this.sides);
_5fe.x=this.origin.x+(this.radius*Math.cos(_5fb));
_5fe.y=this.origin.y+(this.radius*Math.sin(_5fb));
_5fe.clearBounds();
}
},calculateAngle:function(_601,evt){
var _603=Math.atan2(_601.y-this.origin.y,_601.x-this.origin.x);
if(this.snapAngle&&(this.snapToggle&&!evt[this.snapToggle])){
var _604=(Math.PI/180)*this.snapAngle;
this.angle=Math.round(_603/_604)*_604;
}else{
this.angle=_603;
}
},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(_607,_608,_609){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
var _608={"down":this.startBox,"move":this.moveBox,"out":this.removeBox,"up":this.endBox};
this.dragHandler=new OpenLayers.Handler.Drag(this,_608,{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 _60d=Math.abs(this.dragHandler.start.x-xy.x);
var _60e=Math.abs(this.dragHandler.start.y-xy.y);
this.zoomBox.style.width=Math.max(1,_60d)+"px";
this.zoomBox.style.height=Math.max(1,_60e)+"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 _610;
if(Math.abs(this.dragHandler.start.x-end.x)>5||Math.abs(this.dragHandler.start.y-end.y)>5){
var _611=this.dragHandler.start;
var top=Math.min(_611.y,end.y);
var _613=Math.max(_611.y,end.y);
var left=Math.min(_611.x,end.x);
var _615=Math.max(_611.x,end.x);
_610=new OpenLayers.Bounds(left,_613,_615,top);
}else{
_610=this.dragHandler.start.clone();
}
this.removeBox();
this.map.div.style.cursor="";
this.callback("done",[_610]);
},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(_616,_617,_618){
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 _61a=false;
var _61b=false;
var _61c=false;
var elem=OpenLayers.Event.element(e);
while((elem!=null)&&!_61c&&!_61a){
if(!_61a){
try{
if(elem.currentStyle){
_61e=elem.currentStyle["overflow"];
}else{
var _61f=document.defaultView.getComputedStyle(elem,null);
var _61e=_61f.getPropertyValue("overflow");
}
_61a=(_61e&&(_61e=="auto")||(_61e=="scroll"));
}
catch(err){
}
}
if(!_61b){
for(var i=0;i<this.map.layers.length;i++){
if(elem==this.map.layers[i].div||elem==this.map.layers[i].pane){
_61b=true;
break;
}
}
}
_61c=(elem==this.map.div);
elem=elem.parentNode;
}
if(!_61a&&_61c){
if(_61b){
this.wheelZoom(e);
}
OpenLayers.Event.stop(e);
}
},wheelZoom:function(e){
var _622=0;
if(!e){
e=window.event;
}
if(e.wheelDelta){
_622=e.wheelDelta/120;
if(window.opera&&window.opera.version()<9.2){
_622=-_622;
}
}else{
if(e.detail){
_622=-e.detail/3;
}
}
if(_622){
if(this.mousePosition){
e.xy=this.mousePosition;
}
if(!e.xy){
e.xy=this.map.getPixelFromLonLat(this.map.getCenter());
}
if(_622<0){
this.callback("down",[e,_622]);
}else{
this.callback("up",[e,_622]);
}
}
},mousemove:function(evt){
this.mousePosition=evt.xy;
},activate:function(evt){
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
var _625=this.wheelListener;
OpenLayers.Event.observe(window,"DOMMouseScroll",_625);
OpenLayers.Event.observe(window,"mousewheel",_625);
OpenLayers.Event.observe(document,"mousewheel",_625);
return true;
}else{
return false;
}
},deactivate:function(evt){
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
var _627=this.wheelListener;
OpenLayers.Event.stopObserving(window,"DOMMouseScroll",_627);
OpenLayers.Event.stopObserving(window,"mousewheel",_627);
OpenLayers.Event.stopObserving(document,"mousewheel",_627);
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(_628,_629,_62a){
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 _62c=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);
}
_62c=true;
}
return _62c;
},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(_62f){
this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");
OpenLayers.Util.extend(this,_62f);
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(_634){
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 _635=[];
if(this.map&&this.map.layers){
for(var i=0;i<this.map.layers.length;i++){
var _637=this.map.layers[i];
if(_637.attribution&&_637.getVisibility()){
_635.push(_637.attribution);
}
}
this.div.innerHTML=_635.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(_638){
if(_638 instanceof OpenLayers.Bounds){
if(!this.out){
var _639=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_638.left,_638.bottom));
var _63a=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_638.right,_638.top));
var _63b=new OpenLayers.Bounds(_639.lon,_639.lat,_63a.lon,_63a.lat);
}else{
var _63c=Math.abs(_638.right-_638.left);
var _63d=Math.abs(_638.top-_638.bottom);
var _63e=Math.min((this.map.size.h/_63d),(this.map.size.w/_63c));
var _63f=this.map.getExtent();
var _640=this.map.getLonLatFromPixel(_638.getCenterPixel());
var xmin=_640.lon-(_63f.getWidth()/2)*_63e;
var xmax=_640.lon+(_63f.getWidth()/2)*_63e;
var ymin=_640.lat-(_63f.getHeight()/2)*_63e;
var ymax=_640.lat+(_63f.getHeight()/2)*_63e;
var _63b=new OpenLayers.Bounds(xmin,ymin,xmax,ymax);
}
this.map.zoomToExtent(_63b);
}else{
if(!this.out){
this.map.setCenter(this.map.getLonLatFromPixel(_638),this.map.getZoom()+1);
}else{
this.map.setCenter(this.map.getLonLatFromPixel(_638),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(_647){
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 _649=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_649,this.map.zoom+1);
},wheelChange:function(evt,_64b){
var _64c=this.map.getZoom()+_64b;
if(!this.map.isValidZoomLevel(_64c)){
return;
}
var size=this.map.getSize();
var _64e=size.w/2-evt.xy.x;
var _64f=evt.xy.y-size.h/2;
var _650=this.map.baseLayer.getResolutionForZoom(_64c);
var _651=this.map.getLonLatFromPixel(evt.xy);
var _652=new OpenLayers.LonLat(_651.lon+_64e*_650,_651.lat+_64f*_650);
this.map.setCenter(_652,_64c);
},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 _656=!this.performedDrag;
this.performedDrag=false;
return _656;
},defaultDblClick:function(evt){
var _658=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_658,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 _65b=Math.abs(this.mouseDragStart.x-evt.xy.x);
var _65c=Math.abs(this.mouseDragStart.y-evt.xy.y);
this.zoomBox.style.width=Math.max(1,_65b)+"px";
this.zoomBox.style.height=Math.max(1,_65c)+"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 _65b=this.mouseDragStart.x-evt.xy.x;
var _65c=this.mouseDragStart.y-evt.xy.y;
var size=this.map.getSize();
var _65e=new OpenLayers.Pixel(size.w/2+_65b,size.h/2+_65c);
var _65f=this.map.getLonLatFromViewPortPx(_65e);
this.map.setCenter(_65f,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 _665=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
var end=this.map.getLonLatFromViewPortPx(evt.xy);
var top=Math.max(_665.lat,end.lat);
var _668=Math.min(_665.lat,end.lat);
var left=Math.min(_665.lon,end.lon);
var _66a=Math.max(_665.lon,end.lon);
var _66b=new OpenLayers.Bounds(left,_668,_66a,top);
this.map.zoomToExtent(_66b);
}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 _66d=false;
var elem=OpenLayers.Event.element(e);
while(elem!=null){
if(this.map&&elem==this.map.div){
_66d=true;
break;
}
elem=elem.parentNode;
}
if(_66d){
var _66f=0;
if(!e){
e=window.event;
}
if(e.wheelDelta){
_66f=e.wheelDelta/120;
if(window.opera&&window.opera.version()<9.2){
_66f=-_66f;
}
}else{
if(e.detail){
_66f=-e.detail/3;
}
}
if(_66f){
e.xy=this.mousePosition;
if(_66f<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(_670){
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 _672;
if(evt==null){
_672=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;
}
_672=this.map.getLonLatFromPixel(evt.xy);
if(!_672){
return;
}
if(this.displayProjection){
_672.transform(this.map.getProjectionObject(),this.displayProjection);
}
this.lastXy=evt.xy;
}
var _673=this.formatOutput(_672);
if(_673!=this.element.innerHTML){
this.element.innerHTML=_673;
}
},formatOutput:function(_674){
var _675=parseInt(this.numdigits);
var _676=this.prefix+_674.lon.toFixed(_675)+this.separator+_674.lat.toFixed(_675)+this.suffix;
return _676;
},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(_677){
this.layers=[];
this.handlers={};
OpenLayers.Control.prototype.initialize.apply(this,[_677]);
},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 _678=this.map.baseLayer.clone();
this.layers=[_678];
}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 _679=OpenLayers.Util.getImagesLocation();
var img=_679+"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=_679+"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 _67b=["dblclick","mousedown"];
for(var i=0;i<_67b.length;i++){
OpenLayers.Event.observe(this.maximizeDiv,_67b[i],OpenLayers.Event.stop);
OpenLayers.Event.observe(this.minimizeDiv,_67b[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 _67e=this.handlers.drag.last.x-px.x;
var _67f=this.handlers.drag.last.y-px.y;
if(_67e!=0||_67f!=0){
var _680=this.rectPxBounds.top;
var _681=this.rectPxBounds.left;
var _682=Math.abs(this.rectPxBounds.getHeight());
var _683=this.rectPxBounds.getWidth();
var _684=Math.max(0,(_680-_67f));
_684=Math.min(_684,this.ovmap.size.h-this.hComp-_682);
var _685=Math.max(0,(_681-_67e));
_685=Math.min(_685,this.ovmap.size.w-this.wComp-_683);
this.setRectPxBounds(new OpenLayers.Bounds(_685,_684+_682,_685+_683,_684));
}
},mapDivClick:function(evt){
var _687=this.rectPxBounds.getCenterPixel();
var _688=evt.xy.x-_687.x;
var _689=evt.xy.y-_687.y;
var top=this.rectPxBounds.top;
var left=this.rectPxBounds.left;
var _68c=Math.abs(this.rectPxBounds.getHeight());
var _68d=this.rectPxBounds.getWidth();
var _68e=Math.max(0,(top+_689));
_68e=Math.min(_68e,this.ovmap.size.h-_68c);
var _68f=Math.max(0,(left+_688));
_68f=Math.min(_68f,this.ovmap.size.w-_68d);
this.setRectPxBounds(new OpenLayers.Bounds(_68f,_68e+_68c,_68f+_68d,_68e));
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(_692){
this.maximizeDiv.style.display=_692?"":"none";
this.minimizeDiv.style.display=_692?"none":"";
},update:function(){
if(this.ovmap==null){
this.createMap();
}
if(!this.isSuitableOverview()){
this.updateOverview();
}
this.updateRectToMap();
},isSuitableOverview:function(){
var _693=this.map.getExtent();
var _694=this.map.maxExtent;
var _695=new OpenLayers.Bounds(Math.max(_693.left,_694.left),Math.max(_693.bottom,_694.bottom),Math.min(_693.right,_694.right),Math.min(_693.top,_694.top));
var _696=this.ovmap.getResolution()/this.map.getResolution();
return ((_696>this.minRatio)&&(_696<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(_695)));
},updateOverview:function(){
var _697=this.map.getResolution();
var _698=this.ovmap.getResolution();
var _699=_698/_697;
if(_699>this.maxRatio){
_698=this.minRatio*_697;
}else{
if(_699<=this.minRatio){
_698=this.maxRatio*_697;
}
}
this.ovmap.setCenter(this.map.center,this.ovmap.getZoomForResolution(_698));
this.updateRectToMap();
},createMap:function(){
var _69a=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);
this.ovmap=new OpenLayers.Map(this.mapDiv,_69a);
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 _69d=this.getRectBoundsFromMapBounds(this.map.getExtent());
if(_69d){
this.setRectPxBounds(_69d);
}
},updateMapToRect:function(){
var _69e=this.getMapBoundsFromRectBounds(this.rectPxBounds);
this.map.panTo(_69e.getCenterLonLat());
},setRectPxBounds:function(_69f){
var top=Math.max(_69f.top,0);
var left=Math.max(_69f.left,0);
var _6a2=Math.min(_69f.top+Math.abs(_69f.getHeight()),this.ovmap.size.h-this.hComp);
var _6a3=Math.min(_69f.left+_69f.getWidth(),this.ovmap.size.w-this.wComp);
var _6a4=Math.max(_6a3-left,0);
var _6a5=Math.max(_6a2-top,0);
if(_6a4<this.minRectSize||_6a5<this.minRectSize){
this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;
var _6a6=left+(_6a4/2)-(this.minRectSize/2);
var rTop=top+(_6a5/2)-(this.minRectSize/2);
this.extentRectangle.style.top=Math.round(rTop)+"px";
this.extentRectangle.style.left=Math.round(_6a6)+"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(_6a5)+"px";
this.extentRectangle.style.width=Math.round(_6a4)+"px";
}
this.rectPxBounds=new OpenLayers.Bounds(Math.round(left),Math.round(_6a2),Math.round(_6a3),Math.round(top));
},getRectBoundsFromMapBounds:function(_6a8){
var _6a9=new OpenLayers.LonLat(_6a8.left,_6a8.bottom);
var _6aa=new OpenLayers.LonLat(_6a8.right,_6a8.top);
var _6ab=this.getOverviewPxFromLonLat(_6a9);
var _6ac=this.getOverviewPxFromLonLat(_6aa);
var _6ad=null;
if(_6ab&&_6ac){
_6ad=new OpenLayers.Bounds(_6ab.x,_6ab.y,_6ac.x,_6ac.y);
}
return _6ad;
},getMapBoundsFromRectBounds:function(_6ae){
var _6af=new OpenLayers.Pixel(_6ae.left,_6ae.bottom);
var _6b0=new OpenLayers.Pixel(_6ae.right,_6ae.top);
var _6b1=this.getLonLatFromOverviewPx(_6af);
var _6b2=this.getLonLatFromOverviewPx(_6b0);
return new OpenLayers.Bounds(_6b1.lon,_6b1.lat,_6b2.lon,_6b2.lat);
},getLonLatFromOverviewPx:function(_6b3){
var size=this.ovmap.size;
var res=this.ovmap.getResolution();
var _6b6=this.ovmap.getExtent().getCenterLonLat();
var _6b7=_6b3.x-(size.w/2);
var _6b8=_6b3.y-(size.h/2);
return new OpenLayers.LonLat(_6b6.lon+_6b7*res,_6b6.lat-_6b8*res);
},getOverviewPxFromLonLat:function(_6b9){
var res=this.ovmap.getResolution();
var _6bb=this.ovmap.getExtent();
var px=null;
if(_6bb){
px=new OpenLayers.Pixel(Math.round(1/res*(_6b9.lon-_6bb.left)),Math.round(1/res*(_6bb.top-_6b9.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(_6bf){
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 _6c3=new OpenLayers.Pixel(px.x+sz.w/2,px.y);
this._addButton("panup","north-mini.png",_6c3,sz);
px.y=_6c3.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",_6c3.add(0,sz.h*2),sz);
this._addButton("zoomin","zoom-plus-mini.png",_6c3.add(0,sz.h*3+5),sz);
this._addButton("zoomworld","zoom-world-mini.png",_6c3.add(0,sz.h*4+5),sz);
this._addButton("zoomout","zoom-minus-mini.png",_6c3.add(0,sz.h*5+5),sz);
return this.div;
},_addButton:function(id,img,xy,sz){
var _6c8=OpenLayers.Util.getImagesLocation()+img;
var btn=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_PanZoom_"+id,xy,sz,_6c8,"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 _6cf=new OpenLayers.Pixel(px.x+sz.w/2,px.y);
var _6d0=sz.w;
if(this.zoomWorldIcon){
_6cf=new OpenLayers.Pixel(px.x+sz.w,px.y);
}
this._addButton("panup","north-mini.png",_6cf,sz);
px.y=_6cf.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);
_6d0*=2;
}
this._addButton("panright","east-mini.png",px.add(_6d0,0),sz);
this._addButton("pandown","south-mini.png",_6cf.add(0,sz.h*2),sz);
this._addButton("zoomin","zoom-plus-mini.png",_6cf.add(0,sz.h*3+5),sz);
_6cf=this._addZoomBar(_6cf.add(0,sz.h*4+5));
this._addButton("zoomout","zoom-minus-mini.png",_6cf,sz);
return this.div;
},_addZoomBar:function(_6d1){
var _6d2=OpenLayers.Util.getImagesLocation();
var id="OpenLayers_Control_PanZoomBar_Slider"+this.map.id;
var _6d4=this.map.getNumZoomLevels()-1-this.map.getZoom();
var _6d5=OpenLayers.Util.createAlphaImageDiv(id,_6d1.add(-1,_6d4*this.zoomStopHeight),new OpenLayers.Size(20,9),_6d2+"slider.png","absolute");
this.slider=_6d5;
this.sliderEvents=new OpenLayers.Events(this,_6d5,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,_6d1,new OpenLayers.Size(sz.w,this.zoomStopHeight),_6d2+"zoombar.png","absolute",null,"crop");
div.style.height=sz.h;
}else{
div=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,_6d1,sz,_6d2+"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(_6d5);
this.map.events.register("zoomend",this,this.moveZoomBar);
_6d1=_6d1.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());
return _6d1;
},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 _6dc=(y-top)/this.zoomStopHeight;
if(!this.map.fractionalZoom){
_6dc=Math.floor(_6dc);
}
var zoom=(this.map.getNumZoomLevels()-1)-_6dc;
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 _6e0=this.mouseDragStart.y-evt.xy.y;
var _6e1=OpenLayers.Util.pagePosition(this.zoombarDiv);
if((evt.clientY-_6e1[1])>0&&(evt.clientY-_6e1[1])<parseInt(this.zoombarDiv.style.height)-2){
var _6e2=parseInt(this.slider.style.top)-_6e0;
this.slider.style.top=_6e2+"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 _6e4=this.zoomStart.y-evt.xy.y;
var _6e5=this.map.zoom;
if(this.map.fractionalZoom){
_6e5+=_6e4/this.zoomStopHeight;
_6e5=Math.min(Math.max(_6e5,0),this.map.getNumZoomLevels()-1);
}else{
_6e5+=Math.round(_6e4/this.zoomStopHeight);
}
this.map.zoomTo(_6e5);
this.moveZoomBar();
this.mouseDragStart=null;
OpenLayers.Event.stop(evt);
}
},moveZoomBar:function(){
var _6e6=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;
this.slider.style.top=_6e6+"px";
},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});
OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(_6e7){
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 _6ea=this.map.controls[i];
if((_6ea!=this)&&(_6ea.CLASS_NAME=="OpenLayers.Control.ArgParser")){
if(_6ea.displayProjection!=this.displayProjection){
this.displayProjection=_6ea.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 _6ed=this.map.layers[i];
var c=this.layers.charAt(i);
if(c=="B"){
this.map.setBaseLayer(_6ed);
}else{
if((c=="T")||(c=="F")){
_6ed.setVisibility(c=="T");
}
}
}
}
},CLASS_NAME:"OpenLayers.Control.ArgParser"});
OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{element:null,base:"",displayProjection:null,initialize:function(_6ef,base,_6f1){
OpenLayers.Control.prototype.initialize.apply(this,[_6f1]);
this.element=OpenLayers.Util.getElement(_6ef);
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 _6f4=this.map.controls[i];
if(_6f4.CLASS_NAME=="OpenLayers.Control.ArgParser"){
if(_6f4.displayProjection!=this.displayProjection){
this.displayProjection=_6f4.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 _6f5=this.map.getCenter();
if(!_6f5){
return;
}
var _6f6=OpenLayers.Util.getParameters(this.base);
_6f6.zoom=this.map.getZoom();
var lat=_6f5.lat;
var lon=_6f5.lon;
if(this.displayProjection){
var _6f9=OpenLayers.Projection.transform({x:lon,y:lat},this.map.getProjectionObject(),this.displayProjection);
lon=_6f9.x;
lat=_6f9.y;
}
_6f6.lat=Math.round(lat*100000)/100000;
_6f6.lon=Math.round(lon*100000)/100000;
_6f6.layers="";
for(var i=0;i<this.map.layers.length;i++){
var _6fb=this.map.layers[i];
if(_6fb.isBaseLayer){
_6f6.layers+=(_6fb==this.map.baseLayer)?"B":"0";
}else{
_6f6.layers+=(_6fb.getVisibility())?"T":"F";
}
}
var href=this.base;
if(href.indexOf("?")!=-1){
href=href.substring(0,href.indexOf("?"));
}
href+="?"+OpenLayers.Util.getParameterString(_6f6);
this.element.href=href;
},CLASS_NAME:"OpenLayers.Control.Permalink"});
OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(_6fd,_6fe){
OpenLayers.Control.prototype.initialize.apply(this,[_6fe]);
this.element=OpenLayers.Util.getElement(_6fd);
},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 _6ff=this.map.getScale();
if(!_6ff){
return;
}
if(_6ff>=9500&&_6ff<=950000){
_6ff=Math.round(_6ff/1000)+"K";
}else{
if(_6ff>=950000){
_6ff=Math.round(_6ff/1000000)+"M";
}else{
_6ff=Math.round(_6ff);
}
}
this.element.innerHTML=OpenLayers.i18n("scale",{"scaleDenom":_6ff});
},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(_700){
OpenLayers.Control.prototype.initialize.apply(this,[_700]);
},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 _701=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(_702){
var _703=parseInt(Math.log(_702)/Math.log(10));
var _704=Math.pow(10,_703);
var _705=parseInt(_702/_704);
var _706;
if(_705>5){
_706=5;
}else{
if(_705>2){
_706=2;
}else{
_706=1;
}
}
return _706*_704;
},update:function(){
var res=this.map.getResolution();
if(!res){
return;
}
var _708=this.map.units;
var _709=OpenLayers.INCHES_PER_UNIT;
var _70a=this.maxWidth*res*_709[_708];
var _70b;
var _70c;
if(_70a>100000){
_70b=this.topOutUnits;
_70c=this.bottomOutUnits;
}else{
_70b=this.topInUnits;
_70c=this.bottomInUnits;
}
var _70d=_70a/_709[_70b];
var _70e=_70a/_709[_70c];
var _70f=this.getBarLen(_70d);
var _710=this.getBarLen(_70e);
_70d=_70f/_709[_708]*_709[_70b];
_70e=_710/_709[_708]*_709[_70c];
var _711=_70d/res;
var _712=_70e/res;
this.eTop.style.width=Math.round(_711)+"px";
this.eBottom.style.width=Math.round(_712)+"px";
this.eTop.innerHTML=_70f+" "+_70b;
this.eBottom.innerHTML=_710+" "+_70c;
},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(_713){
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(_715){
var _716=this[_715+"Layers"];
if(_716){
for(var i=0;i<_716.length;i++){
var _718=_716[i];
OpenLayers.Event.stopObservingElement(_718.inputElem);
OpenLayers.Event.stopObservingElement(_718.labelSpan);
}
}
this[_715+"LayersDiv"].innerHTML="";
this[_715+"Layers"]=[];
},checkRedraw:function(){
var _719=false;
if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){
_719=true;
}else{
for(var i=0;i<this.layerStates.length;i++){
var _71b=this.layerStates[i];
var _71c=this.map.layers[i];
if((_71b.name!=_71c.name)||(_71b.inRange!=_71c.inRange)||(_71b.id!=_71c.id)||(_71b.visibility!=_71c.visibility)){
_719=true;
break;
}
}
}
return _719;
},redraw:function(){
if(!this.checkRedraw()){
return this.div;
}
this.clearLayersArray("base");
this.clearLayersArray("data");
var _71d=false;
var _71e=false;
this.layerStates=new Array(this.map.layers.length);
for(var i=0;i<this.map.layers.length;i++){
var _720=this.map.layers[i];
this.layerStates[i]={"name":_720.name,"visibility":_720.visibility,"inRange":_720.inRange,"id":_720.id};
}
var _721=this.map.layers.slice();
if(!this.ascending){
_721.reverse();
}
for(var i=0;i<_721.length;i++){
var _720=_721[i];
var _722=_720.isBaseLayer;
if(_720.displayInLayerSwitcher){
if(_722){
_71e=true;
}else{
_71d=true;
}
var _723=(_722)?(_720==this.map.baseLayer):_720.getVisibility();
var _724=document.createElement("input");
_724.id="input_"+_720.name;
_724.name=(_722)?"baseLayers":_720.name;
_724.type=(_722)?"radio":"checkbox";
_724.value=_720.name;
_724.checked=_723;
_724.defaultChecked=_723;
if(!_722&&!_720.inRange){
_724.disabled=true;
}
var _725={"inputElem":_724,"layer":_720,"layerSwitcher":this};
OpenLayers.Event.observe(_724,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,_725));
var _726=document.createElement("span");
if(!_722&&!_720.inRange){
_726.style.color="gray";
}
_726.innerHTML=_720.name;
_726.style.verticalAlign=(_722)?"bottom":"baseline";
OpenLayers.Event.observe(_726,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,_725));
var br=document.createElement("br");
var _728=(_722)?this.baseLayers:this.dataLayers;
_728.push({"layer":_720,"inputElem":_724,"labelSpan":_726});
var _729=(_722)?this.baseLayersDiv:this.dataLayersDiv;
_729.appendChild(_724);
_729.appendChild(_726);
_729.appendChild(br);
}
}
this.dataLbl.style.display=(_71d)?"":"none";
this.baseLbl.style.display=(_71e)?"":"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 _72d=this.baseLayers[i];
if(_72d.inputElem.checked){
this.map.setBaseLayer(_72d.layer,false);
}
}
for(var i=0;i<this.dataLayers.length;i++){
var _72d=this.dataLayers[i];
_72d.layer.setVisibility(_72d.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(_730){
this.maximizeDiv.style.display=_730?"":"none";
this.minimizeDiv.style.display=_730?"none":"";
this.layersDiv.style.display=_730?"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 _731=OpenLayers.Util.getImagesLocation();
var sz=new OpenLayers.Size(18,18);
var img=_731+"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=_731+"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(_737,_738,_739){
OpenLayers.Control.prototype.initialize.apply(this,[_739]);
this.callbacks=OpenLayers.Util.extend({done:this.drawFeature},this.callbacks);
this.layer=_737;
this.handler=new _738(this,this.callbacks,this.handlerOptions);
},drawFeature:function(_73a){
var _73b=new OpenLayers.Feature.Vector(_73a);
this.layer.addFeatures([_73b]);
this.featureAdded(_73b);
},CLASS_NAME:"OpenLayers.Control.DrawFeature"});
OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(_73c,_73d){
},onDrag:function(_73e,_73f){
},onComplete:function(_740,_741){
},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(_742,_743){
OpenLayers.Control.prototype.initialize.apply(this,[_743]);
this.layer=_742;
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(_744){
if(!this.handlers.drag.dragging){
this.feature=_744;
this.handlers.drag.activate();
this.over=true;
this.map.div.style.cursor="move";
}else{
if(this.feature.id==_744.id){
this.over=true;
}else{
this.over=false;
}
}
},downFeature:function(_745){
this.lastPixel=_745;
this.onStart(this.feature,_745);
},moveFeature:function(_746){
var res=this.map.getResolution();
this.feature.geometry.move(res*(_746.x-this.lastPixel.x),res*(this.lastPixel.y-_746.y));
this.layer.drawFeature(this.feature);
this.lastPixel=_746;
this.onDrag(this.feature,_746);
},upFeature:function(_748){
if(!this.over){
this.handlers.drag.deactivate();
this.feature=null;
this.map.div.style.cursor="default";
}
},doneDragging:function(_749){
this.onComplete(this.feature,_749);
},outFeature:function(_74a){
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==_74a.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(_74c,_74d){
this.layer=_74c;
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,[_74d]);
if(!(this.deleteCodes instanceof Array)){
this.deleteCodes=[this.deleteCodes];
}
var _74e=this;
var _74f={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle};
this.selectControl=new OpenLayers.Control.SelectFeature(_74c,_74f);
this.layer.events.on({"featureselected":this.selectFeature,"featureunselected":this.unselectFeature,scope:this});
var _750={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(_751,_752){
_74e.dragStart.apply(_74e,[_751,_752]);
},onDrag:function(_753){
_74e.dragVertex.apply(_74e,[_753]);
},onComplete:function(_754){
_74e.dragComplete.apply(_74e,[_754]);
}};
this.dragControl=new OpenLayers.Control.DragFeature(_74c,_750);
var _755={keypress:this.handleKeypress};
this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,_755)};
},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 _756=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();
_756=true;
}
return _756;
},selectFeature:function(_757){
this.feature=_757.feature;
this.resetVertices();
this.dragControl.activate();
this.onModificationStart(this.feature);
this.layer.events.triggerEvent("beforefeaturemodified",{feature:this.feature});
},unselectFeature:function(_758){
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(_758.feature);
this.layer.events.triggerEvent("afterfeaturemodified",{feature:_758.feature});
},dragStart:function(_759,_75a){
if(_759!=this.feature&&!_759.geometry.parent&&_759!=this.dragHandle&&_759!=this.radiusHandle){
if(this.feature){
this.selectControl.clickFeature.apply(this.selectControl,[this.feature]);
}
if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,_759.geometry.CLASS_NAME)!=-1){
this.selectControl.clickFeature.apply(this.selectControl,[_759]);
this.dragControl.overFeature.apply(this.dragControl,[_759]);
this.dragControl.lastPixel=_75a;
this.dragControl.handlers.drag.started=true;
this.dragControl.handlers.drag.start=_75a;
this.dragControl.handlers.drag.last=_75a;
}
}
},dragVertex:function(_75b){
if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){
if(this.feature!=_75b){
this.feature=_75b;
}
}else{
if(_75b._index){
_75b.geometry.parent.addComponent(_75b.geometry,_75b._index);
delete _75b._index;
OpenLayers.Util.removeItem(this.virtualVertices,_75b);
this.vertices.push(_75b);
}else{
if(_75b==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(_75b);
},dragComplete:function(_75c){
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 _75e=this.dragControl.feature;
if(_75e&&OpenLayers.Util.indexOf(this.vertices,_75e)!=-1&&!this.dragControl.handlers.drag.dragging&&_75e.geometry.parent){
_75e.geometry.parent.removeComponent(_75e.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 _75f=this;
function collectComponentVertices(_760){
var i,_762,_763;
if(_760.CLASS_NAME=="OpenLayers.Geometry.Point"){
_762=new OpenLayers.Feature.Vector(_760);
_75f.vertices.push(_762);
}else{
var _764=_760.components.length;
if(_760.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){
_764-=1;
}
for(i=0;i<_764;++i){
_763=_760.components[i];
if(_763.CLASS_NAME=="OpenLayers.Geometry.Point"){
_762=new OpenLayers.Feature.Vector(_763);
_75f.vertices.push(_762);
}else{
collectComponentVertices(_763);
}
}
if(_760.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){
for(i=0;i<_760.components.length-1;++i){
var _765=_760.components[i];
var _766=_760.components[i+1];
if(_765.CLASS_NAME=="OpenLayers.Geometry.Point"&&_766.CLASS_NAME=="OpenLayers.Geometry.Point"){
var x=(_765.x+_766.x)/2;
var y=(_765.y+_766.y)/2;
var _769=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(x,y),null,_75f.virtualStyle);
_769.geometry.parent=_760;
_769._index=i+1;
_75f.virtualVertices.push(_769);
}
}
}
}
};
collectComponentVertices.call(this,this.feature.geometry);
this.layer.addFeatures(this.vertices,{silent:true});
this.layer.addFeatures(this.virtualVertices,{silent:true});
},collectDragHandle:function(){
var _76a=this.feature.geometry;
var _76b=_76a.getBounds().getCenterLonLat();
var _76c=new OpenLayers.Geometry.Point(_76b.lon,_76b.lat);
var _76d=new OpenLayers.Feature.Vector(_76c);
_76c.move=function(x,y){
OpenLayers.Geometry.Point.prototype.move.call(this,x,y);
_76a.move(x,y);
};
this.dragHandle=_76d;
this.layer.addFeatures([this.dragHandle],{silent:true});
},collectRadiusHandle:function(){
var _770=this.feature.geometry;
var _771=_770.getBounds();
var _772=_771.getCenterLonLat();
var _773=new OpenLayers.Geometry.Point(_772.lon,_772.lat);
var _774=new OpenLayers.Geometry.Point(_771.right,_771.bottom);
var _775=new OpenLayers.Feature.Vector(_774);
var _776=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);
var _777=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);
_774.move=function(x,y){
OpenLayers.Geometry.Point.prototype.move.call(this,x,y);
var dx1=this.x-_773.x;
var dy1=this.y-_773.y;
var dx0=dx1-x;
var dy0=dy1-y;
if(_777){
var a0=Math.atan2(dy0,dx0);
var a1=Math.atan2(dy1,dx1);
var _780=a1-a0;
_780*=180/Math.PI;
_770.rotate(_780,_773);
}
if(_776){
var l0=Math.sqrt((dx0*dx0)+(dy0*dy0));
var l1=Math.sqrt((dx1*dx1)+(dy1*dy1));
_770.resize(l1/l0,_773);
}
};
this.radiusHandle=_775;
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(_784){
OpenLayers.Control.prototype.initialize.apply(this,[_784]);
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 _78a=this.controls[i].panel_div;
if(this.controls[i].active){
_78a.className=this.controls[i].displayClass+"ItemActive";
}else{
_78a.className=this.controls[i].displayClass+"ItemInactive";
}
this.div.appendChild(_78a);
}
}
},activateControl:function(_78b){
if(!this.active){
return false;
}
if(_78b.type==OpenLayers.Control.TYPE_BUTTON){
_78b.trigger();
return;
}
if(_78b.type==OpenLayers.Control.TYPE_TOGGLE){
if(_78b.active){
_78b.deactivate();
}else{
_78b.activate();
}
return;
}
for(var i=0;i<this.controls.length;i++){
if(this.controls[i]!=_78b){
if(this.controls[i].type!=OpenLayers.Control.TYPE_TOGGLE){
this.controls[i].deactivate();
}
}
}
_78b.activate();
},addControls:function(_78d){
if(!(_78d instanceof Array)){
_78d=[_78d];
}
this.controls=this.controls.concat(_78d);
for(var i=0;i<_78d.length;i++){
var _78f=document.createElement("div");
var _790=document.createTextNode(" ");
_78d[i].panel_div=_78f;
if(_78d[i].title!=""){
_78d[i].panel_div.title=_78d[i].title;
}
OpenLayers.Event.observe(_78d[i].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,_78d[i]));
OpenLayers.Event.observe(_78d[i].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop));
}
if(this.map){
for(var i=0;i<_78d.length;i++){
this.map.addControl(_78d[i]);
_78d[i].deactivate();
_78d[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(_793,_794){
var test=(typeof _794.test=="function");
var _796=OpenLayers.Array.filter(this.controls,function(item){
return item[_793]==_794||(test&&_794.test(item[_793]));
});
return _796;
},getControlsByName:function(_798){
return this.getControlsBy("name",_798);
},getControlsByClass:function(_799){
return this.getControlsBy("CLASS_NAME",_799);
},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(_79a,_79b){
OpenLayers.Control.prototype.initialize.apply(this,[_79b]);
this.layer=_79a;
this.callbacks=OpenLayers.Util.extend({click:this.clickFeature,clickout:this.clickoutFeature,over:this.overFeature,out:this.outFeature},this.callbacks);
var _79c={geometryTypes:this.geometryTypes};
this.handler=new OpenLayers.Handler.Feature(this,_79a,this.callbacks,_79c);
},unselectAll:function(_79d){
var _79e;
for(var i=this.layer.selectedFeatures.length-1;i>=0;--i){
_79e=this.layer.selectedFeatures[i];
if(!_79d||_79d.except!=_79e){
this.unselect(_79e);
}
}
},clickFeature:function(_7a0){
if(!this.hover){
var _7a1=(OpenLayers.Util.indexOf(this.layer.selectedFeatures,_7a0)>-1);
if(_7a1){
if(this.toggleSelect()){
this.unselect(_7a0);
}else{
if(!this.multipleSelect()){
this.unselectAll({except:_7a0});
}
}
}else{
if(!this.multipleSelect()){
this.unselectAll({except:_7a0});
}
this.select(_7a0);
}
}
},multipleSelect:function(){
return this.multiple||this.handler.evt[this.multipleKey];
},toggleSelect:function(){
return this.toggle||this.handler.evt[this.toggleKey];
},clickoutFeature:function(_7a2){
if(!this.hover&&this.clickout){
this.unselectAll();
}
},overFeature:function(_7a3){
if(this.hover&&(OpenLayers.Util.indexOf(this.layer.selectedFeatures,_7a3)==-1)){
this.select(_7a3);
}
},outFeature:function(_7a4){
if(this.hover){
this.unselect(_7a4);
}
},select:function(_7a5){
this.layer.selectedFeatures.push(_7a5);
var _7a6=this.selectStyle||this.renderIntent;
this.layer.drawFeature(_7a5,_7a6);
this.layer.events.triggerEvent("featureselected",{feature:_7a5});
this.onSelect(_7a5);
},unselect:function(_7a7){
this.layer.drawFeature(_7a7,"default");
OpenLayers.Util.removeItem(this.layer.selectedFeatures,_7a7);
this.layer.events.triggerEvent("featureunselected",{feature:_7a7});
this.onUnselect(_7a7);
},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(_7a9){
OpenLayers.Control.prototype.initialize.apply(this,[_7a9]);
this.registry=OpenLayers.Util.extend({"moveend":function(){
return {center:this.map.getCenter(),resolution:this.map.getResolution()};
}},this.registry);
this.clear();
var _7aa={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+"Previous"};
OpenLayers.Util.extend(_7aa,this.previousOptions);
this.previous=new OpenLayers.Control.Button(_7aa);
var _7ab={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+"Next"};
OpenLayers.Util.extend(_7ab,this.nextOptions);
this.next=new OpenLayers.Control.Button(_7ab);
},onPreviousChange:function(_7ac,_7ad){
if(_7ac&&!this.previous.active){
this.previous.activate();
}else{
if(!_7ac&&this.previous.active){
this.previous.deactivate();
}
}
},onNextChange:function(_7ae,_7af){
if(_7ae&&!this.next.active){
this.next.activate();
}else{
if(!_7ae&&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 _7b2=this.previousStack.shift();
var _7b3=this.previousStack.shift();
if(_7b3!=undefined){
this.nextStack.unshift(_7b2);
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);
}else{
this.previousStack.unshift(_7b2);
}
return _7b3;
},nextTrigger:function(){
var _7b4=this.nextStack.shift();
if(_7b4!=undefined){
this.previousStack.unshift(_7b4);
this.restoring=true;
this.restore(_7b4);
this.restoring=false;
this.onNextChange(this.nextStack[0],this.nextStack.length);
this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);
}
return _7b4;
},clear:function(){
this.previousStack=[];
this.nextStack=[];
},restore:function(_7b5){
var zoom=this.map.getZoomForResolution(_7b5.resolution);
this.map.setCenter(_7b5.center,zoom);
},setListeners:function(){
this.listeners={};
for(var type in this.registry){
this.listeners[type]=OpenLayers.Function.bind(function(){
if(!this.restoring){
var _7b8=this.registry[type].apply(this,arguments);
this.previousStack.unshift(_7b8);
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 _7b9=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]);
}
_7b9=true;
if(this.previousStack.length==0){
this.initStack();
}
}
}
return _7b9;
},initStack:function(){
if(this.map.getCenter()){
this.listeners.moveend();
}
},deactivate:function(){
var _7bb=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();
}
_7bb=true;
}
}
return _7bb;
},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(_7bd){
if(_7bd){
this.bounds=_7bd.clone();
}
},clearBounds:function(){
this.bounds=null;
if(this.parent){
this.parent.clearBounds();
}
},extendBounds:function(_7be){
var _7bf=this.getBounds();
if(!_7bf){
this.setBounds(_7be);
}else{
this.bounds.extend(_7be);
}
},getBounds:function(){
if(this.bounds==null){
this.calculateBounds();
}
return this.bounds;
},calculateBounds:function(){
},atPoint:function(_7c0,_7c1,_7c2){
var _7c3=false;
var _7c4=this.getBounds();
if((_7c4!=null)&&(_7c0!=null)){
var dX=(_7c1!=null)?_7c1:0;
var dY=(_7c2!=null)?_7c2:0;
var _7c7=new OpenLayers.Bounds(this.bounds.left-dX,this.bounds.bottom-dY,this.bounds.right+dX,this.bounds.top+dY);
_7c3=_7c7.containsLonLat(_7c0);
}
return _7c3;
},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,_7ca){
var _7cb=false;
var _7cc=seg1.x1-seg2.x1;
var _7cd=seg1.y1-seg2.y1;
var _7ce=seg1.x2-seg1.x1;
var _7cf=seg1.y2-seg1.y1;
var _7d0=seg2.y2-seg2.y1;
var _7d1=seg2.x2-seg2.x1;
var d=(_7d0*_7ce)-(_7d1*_7cf);
var n1=(_7d1*_7cd)-(_7d0*_7cc);
var n2=(_7ce*_7cd)-(_7cf*_7cc);
if(d==0){
if(n1==0&&n2==0){
_7cb=true;
}
}else{
var _7d5=n1/d;
var _7d6=n2/d;
if(_7d5>=0&&_7d5<=1&&_7d6>=0&&_7d6<=1){
if(!_7ca){
_7cb=true;
}else{
var x=seg1.x1+(_7d5*_7ce);
var y=seg1.y1+(_7d5*_7cf);
_7cb=new OpenLayers.Geometry.Point(x,y);
}
}
}
return _7cb;
};
OpenLayers.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(x,y,_7db,_7dc){
OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
this.x=x;
this.y=y;
this.width=_7db;
this.height=_7dc;
},calculateBounds:function(){
this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height);
},getLength:function(){
var _7dd=(2*this.width)+(2*this.height);
return _7dd;
},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(_7df){
OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
this.components=[];
if(_7df!=null){
this.addComponents(_7df);
}
},destroy:function(){
this.components.length=0;
this.components=null;
},clone:function(){
var _7e0=eval("new "+this.CLASS_NAME+"()");
for(var i=0;i<this.components.length;i++){
_7e0.addComponent(this.components[i].clone());
}
OpenLayers.Util.applyDefaults(_7e0,this);
return _7e0;
},getComponentsString:function(){
var _7e2=[];
for(var i=0;i<this.components.length;i++){
_7e2.push(this.components[i].toShortString());
}
return _7e2.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(_7e5){
if(!(_7e5 instanceof Array)){
_7e5=[_7e5];
}
for(var i=0;i<_7e5.length;i++){
this.addComponent(_7e5[i]);
}
},addComponent:function(_7e7,_7e8){
var _7e9=false;
if(_7e7){
if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,_7e7.CLASS_NAME)>-1)){
if(_7e8!=null&&(_7e8<this.components.length)){
var _7ea=this.components.slice(0,_7e8);
var _7eb=this.components.slice(_7e8,this.components.length);
_7ea.push(_7e7);
this.components=_7ea.concat(_7eb);
}else{
this.components.push(_7e7);
}
_7e7.parent=this;
this.clearBounds();
_7e9=true;
}
}
return _7e9;
},removeComponents:function(_7ec){
if(!(_7ec instanceof Array)){
_7ec=[_7ec];
}
for(var i=_7ec.length-1;i>=0;--i){
this.removeComponent(_7ec[i]);
}
},removeComponent:function(_7ee){
OpenLayers.Util.removeItem(this.components,_7ee);
this.clearBounds();
},getLength:function(){
var _7ef=0;
for(var i=0;i<this.components.length;i++){
_7ef+=this.components[i].getLength();
}
return _7ef;
},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(_7f6,_7f7){
for(var i=0;i<this.components.length;++i){
this.components[i].rotate(_7f6,_7f7);
}
},resize:function(_7f9,_7fa,_7fb){
for(var i=0;i<this.components.length;++i){
this.components[i].resize(_7f9,_7fa,_7fb);
}
},equals:function(_7fd){
var _7fe=true;
if(!_7fd||!_7fd.CLASS_NAME||(this.CLASS_NAME!=_7fd.CLASS_NAME)){
_7fe=false;
}else{
if(!(_7fd.components instanceof Array)||(_7fd.components.length!=this.components.length)){
_7fe=false;
}else{
for(var i=0;i<this.components.length;++i){
if(!this.components[i].equals(_7fd.components[i])){
_7fe=false;
break;
}
}
}
}
return _7fe;
},transform:function(_800,dest){
if(_800&&dest){
for(var i=0;i<this.components.length;i++){
var _803=this.components[i];
_803.transform(_800,dest);
}
}
return this;
},intersects:function(_804){
var _805=false;
for(var i=0;i<this.components.length;++i){
_805=_804.intersects(this.components[i]);
if(_805){
break;
}
}
return _805;
},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(_80a){
var _80b=0;
if((this.x!=null)&&(this.y!=null)&&(_80a!=null)&&(_80a.x!=null)&&(_80a.y!=null)){
var dx2=Math.pow(this.x-_80a.x,2);
var dy2=Math.pow(this.y-_80a.y,2);
_80b=Math.sqrt(dx2+dy2);
}
return _80b;
},equals:function(geom){
var _80f=false;
if(geom!=null){
_80f=((this.x==geom.x&&this.y==geom.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(geom.x)&&isNaN(geom.y)));
}
return _80f;
},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(_812,_813){
_812*=Math.PI/180;
var _814=this.distanceTo(_813);
var _815=_812+Math.atan2(this.y-_813.y,this.x-_813.x);
this.x=_813.x+(_814*Math.cos(_815));
this.y=_813.y+(_814*Math.sin(_815));
this.clearBounds();
},resize:function(_816,_817,_818){
_818=(_818==undefined)?1:_818;
this.x=_817.x+(_816*_818*(this.x-_817.x));
this.y=_817.y+(_816*(this.y-_817.y));
this.clearBounds();
},intersects:function(_819){
var _81a=false;
if(_819.CLASS_NAME=="OpenLayers.Geometry.Point"){
_81a=this.equals(_819);
}else{
_81a=_819.intersects(this);
}
return _81a;
},transform:function(_81b,dest){
if((_81b&&dest)){
OpenLayers.Projection.transform(this,_81b,dest);
}
return this;
},CLASS_NAME:"OpenLayers.Geometry.Point"});
OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(_81d){
OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments);
},addPoint:function(_81e,_81f){
this.addComponent(_81e,_81f);
},removePoint:function(_820){
this.removeComponent(_820);
},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});
OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(_821){
OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments);
},getLength:function(){
var _822=0;
if(this.components&&(this.components.length>1)){
for(var i=1;i<this.components.length;i++){
_822+=this.components[i-1].distanceTo(this.components[i]);
}
}
return _822;
},CLASS_NAME:"OpenLayers.Geometry.Curve"});
OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(_824){
OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments);
},removeComponent:function(_825){
if(this.components&&(this.components.length>2)){
OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);
}
},intersects:function(_826){
var _827=false;
var type=_826.CLASS_NAME;
if(type=="OpenLayers.Geometry.LineString"||type=="OpenLayers.Geometry.LinearRing"||type=="OpenLayers.Geometry.Point"){
var _829=this.getSortedSegments();
var _82a;
if(type=="OpenLayers.Geometry.Point"){
_82a=[{x1:_826.x,y1:_826.y,x2:_826.x,y2:_826.y}];
}else{
_82a=_826.getSortedSegments();
}
var seg1,_82c,_82d,_82e,_82f,seg2,_831,_832;
outer:
for(var i=0;i<_829.length;++i){
seg1=_829[i];
_82c=seg1.x1;
_82d=seg1.x2;
_82e=seg1.y1;
_82f=seg1.y2;
inner:
for(var j=0;j<_82a.length;++j){
seg2=_82a[j];
if(seg2.x1>_82d){
break;
}
if(seg2.x2<_82c){
continue;
}
_831=seg2.y1;
_832=seg2.y2;
if(Math.min(_831,_832)>Math.max(_82e,_82f)){
continue;
}
if(Math.max(_831,_832)<Math.min(_82e,_82f)){
continue;
}
if(OpenLayers.Geometry.segmentsIntersect(seg1,seg2)){
_827=true;
break outer;
}
}
}
}else{
_827=_826.intersects(this);
}
return _827;
},getSortedSegments:function(){
var _835=this.components.length-1;
var _836=new Array(_835);
for(var i=0;i<_835;++i){
point1=this.components[i];
point2=this.components[i+1];
if(point1.x<point2.x){
_836[i]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y};
}else{
_836[i]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y};
}
}
function byX1(seg1,seg2){
return seg1.x1-seg2.x1;
};
return _836.sort(byX1);
},CLASS_NAME:"OpenLayers.Geometry.LineString"});
OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(_83a){
OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments);
},addComponent:function(_83b,_83c){
var _83d=false;
var _83e=this.components.pop();
if(_83c!=null||!_83b.equals(_83e)){
_83d=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments);
}
var _83f=this.components[0];
OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[_83f]);
return _83d;
},removeComponent:function(_840){
if(this.components.length>4){
this.components.pop();
OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);
var _841=this.components[0];
OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[_841]);
}
},move:function(x,y){
for(var i=0;i<this.components.length-1;i++){
this.components[i].move(x,y);
}
},rotate:function(_845,_846){
for(var i=0;i<this.components.length-1;++i){
this.components[i].rotate(_845,_846);
}
},resize:function(_848,_849,_84a){
for(var i=0;i<this.components.length-1;++i){
this.components[i].resize(_848,_849,_84a);
}
},transform:function(_84c,dest){
if(_84c&&dest){
for(var i=0;i<this.components.length-1;i++){
var _84f=this.components[i];
_84f.transform(_84c,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(_855){
var _856=OpenLayers.Number.limitSigDigs;
var digs=14;
var px=_856(_855.x,digs);
var py=_856(_855.y,digs);
function getX(y,x1,y1,x2,y2){
return (((x1-x2)*y)+((x2*y1)-(x1*y2)))/(y1-y2);
};
var _85f=this.components.length-1;
var _860,end,x1,y1,x2,y2,cx,cy;
var _868=0;
for(var i=0;i<_85f;++i){
_860=this.components[i];
x1=_856(_860.x,digs);
y1=_856(_860.y,digs);
end=this.components[i+1];
x2=_856(end.x,digs);
y2=_856(end.y,digs);
if(y1==y2){
if(py==y1){
if(x1<=x2&&(px>=x1&&px<=x2)||x1>=x2&&(px<=x1&&px>=x2)){
_868=-1;
break;
}
}
continue;
}
cx=_856(getX(py,x1,y1,x2,y2),digs);
if(cx==px){
if(y1<y2&&(py>=y1&&py<=y2)||y1>y2&&(py<=y1&&py>=y2)){
_868=-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)){
++_868;
}
}
var _86a=(_868==-1)?1:!!(_868&1);
return _86a;
},intersects:function(_86b){
var _86c=false;
if(_86b.CLASS_NAME=="OpenLayers.Geometry.Point"){
_86c=this.containsPoint(_86b);
}else{
if(_86b.CLASS_NAME=="OpenLayers.Geometry.LineString"){
_86c=_86b.intersects(this);
}else{
if(_86b.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){
_86c=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[_86b]);
}else{
for(var i=0;i<_86b.components.length;++i){
_86c=_86b.components[i].intersects(this);
if(_86c){
break;
}
}
}
}
}
return _86c;
},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});
OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(_86e){
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(_871){
var _872=this.components.length;
var _873=false;
if(_872>0){
_873=this.components[0].containsPoint(_871);
if(_873!==1){
if(_873&&_872>1){
var hole;
for(var i=1;i<_872;++i){
hole=this.components[i].containsPoint(_871);
if(hole){
if(hole===1){
_873=1;
}else{
_873=false;
}
break;
}
}
}
}
}
return _873;
},intersects:function(_876){
var _877=false;
var i;
if(_876.CLASS_NAME=="OpenLayers.Geometry.Point"){
_877=this.containsPoint(_876);
}else{
if(_876.CLASS_NAME=="OpenLayers.Geometry.LineString"||_876.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){
for(i=0;i<this.components.length;++i){
_877=_876.intersects(this.components[i]);
if(_877){
break;
}
}
if(!_877){
for(i=0;i<_876.components.length;++i){
_877=this.containsPoint(_876.components[i]);
if(_877){
break;
}
}
}
}else{
for(i=0;i<_876.components.length;++i){
_877=this.intersects(_876.components[i]);
if(_877){
break;
}
}
}
}
if(!_877&&_876.CLASS_NAME=="OpenLayers.Geometry.Polygon"){
var ring=this.components[0];
for(i=0;i<ring.components.length;++i){
_877=_876.containsPoint(ring.components[i]);
if(_877){
break;
}
}
}
return _877;
},CLASS_NAME:"OpenLayers.Geometry.Polygon"});
OpenLayers.Geometry.Polygon.createRegularPolygon=function(_87a,_87b,_87c,_87d){
var _87e=Math.PI*((1/_87c)-(1/2));
if(_87d){
_87e+=(_87d/180)*Math.PI;
}
var _87f,x,y;
var _882=[];
for(var i=0;i<_87c;++i){
_87f=_87e+(i*2*Math.PI/_87c);
x=_87a.x+(_87b*Math.cos(_87f));
y=_87a.y+(_87b*Math.sin(_87f));
_882.push(new OpenLayers.Geometry.Point(x,y));
}
var ring=new OpenLayers.Geometry.LinearRing(_882);
return new OpenLayers.Geometry.Polygon([ring]);
};
OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(_885){
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(_886){
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(_887){
this.container=OpenLayers.Util.getElement(_887);
},destroy:function(){
this.container=null;
this.extent=null;
this.size=null;
this.resolution=null;
this.map=null;
},supported:function(){
return false;
},setExtent:function(_888){
this.extent=_888.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(_88a,_88b){
if(_88b==null){
_88b=_88a.style;
}
if(_88a.geometry){
this.drawGeometry(_88a.geometry,_88b,_88a.id);
}
},drawGeometry:function(_88c,_88d,_88e){
},clear:function(){
},getFeatureIdFromEvent:function(evt){
},eraseFeatures:function(_890){
if(!(_890 instanceof Array)){
_890=[_890];
}
for(var i=0;i<_890.length;++i){
this.eraseGeometry(_890[i].geometry);
}
},eraseGeometry:function(_892){
},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(_893){
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(_894,_895){
},drawGeometry:function(_896,_897,_898){
var _899=_896.CLASS_NAME;
if((_899=="OpenLayers.Geometry.Collection")||(_899=="OpenLayers.Geometry.MultiPoint")||(_899=="OpenLayers.Geometry.MultiLineString")||(_899=="OpenLayers.Geometry.MultiPolygon")){
for(var i=0;i<_896.components.length;i++){
this.drawGeometry(_896.components[i],_897,_898);
}
return;
}
if(_897.display!="none"){
var _89b=this.getNodeType(_896,_897);
var node=this.nodeFactory(_896.id,_89b);
node._featureId=_898;
node._geometryClass=_896.CLASS_NAME;
node._style=_897;
node=this.drawGeometryNode(node,_896);
if(node.parentNode!=this.root){
this.root.appendChild(node);
}
this.postDraw(node);
}else{
node=OpenLayers.Util.getElement(_896.id);
if(node){
node.parentNode.removeChild(node);
}
}
},drawGeometryNode:function(node,_89e,_89f){
_89f=_89f||node._style;
OpenLayers.Util.applyDefaults(_89f,this.minimumSymbolizer);
var _8a0={"isFilled":true,"isStroked":!!_89f.strokeWidth};
switch(_89e.CLASS_NAME){
case "OpenLayers.Geometry.Point":
this.drawPoint(node,_89e);
break;
case "OpenLayers.Geometry.LineString":
_8a0.isFilled=false;
this.drawLineString(node,_89e);
break;
case "OpenLayers.Geometry.LinearRing":
this.drawLinearRing(node,_89e);
break;
case "OpenLayers.Geometry.Polygon":
this.drawPolygon(node,_89e);
break;
case "OpenLayers.Geometry.Surface":
this.drawSurface(node,_89e);
break;
case "OpenLayers.Geometry.Rectangle":
this.drawRectangle(node,_89e);
break;
default:
break;
}
node._style=_89f;
node._options=_8a0;
return this.setStyle(node,_89f,_8a0,_89e);
},postDraw:function(node){
},drawPoint:function(node,_8a3){
},drawLineString:function(node,_8a5){
},drawLinearRing:function(node,_8a7){
},drawPolygon:function(node,_8a9){
},drawRectangle:function(node,_8ab){
},drawCircle:function(node,_8ad){
},drawSurface:function(node,_8af){
},getFeatureIdFromEvent:function(evt){
var node=evt.target||evt.srcElement;
return node._featureId;
},eraseGeometry:function(_8b2){
if((_8b2.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(_8b2.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(_8b2.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")){
for(var i=0;i<_8b2.components.length;i++){
this.eraseGeometry(_8b2.components[i]);
}
}else{
var _8b4=OpenLayers.Util.getElement(_8b2.id);
if(_8b4&&_8b4.parentNode){
_8b4.parentNode.removeChild(_8b4);
}
}
},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(_8b8){
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 _8b9="http://www.w3.org/TR/SVG11/feature#";
return (document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(_8b9+"SVG","1.1")||document.implementation.hasFeature(_8b9+"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(_8bc){
OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);
var _8bd=this.getResolution();
if(!this.localResolution||_8bd!=this.localResolution){
this.left=-_8bc.left/_8bd;
this.top=_8bc.top/_8bd;
}
var left=0;
var top=0;
if(this.localResolution&&_8bd==this.localResolution){
left=(this.left)-(-_8bc.left/_8bd);
top=(this.top)-(_8bc.top/_8bd);
}
this.localResolution=_8bd;
var _8c0=left+" "+top+" "+_8bc.getWidth()/_8bd+" "+_8bc.getHeight()/_8bd;
this.rendererRoot.setAttributeNS(null,"viewBox",_8c0);
},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(_8c2,_8c3){
var _8c4=null;
switch(_8c2.CLASS_NAME){
case "OpenLayers.Geometry.Point":
_8c4=_8c3.externalGraphic?"image":"circle";
break;
case "OpenLayers.Geometry.Rectangle":
_8c4="rect";
break;
case "OpenLayers.Geometry.LineString":
_8c4="polyline";
break;
case "OpenLayers.Geometry.LinearRing":
_8c4="polygon";
break;
case "OpenLayers.Geometry.Polygon":
case "OpenLayers.Geometry.Curve":
case "OpenLayers.Geometry.Surface":
_8c4="path";
break;
default:
break;
}
return _8c4;
},setStyle:function(node,_8c6,_8c7){
_8c6=_8c6||node._style;
_8c7=_8c7||node._options;
var r=parseFloat(node.getAttributeNS(null,"r"));
if(node._geometryClass=="OpenLayers.Geometry.Point"&&r){
if(_8c6.externalGraphic){
var x=parseFloat(node.getAttributeNS(null,"cx"));
var y=parseFloat(node.getAttributeNS(null,"cy"));
if(_8c6.graphicWidth&&_8c6.graphicHeight){
node.setAttributeNS(null,"preserveAspectRatio","none");
}
var _8cb=_8c6.graphicWidth||_8c6.graphicHeight;
var _8cc=_8c6.graphicHeight||_8c6.graphicWidth;
_8cb=_8cb?_8cb:_8c6.pointRadius*2;
_8cc=_8cc?_8cc:_8c6.pointRadius*2;
var _8cd=(_8c6.graphicXOffset!=undefined)?_8c6.graphicXOffset:-(0.5*_8cb);
var _8ce=(_8c6.graphicYOffset!=undefined)?_8c6.graphicYOffset:-(0.5*_8cc);
var _8cf=_8c6.graphicOpacity||_8c6.fillOpacity;
node.setAttributeNS(null,"x",(x+_8cd).toFixed());
node.setAttributeNS(null,"y",(y+_8ce).toFixed());
node.setAttributeNS(null,"width",_8cb);
node.setAttributeNS(null,"height",_8cc);
node.setAttributeNS("http://www.w3.org/1999/xlink","href",_8c6.externalGraphic);
node.setAttributeNS(null,"style","opacity: "+_8cf);
}else{
node.setAttributeNS(null,"r",_8c6.pointRadius);
}
}
if(_8c7.isFilled){
node.setAttributeNS(null,"fill",_8c6.fillColor);
node.setAttributeNS(null,"fill-opacity",_8c6.fillOpacity);
}else{
node.setAttributeNS(null,"fill","none");
}
if(_8c7.isStroked){
node.setAttributeNS(null,"stroke",_8c6.strokeColor);
node.setAttributeNS(null,"stroke-opacity",_8c6.strokeOpacity);
node.setAttributeNS(null,"stroke-width",_8c6.strokeWidth);
node.setAttributeNS(null,"stroke-linecap",_8c6.strokeLinecap);
}else{
node.setAttributeNS(null,"stroke","none");
}
if(_8c6.pointerEvents){
node.setAttributeNS(null,"pointer-events",_8c6.pointerEvents);
}
if(_8c6.cursor!=null){
node.setAttributeNS(null,"cursor",_8c6.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,_8d6){
this.drawCircle(node,_8d6,1);
},drawCircle:function(node,_8d8,_8d9){
var _8da=this.getResolution();
var x=(_8d8.x/_8da+this.left);
var y=(this.top-_8d8.y/_8da);
if(this.inValidRange(x,y)){
node.setAttributeNS(null,"cx",x);
node.setAttributeNS(null,"cy",y);
node.setAttributeNS(null,"r",_8d9);
}else{
node.setAttributeNS(null,"cx","");
node.setAttributeNS(null,"cy","");
node.setAttributeNS(null,"r",0);
}
},drawLineString:function(node,_8de){
node.setAttributeNS(null,"points",this.getComponentsString(_8de.components));
},drawLinearRing:function(node,_8e0){
node.setAttributeNS(null,"points",this.getComponentsString(_8e0.components));
},drawPolygon:function(node,_8e2){
var d="";
var draw=true;
for(var j=0;j<_8e2.components.length;j++){
var _8e6=_8e2.components[j];
d+=" M";
for(var i=0;i<_8e6.components.length;i++){
var _8e8=this.getShortString(_8e6.components[i]);
if(_8e8){
d+=" "+_8e8;
}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,_8ea){
var _8eb=this.getResolution();
var x=(_8ea.x/_8eb+this.left);
var y=(this.top-_8ea.y/_8eb);
if(this.inValidRange(x,y)){
node.setAttributeNS(null,"x",x);
node.setAttributeNS(null,"y",y);
node.setAttributeNS(null,"width",_8ea.width/_8eb);
node.setAttributeNS(null,"height",_8ea.height/_8eb);
}else{
node.setAttributeNS(null,"x","");
node.setAttributeNS(null,"y","");
node.setAttributeNS(null,"width",0);
node.setAttributeNS(null,"height",0);
}
},drawSurface:function(node,_8ef){
var d=null;
var draw=true;
for(var i=0;i<_8ef.components.length;i++){
if((i%3)==0&&(i/3)==0){
var _8f3=this.getShortString(_8ef.components[i]);
if(!_8f3){
draw=false;
}
d="M "+_8f3;
}else{
if((i%3)==1){
var _8f3=this.getShortString(_8ef.components[i]);
if(!_8f3){
draw=false;
}
d+=" C "+_8f3;
}else{
var _8f3=this.getShortString(_8ef.components[i]);
if(!_8f3){
draw=false;
}
d+=" "+_8f3;
}
}
}
d+=" Z";
if(draw){
node.setAttributeNS(null,"d",d);
}else{
node.setAttributeNS(null,"d","");
}
},getComponentsString:function(_8f4){
var _8f5=[];
for(var i=0;i<_8f4.length;i++){
var _8f7=this.getShortString(_8f4[i]);
if(_8f7){
_8f5.push(_8f7);
}
}
return _8f5.join(",");
},getShortString:function(_8f8){
var _8f9=this.getResolution();
var x=(_8f8.x/_8f9+this.left);
var y=(this.top-_8f8.y/_8f9);
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(_8fc){
if(!this.supported()){
return;
}
if(!document.namespaces.olv){
document.namespaces.add("olv",this.xmlns);
var _8fd=document.createStyleSheet();
_8fd.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(_8fe){
OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);
var _8ff=this.getResolution();
var org=_8fe.left/_8ff+" "+_8fe.top/_8ff;
this.root.setAttribute("coordorigin",org);
var size=_8fe.getWidth()/_8ff+" "+-_8fe.getHeight()/_8ff;
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(_903,_904){
var _905=null;
switch(_903.CLASS_NAME){
case "OpenLayers.Geometry.Point":
_905=_904.externalGraphic?"olv:rect":"olv:oval";
break;
case "OpenLayers.Geometry.Rectangle":
_905="olv:rect";
break;
case "OpenLayers.Geometry.LineString":
case "OpenLayers.Geometry.LinearRing":
case "OpenLayers.Geometry.Polygon":
case "OpenLayers.Geometry.Curve":
case "OpenLayers.Geometry.Surface":
_905="olv:shape";
break;
default:
break;
}
return _905;
},setStyle:function(node,_907,_908,_909){
_907=_907||node._style;
_908=_908||node._options;
if(node._geometryClass=="OpenLayers.Geometry.Point"){
if(_907.externalGraphic){
var _90a=_907.graphicWidth||_907.graphicHeight;
var _90b=_907.graphicHeight||_907.graphicWidth;
_90a=_90a?_90a:_907.pointRadius*2;
_90b=_90b?_90b:_907.pointRadius*2;
var _90c=this.getResolution();
var _90d=(_907.graphicXOffset!=undefined)?_907.graphicXOffset:-(0.5*_90a);
var _90e=(_907.graphicYOffset!=undefined)?_907.graphicYOffset:-(0.5*_90b);
node.style.left=((_909.x/_90c)+_90d).toFixed();
node.style.top=((_909.y/_90c)-(_90e+_90b)).toFixed();
node.style.width=_90a;
node.style.height=_90b;
_907.fillColor="none";
_908.isStroked=false;
}else{
this.drawCircle(node,_909,_907.pointRadius);
}
}
if(_908.isFilled){
node.setAttribute("fillcolor",_907.fillColor);
}else{
node.setAttribute("filled","false");
}
var _90f=node.getElementsByTagName("fill");
var fill=(_90f.length==0)?null:_90f[0];
if(!_908.isFilled){
if(fill){
node.removeChild(fill);
}
}else{
if(!fill){
fill=this.createNode("olv:fill",node.id+"_fill");
}
fill.setAttribute("opacity",_907.fillOpacity);
if(node._geometryClass=="OpenLayers.Geometry.Point"&&_907.externalGraphic){
if(_907.graphicOpacity){
fill.setAttribute("opacity",_907.graphicOpacity);
}
fill.setAttribute("src",_907.externalGraphic);
fill.setAttribute("type","frame");
node.style.flip="y";
if(!(_907.graphicWidth&&_907.graphicHeight)){
fill.aspect="atmost";
}
}
if(fill.parentNode!=node){
node.appendChild(fill);
}
}
if(_908.isStroked){
node.setAttribute("strokecolor",_907.strokeColor);
node.setAttribute("strokeweight",_907.strokeWidth+"px");
}else{
node.setAttribute("stroked","false");
}
var _911=node.getElementsByTagName("stroke");
var _912=(_911.length==0)?null:_911[0];
if(!_908.isStroked){
if(_912){
node.removeChild(_912);
}
}else{
if(!_912){
_912=this.createNode("olv:stroke",node.id+"_stroke");
node.appendChild(_912);
}
_912.setAttribute("opacity",_907.strokeOpacity);
_912.setAttribute("endcap",!_907.strokeLinecap||_907.strokeLinecap=="butt"?"flat":_907.strokeLinecap);
}
if(_907.cursor!=null){
node.style.cursor=_907.cursor;
}
return node;
},postDraw:function(node){
var _914=node._style.fillColor;
var _915=node._style.strokeColor;
if(_914=="none"&&node.getAttribute("fillcolor")!=_914){
node.setAttribute("fillcolor",_914);
}
if(_915=="none"&&node.getAttribute("strokecolor")!=_915){
node.setAttribute("strokecolor",_915);
}
},setNodeDimension:function(node,_917){
var bbox=_917.getBounds();
if(bbox){
var _919=this.getResolution();
var _91a=new OpenLayers.Bounds((bbox.left/_919).toFixed(),(bbox.bottom/_919).toFixed(),(bbox.right/_919).toFixed(),(bbox.top/_919).toFixed());
node.style.left=_91a.left;
node.style.top=_91a.top;
node.style.width=_91a.getWidth();
node.style.height=_91a.getHeight();
node.coordorigin=_91a.left+" "+_91a.top;
node.coordsize=_91a.getWidth()+" "+_91a.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 _920=type;
var _921=_920.indexOf(":");
if(_921!=-1){
_920=_920.substr(_921+1);
}
var _922=node.nodeName;
_921=_922.indexOf(":");
if(_921!=-1){
_922=_922.substr(_921+1);
}
return (_920==_922);
},createRenderRoot:function(){
return this.nodeFactory(this.container.id+"_vmlRoot","div");
},createRoot:function(){
return this.nodeFactory(this.container.id+"_root","olv:group");
},drawPoint:function(node,_924){
this.drawCircle(node,_924,1);
},drawCircle:function(node,_926,_927){
if(!isNaN(_926.x)&&!isNaN(_926.y)){
var _928=this.getResolution();
node.style.left=(_926.x/_928).toFixed()-_927;
node.style.top=(_926.y/_928).toFixed()-_927;
var _929=_927*2;
node.style.width=_929;
node.style.height=_929;
}
},drawLineString:function(node,_92b){
this.drawLine(node,_92b,false);
},drawLinearRing:function(node,_92d){
this.drawLine(node,_92d,true);
},drawLine:function(node,_92f,_930){
this.setNodeDimension(node,_92f);
var _931=this.getResolution();
var _932=_92f.components.length;
var _933=new Array(_932);
var comp,x,y;
for(var i=0;i<_932;i++){
comp=_92f.components[i];
x=(comp.x/_931);
y=(comp.y/_931);
_933[i]=" "+x.toFixed()+","+y.toFixed()+" l ";
}
var end=(_930)?" x e":" e";
node.path="m"+_933.join("")+end;
},drawPolygon:function(node,_93a){
this.setNodeDimension(node,_93a);
var _93b=this.getResolution();
var path=[];
var _93d,i,comp,x,y;
for(var j=0;j<_93a.components.length;j++){
_93d=_93a.components[j];
path.push("m");
for(i=0;i<_93d.components.length;i++){
comp=_93d.components[i];
x=comp.x/_93b;
y=comp.y/_93b;
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,_944){
var _945=this.getResolution();
node.style.left=_944.x/_945;
node.style.top=_944.y/_945;
node.style.width=_944.width/_945;
node.style.height=_944.height/_945;
},drawSurface:function(node,_947){
this.setNodeDimension(node,_947);
var _948=this.getResolution();
var path=[];
var comp,x,y;
for(var i=0;i<_947.components.length;i++){
comp=_947.components[i];
x=comp.x/_948;
y=comp.y/_948;
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,_94f){
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 _951=OpenLayers.Renderer[this.renderers[i]];
if(_951&&_951.prototype.supported()){
this.renderer=new _951(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(_953,_954,_955){
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
if(!_955){
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 _956=this.map.getExtent();
this.renderer.setExtent(_956);
this.renderer.root.style.visibility="visible";
}
if(!this.drawn||_954){
this.drawn=true;
for(var i=0;i<this.features.length;i++){
var _958=this.features[i];
this.drawFeature(_958);
}
}
},addFeatures:function(_959,_95a){
if(!(_959 instanceof Array)){
_959=[_959];
}
var _95b=!_95a||!_95a.silent;
for(var i=0;i<_959.length;i++){
var _95d=_959[i];
if(this.geometryType&&!(_95d.geometry instanceof this.geometryType)){
var _95e=OpenLayers.i18n("componentShouldBe",{"geomType":this.geometryType.prototype.CLASS_NAME});
throw _95e;
}
this.features.push(_95d);
_95d.layer=this;
if(!_95d.style&&this.style){
_95d.style=OpenLayers.Util.extend({},this.style);
}
if(_95b){
this.events.triggerEvent("beforefeatureadded",{feature:_95d});
this.preFeatureInsert(_95d);
}
if(this.drawn){
this.drawFeature(_95d);
}
if(_95b){
this.events.triggerEvent("featureadded",{feature:_95d});
this.onFeatureInsert(_95d);
}
}
if(_95b){
this.events.triggerEvent("featuresadded",{features:_959});
}
},removeFeatures:function(_95f){
if(!(_95f instanceof Array)){
_95f=[_95f];
}
for(var i=_95f.length-1;i>=0;i--){
var _961=_95f[i];
this.features=OpenLayers.Util.removeItem(this.features,_961);
if(_961.geometry){
this.renderer.eraseGeometry(_961.geometry);
}
if(OpenLayers.Util.indexOf(this.selectedFeatures,_961)!=-1){
OpenLayers.Util.removeItem(this.selectedFeatures,_961);
}
}
},destroyFeatures:function(_962){
var all=(_962==undefined);
if(all){
_962=this.features;
this.selectedFeatures=[];
}
this.eraseFeatures(_962);
var _964;
for(var i=_962.length-1;i>=0;i--){
_964=_962[i];
if(!all){
OpenLayers.Util.removeItem(this.selectedFeatures,_964);
}
_964.destroy();
}
},drawFeature:function(_966,_967){
if(typeof _967!="object"){
var _968=typeof _967=="string"?_967:_966.renderIntent;
_967=_966.style||this.style;
if(!_967){
_967=this.styleMap.createSymbolizer(_966,_968);
}
}
this.renderer.drawFeature(_966,_967);
},eraseFeatures:function(_969){
this.renderer.eraseFeatures(_969);
},getFeatureFromEvent:function(evt){
if(!this.renderer){
OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));
return null;
}
var _96b=this.renderer.getFeatureIdFromEvent(evt);
return this.getFeatureById(_96b);
},getFeatureById:function(_96c){
var _96d=null;
for(var i=0;i<this.features.length;++i){
if(this.features[i].id==_96c){
_96d=this.features[i];
break;
}
}
return _96d;
},onFeatureInsert:function(_96f){
},preFeatureInsert:function(_970){
},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(_971,_972){
this.rules=[];
this.setDefaultStyle(_971||OpenLayers.Feature.Vector.style["default"]);
OpenLayers.Util.extend(this,_972);
},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(_974){
var _975=this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),_974);
var _976=this.rules;
var rule,_978;
var _979=[];
var _97a=false;
for(var i=0;i<_976.length;i++){
rule=_976[i];
var _97c=rule.evaluate(_974);
if(_97c){
if(rule instanceof OpenLayers.Rule&&rule.elseFilter){
_979.push(rule);
}else{
_97a=true;
this.applySymbolizer(rule,_975,_974);
}
}
}
if(_97a==false&&_979.length>0){
_97a=true;
for(var i=0;i<_979.length;i++){
this.applySymbolizer(_979[i],_975,_974);
}
}
if(_976.length>0&&_97a==false){
_975.display="none";
}else{
_975.display="";
}
return _975;
},applySymbolizer:function(rule,_97e,_97f){
var _980=_97f.geometry?this.getSymbolizerPrefix(_97f.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];
var _981=rule.symbolizer[_980]||rule.symbolizer;
return this.createLiterals(OpenLayers.Util.extend(_97e,_981),_97f);
},createLiterals:function(_982,_983){
var _984=this.context||_983.attributes||_983.data;
for(var i in this.propertyStyles){
_982[i]=OpenLayers.Style.createLiteral(_982[i],_984,_983);
}
return _982;
},findPropertyStyles:function(){
var _986={};
var _987=this.defaultStyle;
this.addPropertyStyles(_986,_987);
var _988=this.rules;
var _989,_98a;
for(var i=0;i<_988.length;i++){
var _989=_988[i].symbolizer;
for(var key in _989){
_98a=_989[key];
if(typeof _98a=="object"){
this.addPropertyStyles(_986,_98a);
}else{
this.addPropertyStyles(_986,_989);
break;
}
}
}
return _986;
},addPropertyStyles:function(_98d,_98e){
var _98f;
for(var key in _98e){
_98f=_98e[key];
if(typeof _98f=="string"&&_98f.match(/\$\{\w+\}/)){
_98d[key]=true;
}
}
return _98d;
},addRules:function(_991){
this.rules=this.rules.concat(_991);
this.propertyStyles=this.findPropertyStyles();
},setDefaultStyle:function(_992){
this.defaultStyle=_992;
this.propertyStyles=this.findPropertyStyles();
},getSymbolizerPrefix:function(_993){
var _994=OpenLayers.Style.SYMBOLIZER_PREFIXES;
for(var i=0;i<_994.length;i++){
if(_993.CLASS_NAME.indexOf(_994[i])!=-1){
return _994[i];
}
}
},CLASS_NAME:"OpenLayers.Style"});
OpenLayers.Style.createLiteral=function(_996,_997,_998){
if(typeof _996=="string"&&_996.indexOf("${")!=-1){
_996=OpenLayers.String.format(_996,_997,[_998]);
_996=(isNaN(_996)||!_996)?_996:parseFloat(_996);
}
return _996;
};
OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon"];
OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(_999,_99a){
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(_999 instanceof OpenLayers.Style){
this.styles["default"]=_999;
this.styles["select"]=_999;
this.styles["temporary"]=_999;
}else{
if(typeof _999=="object"){
for(var key in _999){
if(_999[key] instanceof OpenLayers.Style){
this.styles[key]=_999[key];
}else{
if(typeof _999[key]=="object"){
this.styles[key]=new OpenLayers.Style(_999[key]);
}else{
this.styles["default"]=new OpenLayers.Style(_999);
this.styles["select"]=new OpenLayers.Style(_999);
this.styles["temporary"]=new OpenLayers.Style(_999);
break;
}
}
}
}
}
OpenLayers.Util.extend(this,_99a);
},destroy:function(){
for(var key in this.styles){
this.styles[key].destroy();
}
this.styles=null;
},createSymbolizer:function(_99d,_99e){
if(!_99d){
_99d=new OpenLayers.Feature.Vector();
}
if(!this.styles[_99e]){
_99e="default";
}
_99d.renderIntent=_99e;
var _99f={};
if(this.extendDefault&&_99e!="default"){
_99f=this.styles["default"].createSymbolizer(_99d);
}
return OpenLayers.Util.extend(_99f,this.styles[_99e].createSymbolizer(_99d));
},addUniqueValueRules:function(_9a0,_9a1,_9a2){
var _9a3=[];
for(var _9a4 in _9a2){
_9a3.push(new OpenLayers.Rule({symbolizer:_9a2[_9a4],filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:_9a1,value:_9a4})}));
}
this.styles[_9a0].addRules(_9a3);
},CLASS_NAME:"OpenLayers.StyleMap"});
OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(_9a5,_9a6){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);
if(_9a5){
this.position=_9a5;
}
if(_9a6){
this.direction=_9a6;
}
this.measureDivs=[];
},destroy:function(){
for(var _9a7 in this.buttons){
var btn=this.buttons[_9a7];
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 _9aa=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);
this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",_9aa,sz,"Shift->Drag to zoom to area");
_9aa=_9aa.add((this.direction=="vertical"?0:sz.w),(this.direction=="vertical"?sz.h:0));
this._addButton("pan","panning-hand-off.png","panning-hand-on.png",_9aa,sz,"Drag the map to pan.");
_9aa=_9aa.add((this.direction=="vertical"?0:sz.w),(this.direction=="vertical"?sz.h:0));
this.switchModeTo("pan");
return this.div;
},_addButton:function(id,img,_9ad,xy,sz,_9b0){
var _9b1=OpenLayers.Util.getImagesLocation()+img;
var _9b2=OpenLayers.Util.getImagesLocation()+_9ad;
var btn=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+id,xy,sz,_9b1,"absolute");
this.div.appendChild(btn);
btn.imgLocation=_9b1;
btn.activeImgLocation=_9b2;
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=_9b0;
btn.alt=_9b0;
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 _9b7=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_9b7,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 _9b9="";
if(this.measureStart){
var _9ba=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
_9b9=OpenLayers.Util.distVincenty(this.measureStart,_9ba);
_9b9=Math.round(_9b9*100)/100;
_9b9=_9b9+"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(_9b9){
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=_9b9;
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 _9be=Math.abs(this.mouseDragStart.x-evt.xy.x);
var _9bf=Math.abs(this.mouseDragStart.y-evt.xy.y);
this.zoomBox.style.width=Math.max(1,_9be)+"px";
this.zoomBox.style.height=Math.max(1,_9bf)+"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 _9be=this.mouseDragStart.x-evt.xy.x;
var _9bf=this.mouseDragStart.y-evt.xy.y;
var size=this.map.getSize();
var _9c1=new OpenLayers.Pixel(size.w/2+_9be,size.h/2+_9bf);
var _9c2=this.map.getLonLatFromViewPortPx(_9c1);
this.map.setCenter(_9c2,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(_9c6){
OpenLayers.Control.Panel.prototype.initialize.apply(this,[_9c6]);
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(_9c8,_9c9){
OpenLayers.Control.Panel.prototype.initialize.apply(this,[_9c9]);
this.addControls([new OpenLayers.Control.Navigation()]);
var _9ca=[new OpenLayers.Control.DrawFeature(_9c8,OpenLayers.Handler.Point,{"displayClass":"olControlDrawFeaturePoint"}),new OpenLayers.Control.DrawFeature(_9c8,OpenLayers.Handler.Path,{"displayClass":"olControlDrawFeaturePath"}),new OpenLayers.Control.DrawFeature(_9c8,OpenLayers.Handler.Polygon,{"displayClass":"olControlDrawFeaturePolygon"})];
for(var i=0;i<_9ca.length;i++){
_9ca[i].featureAdded=function(_9cc){
_9cc.state=OpenLayers.State.INSERT;
};
}
this.addControls(_9ca);
},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 _9d0=code.split("-");
_9d0[0]=_9d0[0].toLowerCase();
if(typeof OpenLayers.Lang[_9d0[0]]=="object"){
lang=_9d0[0];
}
if(_9d0[1]){
var _9d1=_9d0[0]+"-"+_9d0[1].toUpperCase();
if(typeof OpenLayers.Lang[_9d1]=="object"){
lang=_9d1;
}
}
if(!lang){
OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+_9d0.join("-")+" dictionary, falling back to default language");
lang=OpenLayers.Lang.defaultCode;
}
OpenLayers.Lang.code=lang;
},translate:function(key,_9d3){
var _9d4=OpenLayers.Lang[OpenLayers.Lang.getCode()];
var _9d5=_9d4[key];
if(!_9d5){
_9d5=key;
}
if(_9d3){
_9d5=OpenLayers.String.format(_9d5,_9d3);
}
return _9d5;
}};
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":""};

