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,_6=_4.length;i<_6;i++){
var _7=_4[i].getAttribute("src");
if(_7){
var _8=_7.lastIndexOf(_3);
var _9=_7.lastIndexOf("?");
if(_9<0){
_9=_7.length;
}
if((_8>-1)&&(_8+_3.length==_9)){
_2=_7.slice(0,_9-_3.length);
break;
}
}
}
return _2;
}};
if(!_1){
var _a=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","Gears/gears_init.js","OpenLayers/Ajax.js","OpenLayers/Request.js","OpenLayers/Request/XMLHttpRequest.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/KaMapCache.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/Control/Measure.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/Canvas.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Strategy.js","OpenLayers/Strategy/Fixed.js","OpenLayers/Strategy/Cluster.js","OpenLayers/Strategy/Paging.js","OpenLayers/Strategy/BBOX.js","OpenLayers/Protocol.js","OpenLayers/Protocol/HTTP.js","OpenLayers/Protocol/SQL.js","OpenLayers/Protocol/SQL/Gears.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/Filter/Spatial.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/GML.js","OpenLayers/Format/GML/Base.js","OpenLayers/Format/GML/v2.js","OpenLayers/Format/GML/v3.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/GPX.js","OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/Filter.js","OpenLayers/Format/Filter/v1.js","OpenLayers/Format/Filter/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/PanPanel.js","OpenLayers/Control/Pan.js","OpenLayers/Control/ZoomIn.js","OpenLayers/Control/ZoomOut.js","OpenLayers/Control/ZoomPanel.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");
var _b=navigator.userAgent;
var _c=(_b.match("MSIE")||_b.match("Safari"));
if(_c){
var _d=new Array(_a.length);
}
var _e=OpenLayers._getScriptLocation()+"lib/";
for(var i=0,len=_a.length;i<len;i++){
if(_c){
_d[i]="<script src='"+_e+_a[i]+"'></script>";
}else{
var s=document.createElement("script");
s.src=_e+_a[i];
var h=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;
h.appendChild(s);
}
}
if(_c){
document.write(_d.join(""));
}
}
})();
OpenLayers.VERSION_NUMBER="$Revision: 8012 $";
OpenLayers.Util={};
OpenLayers.Util.getElement=function(){
var _13=[];
for(var i=0,len=arguments.length;i<len;i++){
var _16=arguments[i];
if(typeof _16=="string"){
_16=document.getElementById(_16);
}
if(arguments.length==1){
return _16;
}
_13.push(_16);
}
return _13;
};
if($==null){
var $=OpenLayers.Util.getElement;
}
OpenLayers.Util.extend=function(_17,_18){
_17=_17||{};
if(_18){
for(var _19 in _18){
var _1a=_18[_19];
if(_1a!==undefined){
_17[_19]=_1a;
}
}
var _1b=typeof window.Event=="function"&&_18 instanceof window.Event;
if(!_1b&&_18.hasOwnProperty&&_18.hasOwnProperty("toString")){
_17.toString=_18.toString;
}
}
return _17;
};
OpenLayers.Util.removeItem=function(_1c,_1d){
for(var i=_1c.length-1;i>=0;i--){
if(_1c[i]==_1d){
_1c.splice(i,1);
}
}
return _1c;
};
OpenLayers.Util.clearArray=function(_1f){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"array = []"}));
_1f.length=0;
};
OpenLayers.Util.indexOf=function(_20,obj){
for(var i=0,len=_20.length;i<len;i++){
if(_20[i]==obj){
return i;
}
}
return -1;
};
OpenLayers.Util.modifyDOMElement=function(_24,id,px,sz,_28,_29,_2a,_2b){
if(id){
_24.id=id;
}
if(px){
_24.style.left=px.x+"px";
_24.style.top=px.y+"px";
}
if(sz){
_24.style.width=sz.w+"px";
_24.style.height=sz.h+"px";
}
if(_28){
_24.style.position=_28;
}
if(_29){
_24.style.border=_29;
}
if(_2a){
_24.style.overflow=_2a;
}
if(parseFloat(_2b)>=0&&parseFloat(_2b)<1){
_24.style.filter="alpha(opacity="+(_2b*100)+")";
_24.style.opacity=_2b;
}else{
if(parseFloat(_2b)==1){
_24.style.filter="";
_24.style.opacity="";
}
}
};
OpenLayers.Util.createDiv=function(id,px,sz,_2f,_30,_31,_32,_33){
var dom=document.createElement("div");
if(_2f){
dom.style.backgroundImage="url("+_2f+")";
}
if(!id){
id=OpenLayers.Util.createUniqueID("OpenLayersDiv");
}
if(!_30){
_30="absolute";
}
OpenLayers.Util.modifyDOMElement(dom,id,px,sz,_30,_31,_32,_33);
return dom;
};
OpenLayers.Util.createImage=function(id,px,sz,_38,_39,_3a,_3b,_3c){
var _3d=document.createElement("img");
if(!id){
id=OpenLayers.Util.createUniqueID("OpenLayersDiv");
}
if(!_39){
_39="relative";
}
OpenLayers.Util.modifyDOMElement(_3d,id,px,sz,_39,_3a,null,_3b);
if(_3c){
_3d.style.display="none";
OpenLayers.Event.observe(_3d,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,_3d));
OpenLayers.Event.observe(_3d,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,_3d));
}
_3d.style.alt=id;
_3d.galleryImg="no";
if(_38){
_3d.src=_38;
}
return _3d;
};
OpenLayers.Util.setOpacity=function(_3e,_3f){
OpenLayers.Util.modifyDOMElement(_3e,null,null,null,null,null,null,_3f);
};
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){
var _40=this.urls;
if(_40&&_40 instanceof Array&&_40.length>1){
var src=this.src.toString();
var _42,k;
for(k=0;_42=_40[k];k++){
if(src.indexOf(_42)!=-1){
break;
}
}
var _44=Math.floor(_40.length*Math.random());
var _45=_40[_44];
k=0;
while(_45==_42&&k++<4){
_44=Math.floor(_40.length*Math.random());
_45=_40[_44];
}
this.src=src.replace(_42,_45);
}else{
this.src=this.src;
}
}else{
this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor;
}
this.style.display="";
};
OpenLayers.Util.alphaHack=function(){
var _46=navigator.appVersion.split("MSIE");
var _47=parseFloat(_46[1]);
var _48=false;
try{
_48=!!(document.body.filters);
}
catch(e){
}
return (_48&&(_47>=5.5)&&(_47<7));
};
OpenLayers.Util.modifyAlphaImageDiv=function(div,id,px,sz,_4d,_4e,_4f,_50,_51){
OpenLayers.Util.modifyDOMElement(div,id,px,sz,_4e,null,null,_51);
var img=div.childNodes[0];
if(_4d){
img.src=_4d;
}
OpenLayers.Util.modifyDOMElement(img,div.id+"_innerImage",null,sz,"relative",_4f);
if(OpenLayers.Util.alphaHack()){
if(div.style.display!="none"){
div.style.display="inline-block";
}
if(_50==null){
_50="scale";
}
div.style.filter="progid:DXImageTransform.Microsoft"+".AlphaImageLoader(src='"+img.src+"', "+"sizingMethod='"+_50+"')";
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,_56,_57,_58,_59,_5a,_5b){
var div=OpenLayers.Util.createDiv();
var img=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);
div.appendChild(img);
if(_5b){
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,_56,_57,_58,_59,_5a);
return div;
};
OpenLayers.Util.upperCaseObject=function(_5e){
var _5f={};
for(var key in _5e){
_5f[key.toUpperCase()]=_5e[key];
}
return _5f;
};
OpenLayers.Util.applyDefaults=function(to,_62){
to=to||{};
var _63=typeof window.Event=="function"&&_62 instanceof window.Event;
for(var key in _62){
if(to[key]===undefined||(!_63&&_62.hasOwnProperty&&_62.hasOwnProperty(key)&&!to.hasOwnProperty(key))){
to[key]=_62[key];
}
}
if(!_63&&_62&&_62.hasOwnProperty&&_62.hasOwnProperty("toString")&&!to.hasOwnProperty("toString")){
to.toString=_62.toString;
}
return to;
};
OpenLayers.Util.getParameterString=function(_65){
var _66=[];
for(var key in _65){
var _68=_65[key];
if((_68!=null)&&(typeof _68!="function")){
var _69;
if(typeof _68=="object"&&_68.constructor==Array){
var _6a=[];
for(var _6b=0,len=_68.length;_6b<len;_6b++){
_6a.push(encodeURIComponent(_68[_6b]));
}
_69=_6a.join(",");
}else{
_69=encodeURIComponent(_68);
}
_66.push(encodeURIComponent(key)+"="+_69);
}
}
return _66.join("&");
};
OpenLayers.ImgPath="";
OpenLayers.Util.getImagesLocation=function(){
return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/");
};
OpenLayers.Util.Try=function(){
var _6d=null;
for(var i=0,len=arguments.length;i<len;i++){
var _70=arguments[i];
try{
_6d=_70();
break;
}
catch(e){
}
}
return _6d;
};
OpenLayers.Util.getNodes=function(p,_72){
var _73=OpenLayers.Util.Try(function(){
return OpenLayers.Util._getNodes(p.documentElement.childNodes,_72);
},function(){
return OpenLayers.Util._getNodes(p.childNodes,_72);
});
return _73;
};
OpenLayers.Util._getNodes=function(_74,_75){
var _76=[];
for(var i=0,len=_74.length;i<len;i++){
if(_74[i].nodeName==_75){
_76.push(_74[i]);
}
}
return _76;
};
OpenLayers.Util.getTagText=function(_79,_7a,_7b){
var _7c=OpenLayers.Util.getNodes(_79,_7a);
if(_7c&&(_7c.length>0)){
if(!_7b){
_7b=0;
}
if(_7c[_7b].childNodes.length>1){
return _7c.childNodes[1].nodeValue;
}else{
if(_7c[_7b].childNodes.length==1){
return _7c[_7b].firstChild.nodeValue;
}
}
}else{
return "";
}
};
OpenLayers.Util.getXmlNodeValue=function(_7d){
var val=null;
OpenLayers.Util.Try(function(){
val=_7d.text;
if(!val){
val=_7d.textContent;
}
if(!val){
val=_7d.firstChild.nodeValue;
}
},function(){
val=_7d.textContent;
});
return val;
};
OpenLayers.Util.mouseLeft=function(evt,div){
var _81=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;
while(_81!=div&&_81!=null){
_81=_81.parentNode;
}
return (_81!=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 _8b=Math.sin(U1),_8c=Math.cos(U1);
var _8d=Math.sin(U2),_8e=Math.cos(U2);
var _8f=L,_90=2*Math.PI;
var _91=20;
while(Math.abs(_8f-_90)>1e-12&&--_91>0){
var _92=Math.sin(_8f),_93=Math.cos(_8f);
var _94=Math.sqrt((_8e*_92)*(_8e*_92)+(_8c*_8d-_8b*_8e*_93)*(_8c*_8d-_8b*_8e*_93));
if(_94==0){
return 0;
}
var _95=_8b*_8d+_8c*_8e*_93;
var _96=Math.atan2(_94,_95);
var _97=Math.asin(_8c*_8e*_92/_94);
var _98=Math.cos(_97)*Math.cos(_97);
var _99=_95-2*_8b*_8d/_98;
var C=f/16*_98*(4+f*(4-3*_98));
_90=_8f;
_8f=L+(1-C)*f*Math.sin(_97)*(_96+C*_94*(_99+C*_95*(-1+2*_99*_99)));
}
if(_91==0){
return NaN;
}
var uSq=_98*(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 _9e=B*_94*(_99+B/4*(_95*(-1+2*_99*_99)-B/6*_99*(-3+4*_94*_94)*(-3+4*_99*_99)));
var s=b*A*(_96-_9e);
var d=s.toFixed(3)/1000;
return d;
};
OpenLayers.Util.getParameters=function(url){
url=url||window.location.href;
var _a2="";
if(OpenLayers.String.contains(url,"?")){
var _a3=url.indexOf("?")+1;
var end=OpenLayers.String.contains(url,"#")?url.indexOf("#"):url.length;
_a2=url.substring(_a3,end);
}
var _a5={};
var _a6=_a2.split(/[&;]/);
for(var i=0,len=_a6.length;i<len;++i){
var _a9=_a6[i].split("=");
if(_a9[0]){
var key=decodeURIComponent(_a9[0]);
var _ab=_a9[1]||"";
_ab=_ab.split(",");
for(var j=0,_ad=_ab.length;j<_ad;j++){
_ab[j]=decodeURIComponent(_ab[j]);
}
if(_ab.length==1){
_ab=_ab[0];
}
_a5[key]=_ab;
}
}
return _a5;
};
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(_af){
if(_af==null){
_af="id_";
}
OpenLayers.Util.lastSeqID+=1;
return _af+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(_b0){
var _b1=(_b0>1)?(1/_b0):_b0;
return _b1;
};
OpenLayers.Util.getResolutionFromScale=function(_b2,_b3){
if(_b3==null){
_b3="degrees";
}
var _b4=OpenLayers.Util.normalizeScale(_b2);
var _b5=1/(_b4*OpenLayers.INCHES_PER_UNIT[_b3]*OpenLayers.DOTS_PER_INCH);
return _b5;
};
OpenLayers.Util.getScaleFromResolution=function(_b6,_b7){
if(_b7==null){
_b7="degrees";
}
var _b8=_b6*OpenLayers.INCHES_PER_UNIT[_b7]*OpenLayers.DOTS_PER_INCH;
return _b8;
};
OpenLayers.Util.safeStopPropagation=function(evt){
OpenLayers.Event.stop(evt,true);
};
OpenLayers.Util.pagePosition=function(_ba){
var _bb=0,_bc=0;
var _bd=_ba;
var _be=_ba;
while(_bd){
if(_bd==document.body){
if(OpenLayers.Element.getStyle(_be,"position")=="absolute"){
break;
}
}
_bb+=_bd.offsetTop||0;
_bc+=_bd.offsetLeft||0;
_be=_bd;
try{
_bd=_bd.offsetParent;
}
catch(e){
OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{"elemId":_bd.id}));
break;
}
}
_bd=_ba;
while(_bd){
_bb-=_bd.scrollTop||0;
_bc-=_bd.scrollLeft||0;
_bd=_bd.parentNode;
}
return [_bc,_bb];
};
OpenLayers.Util.isEquivalentUrl=function(_bf,_c0,_c1){
_c1=_c1||{};
OpenLayers.Util.applyDefaults(_c1,{ignoreCase:true,ignorePort80:true,ignoreHash:true});
var _c2=OpenLayers.Util.createUrlObject(_bf,_c1);
var _c3=OpenLayers.Util.createUrlObject(_c0,_c1);
for(var key in _c2){
if(_c1.test){
OpenLayers.Console.userError(key+"\n1:"+_c2[key]+"\n2:"+_c3[key]);
}
var _c5=_c2[key];
var _c6=_c3[key];
switch(key){
case "args":
break;
case "host":
case "port":
case "protocol":
if((_c5=="")||(_c6=="")){
break;
}
default:
if((key!="args")&&(_c2[key]!=_c3[key])){
return false;
}
break;
}
}
for(var key in _c2.args){
if(_c2.args[key]!=_c3.args[key]){
return false;
}
delete _c3.args[key];
}
for(var key in _c3.args){
return false;
}
return true;
};
OpenLayers.Util.createUrlObject=function(url,_c8){
_c8=_c8||{};
var _c9={};
if(_c8.ignoreCase){
url=url.toLowerCase();
}
var a=document.createElement("a");
a.href=url;
_c9.host=a.host;
var _cb=a.port;
if(_cb.length<=0){
var _cc=_c9.host.length-(_cb.length);
_c9.host=_c9.host.substring(0,_cc);
}
_c9.protocol=a.protocol;
_c9.port=((_cb=="80")&&(_c8.ignorePort80))?"":_cb;
_c9.hash=(_c8.ignoreHash)?"":a.hash;
var _cd=a.search;
if(!_cd){
var _ce=url.indexOf("?");
_cd=(_ce!=-1)?url.substr(_ce):"";
}
_c9.args=OpenLayers.Util.getParameters(_cd);
if(((_c9.protocol=="file:")&&(url.indexOf("file:")!=-1))||((_c9.protocol!="file:")&&(_c9.host!=""))){
_c9.pathname=a.pathname;
var _cf=_c9.pathname.indexOf("?");
if(_cf!=-1){
_c9.pathname=_c9.pathname.substring(0,_cf);
}
}else{
var _d0=OpenLayers.Util.removeTail(url);
var _d1=0;
do{
var _d2=_d0.indexOf("../");
if(_d2==0){
_d1++;
_d0=_d0.substr(3);
}else{
if(_d2>=0){
var _d3=_d0.substr(0,_d2-1);
var _d4=_d3.indexOf("/");
_d3=(_d4!=-1)?_d3.substr(0,_d4+1):"";
var _d5=_d0.substr(_d2+3);
_d0=_d3+_d5;
}
}
}while(_d2!=-1);
var _d6=document.createElement("a");
var _d7=window.location.href;
if(_c8.ignoreCase){
_d7=_d7.toLowerCase();
}
_d6.href=_d7;
_c9.protocol=_d6.protocol;
var _d8=(_d6.pathname.indexOf("/")!=-1)?"/":"\\";
var _d9=_d6.pathname.split(_d8);
_d9.pop();
while((_d1>0)&&(_d9.length>0)){
_d9.pop();
_d1--;
}
_d0=_d9.join("/")+"/"+_d0;
_c9.pathname=_d0;
}
if((_c9.protocol=="file:")||(_c9.protocol=="")){
_c9.host="localhost";
}
return _c9;
};
OpenLayers.Util.removeTail=function(url){
var _db=null;
var _dc=url.indexOf("?");
var _dd=url.indexOf("#");
if(_dc==-1){
_db=(_dd!=-1)?url.substr(0,_dd):url;
}else{
_db=(_dd!=-1)?url.substr(0,Math.min(_dc,_dd)):url.substr(0,_dc);
}
return _db;
};
OpenLayers.Util.getBrowserName=function(){
var _de="";
var ua=navigator.userAgent.toLowerCase();
if(ua.indexOf("opera")!=-1){
_de="opera";
}else{
if(ua.indexOf("msie")!=-1){
_de="msie";
}else{
if(ua.indexOf("safari")!=-1){
_de="safari";
}else{
if(ua.indexOf("mozilla")!=-1){
if(ua.indexOf("firefox")!=-1){
_de="firefox";
}else{
_de="mozilla";
}
}
}
}
}
return _de;
};
OpenLayers.Util.getRenderedDimensions=function(_e0,_e1,_e2){
var w,h;
var _e5=document.createElement("div");
_e5.style.overflow="";
_e5.style.position="absolute";
_e5.style.left="-9999px";
if(_e1){
if(_e1.w){
w=_e1.w;
_e5.style.width=w+"px";
}else{
if(_e1.h){
h=_e1.h;
_e5.style.height=h+"px";
}
}
}
if(_e2&&_e2.displayClass){
_e5.className=_e2.displayClass;
}
var _e6=document.createElement("div");
_e6.innerHTML=_e0;
_e5.appendChild(_e6);
document.body.appendChild(_e5);
if(!w){
w=parseInt(_e6.scrollWidth);
_e5.style.width=w+"px";
}
if(!h){
h=parseInt(_e6.scrollHeight);
}
_e5.removeChild(_e6);
document.body.removeChild(_e5);
return new OpenLayers.Size(w,h);
};
OpenLayers.Util.getScrollbarWidth=function(){
var _e7=OpenLayers.Util._scrollbarWidth;
if(_e7==null){
var scr=null;
var inn=null;
var _ea=0;
var _eb=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);
_ea=inn.offsetWidth;
scr.style.overflow="scroll";
_eb=inn.offsetWidth;
document.body.removeChild(document.body.lastChild);
OpenLayers.Util._scrollbarWidth=(_ea-_eb);
_e7=OpenLayers.Util._scrollbarWidth;
}
return _e7;
};
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 _f2=str.split("-");
var _f3=_f2[0];
for(var i=1,len=_f2.length;i<len;i++){
var s=_f2[i];
_f3+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _f3;
},format:function(_f7,_f8,_f9){
if(!_f8){
_f8=window;
}
var _fa=_f7.split("${");
var _fb,_fc,_fd;
for(var i=1,len=_fa.length;i<len;i++){
_fb=_fa[i];
_fc=_fb.indexOf("}");
if(_fc>0){
_fd=_f8[_fb.substring(0,_fc)];
if(typeof _fd=="function"){
_fd=_f9?_fd.apply(null,_f9):_fd();
}
_fa[i]=_fd+_fb.substring(++_fc);
}else{
_fa[i]="${"+_fb;
}
}
return _fa.join("");
},numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(_100){
return OpenLayers.String.numberRegEx.test(_100);
}};
if(!String.prototype.startsWith){
String.prototype.startsWith=function(_101){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.String.startsWith"}));
return OpenLayers.String.startsWith(this,_101);
};
}
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,tsep,dsep){
dec=(typeof dec!="undefined")?dec:0;
tsep=(typeof tsep!="undefined")?tsep:OpenLayers.Number.thousandsSeparator;
dsep=(typeof dsep!="undefined")?dsep:OpenLayers.Number.decimalSeparator;
if(dec!=null){
num=parseFloat(num.toFixed(dec));
}
var _10a=num.toString().split(".");
if(_10a.length==1&&dec==null){
dec=0;
}
var _10b=_10a[0];
if(tsep){
var _10c=/(-?[0-9]+)([0-9]{3})/;
while(_10c.test(_10b)){
_10b=_10b.replace(_10c,"$1"+tsep+"$2");
}
}
var str;
if(dec==0){
str=_10b;
}else{
var rem=_10a.length>1?_10a[1]:"0";
if(dec!=null){
rem=rem+new Array(dec-rem.length+1).join("0");
}
str=_10b+dsep+rem;
}
return str;
}};
if(!Number.prototype.limitSigDigs){
Number.prototype.limitSigDigs=function(sig){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.Number.limitSigDigs"}));
return OpenLayers.Number.limitSigDigs(this,sig);
};
}
OpenLayers.Function={bind:function(func,_111){
var args=Array.prototype.slice.apply(arguments,[2]);
return function(){
var _113=args.concat(Array.prototype.slice.apply(arguments,[0]));
return func.apply(_111,_113);
};
},bindAsEventListener:function(func,_115){
return function(_116){
return func.call(_115,_116||window.event);
};
}};
if(!Function.prototype.bind){
Function.prototype.bind=function(){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.Function.bind"}));
Array.prototype.unshift.apply(arguments,[this]);
return OpenLayers.Function.bind.apply(null,arguments);
};
}
if(!Function.prototype.bindAsEventListener){
Function.prototype.bindAsEventListener=function(_117){
OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.Function.bindAsEventListener"}));
return OpenLayers.Function.bindAsEventListener(this,_117);
};
}
OpenLayers.Array={filter:function(_118,_119,_11a){
var _11b=[];
if(Array.prototype.filter){
_11b=_118.filter(_119,_11a);
}else{
var len=_118.length;
if(typeof _119!="function"){
throw new TypeError();
}
for(var i=0;i<len;i++){
if(i in _118){
var val=_118[i];
if(_119.call(_11a,val,i,_118)){
_11b.push(val);
}
}
}
}
return _11b;
}};
OpenLayers.Class=function(){
var _11f=function(){
if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){
this.initialize.apply(this,arguments);
}
};
var _120={};
var _121;
for(var i=0,len=arguments.length;i<len;++i){
if(typeof arguments[i]=="function"){
_121=arguments[i].prototype;
}else{
_121=arguments[i];
}
OpenLayers.Util.extend(_120,_121);
}
_11f.prototype=_120;
return _11f;
};
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 _124=arguments[0];
var _125=new _124(OpenLayers.Class.isPrototype);
for(var i=1,len=arguments.length;i<len;i++){
if(typeof arguments[i]=="function"){
var _128=arguments[i];
arguments[i]=new _128(OpenLayers.Class.isPrototype);
}
OpenLayers.Util.extend(_125,arguments[i]);
}
return _125;
};
OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,initialize:function(left,_12a,_12b,top){
if(left!=null){
this.left=parseFloat(left);
}
if(_12a!=null){
this.bottom=parseFloat(_12a);
}
if(_12b!=null){
this.right=parseFloat(_12b);
}
if(top!=null){
this.top=parseFloat(top);
}
},clone:function(){
return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top);
},equals:function(_12d){
var _12e=false;
if(_12d!=null){
_12e=((this.left==_12d.left)&&(this.right==_12d.right)&&(this.top==_12d.top)&&(this.bottom==_12d.bottom));
}
return _12e;
},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(_12f){
if(_12f==null){
_12f=6;
}
var mult=Math.pow(10,_12f);
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);
},scale:function(_132,_133){
if(_133==null){
_133=this.getCenterLonLat();
}
var _134=[];
var _135,_136;
if(_133.CLASS_NAME=="OpenLayers.LonLat"){
_135=_133.lon;
_136=_133.lat;
}else{
_135=_133.x;
_136=_133.y;
}
var left=(this.left-_135)*_132+_135;
var _138=(this.bottom-_136)*_132+_136;
var _139=(this.right-_135)*_132+_135;
var top=(this.top-_136)*_132+_136;
return new OpenLayers.Bounds(left,_138,_139,top);
},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(_13e){
var _13f=null;
if(_13e){
switch(_13e.CLASS_NAME){
case "OpenLayers.LonLat":
_13f=new OpenLayers.Bounds(_13e.lon,_13e.lat,_13e.lon,_13e.lat);
break;
case "OpenLayers.Geometry.Point":
_13f=new OpenLayers.Bounds(_13e.x,_13e.y,_13e.x,_13e.y);
break;
case "OpenLayers.Bounds":
_13f=_13e;
break;
}
if(_13f){
if((this.left==null)||(_13f.left<this.left)){
this.left=_13f.left;
}
if((this.bottom==null)||(_13f.bottom<this.bottom)){
this.bottom=_13f.bottom;
}
if((this.right==null)||(_13f.right>this.right)){
this.right=_13f.right;
}
if((this.top==null)||(_13f.top>this.top)){
this.top=_13f.top;
}
}
}
},containsLonLat:function(ll,_141){
return this.contains(ll.lon,ll.lat,_141);
},containsPixel:function(px,_143){
return this.contains(px.x,px.y,_143);
},contains:function(x,y,_146){
if(_146==null){
_146=true;
}
var _147=false;
if(_146){
_147=((x>=this.left)&&(x<=this.right)&&(y>=this.bottom)&&(y<=this.top));
}else{
_147=((x>this.left)&&(x<this.right)&&(y>this.bottom)&&(y<this.top));
}
return _147;
},intersectsBounds:function(_148,_149){
if(_149==null){
_149=true;
}
var _14a=(_148.bottom==this.bottom&&_148.top==this.top)?true:(((_148.bottom>this.bottom)&&(_148.bottom<this.top))||((this.bottom>_148.bottom)&&(this.bottom<_148.top)));
var _14b=(_148.bottom==this.bottom&&_148.top==this.top)?true:(((_148.top>this.bottom)&&(_148.top<this.top))||((this.top>_148.bottom)&&(this.top<_148.top)));
var _14c=(_148.right==this.right&&_148.left==this.left)?true:(((_148.right>this.left)&&(_148.right<this.right))||((this.right>_148.left)&&(this.right<_148.right)));
var _14d=(_148.right==this.right&&_148.left==this.left)?true:(((_148.left>this.left)&&(_148.left<this.right))||((this.left>_148.left)&&(this.left<_148.right)));
return (this.containsBounds(_148,true,_149)||_148.containsBounds(this,true,_149)||((_14b||_14a)&&(_14d||_14c)));
},containsBounds:function(_14e,_14f,_150){
if(_14f==null){
_14f=false;
}
if(_150==null){
_150=true;
}
var _151;
var _152;
var _153;
var _154;
if(_150){
_151=(_14e.left>=this.left)&&(_14e.left<=this.right);
_152=(_14e.top>=this.bottom)&&(_14e.top<=this.top);
_153=(_14e.right>=this.left)&&(_14e.right<=this.right);
_154=(_14e.bottom>=this.bottom)&&(_14e.bottom<=this.top);
}else{
_151=(_14e.left>this.left)&&(_14e.left<this.right);
_152=(_14e.top>this.bottom)&&(_14e.top<this.top);
_153=(_14e.right>this.left)&&(_14e.right<this.right);
_154=(_14e.bottom>this.bottom)&&(_14e.bottom<this.top);
}
return (_14f)?(_152||_154)&&(_151||_153):(_152&&_151&&_154&&_153);
},determineQuadrant:function(_155){
var _156="";
var _157=this.getCenterLonLat();
_156+=(_155.lat<_157.lat)?"b":"t";
_156+=(_155.lon<_157.lon)?"l":"r";
return _156;
},transform:function(_158,dest){
var ll=OpenLayers.Projection.transform({"x":this.left,"y":this.bottom},_158,dest);
var lr=OpenLayers.Projection.transform({"x":this.right,"y":this.bottom},_158,dest);
var ul=OpenLayers.Projection.transform({"x":this.left,"y":this.top},_158,dest);
var ur=OpenLayers.Projection.transform({"x":this.right,"y":this.top},_158,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(_15e,_15f){
_15f=_15f||{};
var _160=_15f.leftTolerance||0;
var _161=_15f.rightTolerance||0;
var _162=this.clone();
if(_15e){
while(_162.left<_15e.left&&(_162.right-_161)<=_15e.left){
_162=_162.add(_15e.getWidth(),0);
}
while((_162.left+_160)>=_15e.right&&_162.right>_15e.right){
_162=_162.add(-_15e.getWidth(),0);
}
}
return _162;
},CLASS_NAME:"OpenLayers.Bounds"});
OpenLayers.Bounds.fromString=function(str){
var _164=str.split(",");
return OpenLayers.Bounds.fromArray(_164);
};
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(_167){
var opp="";
opp+=(_167.charAt(0)=="t")?"b":"t";
opp+=(_167.charAt(1)=="l")?"r":"l";
return opp;
};
OpenLayers.Element={visible:function(_169){
return OpenLayers.Util.getElement(_169).style.display!="none";
},toggle:function(){
for(var i=0,len=arguments.length;i<len;i++){
var _16c=OpenLayers.Util.getElement(arguments[i]);
var _16d=OpenLayers.Element.visible(_16c)?"hide":"show";
OpenLayers.Element[_16d](_16c);
}
},hide:function(){
for(var i=0,len=arguments.length;i<len;i++){
var _170=OpenLayers.Util.getElement(arguments[i]);
_170.style.display="none";
}
},show:function(){
for(var i=0,len=arguments.length;i<len;i++){
var _173=OpenLayers.Util.getElement(arguments[i]);
_173.style.display="";
}
},remove:function(_174){
_174=OpenLayers.Util.getElement(_174);
_174.parentNode.removeChild(_174);
},getHeight:function(_175){
_175=OpenLayers.Util.getElement(_175);
return _175.offsetHeight;
},getDimensions:function(_176){
_176=OpenLayers.Util.getElement(_176);
if(OpenLayers.Element.getStyle(_176,"display")!="none"){
return {width:_176.offsetWidth,height:_176.offsetHeight};
}
var els=_176.style;
var _178=els.visibility;
var _179=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _17a=_176.clientWidth;
var _17b=_176.clientHeight;
els.display="none";
els.position=_179;
els.visibility=_178;
return {width:_17a,height:_17b};
},hasClass:function(_17c,name){
var _17e=_17c.className;
return (!!_17e&&new RegExp("(^|\\s)"+name+"(\\s|$)").test(_17e));
},addClass:function(_17f,name){
if(!OpenLayers.Element.hasClass(_17f,name)){
_17f.className+=(_17f.className?" ":"")+name;
}
return _17f;
},removeClass:function(_181,name){
var _183=_181.className;
if(_183){
_181.className=OpenLayers.String.trim(_183.replace(new RegExp("(^|\\s+)"+name+"(\\s+|$)")," "));
}
return _181;
},toggleClass:function(_184,name){
if(OpenLayers.Element.hasClass(_184,name)){
OpenLayers.Element.removeClass(_184,name);
}else{
OpenLayers.Element.addClass(_184,name);
}
return _184;
},getStyle:function(_186,_187){
_186=OpenLayers.Util.getElement(_186);
var _188=null;
if(_186&&_186.style){
_188=_186.style[OpenLayers.String.camelize(_187)];
if(!_188){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_186,null);
_188=css?css.getPropertyValue(_187):null;
}else{
if(_186.currentStyle){
_188=_186.currentStyle[OpenLayers.String.camelize(_187)];
}
}
}
var _18a=["left","top","right","bottom"];
if(window.opera&&(OpenLayers.Util.indexOf(_18a,_187)!=-1)&&(OpenLayers.Element.getStyle(_186,"position")=="static")){
_188="auto";
}
}
return _188=="auto"?null:_188;
}};
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 _191=false;
if(ll!=null){
_191=((this.lon==ll.lon&&this.lat==ll.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(ll.lon)&&isNaN(ll.lat)));
}
return _191;
},transform:function(_192,dest){
var _194=OpenLayers.Projection.transform({"x":this.lon,"y":this.lat},_192,dest);
this.lon=_194.x;
this.lat=_194.y;
return this;
},wrapDateLine:function(_195){
var _196=this.clone();
if(_195){
while(_196.lon<_195.left){
_196.lon+=_195.getWidth();
}
while(_196.lon>_195.right){
_196.lon-=_195.getWidth();
}
}
return _196;
},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 _19c=false;
if(px!=null){
_19c=((this.x==px.x&&this.y==px.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(px.x)&&isNaN(px.y)));
}
return _19c;
},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 _1a1=this.clone();
if(px){
_1a1=this.add(px.x,px.y);
}
return _1a1;
},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 _1a5=false;
if(sz!=null){
_1a5=((this.w==sz.w&&this.h==sz.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(sz.w)&&isNaN(sz.h)));
}
return _1a5;
},CLASS_NAME:"OpenLayers.Size"});
OpenLayers.Console={log:function(){
},debug:function(){
},info:function(){
},warn:function(){
},error:function(){
},userError:function(_1a6){
alert(_1a6);
},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(){
var _1a7=document.getElementsByTagName("script");
for(var i=0,len=_1a7.length;i<len;++i){
if(_1a7[i].src.indexOf("firebug.js")!=-1){
if(console){
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(_1aa){
this.easing=(_1aa)?_1aa:OpenLayers.Easing.Expo.easeOut;
},start:function(_1ab,_1ac,_1ad,_1ae){
this.playing=true;
this.begin=_1ab;
this.finish=_1ac;
this.duration=_1ad;
this.callbacks=_1ae.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 _1af={};
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;
_1af[i]=this.easing.apply(this,[this.time,b,c,this.duration]);
}
this.time++;
if(this.callbacks&&this.callbacks.eachStep){
this.callbacks.eachStep.call(this,_1af);
}
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(_1d8){
OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{"statusText":_1d8.statusText}));
};
OpenLayers.loadURL=function(uri,_1da,_1db,_1dc,_1dd){
if(typeof _1da=="string"){
_1da=OpenLayers.Util.getParameters(_1da);
}
var _1de=(_1dc)?_1dc:OpenLayers.nullHandler;
var _1df=(_1dd)?_1dd:OpenLayers.nullHandler;
return OpenLayers.Request.GET({url:uri,params:_1da,success:_1de,failure:_1df,scope:_1db});
};
OpenLayers.parseXMLString=function(text){
var _1e1=text.indexOf("<");
if(_1e1>0){
text=text.substring(_1e1);
}
var _1e2=OpenLayers.Util.Try(function(){
var _1e3=new ActiveXObject("Microsoft.XMLDOM");
_1e3.loadXML(text);
return _1e3;
},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 _1e2;
};
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(_1e5){
for(var i=0;i<this.responders.length;i++){
if(_1e5==this.responders[i]){
return;
}
}
this.responders.push(_1e5);
},unregister:function(_1e7){
OpenLayers.Util.removeItem(this.reponders,_1e7);
},dispatch:function(_1e8,_1e9,_1ea){
var _1eb;
for(var i=0;i<this.responders.length;i++){
_1eb=this.responders[i];
if(_1eb[_1e8]&&typeof _1eb[_1e8]=="function"){
try{
_1eb[_1e8].apply(_1eb,[_1e9,_1ea]);
}
catch(e){
}
}
}
}};
OpenLayers.Ajax.Responders.register({onCreate:function(){
OpenLayers.Ajax.activeRequestCount++;
},onComplete:function(){
OpenLayers.Ajax.activeRequestCount--;
}});
OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(_1ed){
this.options={method:"post",asynchronous:true,contentType:"application/xml",parameters:""};
OpenLayers.Util.extend(this.options,_1ed||{});
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,_1ef){
OpenLayers.Ajax.Base.prototype.initialize.apply(this,[_1ef]);
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 _1f1=OpenLayers.Util.extend({},this.options.parameters);
if(this.method!="get"&&this.method!="post"){
_1f1["_method"]=this.method;
this.method="post";
}
this.parameters=_1f1;
if(_1f1=OpenLayers.Util.getParameterString(_1f1)){
if(this.method=="get"){
this.url+=((this.url.indexOf("?")>-1)?"&":"?")+_1f1;
}else{
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
_1f1+="&_=";
}
}
}
try{
var _1f2=new OpenLayers.Ajax.Response(this);
if(this.options.onCreate){
this.options.onCreate(_1f2);
}
OpenLayers.Ajax.Responders.dispatch("onCreate",this,_1f2);
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||_1f1):null;
this.transport.send(this.body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},onStateChange:function(){
var _1f3=this.transport.readyState;
if(_1f3>1&&!((_1f3==4)&&this._complete)){
this.respondToReadyState(this.transport.readyState);
}
},setRequestHeaders:function(){
var _1f4={"X-Requested-With":"XMLHttpRequest","Accept":"text/javascript, text/html, application/xml, text/xml, */*","OpenLayers":true};
if(this.method=="post"){
_1f4["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){
_1f4["Connection"]="close";
}
}
if(typeof this.options.requestHeaders=="object"){
var _1f5=this.options.requestHeaders;
if(typeof _1f5.push=="function"){
for(var i=0,_1f7=_1f5.length;i<_1f7;i+=2){
_1f4[_1f5[i]]=_1f5[i+1];
}
}else{
for(var i in _1f5){
_1f4[i]=_1f5[i];
}
}
}
for(var name in _1f4){
this.transport.setRequestHeader(name,_1f4[name]);
}
},success:function(){
var _1f9=this.getStatus();
return !_1f9||(_1f9>=200&&_1f9<300);
},getStatus:function(){
try{
return this.transport.status||0;
}
catch(e){
return 0;
}
},respondToReadyState:function(_1fa){
var _1fb=OpenLayers.Ajax.Request.Events[_1fa];
var _1fc=new OpenLayers.Ajax.Response(this);
if(_1fb=="Complete"){
try{
this._complete=true;
(this.options["on"+_1fc.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(_1fc);
}
catch(e){
this.dispatchException(e);
}
var _1fd=_1fc.getHeader("Content-type");
}
try{
(this.options["on"+_1fb]||OpenLayers.Ajax.emptyFunction)(_1fc);
OpenLayers.Ajax.Responders.dispatch("on"+_1fb,this,_1fc);
}
catch(e){
this.dispatchException(e);
}
if(_1fb=="Complete"){
this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction;
}
},getHeader:function(name){
try{
return this.transport.getResponseHeader(name);
}
catch(e){
return null;
}
},dispatchException:function(_1ff){
var _200=this.options.onException;
if(_200){
_200(this,_1ff);
OpenLayers.Ajax.Responders.dispatch("onException",this,_1ff);
}else{
var _201=false;
var _202=OpenLayers.Ajax.Responders.responders;
for(var i=0;i<_202.length;i++){
if(_202[i].onException){
_201=true;
break;
}
}
if(_201){
OpenLayers.Ajax.Responders.dispatch("onException",this,_1ff);
}else{
throw _1ff;
}
}
}});
OpenLayers.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:"",initialize:function(_204){
this.request=_204;
var _205=this.transport=_204.transport,_206=this.readyState=_205.readyState;
if((_206>2&&!(!!(window.attachEvent&&!window.opera)))||_206==4){
this.status=this.getStatus();
this.statusText=this.getStatusText();
this.responseText=_205.responseText==null?"":String(_205.responseText);
}
if(_206==4){
var xml=_205.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(_209,_20a,_20b,_20c){
var elem=null;
if(_209.getElementsByTagNameNS){
elem=_209.getElementsByTagNameNS(_20a,_20c);
}else{
elem=_209.getElementsByTagName(_20b+":"+_20c);
}
return elem;
};
OpenLayers.Ajax.serializeXMLToString=function(_20e){
var _20f=new XMLSerializer();
var data=_20f.serializeToString(_20e);
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(_211){
return _211.target||_211.srcElement;
},isLeftClick:function(_212){
return (((_212.which)&&(_212.which==1))||((_212.button)&&(_212.button==1)));
},isRightClick:function(_213){
return (((_213.which)&&(_213.which==3))||((_213.button)&&(_213.button==2)));
},stop:function(_214,_215){
if(!_215){
if(_214.preventDefault){
_214.preventDefault();
}else{
_214.returnValue=false;
}
}
if(_214.stopPropagation){
_214.stopPropagation();
}else{
_214.cancelBubble=true;
}
},findElement:function(_216,_217){
var _218=OpenLayers.Event.element(_216);
while(_218.parentNode&&(!_218.tagName||(_218.tagName.toUpperCase()!=_217.toUpperCase()))){
_218=_218.parentNode;
}
return _218;
},observe:function(_219,name,_21b,_21c){
var _21d=OpenLayers.Util.getElement(_219);
_21c=_21c||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_21d.attachEvent)){
name="keydown";
}
if(!this.observers){
this.observers={};
}
if(!_21d._eventCacheID){
var _21e="eventCacheID_";
if(_21d.id){
_21e=_21d.id+"_"+_21e;
}
_21d._eventCacheID=OpenLayers.Util.createUniqueID(_21e);
}
var _21f=_21d._eventCacheID;
if(!this.observers[_21f]){
this.observers[_21f]=[];
}
this.observers[_21f].push({"element":_21d,"name":name,"observer":_21b,"useCapture":_21c});
if(_21d.addEventListener){
_21d.addEventListener(name,_21b,_21c);
}else{
if(_21d.attachEvent){
_21d.attachEvent("on"+name,_21b);
}
}
},stopObservingElement:function(_220){
var _221=OpenLayers.Util.getElement(_220);
var _222=_221._eventCacheID;
this._removeElementObservers(OpenLayers.Event.observers[_222]);
},_removeElementObservers:function(_223){
if(_223){
for(var i=_223.length-1;i>=0;i--){
var _225=_223[i];
var args=new Array(_225.element,_225.name,_225.observer,_225.useCapture);
var _227=OpenLayers.Event.stopObserving.apply(this,args);
}
}
},stopObserving:function(_228,name,_22a,_22b){
_22b=_22b||false;
var _22c=OpenLayers.Util.getElement(_228);
var _22d=_22c._eventCacheID;
if(name=="keypress"){
if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_22c.detachEvent){
name="keydown";
}
}
var _22e=false;
var _22f=OpenLayers.Event.observers[_22d];
if(_22f){
var i=0;
while(!_22e&&i<_22f.length){
var _231=_22f[i];
if((_231.name==name)&&(_231.observer==_22a)&&(_231.useCapture==_22b)){
_22f.splice(i,1);
if(_22f.length==0){
delete OpenLayers.Event.observers[_22d];
}
_22e=true;
break;
}
i++;
}
}
if(_22e){
if(_22c.removeEventListener){
_22c.removeEventListener(name,_22a,_22b);
}else{
if(_22c&&_22c.detachEvent){
_22c.detachEvent("on"+name,_22a);
}
}
}
return _22e;
},unloadCache:function(){
if(OpenLayers.Event&&OpenLayers.Event.observers){
for(var _232 in OpenLayers.Event.observers){
var _233=OpenLayers.Event.observers[_232];
OpenLayers.Event._removeElementObservers.apply(this,[_233]);
}
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","rightclick","dblrightclick","resize","focus","blur"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:false,initialize:function(_234,_235,_236,_237,_238){
OpenLayers.Util.extend(this,_238);
this.object=_234;
this.element=_235;
this.fallThrough=_237;
this.listeners={};
this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);
this.eventTypes=[];
if(_236!=null){
for(var i=0,len=_236.length;i<len;i++){
this.addEventType(_236[i]);
}
}
if(this.element!=null){
this.attachToElement(_235);
}
},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(_23b){
if(!this.listeners[_23b]){
this.eventTypes.push(_23b);
this.listeners[_23b]=[];
}
},attachToElement:function(_23c){
for(var i=0,len=this.BROWSER_EVENTS.length;i<len;i++){
var _23f=this.BROWSER_EVENTS[i];
this.addEventType(_23f);
OpenLayers.Event.observe(_23c,_23f,this.eventHandler);
}
OpenLayers.Event.observe(_23c,"dragstart",OpenLayers.Event.stop);
},on:function(_240){
for(var type in _240){
if(type!="scope"){
this.register(type,_240.scope,_240[type]);
}
}
},register:function(type,obj,func){
if((func!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,type)!=-1)){
if(obj==null){
obj=this.object;
}
var _245=this.listeners[type];
_245.push({obj:obj,func:func});
}
},registerPriority:function(type,obj,func){
if(func!=null){
if(obj==null){
obj=this.object;
}
var _249=this.listeners[type];
if(_249!=null){
_249.unshift({obj:obj,func:func});
}
}
},un:function(_24a){
for(var type in _24a){
if(type!="scope"){
this.unregister(type,_24a.scope,_24a[type]);
}
}
},unregister:function(type,obj,func){
if(obj==null){
obj=this.object;
}
var _24f=this.listeners[type];
if(_24f!=null){
for(var i=0,len=_24f.length;i<len;i++){
if(_24f[i].obj==obj&&_24f[i].func==func){
_24f.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 _255=(this.listeners[type])?this.listeners[type].slice():null;
if((_255!=null)&&(_255.length>0)){
var _256;
for(var i=0,len=_255.length;i<len;i++){
var _259=_255[i];
_256=_259.func.apply(_259.obj,[evt]);
if((_256!=undefined)&&(_256==false)){
break;
}
}
if(!this.fallThrough){
OpenLayers.Event.stop(evt,true);
}
}
return _256;
},handleBrowserEvent:function(evt){
if(this.includeXY){
evt.xy=this.getMousePosition(evt);
}
this.triggerEvent(evt.type,evt);
},clearMouseCache:function(){
this.element.scrolls=null;
this.element.lefttop=null;
this.element.offsets=null;
},getMousePosition:function(evt){
if(!this.includeXY){
this.clearMouseCache();
}else{
if(!this.element.hasScrollEvent){
OpenLayers.Event.observe(window,"scroll",OpenLayers.Function.bind(this.clearMouseCache,this));
this.element.hasScrollEvent=true;
}
}
if(!this.element.scrolls){
this.element.scrolls=[];
this.element.scrolls[0]=(document.documentElement.scrollLeft||document.body.scrollLeft);
this.element.scrolls[1]=(document.documentElement.scrollTop||document.body.scrollTop);
}
if(!this.element.lefttop){
this.element.lefttop=[];
this.element.lefttop[0]=(document.documentElement.clientLeft||0);
this.element.lefttop[1]=(document.documentElement.clientTop||0);
}
if(!this.element.offsets){
this.element.offsets=OpenLayers.Util.pagePosition(this.element);
this.element.offsets[0]+=this.element.scrolls[0];
this.element.offsets[1]+=this.element.scrolls[1];
}
return new OpenLayers.Pixel((evt.clientX+this.element.scrolls[0])-this.element.offsets[0]-this.element.lefttop[0],(evt.clientY+this.element.scrolls[1])-this.element.offsets[1]-this.element.lefttop[1]);
},CLASS_NAME:"OpenLayers.Events"});
OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(_25c,_25d){
OpenLayers.Util.extend(this,_25d);
this.projCode=_25c;
if(window.Proj4js){
this.proj=new Proj4js.Proj(_25c);
}
},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(_25e){
if(_25e&&_25e.getCode){
return this.getCode()==_25e.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,_261){
if(!OpenLayers.Projection.transforms[from]){
OpenLayers.Projection.transforms[from]={};
}
OpenLayers.Projection.transforms[from][to]=_261;
};
OpenLayers.Projection.transform=function(_262,_263,dest){
if(_263.proj&&dest.proj){
_262=Proj4js.transform(_263.proj,dest.proj,_262);
}else{
if(_263&&dest&&OpenLayers.Projection.transforms[_263.getCode()]&&OpenLayers.Projection.transforms[_263.getCode()][dest.getCode()]){
OpenLayers.Projection.transforms[_263.getCode()][dest.getCode()](_262);
}
}
return _262;
};
OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,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,panRatio:1.5,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,_266){
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,_266);
this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");
this.div=OpenLayers.Util.getElement(div);
OpenLayers.Element.addClass(this.div,"olMap");
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,{includeXY:true});
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 _268=true;
var _269=document.getElementsByTagName("link");
for(var i=0,len=_269.length;i<len;++i){
if(OpenLayers.Util.isEquivalentUrl(_269.item(i).href,this.theme)){
_268=false;
break;
}
}
if(_268){
var _26c=document.createElement("link");
_26c.setAttribute("rel","stylesheet");
_26c.setAttribute("type","text/css");
_26c.setAttribute("href",this.theme);
document.getElementsByTagName("head")[0].appendChild(_26c);
}
}
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,len=this.controls.length;i<len;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(_26e){
OpenLayers.Util.extend(this,_26e);
},getTileSize:function(){
return this.tileSize;
},getBy:function(_26f,_270,_271){
var test=(typeof _271.test=="function");
var _273=OpenLayers.Array.filter(this[_26f],function(item){
return item[_270]==_271||(test&&_271.test(item[_270]));
});
return _273;
},getLayersBy:function(_275,_276){
return this.getBy("layers",_275,_276);
},getLayersByName:function(_277){
return this.getLayersBy("name",_277);
},getLayersByClass:function(_278){
return this.getLayersBy("CLASS_NAME",_278);
},getControlsBy:function(_279,_27a){
return this.getBy("controls",_279,_27a);
},getControlsByClass:function(_27b){
return this.getControlsBy("CLASS_NAME",_27b);
},getLayer:function(id){
var _27d=null;
for(var i=0,len=this.layers.length;i<len;i++){
var _280=this.layers[i];
if(_280.id==id){
_27d=_280;
break;
}
}
return _27d;
},setLayerZIndex:function(_281,zIdx){
_281.setZIndex(this.Z_INDEX_BASE[_281.isBaseLayer?"BaseLayer":"Overlay"]+zIdx*5);
},resetLayersZIndex:function(){
for(var i=0,len=this.layers.length;i<len;i++){
var _285=this.layers[i];
this.setLayerZIndex(_285,i);
}
},addLayer:function(_286){
for(var i=0,len=this.layers.length;i<len;i++){
if(this.layers[i]==_286){
var msg=OpenLayers.i18n("layerAlreadyAdded",{"layerName":_286.name});
OpenLayers.Console.warn(msg);
return false;
}
}
this.events.triggerEvent("preaddlayer",{layer:_286});
_286.div.className="olLayerDiv";
_286.div.style.overflow="";
this.setLayerZIndex(_286,this.layers.length);
if(_286.isFixed){
this.viewPortDiv.appendChild(_286.div);
}else{
this.layerContainerDiv.appendChild(_286.div);
}
this.layers.push(_286);
_286.setMap(this);
if(_286.isBaseLayer){
if(this.baseLayer==null){
this.setBaseLayer(_286);
}else{
_286.setVisibility(false);
}
}else{
_286.redraw();
}
this.events.triggerEvent("addlayer",{layer:_286});
},addLayers:function(_28a){
for(var i=0,len=_28a.length;i<len;i++){
this.addLayer(_28a[i]);
}
},removeLayer:function(_28d,_28e){
if(_28e==null){
_28e=true;
}
if(_28d.isFixed){
this.viewPortDiv.removeChild(_28d.div);
}else{
this.layerContainerDiv.removeChild(_28d.div);
}
OpenLayers.Util.removeItem(this.layers,_28d);
_28d.removeMap(this);
_28d.map=null;
if(this.baseLayer==_28d){
this.baseLayer=null;
if(_28e){
for(var i=0,len=this.layers.length;i<len;i++){
var _291=this.layers[i];
if(_291.isBaseLayer){
this.setBaseLayer(_291);
break;
}
}
}
}
this.resetLayersZIndex();
this.events.triggerEvent("removelayer",{layer:_28d});
},getNumLayers:function(){
return this.layers.length;
},getLayerIndex:function(_292){
return OpenLayers.Util.indexOf(this.layers,_292);
},setLayerIndex:function(_293,idx){
var base=this.getLayerIndex(_293);
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,_293);
for(var i=0,len=this.layers.length;i<len;i++){
this.setLayerZIndex(this.layers[i],i);
}
this.events.triggerEvent("changelayer",{layer:_293,property:"order"});
}
},raiseLayer:function(_298,_299){
var idx=this.getLayerIndex(_298)+_299;
this.setLayerIndex(_298,idx);
},setBaseLayer:function(_29b){
var _29c=null;
if(this.baseLayer){
_29c=this.baseLayer.getExtent();
}
if(_29b!=this.baseLayer){
if(OpenLayers.Util.indexOf(this.layers,_29b)!=-1){
if(this.baseLayer!=null){
this.baseLayer.setVisibility(false);
}
this.baseLayer=_29b;
this.viewRequestID++;
this.baseLayer.visibility=true;
var _29d=this.getCenter();
if(_29d!=null){
var _29e=(_29c)?_29c.getCenterLonLat():_29d;
var _29f=(_29c)?this.getZoomForExtent(_29c,true):this.getZoomForResolution(this.resolution,true);
this.setCenter(_29e,_29f,false,true);
}
this.events.triggerEvent("changebaselayer",{layer:this.baseLayer});
}
}
},addControl:function(_2a0,px){
this.controls.push(_2a0);
this.addControlToMap(_2a0,px);
},addControlToMap:function(_2a2,px){
_2a2.outsideViewport=(_2a2.div!=null);
if(this.displayProjection&&!_2a2.displayProjection){
_2a2.displayProjection=this.displayProjection;
}
_2a2.setMap(this);
var div=_2a2.draw(px);
if(div){
if(!_2a2.outsideViewport){
div.style.zIndex=this.Z_INDEX_BASE["Control"]+this.controls.length;
this.viewPortDiv.appendChild(div);
}
}
},getControl:function(id){
var _2a6=null;
for(var i=0,len=this.controls.length;i<len;i++){
var _2a9=this.controls[i];
if(_2a9.id==id){
_2a6=_2a9;
break;
}
}
return _2a6;
},removeControl:function(_2aa){
if((_2aa)&&(_2aa==this.getControl(_2aa.id))){
if(_2aa.div&&(_2aa.div.parentNode==this.viewPortDiv)){
this.viewPortDiv.removeChild(_2aa.div);
}
OpenLayers.Util.removeItem(this.controls,_2aa);
}
},addPopup:function(_2ab,_2ac){
if(_2ac){
for(var i=this.popups.length-1;i>=0;--i){
this.removePopup(this.popups[i]);
}
}
_2ab.map=this;
this.popups.push(_2ab);
var _2ae=_2ab.draw();
if(_2ae){
_2ae.style.zIndex=this.Z_INDEX_BASE["Popup"]+this.popups.length;
this.layerContainerDiv.appendChild(_2ae);
}
},removePopup:function(_2af){
OpenLayers.Util.removeItem(this.popups,_2af);
if(_2af.div){
try{
this.layerContainerDiv.removeChild(_2af.div);
}
catch(e){
}
}
_2af.map=null;
},getSize:function(){
var size=null;
if(this.size!=null){
size=this.size.clone();
}
return size;
},updateSize:function(){
this.events.clearMouseCache();
var _2b1=this.getCurrentSize();
var _2b2=this.getSize();
if(_2b2==null){
this.size=_2b2=_2b1;
}
if(!_2b1.equals(_2b2)){
this.size=_2b1;
for(var i=0,len=this.layers.length;i<len;i++){
this.layers[i].onMapResize();
}
if(this.baseLayer!=null){
var _2b5=new OpenLayers.Pixel(_2b1.w/2,_2b1.h/2);
var _2b6=this.getLonLatFromViewPortPx(_2b5);
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(_2ba,_2bb){
var _2bc=null;
if(_2ba==null){
_2ba=this.getCenter();
}
if(_2bb==null){
_2bb=this.getResolution();
}
if((_2ba!=null)&&(_2bb!=null)){
var size=this.getSize();
var _2be=size.w*_2bb;
var _2bf=size.h*_2bb;
_2bc=new OpenLayers.Bounds(_2ba.lon-_2be/2,_2ba.lat-_2bf/2,_2ba.lon+_2be/2,_2ba.lat+_2bf/2);
}
return _2bc;
},getCenter:function(){
return this.center;
},getZoom:function(){
return this.zoom;
},pan:function(dx,dy,_2c2){
_2c2=OpenLayers.Util.applyDefaults(_2c2,{animate:true,dragging:false});
var _2c3=this.getViewPortPxFromLonLat(this.getCenter());
var _2c4=_2c3.add(dx,dy);
if(!_2c2.dragging||!_2c4.equals(_2c3)){
var _2c5=this.getLonLatFromViewPortPx(_2c4);
if(_2c2.animate){
this.panTo(_2c5);
}else{
this.setCenter(_2c5,null,_2c2.dragging);
}
}
},panTo:function(_2c6){
if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(_2c6)){
if(!this.panTween){
this.panTween=new OpenLayers.Tween(this.panMethod);
}
var _2c7=this.getCenter();
if(_2c6.lon==_2c7.lon&&_2c6.lat==_2c7.lat){
return;
}
var from={lon:_2c7.lon,lat:_2c7.lat};
var to={lon:_2c6.lon,lat:_2c6.lat};
this.panTween.start(from,to,50,{callbacks:{start:OpenLayers.Function.bind(function(_2ca){
this.events.triggerEvent("movestart");
},this),eachStep:OpenLayers.Function.bind(function(_2cb){
_2cb=new OpenLayers.LonLat(_2cb.lon,_2cb.lat);
this.moveTo(_2cb,this.zoom,{"dragging":true,"noEvent":true});
},this),done:OpenLayers.Function.bind(function(_2cc){
_2cc=new OpenLayers.LonLat(_2cc.lon,_2cc.lat);
this.moveTo(_2cc,this.zoom,{"noEvent":true});
this.events.triggerEvent("moveend");
},this)}});
}else{
this.setCenter(_2c6);
}
},setCenter:function(_2cd,zoom,_2cf,_2d0){
this.moveTo(_2cd,zoom,{"dragging":_2cf,"forceZoomChange":_2d0,"caller":"setCenter"});
},moveTo:function(_2d1,zoom,_2d3){
if(!_2d3){
_2d3={};
}
var _2d4=_2d3.dragging;
var _2d5=_2d3.forceZoomChange;
var _2d6=_2d3.noEvent;
if(this.panTween&&_2d3.caller=="setCenter"){
this.panTween.stop();
}
if(!this.center&&!this.isValidLonLat(_2d1)){
_2d1=this.maxExtent.getCenterLonLat();
}
if(this.restrictedExtent!=null){
if(_2d1==null){
_2d1=this.getCenter();
}
if(zoom==null){
zoom=this.getZoom();
}
var _2d7=this.getResolutionForZoom(zoom);
var _2d8=this.calculateBounds(_2d1,_2d7);
if(!this.restrictedExtent.containsBounds(_2d8)){
var _2d9=this.restrictedExtent.getCenterLonLat();
if(_2d8.getWidth()>this.restrictedExtent.getWidth()){
_2d1=new OpenLayers.LonLat(_2d9.lon,_2d1.lat);
}else{
if(_2d8.left<this.restrictedExtent.left){
_2d1=_2d1.add(this.restrictedExtent.left-_2d8.left,0);
}else{
if(_2d8.right>this.restrictedExtent.right){
_2d1=_2d1.add(this.restrictedExtent.right-_2d8.right,0);
}
}
}
if(_2d8.getHeight()>this.restrictedExtent.getHeight()){
_2d1=new OpenLayers.LonLat(_2d1.lon,_2d9.lat);
}else{
if(_2d8.bottom<this.restrictedExtent.bottom){
_2d1=_2d1.add(0,this.restrictedExtent.bottom-_2d8.bottom);
}else{
if(_2d8.top>this.restrictedExtent.top){
_2d1=_2d1.add(0,this.restrictedExtent.top-_2d8.top);
}
}
}
}
}
var _2da=_2d5||((this.isValidZoomLevel(zoom))&&(zoom!=this.getZoom()));
var _2db=(this.isValidLonLat(_2d1))&&(!_2d1.equals(this.center));
if(_2da||_2db||!_2d4){
if(!this.dragging&&!_2d6){
this.events.triggerEvent("movestart");
}
if(_2db){
if((!_2da)&&(this.center)){
this.centerLayerContainer(_2d1);
}
this.center=_2d1.clone();
}
if((_2da)||(this.layerContainerOrigin==null)){
this.layerContainerOrigin=this.center.clone();
this.layerContainerDiv.style.left="0px";
this.layerContainerDiv.style.top="0px";
}
if(_2da){
this.zoom=zoom;
this.resolution=this.getResolutionForZoom(zoom);
this.viewRequestID++;
}
var _2dc=this.getExtent();
this.baseLayer.moveTo(_2dc,_2da,_2d4);
_2dc=this.baseLayer.getExtent();
for(var i=0,len=this.layers.length;i<len;i++){
var _2df=this.layers[i];
if(!_2df.isBaseLayer){
var _2e0=_2df.calculateInRange();
if(_2df.inRange!=_2e0){
_2df.inRange=_2e0;
if(!_2e0){
_2df.display(false);
}
this.events.triggerEvent("changelayer",{layer:_2df,property:"visibility"});
}
if(_2e0&&_2df.visibility){
_2df.moveTo(_2dc,_2da,_2d4);
_2df.events.triggerEvent("moveend",{"zoomChanged":_2da});
}
}
}
if(_2da){
for(var i=0,len=this.popups.length;i<len;i++){
this.popups[i].updatePosition();
}
}
this.events.triggerEvent("move");
if(_2da){
this.events.triggerEvent("zoomend");
}
}
if(!_2d4&&!_2d6){
this.events.triggerEvent("moveend");
}
this.dragging=!!_2d4;
},centerLayerContainer:function(_2e1){
var _2e2=this.getViewPortPxFromLonLat(this.layerContainerOrigin);
var _2e3=this.getViewPortPxFromLonLat(_2e1);
if((_2e2!=null)&&(_2e3!=null)){
this.layerContainerDiv.style.left=Math.round(_2e2.x-_2e3.x)+"px";
this.layerContainerDiv.style.top=Math.round(_2e2.y-_2e3.y)+"px";
}
},isValidZoomLevel:function(_2e4){
return ((_2e4!=null)&&(_2e4>=0)&&(_2e4<this.getNumZoomLevels()));
},isValidLonLat:function(_2e5){
var _2e6=false;
if(_2e5!=null){
var _2e7=this.getMaxExtent();
_2e6=_2e7.containsLonLat(_2e5);
}
return _2e6;
},getProjection:function(){
var _2e8=this.getProjectionObject();
return _2e8?_2e8.getCode():null;
},getProjectionObject:function(){
var _2e9=null;
if(this.baseLayer!=null){
_2e9=this.baseLayer.projection;
}
return _2e9;
},getMaxResolution:function(){
var _2ea=null;
if(this.baseLayer!=null){
_2ea=this.baseLayer.maxResolution;
}
return _2ea;
},getMaxExtent:function(_2eb){
var _2ec=null;
if(_2eb&&_2eb.restricted&&this.restrictedExtent){
_2ec=this.restrictedExtent;
}else{
if(this.baseLayer!=null){
_2ec=this.baseLayer.maxExtent;
}
}
return _2ec;
},getNumZoomLevels:function(){
var _2ed=null;
if(this.baseLayer!=null){
_2ed=this.baseLayer.numZoomLevels;
}
return _2ed;
},getExtent:function(){
var _2ee=null;
if(this.baseLayer!=null){
_2ee=this.baseLayer.getExtent();
}
return _2ee;
},getResolution:function(){
var _2ef=null;
if(this.baseLayer!=null){
_2ef=this.baseLayer.getResolution();
}
return _2ef;
},getUnits:function(){
var _2f0=null;
if(this.baseLayer!=null){
_2f0=this.baseLayer.units;
}
return _2f0;
},getScale:function(){
var _2f1=null;
if(this.baseLayer!=null){
var res=this.getResolution();
var _2f3=this.baseLayer.units;
_2f1=OpenLayers.Util.getScaleFromResolution(res,_2f3);
}
return _2f1;
},getZoomForExtent:function(_2f4,_2f5){
var zoom=null;
if(this.baseLayer!=null){
zoom=this.baseLayer.getZoomForExtent(_2f4,_2f5);
}
return zoom;
},getResolutionForZoom:function(zoom){
var _2f8=null;
if(this.baseLayer){
_2f8=this.baseLayer.getResolutionForZoom(zoom);
}
return _2f8;
},getZoomForResolution:function(_2f9,_2fa){
var zoom=null;
if(this.baseLayer!=null){
zoom=this.baseLayer.getZoomForResolution(_2f9,_2fa);
}
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(_2fd,_2fe){
var _2ff=_2fd.getCenterLonLat();
if(this.baseLayer.wrapDateLine){
var _300=this.getMaxExtent();
_2fd=_2fd.clone();
while(_2fd.right<_2fd.left){
_2fd.right+=_300.getWidth();
}
_2ff=_2fd.getCenterLonLat().wrapDateLine(_300);
}
this.setCenter(_2ff,this.getZoomForExtent(_2fd,_2fe));
},zoomToMaxExtent:function(_301){
var _302=(_301)?_301.restricted:true;
var _303=this.getMaxExtent({"restricted":_302});
this.zoomToExtent(_303);
},zoomToScale:function(_304,_305){
var res=OpenLayers.Util.getResolutionFromScale(_304,this.baseLayer.units);
var size=this.getSize();
var _308=size.w*res;
var _309=size.h*res;
var _30a=this.getCenter();
var _30b=new OpenLayers.Bounds(_30a.lon-_308/2,_30a.lat-_309/2,_30a.lon+_308/2,_30a.lat+_309/2);
this.zoomToExtent(_30b,_305);
},getLonLatFromViewPortPx:function(_30c){
var _30d=null;
if(this.baseLayer!=null){
_30d=this.baseLayer.getLonLatFromViewPortPx(_30c);
}
return _30d;
},getViewPortPxFromLonLat:function(_30e){
var px=null;
if(this.baseLayer!=null){
px=this.baseLayer.getViewPortPxFromLonLat(_30e);
}
return px;
},getLonLatFromPixel:function(px){
return this.getLonLatFromViewPortPx(px);
},getPixelFromLonLat:function(_311){
var px=this.getViewPortPxFromLonLat(_311);
px.x=Math.round(px.x);
px.y=Math.round(px.y);
return px;
},getViewPortPxFromLayerPx:function(_313){
var _314=null;
if(_313!=null){
var dX=parseInt(this.layerContainerDiv.style.left);
var dY=parseInt(this.layerContainerDiv.style.top);
_314=_313.add(dX,dY);
}
return _314;
},getLayerPxFromViewPortPx:function(_317){
var _318=null;
if(_317!=null){
var dX=-parseInt(this.layerContainerDiv.style.left);
var dY=-parseInt(this.layerContainerDiv.style.top);
_318=_317.add(dX,dY);
if(isNaN(_318.x)||isNaN(_318.y)){
_318=null;
}
}
return _318;
},getLonLatFromLayerPx:function(px){
px=this.getViewPortPxFromLayerPx(px);
return this.getLonLatFromViewPortPx(px);
},getLayerPxFromLonLat:function(_31c){
var px=this.getPixelFromLonLat(_31c);
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,alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","moveend"],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,_31f){
this.addOptions(_31f);
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(_320){
if(_320==null){
_320=true;
}
if(this.map!=null){
this.map.removeLayer(this,_320);
}
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(_322){
if(_322!=this.name){
this.name=_322;
if(this.map!=null){
this.map.events.triggerEvent("changelayer",{layer:this,property:"name"});
}
}
},addOptions:function(_323){
if(this.options==null){
this.options={};
}
OpenLayers.Util.extend(this.options,_323);
OpenLayers.Util.extend(this,_323);
},onMapResize:function(){
},redraw:function(){
var _324=false;
if(this.map){
this.inRange=this.calculateInRange();
var _325=this.getExtent();
if(_325&&this.inRange&&this.visibility){
this.moveTo(_325,true,false);
_324=true;
}
}
return _324;
},moveTo:function(_326,_327,_328){
var _329=this.visibility;
if(!this.isBaseLayer){
_329=_329&&this.inRange;
}
this.display(_329);
},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 _32e=(size)?size:((this.tileSize)?this.tileSize:this.map.getTileSize());
this.tileSize=_32e;
if(this.gutter){
this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);
this.imageSize=new OpenLayers.Size(_32e.w+(2*this.gutter),_32e.h+(2*this.gutter));
}
},getVisibility:function(){
return this.visibility;
},setVisibility:function(_32f){
if(_32f!=this.visibility){
this.visibility=_32f;
this.display(_32f);
this.redraw();
if(this.map!=null){
this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"});
}
this.events.triggerEvent("visibilitychanged");
}
},display:function(_330){
var _331=this.calculateInRange();
if(_330!=(this.div.style.display!="none")){
this.div.style.display=(_330&&_331)?"block":"none";
}
},calculateInRange:function(){
var _332=false;
if(this.alwaysInRange){
_332=true;
}else{
if(this.map){
var _333=this.map.getResolution();
_332=((_333>=this.minResolution)&&(_333<=this.maxResolution));
}
}
return _332;
},setIsBaseLayer:function(_334){
if(_334!=this.isBaseLayer){
this.isBaseLayer=_334;
if(this.map!=null){
this.map.events.triggerEvent("changebaselayer",{layer:this});
}
}
},initResolutions:function(){
var _335=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");
var _336=["projection","units"];
var _337=false;
var _338={};
for(var i=0,len=_335.length;i<len;i++){
var _33b=_335[i];
if(this.options[_33b]&&OpenLayers.Util.indexOf(_336,_33b)==-1){
_337=true;
}
_338[_33b]=this.options[_33b]||this.map[_33b];
}
if(this.alwaysInRange==null){
this.alwaysInRange=!_337;
}
if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){
_338.scales=null;
}
if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){
_338.resolutions=null;
}
if((!_338.numZoomLevels)&&(_338.maxZoomLevel)){
_338.numZoomLevels=_338.maxZoomLevel+1;
}
if((_338.scales!=null)||(_338.resolutions!=null)){
if(_338.scales!=null){
_338.resolutions=[];
for(var i=0,len=_338.scales.length;i<len;i++){
var _33c=_338.scales[i];
_338.resolutions[i]=OpenLayers.Util.getResolutionFromScale(_33c,_338.units);
}
}
_338.numZoomLevels=_338.resolutions.length;
}else{
if(_338.minScale){
_338.maxResolution=OpenLayers.Util.getResolutionFromScale(_338.minScale,_338.units);
}else{
if(_338.maxResolution=="auto"){
var _33d=this.map.getSize();
var wRes=_338.maxExtent.getWidth()/_33d.w;
var hRes=_338.maxExtent.getHeight()/_33d.h;
_338.maxResolution=Math.max(wRes,hRes);
}
}
if(_338.maxScale!=null){
_338.minResolution=OpenLayers.Util.getResolutionFromScale(_338.maxScale,_338.units);
}else{
if((_338.minResolution=="auto")&&(_338.minExtent!=null)){
var _33d=this.map.getSize();
var wRes=_338.minExtent.getWidth()/_33d.w;
var hRes=_338.minExtent.getHeight()/_33d.h;
_338.minResolution=Math.max(wRes,hRes);
}
}
if(_338.minResolution!=null&&this.options.numZoomLevels==undefined){
var _340=_338.maxResolution/_338.minResolution;
_338.numZoomLevels=Math.floor(Math.log(_340)/Math.log(2))+1;
}
_338.resolutions=new Array(_338.numZoomLevels);
var base=2;
if(typeof _338.minResolution=="number"&&_338.numZoomLevels>1){
base=Math.pow((_338.maxResolution/_338.minResolution),(1/(_338.numZoomLevels-1)));
}
for(var i=0;i<_338.numZoomLevels;i++){
var res=_338.maxResolution/Math.pow(base,i);
_338.resolutions[i]=res;
}
}
_338.resolutions.sort(function(a,b){
return (b-a);
});
this.resolutions=_338.resolutions;
this.maxResolution=_338.resolutions[0];
var _345=_338.resolutions.length-1;
this.minResolution=_338.resolutions[_345];
this.scales=[];
for(var i=0,len=_338.resolutions.length;i<len;i++){
this.scales[i]=OpenLayers.Util.getScaleFromResolution(_338.resolutions[i],_338.units);
}
this.minScale=this.scales[0];
this.maxScale=this.scales[this.scales.length-1];
this.numZoomLevels=_338.numZoomLevels;
},getResolution:function(){
var zoom=this.map.getZoom();
return this.getResolutionForZoom(zoom);
},getExtent:function(){
return this.map.calculateBounds();
},getZoomForExtent:function(_347,_348){
var _349=this.map.getSize();
var _34a=Math.max(_347.getWidth()/_349.w,_347.getHeight()/_349.h);
return this.getZoomForResolution(_34a,_348);
},getDataExtent:function(){
},getResolutionForZoom:function(zoom){
zoom=Math.max(0,Math.min(zoom,this.resolutions.length-1));
var _34c;
if(this.map.fractionalZoom){
var low=Math.floor(zoom);
var high=Math.ceil(zoom);
_34c=this.resolutions[high]+((zoom-low)*(this.resolutions[low]-this.resolutions[high]));
}else{
_34c=this.resolutions[Math.round(zoom)];
}
return _34c;
},getZoomForResolution:function(_34f,_350){
var zoom;
if(this.map.fractionalZoom){
var _352=0;
var _353=this.resolutions.length-1;
var _354=this.resolutions[_352];
var _355=this.resolutions[_353];
var res;
for(var i=0,len=this.resolutions.length;i<len;++i){
res=this.resolutions[i];
if(res>=_34f){
_354=res;
_352=i;
}
if(res<=_34f){
_355=res;
_353=i;
break;
}
}
var dRes=_354-_355;
if(dRes>0){
zoom=_352+((_34f-_355)/dRes);
}else{
zoom=_352;
}
}else{
var diff;
var _35b=Number.POSITIVE_INFINITY;
for(var i=0,len=this.resolutions.length;i<len;i++){
if(_350){
diff=Math.abs(this.resolutions[i]-_34f);
if(diff>_35b){
break;
}
_35b=diff;
}else{
if(this.resolutions[i]<_34f){
break;
}
}
}
zoom=Math.max(0,i-1);
}
return zoom;
},getLonLatFromViewPortPx:function(_35c){
var _35d=null;
if(_35c!=null){
var size=this.map.getSize();
var _35f=this.map.getCenter();
if(_35f){
var res=this.map.getResolution();
var _361=_35c.x-(size.w/2);
var _362=_35c.y-(size.h/2);
_35d=new OpenLayers.LonLat(_35f.lon+_361*res,_35f.lat-_362*res);
if(this.wrapDateLine){
_35d=_35d.wrapDateLine(this.maxExtent);
}
}
}
return _35d;
},getViewPortPxFromLonLat:function(_363){
var px=null;
if(_363!=null){
var _365=this.map.getResolution();
var _366=this.map.getExtent();
px=new OpenLayers.Pixel((1/_365*(_363.lon-_366.left)),(1/_365*(_366.top-_363.lat)));
}
return px;
},setOpacity:function(_367){
if(_367!=this.opacity){
this.opacity=_367;
for(var i=0,len=this.div.childNodes.length;i<len;++i){
var _36a=this.div.childNodes[i].firstChild;
OpenLayers.Util.modifyDOMElement(_36a,null,null,null,null,null,null,_367);
}
}
},getZIndex:function(){
return this.div.style.zIndex;
},setZIndex:function(_36b){
this.div.style.zIndex=_36b;
},adjustBounds:function(_36c){
if(this.gutter){
var _36d=this.gutter*this.map.getResolution();
_36c=new OpenLayers.Bounds(_36c.left-_36d,_36c.bottom-_36d,_36c.right+_36d,_36c.top+_36d);
}
if(this.wrapDateLine){
var _36e={"rightTolerance":this.getResolution()};
_36c=_36c.wrapDateLine(this.maxExtent,_36e);
}
return _36c;
},CLASS_NAME:"OpenLayers.Layer"});
OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(url,size,_371,_372){
this.url=url;
this.size=(size)?size:new OpenLayers.Size(20,20);
this.offset=_371?_371:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));
this.calculateOffset=_372;
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(_377){
OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,_377);
},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 _379=this.px.offset(this.offset);
OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,_379);
}
}
},display:function(_37a){
this.imageDiv.style.display=(_37a)?"":"none";
},CLASS_NAME:"OpenLayers.Icon"});
OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(_37b,icon){
this.lonlat=_37b;
var _37d=(icon)?icon:OpenLayers.Marker.defaultIcon();
if(this.icon==null){
this.icon=_37d;
}else{
this.icon.url=_37d.url;
this.icon.size=_37d.size;
this.icon.offset=_37d.offset;
this.icon.calculateOffset=_37d.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 _380=false;
if(this.map){
var _381=this.map.getExtent();
_380=_381.containsLonLat(this.lonlat);
}
return _380;
},inflate:function(_382){
if(this.icon){
var _383=new OpenLayers.Size(this.icon.size.w*_382,this.icon.size.h*_382);
this.icon.setSize(_383);
}
},setOpacity:function(_384){
this.icon.setOpacity(_384);
},setUrl:function(url){
this.icon.setUrl(url);
},display:function(_386){
this.icon.display(_386);
},CLASS_NAME:"OpenLayers.Marker"});
OpenLayers.Marker.defaultIcon=function(){
var url=OpenLayers.Util.getImagesLocation()+"marker.png";
var size=new OpenLayers.Size(21,25);
var _389=function(size){
return new OpenLayers.Pixel(-(size.w/2),-size.h);
};
return new OpenLayers.Icon(url,size,null,_389);
};
OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",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,_38c,_38d,_38e,_38f,_390){
if(id==null){
id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
}
this.id=id;
this.lonlat=_38c;
this.contentSize=(_38d!=null)?_38d:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);
if(_38e!=null){
this.contentHTML=_38e;
}
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=this.displayClass;
var _391=this.id+"_GroupDiv";
this.groupDiv=OpenLayers.Util.createDiv(_391,null,null,null,"relative",null,"hidden");
var id=this.div.id+"_contentDiv";
this.contentDiv=OpenLayers.Util.createDiv(id,null,this.contentSize.clone(),null,"relative");
this.contentDiv.className=this.contentDisplayClass;
this.groupDiv.appendChild(this.contentDiv);
this.div.appendChild(this.groupDiv);
if(_38f){
this.addCloseBox(_390);
}
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 _393=document.defaultView.getComputedStyle(this.contentDiv,null);
var _394=_393.getPropertyValue("overflow");
if(_394!="hidden"){
this.contentDiv._oldOverflow=_394;
this.contentDiv.style.overflow="hidden";
}
});
this.map.events.register("moveend",this,function(){
var _395=this.contentDiv._oldOverflow;
if(_395){
this.contentDiv.style.overflow=_395;
this.contentDiv._oldOverflow=null;
}
});
}
this.moveTo(px);
if(!this.autoSize&&!this.size){
this.setSize(this.contentSize);
}
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(_398){
this.size=_398.clone();
var _399=this.getContentDivPadding();
var _39a=_399.left+_399.right;
var _39b=_399.top+_399.bottom;
this.fixPadding();
_39a+=this.padding.left+this.padding.right;
_39b+=this.padding.top+this.padding.bottom;
if(this.closeDiv){
var _39c=parseInt(this.closeDiv.style.width);
_39a+=_39c+_399.right;
}
this.size.w+=_39a;
this.size.h+=_39b;
if(OpenLayers.Util.getBrowserName()=="msie"){
this.contentSize.w+=_399.left+_399.right;
this.contentSize.h+=_399.bottom+_399.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=_398.w+"px";
this.contentDiv.style.height=_398.h+"px";
}
},updateSize:function(){
var _39d="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"<div>";
var _39e=OpenLayers.Util.getRenderedDimensions(_39d,null,{displayClass:this.displayClass});
var _39f=this.getSafeContentSize(_39e);
var _3a0=null;
if(_39f.equals(_39e)){
_3a0=_39e;
}else{
var _3a1=new OpenLayers.Size();
_3a1.w=(_39f.w<_39e.w)?_39f.w:null;
_3a1.h=(_39f.h<_39e.h)?_39f.h:null;
if(_3a1.w&&_3a1.h){
_3a0=_39f;
}else{
var _3a2=OpenLayers.Util.getRenderedDimensions(_39d,_3a1,{displayClass:this.contentDisplayClass});
var _3a3=OpenLayers.Element.getStyle(this.contentDiv,"overflow");
if((_3a3!="hidden")&&(_3a2.equals(_39f))){
var _3a4=OpenLayers.Util.getScrollbarWidth();
if(_3a1.w){
_3a2.h+=_3a4;
}else{
_3a2.w+=_3a4;
}
}
_3a0=this.getSafeContentSize(_3a2);
}
}
this.setSize(_3a0);
},setBackgroundColor:function(_3a5){
if(_3a5!=undefined){
this.backgroundColor=_3a5;
}
if(this.div!=null){
this.div.style.backgroundColor=this.backgroundColor;
}
},setOpacity:function(_3a6){
if(_3a6!=undefined){
this.opacity=_3a6;
}
if(this.div!=null){
this.div.style.opacity=this.opacity;
this.div.style.filter="alpha(opacity="+this.opacity*100+")";
}
},setBorder:function(_3a7){
if(_3a7!=undefined){
this.border=_3a7;
}
if(this.div!=null){
this.div.style.border=this.border;
}
},setContentHTML:function(_3a8){
if(_3a8!=null){
this.contentHTML=_3a8;
}
if((this.contentDiv!=null)&&(this.contentHTML!=null)&&(this.contentHTML!=this.contentDiv.innerHTML)){
this.contentDiv.innerHTML=this.contentHTML;
if(this.autoSize){
this.registerImageListeners();
this.updateSize();
}
}
},registerImageListeners:function(){
var _3a9=function(){
this.popup.updateSize();
if(this.popup.visible()&&this.popup.panMapIfOutOfView){
this.popup.panIntoView();
}
OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad);
};
var _3aa=this.contentDiv.getElementsByTagName("img");
for(var i=0,len=_3aa.length;i<len;i++){
var img=_3aa[i];
if(img.width==0||img.height==0){
var _3ae={"popup":this,"img":img};
img._onImgLoad=OpenLayers.Function.bind(_3a9,_3ae);
OpenLayers.Event.observe(img,"load",img._onImgLoad);
}
}
},getSafeContentSize:function(size){
var _3b0=size.clone();
var _3b1=this.getContentDivPadding();
var _3b2=_3b1.left+_3b1.right;
var _3b3=_3b1.top+_3b1.bottom;
this.fixPadding();
_3b2+=this.padding.left+this.padding.right;
_3b3+=this.padding.top+this.padding.bottom;
if(this.closeDiv){
var _3b4=parseInt(this.closeDiv.style.width);
_3b2+=_3b4+_3b1.right;
}
if(this.minSize){
_3b0.w=Math.max(_3b0.w,(this.minSize.w-_3b2));
_3b0.h=Math.max(_3b0.h,(this.minSize.h-_3b3));
}
if(this.maxSize){
_3b0.w=Math.min(_3b0.w,(this.maxSize.w-_3b2));
_3b0.h=Math.min(_3b0.h,(this.maxSize.h-_3b3));
}
if(this.map&&this.map.size){
var maxY=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-_3b3;
var maxX=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-_3b2;
_3b0.w=Math.min(_3b0.w,maxX);
_3b0.h=Math.min(_3b0.h,maxY);
}
return _3b0;
},getContentDivPadding:function(){
var _3b7=this._contentDivPadding;
if(!_3b7){
this.div.style.display="none";
document.body.appendChild(this.div);
_3b7=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=_3b7;
document.body.removeChild(this.div);
this.div.style.display="";
}
return _3b7;
},addCloseBox:function(_3b8){
this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));
this.closeDiv.className="olPopupCloseBox";
var _3b9=this.getContentDivPadding();
this.closeDiv.style.right=_3b9.right+"px";
this.closeDiv.style.top=_3b9.top+"px";
this.groupDiv.appendChild(this.closeDiv);
var _3ba=_3b8||function(e){
this.hide();
OpenLayers.Event.stop(e);
};
OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(_3ba,this));
},panIntoView:function(){
var _3bc=this.map.getSize();
var _3bd=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));
var _3be=_3bd.clone();
if(_3bd.x<this.map.paddingForPopups.left){
_3be.x=this.map.paddingForPopups.left;
}else{
if((_3bd.x+this.size.w)>(_3bc.w-this.map.paddingForPopups.right)){
_3be.x=_3bc.w-this.map.paddingForPopups.right-this.size.w;
}
}
if(_3bd.y<this.map.paddingForPopups.top){
_3be.y=this.map.paddingForPopups.top;
}else{
if((_3bd.y+this.size.h)>(_3bc.h-this.map.paddingForPopups.bottom)){
_3be.y=_3bc.h-this.map.paddingForPopups.bottom-this.size.h;
}
}
var dx=_3bd.x-_3be.x;
var dy=_3bd.y-_3be.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,initialize:function(_3c7,_3c8,_3c9,url,size){
this.layer=_3c7;
this.position=_3c8.clone();
this.bounds=_3c9.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(){
this.layer=null;
this.bounds=null;
this.size=null;
this.position=null;
this.events.destroy();
this.events=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 _3cd=this.layer.maxExtent;
var _3ce=(_3cd&&this.bounds.intersectsBounds(_3cd,false));
this.shouldDraw=(_3ce||this.layer.displayOutsideMaxExtent);
this.clear();
return this.shouldDraw;
},moveTo:function(_3cf,_3d0,_3d1){
if(_3d1==null){
_3d1=true;
}
this.bounds=_3cf.clone();
this.position=_3d0.clone();
if(_3d1){
this.draw();
}
},clear:function(){
},getBoundsFromBaseLayer:function(_3d2){
var msg=OpenLayers.i18n("reprojectDeprecated",{"layerName":this.layer.name});
OpenLayers.Console.warn(msg);
var _3d4=this.layer.map.getLonLatFromLayerPx(_3d2);
var _3d5=_3d2.clone();
_3d5.x+=this.size.w;
_3d5.y+=this.size.h;
var _3d6=this.layer.map.getLonLatFromLayerPx(_3d5);
if(_3d4.lon>_3d6.lon){
if(_3d4.lon<0){
_3d4.lon=-180-(_3d4.lon+180);
}else{
_3d6.lon=180+_3d6.lon+180;
}
}
var _3d7=new OpenLayers.Bounds(_3d4.lon,_3d6.lat,_3d6.lon,_3d4.lat);
return _3d7;
},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,isBackBuffer:false,lastRatio:1,isFirstDraw:true,backBufferTile:null,initialize:function(_3d8,_3d9,_3da,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.urls=null;
}
this.imgDiv=null;
if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){
this.layer.div.removeChild(this.frame);
}
this.frame=null;
if(this.backBufferTile){
this.backBufferTile.destroy();
this.backBufferTile=null;
}
this.layer.events.unregister("loadend",this,this.resetBackBuffer);
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);
}
var _3de=OpenLayers.Tile.prototype.draw.apply(this,arguments);
if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){
if(_3de){
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(_3de&&this.isFirstDraw){
this.events.register("loadend",this,this.showTile);
this.isFirstDraw=false;
}
}
if(!_3de){
return false;
}
if(this.isLoading){
this.events.triggerEvent("reload");
}else{
this.isLoading=true;
this.events.triggerEvent("loadstart");
}
return this.renderTile();
},resetBackBuffer:function(){
this.showTile();
if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){
this.isFirstDraw=false;
var _3df=this.layer.maxExtent;
var _3e0=(_3df&&this.bounds.intersectsBounds(_3df,false));
if(_3e0){
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();
}
}
},renderTile:function(){
if(this.imgDiv==null){
this.initImgDiv();
}
this.imgDiv.viewRequestID=this.layer.map.viewRequestID;
if(this.layer.url instanceof Array){
this.imgDiv.urls=this.layer.url.slice();
}
this.url=this.layer.getURL(this.bounds);
OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);
var _3e1=this.layer.getImageSize();
if(this.layerAlphaHack){
OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,_3e1,this.url);
}else{
OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,_3e1);
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 _3e2=this.layer.imageOffset;
var size=this.layer.getImageSize();
if(this.layerAlphaHack){
this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,_3e2,size,null,"relative",null,null,null,true);
}else{
this.imgDiv=OpenLayers.Util.createImage(null,_3e2,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 _3e4=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(_3e4,this));
}else{
OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(_3e4,this));
}
var _3e5=function(){
if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){
_3e4.call(this);
}
};
OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(_3e5,this));
},checkImgURL:function(){
if(this.layer){
var _3e6=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;
if(!OpenLayers.Util.isEquivalentUrl(_3e6,this.url)){
this.hide();
}
}
},startTransition:function(){
if(!this.backBufferTile||!this.backBufferTile.imgDiv){
return;
}
var _3e7=1;
if(this.backBufferTile.resolution){
_3e7=this.backBufferTile.resolution/this.layer.getResolution();
}
if(_3e7!=this.lastRatio){
if(this.layer.transitionEffect=="resize"){
var _3e8=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);
var size=new OpenLayers.Size(this.backBufferTile.size.w*_3e7,this.backBufferTile.size.h*_3e7);
var px=this.layer.map.getLayerPxFromLonLat(_3e8);
OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,px,size);
var _3eb=this.backBufferTile.imageSize;
_3eb=new OpenLayers.Size(_3eb.w*_3e7,_3eb.h*_3e7);
var _3ec=this.backBufferTile.imageOffset;
if(_3ec){
_3ec=new OpenLayers.Pixel(_3ec.x*_3e7,_3ec.y*_3e7);
}
OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,_3ec,_3eb);
this.backBufferTile.show();
}
}else{
if(this.layer.singleTile){
this.backBufferTile.show();
}else{
this.backBufferTile.hide();
}
}
this.lastRatio=_3e7;
},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,_3ef,size,_3f1){
this.url=url;
this.extent=_3ef;
this.size=size;
OpenLayers.Layer.prototype.initialize.apply(this,[name,_3f1]);
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(_3f4,_3f5,_3f6){
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
var _3f7=(this.tile==null);
if(_3f5||_3f7){
this.setTileSize();
var ul=new OpenLayers.LonLat(this.extent.left,this.extent.top);
var ulPx=this.map.getLayerPxFromLonLat(ul);
if(_3f7){
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 _3fa=this.extent.getWidth()/this.map.getResolution();
var _3fb=this.extent.getHeight()/this.map.getResolution();
this.tileSize=new OpenLayers.Size(_3fa,_3fb);
},setUrl:function(_3fc){
this.url=_3fc;
this.tile.draw();
},getURL:function(_3fd){
return this.url;
},CLASS_NAME:"OpenLayers.Layer.Image"});
OpenLayers.Layer.SphericalMercator={getExtent:function(){
var _3fe=null;
if(this.sphericalMercator){
_3fe=this.map.calculateBounds();
}else{
_3fe=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this);
}
return _3fe;
},initMercatorParameters:function(){
this.RESOLUTIONS=[];
var _3ff=156543.0339;
for(var zoom=0;zoom<=this.MAX_ZOOM_LEVEL;++zoom){
this.RESOLUTIONS[zoom]=_3ff/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(_409){
var _40a=OpenLayers.Layer.SphericalMercator.forwardMercator(_409.x,_409.y);
_409.x=_40a.lon;
_409.y=_40a.lat;
return _409;
},projectInverse:function(_40b){
var _40c=OpenLayers.Layer.SphericalMercator.inverseMercator(_40b.x,_40b.y);
_40b.x=_40c.lon;
_40b.y=_40c.lat;
return _40b;
}};
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,_40e){
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 _411=this.map.getSize();
var msgW=Math.min(_411.w,300);
var msgH=Math.min(_411.h,200);
var size=new OpenLayers.Size(msgW,msgH);
var _415=new OpenLayers.Pixel(_411.w/2,_411.h/2);
var _416=_415.add(-size.w/2,-size.h/2);
var div=OpenLayers.Util.createDiv(this.name+"_warning",_416,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(_418){
OpenLayers.Layer.prototype.display.apply(this,arguments);
this.pane.style.display=this.div.style.display;
},setZIndex:function(_419){
OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);
this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;
},moveTo:function(_41a,_41b,_41c){
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
if(this.mapObject!=null){
var _41d=this.map.getCenter();
var _41e=this.map.getZoom();
if(_41d!=null){
var _41f=this.getMapObjectCenter();
var _420=this.getOLLonLatFromMapObjectLonLat(_41f);
var _421=this.getMapObjectZoom();
var _422=this.getOLZoomFromMapObjectZoom(_421);
if(!(_41d.equals(_420))||!(_41e==_422)){
if(_41c&&this.dragPanMapObject&&this.smoothDragPan){
var _423=this.map.getViewPortPxFromLonLat(_420);
var _424=this.map.getViewPortPxFromLonLat(_41d);
this.dragPanMapObject(_424.x-_423.x,_423.y-_424.y);
}else{
var _425=this.getMapObjectLonLatFromOLLonLat(_41d);
var zoom=this.getMapObjectZoomFromOLZoom(_41e);
this.setMapObjectCenter(_425,zoom,_41c);
}
}
}
}
},getLonLatFromViewPortPx:function(_427){
var _428=null;
if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){
var _429=this.getMapObjectPixelFromOLPixel(_427);
var _42a=this.getMapObjectLonLatFromMapObjectPixel(_429);
_428=this.getOLLonLatFromMapObjectLonLat(_42a);
}
return _428;
},getViewPortPxFromLonLat:function(_42b){
var _42c=null;
if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){
var _42d=this.getMapObjectLonLatFromOLLonLat(_42b);
var _42e=this.getMapObjectPixelFromMapObjectLonLat(_42d);
_42c=this.getOLPixelFromMapObjectPixel(_42e);
}
return _42c;
},getOLLonLatFromMapObjectLonLat:function(_42f){
var _430=null;
if(_42f!=null){
var lon=this.getLongitudeFromMapObjectLonLat(_42f);
var lat=this.getLatitudeFromMapObjectLonLat(_42f);
_430=new OpenLayers.LonLat(lon,lat);
}
return _430;
},getMapObjectLonLatFromOLLonLat:function(_433){
var _434=null;
if(_433!=null){
_434=this.getMapObjectLonLatFromLonLat(_433.lon,_433.lat);
}
return _434;
},getOLPixelFromMapObjectPixel:function(_435){
var _436=null;
if(_435!=null){
var x=this.getXFromMapObjectPixel(_435);
var y=this.getYFromMapObjectPixel(_435);
_436=new OpenLayers.Pixel(x,y);
}
return _436;
},getMapObjectPixelFromOLPixel:function(_439){
var _43a=null;
if(_439!=null){
_43a=this.getMapObjectPixelFromXY(_439.x,_439.y);
}
return _43a;
},CLASS_NAME:"OpenLayers.Layer.EventPane"});
OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){
},initResolutions:function(){
var _43b=new Array("minZoomLevel","maxZoomLevel","numZoomLevels");
for(var i=0,len=_43b.length;i<len;i++){
var _43e=_43b[i];
this[_43e]=(this.options[_43e]!=null)?this.options[_43e]:this.map[_43e];
}
if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){
this.minZoomLevel=this.MIN_ZOOM_LEVEL;
}
var _43f;
var _440=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;
if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){
_43f=this.maxZoomLevel-this.minZoomLevel+1;
}else{
_43f=this.numZoomLevels;
}
if(_43f!=null){
this.numZoomLevels=Math.min(_43f,_440);
}else{
this.numZoomLevels=_440;
}
this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;
if(this.RESOLUTIONS!=null){
var _441=0;
this.resolutions=[];
for(var i=this.minZoomLevel;i<=this.maxZoomLevel;i++){
this.resolutions[_441++]=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 _442=null;
var _443=this.map.getSize();
var _444=this.getExtent();
if((_443!=null)&&(_444!=null)){
_442=Math.max(_444.getWidth()/_443.w,_444.getHeight()/_443.h);
}
return _442;
}
},getExtent:function(){
var _445=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)){
_445=new OpenLayers.Bounds(tlLL.lon,brLL.lat,brLL.lon,tlLL.lat);
}
return _445;
},getZoomForResolution:function(_44b){
if(this.resolutions!=null){
return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments);
}else{
var _44c=OpenLayers.Layer.prototype.getExtent.apply(this,[]);
return this.getZoomForExtent(_44c);
}
},getOLZoomFromMapObjectZoom:function(_44d){
var zoom=null;
if(_44d!=null){
zoom=_44d-this.minZoomLevel;
}
return zoom;
},getMapObjectZoomFromOLZoom:function(_44f){
var zoom=null;
if(_44f!=null){
zoom=_44f+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,_452){
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 _453=this.div.lastChild;
this.div.removeChild(_453);
this.pane.appendChild(_453);
_453.className="olLayerGooglePoweredBy gmnoprint";
_453.style.left="";
_453.style.bottom="";
var _454=this.div.lastChild;
this.div.removeChild(_454);
this.pane.appendChild(_454);
_454.className="olLayerGoogleCopyright";
_454.style.right="";
_454.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(_456){
OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments);
if(this.div.style.display=="block"&&this.windowResized){
this.mapObject.checkResize();
this.windowResized=false;
}
},getOLBoundsFromMapObjectBounds:function(_457){
var _458=null;
if(_457!=null){
var sw=_457.getSouthWest();
var ne=_457.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());
}
_458=new OpenLayers.Bounds(sw.lon,sw.lat,ne.lon,ne.lat);
}
return _458;
},getMapObjectBoundsFromOLBounds:function(_45b){
var _45c=null;
if(_45b!=null){
var sw=this.sphericalMercator?this.inverseMercator(_45b.bottom,_45b.left):new OpenLayers.LonLat(_45b.bottom,_45b.left);
var ne=this.sphericalMercator?this.inverseMercator(_45b.top,_45b.right):new OpenLayers.LonLat(_45b.top,_45b.right);
_45c=new GLatLngBounds(new GLatLng(sw.lat,sw.lon),new GLatLng(ne.lat,ne.lon));
}
return _45c;
},addContainerPxFunction:function(){
if((typeof GMap2!="undefined")&&!GMap2.prototype.fromLatLngToContainerPixel){
GMap2.prototype.fromLatLngToContainerPixel=function(_45f){
var _460=this.fromLatLngToDivPixel(_45f);
var div=this.getContainer().firstChild.firstChild;
_460.x+=div.offsetLeft;
_460.y+=div.offsetTop;
return _460;
};
}
},getWarningHTML:function(){
return OpenLayers.i18n("googleWarning");
},setMapObjectCenter:function(_462,zoom){
this.mapObject.setCenter(_462,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(_466){
return this.mapObject.fromContainerPixelToLatLng(_466);
},getMapObjectPixelFromMapObjectLonLat:function(_467){
return this.mapObject.fromLatLngToContainerPixel(_467);
},getMapObjectZoomFromMapObjectBounds:function(_468){
return this.mapObject.getBoundsZoomLevel(_468);
},getLongitudeFromMapObjectLonLat:function(_469){
return this.sphericalMercator?this.forwardMercator(_469.lng(),_469.lat()).lon:_469.lng();
},getLatitudeFromMapObjectLonLat:function(_46a){
var lat=this.sphericalMercator?this.forwardMercator(_46a.lng(),_46a.lat()).lat:_46a.lat();
return lat;
},getMapObjectLonLatFromLonLat:function(lon,lat){
var _46e;
if(this.sphericalMercator){
var _46f=this.inverseMercator(lon,lat);
_46e=new GLatLng(_46f.lat,_46f.lon);
}else{
_46e=new GLatLng(lat,lon);
}
return _46e;
},getXFromMapObjectPixel:function(_470){
return _470.x;
},getYFromMapObjectPixel:function(_471){
return _471.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,0.00002145767211914062],type:null,sphericalMercator:false,initialize:function(name,_475){
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 _476=OpenLayers.Util.createDiv(this.name);
var sz=this.map.getSize();
_476.style.width=sz.w+"px";
_476.style.height=sz.h+"px";
this.div.appendChild(_476);
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(_478,zoom){
this.mapObject.SetCenterAndZoom(_478,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(_47c){
return (typeof VEPixel!="undefined")?this.mapObject.PixelToLatLong(_47c):this.mapObject.PixelToLatLong(_47c.x,_47c.y);
},getMapObjectPixelFromMapObjectLonLat:function(_47d){
return this.mapObject.LatLongToPixel(_47d);
},getLongitudeFromMapObjectLonLat:function(_47e){
return this.sphericalMercator?this.forwardMercator(_47e.Longitude,_47e.Latitude).lon:_47e.Longitude;
},getLatitudeFromMapObjectLonLat:function(_47f){
return this.sphericalMercator?this.forwardMercator(_47f.Longitude,_47f.Latitude).lat:_47f.Latitude;
},getMapObjectLonLatFromLonLat:function(lon,lat){
var _482;
if(this.sphericalMercator){
var _483=this.inverseMercator(lon,lat);
_482=new VELatLong(_483.lat,_483.lon);
}else{
_482=new VELatLong(lat,lon);
}
return _482;
},getXFromMapObjectPixel:function(_484){
return _484.x;
},getYFromMapObjectPixel:function(_485){
return _485.y;
},getMapObjectPixelFromXY:function(x,y){
return (typeof VEPixel!="undefined")?new VEPixel(x,y):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,_489){
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 _48d=OpenLayers.Util.getElement("ygddfdiv");
if(_48d!=null){
if(_48d.parentNode!=null){
_48d.parentNode.removeChild(_48d);
}
this.map.events.unregister("moveend",this,this.fixYahooEventPane);
}
},getWarningHTML:function(){
return OpenLayers.i18n("getLayerWarning",{"layerType":"Yahoo","layerLib":"Yahoo"});
},getOLZoomFromMapObjectZoom:function(_48e){
var zoom=null;
if(_48e!=null){
zoom=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[_48e]);
zoom=18-zoom;
}
return zoom;
},getMapObjectZoomFromOLZoom:function(_490){
var zoom=null;
if(_490!=null){
zoom=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[_490]);
zoom=18-zoom;
}
return zoom;
},setMapObjectCenter:function(_492,zoom){
this.mapObject.drawZoomAndCenter(_492,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(_496){
return this.mapObject.convertXYLatLon(_496);
},getMapObjectPixelFromMapObjectLonLat:function(_497){
return this.mapObject.convertLatLonXY(_497);
},getLongitudeFromMapObjectLonLat:function(_498){
return this.sphericalMercator?this.forwardMercator(_498.Lon,_498.Lat).lon:_498.Lon;
},getLatitudeFromMapObjectLonLat:function(_499){
return this.sphericalMercator?this.forwardMercator(_499.Lon,_499.Lat).lat:_499.Lat;
},getMapObjectLonLatFromLonLat:function(lon,lat){
var _49c;
if(this.sphericalMercator){
var _49d=this.inverseMercator(lon,lat);
_49c=new YGeoPoint(_49d.lat,_49d.lon);
}else{
_49c=new YGeoPoint(lat,lon);
}
return _49c;
},getXFromMapObjectPixel:function(_49e){
return _49e.x;
},getYFromMapObjectPixel:function(_49f){
return _49f.y;
},getMapObjectPixelFromXY:function(x,y){
return new YCoordPoint(x,y);
},getMapObjectSizeFromOLSize:function(_4a2){
return new YSize(_4a2.w,_4a2.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,_4a5,_4a6){
var _4a7=arguments;
_4a7=[name,_4a6];
OpenLayers.Layer.prototype.initialize.apply(this,_4a7);
this.url=url;
this.params=OpenLayers.Util.extend({},_4a5);
},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(_4a9){
this.url=_4a9;
},mergeNewParams:function(_4aa){
this.params=OpenLayers.Util.extend(this.params,_4aa);
return this.redraw();
},redraw:function(_4ab){
if(_4ab){
return this.mergeNewParams({"_olSalt":Math.random()});
}else{
return OpenLayers.Layer.prototype.redraw.apply(this,[]);
}
},selectUrl:function(_4ac,urls){
var _4ae=1;
for(var i=0,len=_4ac.length;i<len;i++){
_4ae*=_4ac.charCodeAt(i)*this.URL_HASH_FACTOR;
_4ae-=Math.floor(_4ae);
}
return urls[Math.floor(_4ae*urls.length)];
},getFullRequestString:function(_4b1,_4b2){
var url=_4b2||this.url;
var _4b4=OpenLayers.Util.extend({},this.params);
_4b4=OpenLayers.Util.extend(_4b4,_4b1);
var _4b5=OpenLayers.Util.getParameterString(_4b4);
if(url instanceof Array){
url=this.selectUrl(_4b5,url);
}
var _4b6=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(url));
for(var key in _4b4){
if(key.toUpperCase() in _4b6){
delete _4b4[key];
}
}
_4b5=OpenLayers.Util.getParameterString(_4b4);
var _4b8=url;
if(_4b5!=""){
var _4b9=url.charAt(url.length-1);
if((_4b9=="&")||(_4b9=="?")){
_4b8+=_4b5;
}else{
if(url.indexOf("?")==-1){
_4b8+="?"+_4b5;
}else{
_4b8+="&"+_4b5;
}
}
}
return _4b8;
},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,_4bc,_4bd){
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,len=this.grid.length;iRow<len;iRow++){
var row=this.grid[iRow];
for(var iCol=0,clen=row.length;iCol<clen;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(_4c5,_4c6,_4c7){
OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);
_4c5=_4c5||this.map.getExtent();
if(_4c5!=null){
var _4c8=!this.grid.length||_4c6;
var _4c9=this.getTilesBounds();
if(this.singleTile){
if(_4c8||(!_4c7&&!_4c9.containsBounds(_4c5))){
this.initSingleTile(_4c5);
}
}else{
if(_4c8||!_4c9.containsBounds(_4c5,true)){
this.initGriddedTiles(_4c5);
}else{
this.moveGriddedTiles(_4c5);
}
}
}
},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 _4cc=null;
if(this.grid.length){
var _4cd=this.grid.length-1;
var _4ce=this.grid[_4cd][0];
var _4cf=this.grid[0].length-1;
var _4d0=this.grid[0][_4cf];
_4cc=new OpenLayers.Bounds(_4ce.bounds.left,_4ce.bounds.bottom,_4d0.bounds.right,_4d0.bounds.top);
}
return _4cc;
},initSingleTile:function(_4d1){
var _4d2=_4d1.getCenterLonLat();
var _4d3=_4d1.getWidth()*this.ratio;
var _4d4=_4d1.getHeight()*this.ratio;
var _4d5=new OpenLayers.Bounds(_4d2.lon-(_4d3/2),_4d2.lat-(_4d4/2),_4d2.lon+(_4d3/2),_4d2.lat+(_4d4/2));
var ul=new OpenLayers.LonLat(_4d5.left,_4d5.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(_4d5,px);
this.addTileMonitoringHooks(tile);
tile.draw();
this.grid[0][0]=tile;
}else{
tile.moveTo(_4d5,px);
}
this.removeExcessTiles(1,1);
},calculateGridLayout:function(_4d9,_4da,_4db){
var _4dc=_4db*this.tileSize.w;
var _4dd=_4db*this.tileSize.h;
var _4de=_4d9.left-_4da.left;
var _4df=Math.floor(_4de/_4dc)-this.buffer;
var _4e0=_4de/_4dc-_4df;
var _4e1=-_4e0*this.tileSize.w;
var _4e2=_4da.left+_4df*_4dc;
var _4e3=_4d9.top-(_4da.bottom+_4dd);
var _4e4=Math.ceil(_4e3/_4dd)+this.buffer;
var _4e5=_4e4-_4e3/_4dd;
var _4e6=-_4e5*this.tileSize.h;
var _4e7=_4da.bottom+_4e4*_4dd;
return {tilelon:_4dc,tilelat:_4dd,tileoffsetlon:_4e2,tileoffsetlat:_4e7,tileoffsetx:_4e1,tileoffsety:_4e6};
},initGriddedTiles:function(_4e8){
var _4e9=this.map.getSize();
var _4ea=Math.ceil(_4e9.h/this.tileSize.h)+Math.max(1,2*this.buffer);
var _4eb=Math.ceil(_4e9.w/this.tileSize.w)+Math.max(1,2*this.buffer);
var _4ec=this.maxExtent;
var _4ed=this.map.getResolution();
var _4ee=this.calculateGridLayout(_4e8,_4ec,_4ed);
var _4ef=Math.round(_4ee.tileoffsetx);
var _4f0=Math.round(_4ee.tileoffsety);
var _4f1=_4ee.tileoffsetlon;
var _4f2=_4ee.tileoffsetlat;
var _4f3=_4ee.tilelon;
var _4f4=_4ee.tilelat;
this.origin=new OpenLayers.Pixel(_4ef,_4f0);
var _4f5=_4ef;
var _4f6=_4f1;
var _4f7=0;
var _4f8=parseInt(this.map.layerContainerDiv.style.left);
var _4f9=parseInt(this.map.layerContainerDiv.style.top);
do{
var row=this.grid[_4f7++];
if(!row){
row=[];
this.grid.push(row);
}
_4f1=_4f6;
_4ef=_4f5;
var _4fb=0;
do{
var _4fc=new OpenLayers.Bounds(_4f1,_4f2,_4f1+_4f3,_4f2+_4f4);
var x=_4ef;
x-=_4f8;
var y=_4f0;
y-=_4f9;
var px=new OpenLayers.Pixel(x,y);
var tile=row[_4fb++];
if(!tile){
tile=this.addTile(_4fc,px);
this.addTileMonitoringHooks(tile);
row.push(tile);
}else{
tile.moveTo(_4fc,px,false);
}
_4f1+=_4f3;
_4ef+=this.tileSize.w;
}while((_4f1<=_4e8.right+_4f3*this.buffer)||_4fb<_4eb);
_4f2-=_4f4;
_4f0+=this.tileSize.h;
}while((_4f2>=_4e8.bottom-_4f4*this.buffer)||_4f7<_4ea);
this.removeExcessTiles(_4f7,_4fb);
this.spiralTileLoad();
},spiralTileLoad:function(){
var _501=[];
var _502=["right","down","left","up"];
var iRow=0;
var _504=-1;
var _505=OpenLayers.Util.indexOf(_502,"right");
var _506=0;
while(_506<_502.length){
var _507=iRow;
var _508=_504;
switch(_502[_505]){
case "right":
_508++;
break;
case "down":
_507++;
break;
case "left":
_508--;
break;
case "up":
_507--;
break;
}
var tile=null;
if((_507<this.grid.length)&&(_507>=0)&&(_508<this.grid[0].length)&&(_508>=0)){
tile=this.grid[_507][_508];
}
if((tile!=null)&&(!tile.queued)){
_501.unshift(tile);
tile.queued=true;
_506=0;
iRow=_507;
_504=_508;
}else{
_505=(_505+1)%4;
_506++;
}
}
for(var i=0,len=_501.length;i<len;i++){
var tile=_501[i];
tile.draw();
tile.queued=false;
}
},addTile:function(_50c,_50d){
},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(_510){
var _511=this.buffer||1;
while(true){
var _512=this.grid[0][0].position;
var _513=this.map.getViewPortPxFromLayerPx(_512);
if(_513.x>-this.tileSize.w*(_511-1)){
this.shiftColumn(true);
}else{
if(_513.x<-this.tileSize.w*_511){
this.shiftColumn(false);
}else{
if(_513.y>-this.tileSize.h*(_511-1)){
this.shiftRow(true);
}else{
if(_513.y<-this.tileSize.h*_511){
this.shiftRow(false);
}else{
break;
}
}
}
}
}
},shiftRow:function(_514){
var _515=(_514)?0:(this.grid.length-1);
var grid=this.grid;
var _517=grid[_515];
var _518=this.map.getResolution();
var _519=(_514)?-this.tileSize.h:this.tileSize.h;
var _51a=_518*-_519;
var row=(_514)?grid.pop():grid.shift();
for(var i=0,len=_517.length;i<len;i++){
var _51e=_517[i];
var _51f=_51e.bounds.clone();
var _520=_51e.position.clone();
_51f.bottom=_51f.bottom+_51a;
_51f.top=_51f.top+_51a;
_520.y=_520.y+_519;
row[i].moveTo(_51f,_520);
}
if(_514){
grid.unshift(row);
}else{
grid.push(row);
}
},shiftColumn:function(_521){
var _522=(_521)?-this.tileSize.w:this.tileSize.w;
var _523=this.map.getResolution();
var _524=_523*_522;
for(var i=0,len=this.grid.length;i<len;i++){
var row=this.grid[i];
var _528=(_521)?0:(row.length-1);
var _529=row[_528];
var _52a=_529.bounds.clone();
var _52b=_529.position.clone();
_52a.left=_52a.left+_524;
_52a.right=_52a.right+_524;
_52b.x=_52b.x+_522;
var tile=_521?this.grid[i].pop():this.grid[i].shift();
tile.moveTo(_52a,_52b);
if(_521){
row.unshift(tile);
}else{
row.push(tile);
}
}
},removeExcessTiles:function(rows,_52e){
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>_52e){
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(_533){
var _534=this.maxExtent;
var _535=this.getResolution();
var _536=_535*this.tileSize.w;
var _537=_535*this.tileSize.h;
var _538=this.getLonLatFromViewPortPx(_533);
var _539=_534.left+(_536*Math.floor((_538.lon-_534.left)/_536));
var _53a=_534.bottom+(_537*Math.floor((_538.lat-_534.bottom)/_537));
return new OpenLayers.Bounds(_539,_53a,_539+_536,_53a+_537);
},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,_53d,_53e){
var _53f=[];
_53f.push(name,url,_53d,_53e);
OpenLayers.Layer.Grid.prototype.initialize.apply(this,_53f);
this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);
},getURL:function(_540){
_540=this.adjustBounds(_540);
var _541=this.map.getResolution();
var _542=Math.round((this.map.getScale()*10000))/10000;
var pX=Math.round(_540.left/_541);
var pY=-Math.round(_540.top/_541);
return this.getFullRequestString({t:pY,l:pX,s:_542});
},addTile:function(_545,_546){
var url=this.getURL(_545);
return new OpenLayers.Tile.Image(this,_546,_545,url,this.tileSize);
},calculateGridLayout:function(_548,_549,_54a){
var _54b=_54a*this.tileSize.w;
var _54c=_54a*this.tileSize.h;
var _54d=_548.left;
var _54e=Math.floor(_54d/_54b)-this.buffer;
var _54f=_54d/_54b-_54e;
var _550=-_54f*this.tileSize.w;
var _551=_54e*_54b;
var _552=_548.top;
var _553=Math.ceil(_552/_54c)+this.buffer;
var _554=_553-_552/_54c;
var _555=-(_554+1)*this.tileSize.h;
var _556=_553*_54c;
return {tilelon:_54b,tilelat:_54c,tileoffsetlon:_551,tileoffsetlat:_556,tileoffsetx:_550,tileoffsety:_555};
},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(_558){
var _559=this.getResolution();
var _55a=_559*this.tileSize.w;
var _55b=_559*this.tileSize.h;
var _55c=this.getLonLatFromViewPortPx(_558);
var _55d=_55a*Math.floor(_55c.lon/_55a);
var _55e=_55b*Math.floor(_55c.lat/_55b);
return new OpenLayers.Bounds(_55d,_55e,_55d+_55a,_55e+_55b);
},CLASS_NAME:"OpenLayers.Layer.KaMap"});
OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(name,_560){
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(_561){
if(_561!=this.opacity){
this.opacity=_561;
for(var i=0,len=this.markers.length;i<len;i++){
this.markers[i].setOpacity(this.opacity);
}
}
},moveTo:function(_564,_565,_566){
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
if(_565||!this.drawn){
for(var i=0,len=this.markers.length;i<len;i++){
this.drawMarker(this.markers[i]);
}
this.drawn=true;
}
},addMarker:function(_569){
this.markers.push(_569);
if(this.opacity!=null){
_569.setOpacity(this.opacity);
}
if(this.map&&this.map.getExtent()){
_569.map=this.map;
this.drawMarker(_569);
}
},removeMarker:function(_56a){
if(this.markers&&this.markers.length){
OpenLayers.Util.removeItem(this.markers,_56a);
if((_56a.icon!=null)&&(_56a.icon.imageDiv!=null)&&(_56a.icon.imageDiv.parentNode==this.div)){
this.div.removeChild(_56a.icon.imageDiv);
_56a.drawn=false;
}
}
},clearMarkers:function(){
if(this.markers!=null){
while(this.markers.length>0){
this.removeMarker(this.markers[0]);
}
}
},drawMarker:function(_56b){
var px=this.map.getLayerPxFromLonLat(_56b.lonlat);
if(px==null){
_56b.display(false);
}else{
var _56d=_56b.draw(px);
if(!_56b.drawn){
this.div.appendChild(_56d);
_56b.drawn=true;
}
}
},getDataExtent:function(){
var _56e=null;
if(this.markers&&(this.markers.length>0)){
var _56e=new OpenLayers.Bounds();
for(var i=0,len=this.markers.length;i<len;i++){
var _571=this.markers[i];
_56e.extend(_571.lonlat);
}
}
return _56e;
},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,_574,_575){
var _576=[];
_574=OpenLayers.Util.upperCaseObject(_574);
_576.push(name,url,_574,_575);
OpenLayers.Layer.Grid.prototype.initialize.apply(this,_576);
OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));
if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){
if((_575==null)||(!_575.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(_578){
_578=this.adjustBounds(_578);
var _579=this.getImageSize();
var _57a={"BBOX":this.encodeBBOX?_578.toBBOX():_578.toArray(),"WIDTH":_579.w,"HEIGHT":_579.h};
var _57b=this.getFullRequestString(_57a);
return _57b;
},addTile:function(_57c,_57d){
return new OpenLayers.Tile.Image(this,_57d,_57c,null,this.tileSize);
},mergeNewParams:function(_57e){
var _57f=OpenLayers.Util.upperCaseObject(_57e);
var _580=[_57f];
return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,_580);
},getFullRequestString:function(_581,_582){
var _583=this.map.getProjection();
this.params.SRS=(_583=="none")?null:_583;
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,_586,_587){
this.layername=_586;
OpenLayers.Layer.Grid.prototype.initialize.apply(this,[name,url,{},_587]);
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(_589){
var res=this.map.getResolution();
var bbox=this.maxExtent;
var size=this.tileSize;
var _58d=Math.round((_589.left-bbox.left)/(res*size.w));
var _58e=Math.round((_589.bottom-bbox.bottom)/(res*size.h));
var _58f=this.map.zoom;
function zeroPad(_590,_591){
_590=String(_590);
var _592=[];
for(var i=0;i<_591;++i){
_592.push("0");
}
return _592.join("").substring(0,_591-_590.length)+_590;
};
var _594=[this.layername,zeroPad(_58f,2),zeroPad(parseInt(_58d/1000000),3),zeroPad((parseInt(_58d/1000)%1000),3),zeroPad((parseInt(_58d)%1000),3),zeroPad(parseInt(_58e/1000000),3),zeroPad((parseInt(_58e/1000)%1000),3),zeroPad((parseInt(_58e)%1000),3)+"."+this.extension];
var path=_594.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(_597,_598){
var url=this.getURL(_597);
return new OpenLayers.Tile.Image(this,_598,_597,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,_59c,_59d,_59e,_59f,_5a0,_5a1){
var _5a2=[id,_59c,_59d,_59e,_5a0,_5a1];
OpenLayers.Popup.prototype.initialize.apply(this,_5a2);
this.anchor=(_59f!=null)?_59f:{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 _5a4=this.relativePosition;
this.relativePosition=this.calculateRelativePosition(px);
var _5a5=this.calculateNewPx(px);
var _5a6=new Array(_5a5);
OpenLayers.Popup.prototype.moveTo.apply(this,_5a6);
if(this.relativePosition!=_5a4){
this.updateRelativePosition();
}
},setSize:function(_5a7){
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 _5aa=this.map.getLonLatFromLayerPx(px);
var _5ab=this.map.getExtent();
var _5ac=_5ab.determineQuadrant(_5aa);
return OpenLayers.Bounds.oppositeQuadrant(_5ac);
},updateRelativePosition:function(){
},calculateNewPx:function(px){
var _5ae=px.offset(this.anchor.offset);
var size=this.size||this.contentSize;
var top=(this.relativePosition.charAt(0)=="t");
_5ae.y+=(top)?-size.h:this.anchor.size.h;
var left=(this.relativePosition.charAt(1)=="l");
_5ae.x+=(left)?-size.w:this.anchor.size.w;
return _5ae;
},CLASS_NAME:"OpenLayers.Popup.Anchored"});
OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(id,_5b3,_5b4,_5b5,_5b6,_5b7,_5b8){
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(_5ba){
OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);
this.setRicoCorners();
},setBackgroundColor:function(_5bb){
if(_5bb!=undefined){
this.backgroundColor=_5bb;
}
if(this.div!=null){
if(this.contentDiv!=null){
this.div.style.background="transparent";
OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor);
}
}
},setOpacity:function(_5bc){
OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,_5bc);
if(this.div!=null){
if(this.groupDiv!=null){
OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity);
}
}
},setBorder:function(_5bd){
this.border=0;
},setRicoCorners:function(){
var _5be=this.getCornersToRound(this.relativePosition);
var _5bf={corners:_5be,color:this.backgroundColor,bgColor:"transparent",blend:false};
if(!this.rounded){
OpenLayers.Rico.Corner.round(this.div,_5bf);
this.rounded=true;
}else{
OpenLayers.Rico.Corner.reRound(this.groupDiv,_5bf);
this.setBackgroundColor();
this.setOpacity();
}
},getCornersToRound:function(){
var _5c0=["tl","tr","bl","br"];
var _5c1=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);
OpenLayers.Util.removeItem(_5c0,_5c1);
return _5c0.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(_5c2,_5c3,data){
this.layer=_5c2;
this.lonlat=_5c3;
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 _5c5=false;
if((this.layer!=null)&&(this.layer.map!=null)){
var _5c6=this.layer.map.getExtent();
_5c5=_5c6.containsLonLat(this.lonlat);
}
return _5c5;
},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(_5c7){
if(this.lonlat!=null){
var id=this.id+"_popup";
var _5c9=(this.marker)?this.marker.icon:null;
if(!this.popup){
this.popup=new this.popupClass(id,this.lonlat,this.data.popupSize,this.data.popupContentHTML,_5c9,_5c7);
}
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(_5ca,_5cb,_5cc){
OpenLayers.Feature.prototype.initialize.apply(this,[null,null,_5cb]);
this.lonlat=null;
this.geometry=_5ca?_5ca:null;
this.state=null;
this.attributes={};
if(_5cb){
this.attributes=OpenLayers.Util.extend(this.attributes,_5cb);
}
this.style=_5cc?_5cc: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?this.geometry.clone():null,this.attributes,this.style);
},onScreen:function(_5cd){
var _5ce=false;
if(this.layer&&this.layer.map){
var _5cf=this.layer.map.getExtent();
if(_5cd){
var _5d0=this.geometry.getBounds();
_5ce=_5cf.intersectsBounds(_5d0);
}else{
var _5d1=_5cf.toGeometry();
_5ce=_5d1.intersects(this.geometry);
}
}
return _5ce;
},createMarker:function(){
return null;
},destroyMarker:function(){
},createPopup:function(){
return null;
},atPoint:function(_5d2,_5d3,_5d4){
var _5d5=false;
if(this.geometry){
_5d5=this.geometry.atPoint(_5d2,_5d3,_5d4);
}
return _5d5;
},destroyPopup:function(){
},move:function(_5d6){
if(!this.layer||!this.geometry.move){
return;
}
var _5d7;
if(_5d6.CLASS_NAME=="OpenLayers.LonLat"){
_5d7=this.layer.getViewPortPxFromLonLat(_5d6);
}else{
_5d7=_5d6;
}
var _5d8=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());
var res=this.layer.map.getResolution();
this.geometry.move(res*(_5d7.x-_5d8.x),res*(_5d8.y-_5d7.y));
this.layer.drawFeature(this);
return _5d8;
},toState:function(_5da){
if(_5da==OpenLayers.State.UPDATE){
switch(this.state){
case OpenLayers.State.UNKNOWN:
case OpenLayers.State.DELETE:
this.state=_5da;
break;
case OpenLayers.State.UPDATE:
case OpenLayers.State.INSERT:
break;
}
}else{
if(_5da==OpenLayers.State.INSERT){
switch(this.state){
case OpenLayers.State.UNKNOWN:
break;
default:
this.state=_5da;
break;
}
}else{
if(_5da==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=_5da;
break;
}
}else{
if(_5da==OpenLayers.State.UNKNOWN){
this.state=_5da;
}
}
}
}
},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",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"select":{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",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,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"}};
OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(_5db,_5dc,_5dd){
OpenLayers.Util.extend(this,_5dd);
this.control=_5db;
this.callbacks=_5dc;
if(_5db.map){
this.setMap(_5db.map);
}
OpenLayers.Util.extend(this,_5dd);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
},setMap:function(map){
this.map=map;
},checkModifiers:function(evt){
if(this.keyMask==null){
return true;
}
var _5e0=(evt.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(evt.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(evt.altKey?OpenLayers.Handler.MOD_ALT:0);
return (_5e0==this.keyMask);
},activate:function(){
if(this.active){
return false;
}
var _5e1=OpenLayers.Events.prototype.BROWSER_EVENTS;
for(var i=0,len=_5e1.length;i<len;i++){
if(this[_5e1[i]]){
this.register(_5e1[i],this[_5e1[i]]);
}
}
this.active=true;
return true;
},deactivate:function(){
if(!this.active){
return false;
}
var _5e4=OpenLayers.Events.prototype.BROWSER_EVENTS;
for(var i=0,len=_5e4.length;i<len;i++){
if(this[_5e4[i]]){
this.unregister(_5e4[i],this[_5e4[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,_5ea){
this.map.events.registerPriority(name,this,_5ea);
this.map.events.registerPriority(name,this,this.setEvent);
},unregister:function(name,_5ec){
this.map.events.unregister(name,this,_5ec);
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,rightclickTimerId:null,initialize:function(_5ee,_5ef,_5f0){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
if(this.pixelTolerance!=null){
this.mousedown=function(evt){
this.down=evt.xy;
return true;
};
}
},mousedown:null,mouseup:function(evt){
var _5f3=true;
if(this.checkModifiers(evt)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(evt)){
propogate=this.rightclick(evt);
}
return _5f3;
},rightclick:function(evt){
if(this.passesTolerance(evt)){
if(this.rightclickTimerId!=null){
this.clearTimer();
this.callback("dblrightclick",[evt]);
return !this.stopDouble;
}else{
var _5f5=this["double"]?OpenLayers.Util.extend({},evt):this.callback("rightclick",[evt]);
var _5f6=OpenLayers.Function.bind(this.delayedRightCall,this,_5f5);
this.rightclickTimerId=window.setTimeout(_5f6,this.delay);
}
}
return !this.stopSingle;
},delayedRightCall:function(evt){
this.rightclickTimerId=null;
if(evt){
this.callback("rightclick",[evt]);
}
return !this.stopSingle;
},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 _5fa=this.single?OpenLayers.Util.extend({},evt):null;
this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,_5fa),this.delay);
}
}
return !this.stopSingle;
},passesTolerance:function(evt){
var _5fc=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){
_5fc=false;
}
}
return _5fc;
},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 _5ff=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.clearTimer();
this.down=null;
_5ff=true;
}
return _5ff;
},CLASS_NAME:"OpenLayers.Handler.Click"});
OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(_600,_601,_602){
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 _606=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){
_606=false;
}
}
return _606;
},clearTimer:function(){
if(this.timerId!=null){
window.clearTimeout(this.timerId);
this.timerId=null;
}
},delayedCall:function(evt){
this.callback("pause",[evt]);
},deactivate:function(){
var _609=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.clearTimer();
_609=true;
}
return _609;
},CLASS_NAME:"OpenLayers.Handler.Hover"});
OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:false,drawing:false,mouseDown:false,lastDown:null,lastUp:null,persist:false,layerOptions:null,initialize:function(_60a,_60b,_60c){
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 _60d=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:function(){
return true;
}},this.layerOptions);
this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,_60d);
this.map.addLayer(this.layer);
return true;
},createFeature:function(){
this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point());
this.layer.addFeatures([this.point],{silent:true});
},deactivate:function(){
if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
return false;
}
if(this.drawing){
this.cancel();
}
this.destroyFeature();
if(this.layer.map!=null){
this.layer.destroy(false);
}
this.layer=null;
return true;
},destroyFeature:function(){
if(this.layer){
this.layer.destroyFeatures();
}
this.point=null;
},finalize:function(_60e){
var key=_60e?"cancel":"done";
this.drawing=false;
this.mouseDown=false;
this.lastDown=null;
this.lastUp=null;
this.callback(key,[this.geometryClone()]);
if(_60e||!this.persist){
this.destroyFeature();
}
},cancel:function(){
this.finalize(true);
},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);
},getGeometry:function(){
var _612=this.point.geometry;
if(this.multi){
_612=new OpenLayers.Geometry.MultiPoint([_612]);
}
return _612;
},geometryClone:function(){
return this.getGeometry().clone();
},mousedown:function(evt){
if(!this.checkModifiers(evt)){
return true;
}
if(this.lastDown&&this.lastDown.equals(evt.xy)){
return true;
}
if(this.lastDown==null){
if(this.persist){
this.destroyFeature();
}
this.createFeature();
}
this.lastDown=evt.xy;
this.drawing=true;
var _614=this.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_614.lon;
this.point.geometry.y=_614.lat;
this.point.geometry.clearBounds();
this.drawFeature();
return false;
},mousemove:function(evt){
if(this.drawing){
var _616=this.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_616.lon;
this.point.geometry.y=_616.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(_618,_619,_61a){
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());
this.layer.addFeatures([this.line,this.point],{silent:true});
},destroyFeature:function(){
OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);
this.line=null;
},destroyPoint:function(){
if(this.point){
this.layer.destroyFeatures([this.point]);
}
},addPoint:function(){
this.line.geometry.addComponent(this.point.geometry.clone(),this.line.geometry.components.length);
this.callback("point",[this.point.geometry,this.getGeometry()]);
},freehandMode:function(evt){
return (this.freehandToggle&&evt[this.freehandToggle])?!this.freehand:this.freehand;
},modifyFeature:function(){
var _61c=this.line.geometry.components.length-1;
this.line.geometry.components[_61c].x=this.point.geometry.x;
this.line.geometry.components[_61c].y=this.point.geometry.y;
this.line.geometry.components[_61c].clearBounds();
},drawFeature:function(){
this.layer.drawFeature(this.line,this.style);
this.layer.drawFeature(this.point,this.style);
},getGeometry:function(){
var _61d=this.line.geometry;
if(this.multi){
_61d=new OpenLayers.Geometry.MultiLineString([_61d]);
}
return _61d;
},mousedown:function(evt){
if(this.lastDown&&this.lastDown.equals(evt.xy)){
return false;
}
if(this.lastDown==null){
if(this.persist){
this.destroyFeature();
}
this.createFeature();
}
this.mouseDown=true;
this.lastDown=evt.xy;
var _61f=this.control.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_61f.lon;
this.point.geometry.y=_61f.lat;
this.point.geometry.clearBounds();
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 _621=this.map.getLonLatFromPixel(evt.xy);
this.point.geometry.x=_621.lon;
this.point.geometry.y=_621.lat;
this.point.geometry.clearBounds();
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)){
if(this.persist){
this.destroyPoint();
}
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 _624=this.line.geometry.components.length-1;
this.line.geometry.removeComponent(this.line.geometry.components[_624]);
if(this.persist){
this.destroyPoint();
}
this.finalize();
}
return false;
},CLASS_NAME:"OpenLayers.Handler.Path"});
OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(_625,_626,_627){
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());
this.layer.addFeatures([this.polygon,this.point],{silent:true});
},destroyFeature:function(){
OpenLayers.Handler.Path.prototype.destroyFeature.apply(this);
this.polygon=null;
},modifyFeature:function(){
var _628=this.line.geometry.components.length-2;
this.line.geometry.components[_628].x=this.point.geometry.x;
this.line.geometry.components[_628].y=this.point.geometry.y;
this.line.geometry.components[_628].clearBounds();
},drawFeature:function(){
this.layer.drawFeature(this.polygon,this.style);
this.layer.drawFeature(this.point,this.style);
},getGeometry:function(){
var _629=this.polygon.geometry;
if(this.multi){
_629=new OpenLayers.Geometry.MultiPolygon([_629]);
}
return _629;
},dblclick:function(evt){
if(!this.freehandMode(evt)){
var _62b=this.line.geometry.components.length-2;
this.line.geometry.removeComponent(this.line.geometry.components[_62b]);
if(this.persist){
this.destroyPoint();
}
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:false,initialize:function(_62c,_62d,_62e,_62f){
OpenLayers.Handler.prototype.initialize.apply(this,[_62c,_62e,_62f]);
this.layer=_62d;
},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){
if(!this.callbacks["over"]&&!this.callbacks["out"]){
return true;
}
this.handle(evt);
return true;
},dblclick:function(evt){
return !this.handle(evt);
},geometryTypeMatches:function(_635){
return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,_635.geometry.CLASS_NAME)>-1;
},handle:function(evt){
var type=evt.type;
var _638=false;
var _639=!!(this.feature);
var _63a=(type=="click"||type=="dblclick");
this.feature=this.layer.getFeatureFromEvent(evt);
if(this.feature){
var _63b=(this.feature!=this.lastFeature);
if(this.geometryTypeMatches(this.feature)){
if(_639&&_63b){
this.triggerCallback(type,"out",[this.lastFeature]);
this.triggerCallback(type,"in",[this.feature]);
}else{
if(!_639||_63a){
this.triggerCallback(type,"in",[this.feature]);
}
}
this.lastFeature=this.feature;
_638=true;
}else{
if(_639&&_63b||(_63a&&this.lastFeature)){
this.triggerCallback(type,"out",[this.lastFeature]);
}
this.feature=null;
}
}else{
if(_639||(_63a&&this.lastFeature)){
this.triggerCallback(type,"out",[this.lastFeature]);
}
}
return _638;
},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 _641=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
this.moveLayerToTop();
this.map.events.on({"removelayer":this.handleMapEvents,"changelayer":this.handleMapEvents,scope:this});
_641=true;
}
return _641;
},deactivate:function(){
var _642=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.moveLayerBack();
this.feature=null;
this.lastFeature=null;
this.down=null;
this.up=null;
this.map.events.un({"removelayer":this.handleMapEvents,"changelayer":this.handleMapEvents,scope:this});
_642=true;
}
return _642;
},handleMapEvents:function(evt){
if(!evt.property||evt.property=="order"){
this.moveLayerToTop();
}
},moveLayerToTop:function(){
var _644=Math.max(this.map.Z_INDEX_BASE["Feature"]-1,this.layer.getZIndex())+1;
this.layer.setZIndex(_644);
},moveLayerBack:function(){
var _645=this.layer.getZIndex()-1;
if(_645>=this.map.Z_INDEX_BASE["Feature"]){
this.layer.setZIndex(_645);
}else{
this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer));
}
},CLASS_NAME:"OpenLayers.Handler.Feature"});
OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,last:null,start:null,oldOnselectstart:null,interval:0,timeoutId:null,initialize:function(_646,_647,_648){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
},down:function(evt){
},move:function(evt){
},up:function(evt){
},out:function(evt){
},mousedown:function(evt){
var _64e=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;
};
}
_64e=!this.stopDown;
}else{
this.started=false;
this.start=null;
this.last=null;
}
return _64e;
},mousemove:function(evt){
if(this.started&&!this.timeoutId&&(evt.xy.x!=this.last.x||evt.xy.y!=this.last.y)){
if(this.interval>0){
this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval);
}
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=this.evt.xy;
}
return true;
},removeTimeout:function(){
this.timeoutId=null;
},mouseup:function(evt){
if(this.started){
var _651=(this.start!=this.last);
this.started=false;
this.dragging=false;
this.map.div.style.cursor="";
this.up(evt);
this.callback("up",[evt.xy]);
if(_651){
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 _653=(this.start!=this.last);
this.started=false;
this.dragging=false;
this.map.div.style.cursor="";
this.out(evt);
this.callback("out",[]);
if(_653){
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 _655=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
this.dragging=false;
_655=true;
}
return _655;
},deactivate:function(){
var _656=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
this.started=false;
this.dragging=false;
this.start=null;
this.last=null;
_656=true;
}
return _656;
},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(_657,_658,_659){
this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});
OpenLayers.Handler.prototype.initialize.apply(this,[_657,_658,_659]);
this.options=(_659)?_659:new Object();
},setOptions:function(_65a){
OpenLayers.Util.extend(this.options,_65a);
OpenLayers.Util.extend(this,_65a);
},activate:function(){
var _65b=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
var _65c={displayInLayerSwitcher:false,calculateInRange:function(){
return true;
}};
this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,_65c);
this.map.addLayer(this.layer);
_65b=true;
}
return _65b;
},deactivate:function(){
var _65d=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;
_65d=true;
}
return _65d;
},down:function(evt){
this.fixedRadius=!!(this.radius);
var _65f=this.map.getLonLatFromPixel(evt.xy);
this.origin=new OpenLayers.Geometry.Point(_65f.lon,_65f.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 _661=this.map.getLonLatFromPixel(evt.xy);
var _662=new OpenLayers.Geometry.Point(_661.lon,_661.lat);
if(this.irregular){
var ry=Math.sqrt(2)*Math.abs(_662.y-this.origin.y)/2;
this.radius=Math.max(this.map.getResolution()/2,ry);
}else{
if(this.fixedRadius){
this.origin=_662;
}else{
this.calculateAngle(_662,evt);
this.radius=Math.max(this.map.getResolution()/2,_662.distanceTo(this.origin));
}
}
this.modifyGeometry();
if(this.irregular){
var dx=_662.x-this.origin.x;
var dy=_662.y-this.origin.y;
var _666;
if(dy==0){
_666=dx/(this.radius*Math.sqrt(2));
}else{
_666=dx/dy;
}
this.feature.geometry.resize(1,this.origin,_666);
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 _669,dx,dy,_66c;
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){
_66c=ring.components[i];
_669=this.angle+(i*2*Math.PI/this.sides);
_66c.x=this.origin.x+(this.radius*Math.cos(_669));
_66c.y=this.origin.y+(this.radius*Math.sin(_669));
_66c.clearBounds();
}
},calculateAngle:function(_66f,evt){
var _671=Math.atan2(_66f.y-this.origin.y,_66f.x-this.origin.x);
if(this.snapAngle&&(this.snapToggle&&!evt[this.snapToggle])){
var _672=(Math.PI/180)*this.snapAngle;
this.angle=Math.round(_671/_672)*_672;
}else{
this.angle=_671;
}
},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",boxCharacteristics:null,initialize:function(_675,_676,_677){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
var _676={"down":this.startBox,"move":this.moveBox,"out":this.removeBox,"up":this.endBox};
this.dragHandler=new OpenLayers.Handler.Drag(this,_676,{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 _67b=this.dragHandler.start.x;
var _67c=this.dragHandler.start.y;
var _67d=Math.abs(_67b-xy.x);
var _67e=Math.abs(_67c-xy.y);
this.zoomBox.style.width=Math.max(1,_67d)+"px";
this.zoomBox.style.height=Math.max(1,_67e)+"px";
this.zoomBox.style.left=xy.x<_67b?xy.x+"px":_67b+"px";
this.zoomBox.style.top=xy.y<_67c?xy.y+"px":_67c+"px";
var box=this.getBoxCharacteristics(_67d,_67e);
if(box.newBoxModel){
if(xy.x>_67b){
this.zoomBox.style.width=Math.max(1,_67d-box.xOffset)+"px";
}
if(xy.y>_67c){
this.zoomBox.style.height=Math.max(1,_67e-box.yOffset)+"px";
}
}
},endBox:function(end){
var _681;
if(Math.abs(this.dragHandler.start.x-end.x)>5||Math.abs(this.dragHandler.start.y-end.y)>5){
var _682=this.dragHandler.start;
var top=Math.min(_682.y,end.y);
var _684=Math.max(_682.y,end.y);
var left=Math.min(_682.x,end.x);
var _686=Math.max(_682.x,end.x);
_681=new OpenLayers.Bounds(left,_684,_686,top);
}else{
_681=this.dragHandler.start.clone();
}
this.removeBox();
this.map.div.style.cursor="";
this.callback("done",[_681]);
},removeBox:function(){
this.map.viewPortDiv.removeChild(this.zoomBox);
this.zoomBox=null;
this.boxCharacteristics=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;
}
},getBoxCharacteristics:function(dx,dy){
if(!this.boxCharacteristics){
var _689=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;
var _68a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;
var _68b=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!="BackCompat":true;
this.boxCharacteristics={xOffset:_689,yOffset:_68a,newBoxModel:_68b};
}
return this.boxCharacteristics;
},CLASS_NAME:"OpenLayers.Handler.Box"});
OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,initialize:function(_68c,_68d,_68e){
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 _690=false;
var _691=false;
var _692=false;
var elem=OpenLayers.Event.element(e);
while((elem!=null)&&!_692&&!_690){
if(!_690){
try{
if(elem.currentStyle){
_694=elem.currentStyle["overflow"];
}else{
var _695=document.defaultView.getComputedStyle(elem,null);
var _694=_695.getPropertyValue("overflow");
}
_690=(_694&&(_694=="auto")||(_694=="scroll"));
}
catch(err){
}
}
if(!_691){
for(var i=0,len=this.map.layers.length;i<len;i++){
if(elem==this.map.layers[i].div||elem==this.map.layers[i].pane){
_691=true;
break;
}
}
}
_692=(elem==this.map.div);
elem=elem.parentNode;
}
if(!_690&&_692){
if(_691){
this.wheelZoom(e);
}
OpenLayers.Event.stop(e);
}
},wheelZoom:function(e){
var _699=0;
if(!e){
e=window.event;
}
if(e.wheelDelta){
_699=e.wheelDelta/120;
if(window.opera&&window.opera.version()<9.2){
_699=-_699;
}
}else{
if(e.detail){
_699=-e.detail/3;
}
}
if(_699){
if(this.mousePosition){
e.xy=this.mousePosition;
}
if(!e.xy){
e.xy=this.map.getPixelFromLonLat(this.map.getCenter());
}
if(_699<0){
this.callback("down",[e,_699]);
}else{
this.callback("up",[e,_699]);
}
}
},mousemove:function(evt){
this.mousePosition=evt.xy;
},activate:function(evt){
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
var _69c=this.wheelListener;
OpenLayers.Event.observe(window,"DOMMouseScroll",_69c);
OpenLayers.Event.observe(window,"mousewheel",_69c);
OpenLayers.Event.observe(document,"mousewheel",_69c);
return true;
}else{
return false;
}
},deactivate:function(evt){
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
var _69e=this.wheelListener;
OpenLayers.Event.stopObserving(window,"DOMMouseScroll",_69e);
OpenLayers.Event.stopObserving(window,"mousewheel",_69e);
OpenLayers.Event.stopObserving(document,"mousewheel",_69e);
return true;
}else{
return false;
}
},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});
OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,initialize:function(_69f,_6a0,_6a1){
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,len=this.KEY_EVENTS.length;i<len;i++){
OpenLayers.Event.observe(document,this.KEY_EVENTS[i],this.eventListener);
}
return true;
}else{
return false;
}
},deactivate:function(){
var _6a4=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
for(var i=0,len=this.KEY_EVENTS.length;i<len;i++){
OpenLayers.Event.stopObserving(document,this.KEY_EVENTS[i],this.eventListener);
}
_6a4=true;
}
return _6a4;
},handleKeyEvent:function(evt){
if(this.checkModifiers(evt)){
this.callback(evt.type,[evt]);
}
},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(_6a8){
this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");
OpenLayers.Util.extend(this,_6a8);
this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);
if(this.eventListeners instanceof Object){
this.events.on(this.eventListeners);
}
if(this.id==null){
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(_6ad){
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 _6ae=[];
if(this.map&&this.map.layers){
for(var i=0,len=this.map.layers.length;i<len;i++){
var _6b1=this.map.layers[i];
if(_6b1.attribution&&_6b1.getVisibility()){
_6ae.push(_6b1.attribution);
}
}
this.div.innerHTML=_6ae.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(_6b2){
if(_6b2 instanceof OpenLayers.Bounds){
if(!this.out){
var _6b3=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_6b2.left,_6b2.bottom));
var _6b4=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_6b2.right,_6b2.top));
var _6b5=new OpenLayers.Bounds(_6b3.lon,_6b3.lat,_6b4.lon,_6b4.lat);
}else{
var _6b6=Math.abs(_6b2.right-_6b2.left);
var _6b7=Math.abs(_6b2.top-_6b2.bottom);
var _6b8=Math.min((this.map.size.h/_6b7),(this.map.size.w/_6b6));
var _6b9=this.map.getExtent();
var _6ba=this.map.getLonLatFromPixel(_6b2.getCenterPixel());
var xmin=_6ba.lon-(_6b9.getWidth()/2)*_6b8;
var xmax=_6ba.lon+(_6b9.getWidth()/2)*_6b8;
var ymin=_6ba.lat-(_6b9.getHeight()/2)*_6b8;
var ymax=_6ba.lat+(_6b9.getHeight()/2)*_6b8;
var _6b5=new OpenLayers.Bounds(xmin,ymin,xmax,ymax);
}
this.map.zoomToExtent(_6b5);
}else{
if(!this.out){
this.map.setCenter(this.map.getLonLatFromPixel(_6b2),this.map.getZoom()+1);
}else{
this.map.setCenter(this.map.getLonLatFromPixel(_6b2),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,interval:25,draw:function(){
this.handler=new OpenLayers.Handler.Drag(this,{"move":this.panMap,"done":this.panMapDone},{interval:this.interval});
},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,dragPanOptions:null,zoomBox:null,zoomWheelEnabled:true,handleRightClicks:false,initialize:function(_6c1){
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(){
if(this.handleRightClicks){
this.map.div.oncontextmenu=function(){
return false;
};
}
var _6c2={"dblclick":this.defaultDblClick,"dblrightclick":this.defaultDblRightClick};
var _6c3={"double":true,"stopDouble":true};
this.handlers.click=new OpenLayers.Handler.Click(this,_6c2,_6c3);
this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map},this.dragPanOptions));
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 _6c5=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_6c5,this.map.zoom+1);
},defaultDblRightClick:function(evt){
var _6c7=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_6c7,this.map.zoom-1);
},wheelChange:function(evt,_6c9){
var _6ca=this.map.getZoom()+_6c9;
if(!this.map.isValidZoomLevel(_6ca)){
return;
}
var size=this.map.getSize();
var _6cc=size.w/2-evt.xy.x;
var _6cd=evt.xy.y-size.h/2;
var _6ce=this.map.baseLayer.getResolutionForZoom(_6ca);
var _6cf=this.map.getLonLatFromPixel(evt.xy);
var _6d0=new OpenLayers.LonLat(_6cf.lon+_6cc*_6ce,_6cf.lat+_6cd*_6ce);
this.map.setCenter(_6d0,_6ca);
},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 _6d4=!this.performedDrag;
this.performedDrag=false;
return _6d4;
},defaultDblClick:function(evt){
var _6d6=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_6d6,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 _6d9=Math.abs(this.mouseDragStart.x-evt.xy.x);
var _6da=Math.abs(this.mouseDragStart.y-evt.xy.y);
this.zoomBox.style.width=Math.max(1,_6d9)+"px";
this.zoomBox.style.height=Math.max(1,_6da)+"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 _6d9=this.mouseDragStart.x-evt.xy.x;
var _6da=this.mouseDragStart.y-evt.xy.y;
var size=this.map.getSize();
var _6dc=new OpenLayers.Pixel(size.w/2+_6d9,size.h/2+_6da);
var _6dd=this.map.getLonLatFromViewPortPx(_6dc);
this.map.setCenter(_6dd,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 _6e3=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
var end=this.map.getLonLatFromViewPortPx(evt.xy);
var top=Math.max(_6e3.lat,end.lat);
var _6e6=Math.min(_6e3.lat,end.lat);
var left=Math.min(_6e3.lon,end.lon);
var _6e8=Math.max(_6e3.lon,end.lon);
var _6e9=new OpenLayers.Bounds(left,_6e6,_6e8,top);
this.map.zoomToExtent(_6e9);
}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 _6eb=false;
var elem=OpenLayers.Event.element(e);
while(elem!=null){
if(this.map&&elem==this.map.div){
_6eb=true;
break;
}
elem=elem.parentNode;
}
if(_6eb){
var _6ed=0;
if(!e){
e=window.event;
}
if(e.wheelDelta){
_6ed=e.wheelDelta/120;
if(window.opera&&window.opera.version()<9.2){
_6ed=-_6ed;
}
}else{
if(e.detail){
_6ed=-e.detail/3;
}
}
if(_6ed){
e.xy=this.mousePosition;
if(_6ed<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(_6ee){
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 _6f0;
if(evt==null){
_6f0=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;
}
_6f0=this.map.getLonLatFromPixel(evt.xy);
if(!_6f0){
return;
}
if(this.displayProjection){
_6f0.transform(this.map.getProjectionObject(),this.displayProjection);
}
this.lastXy=evt.xy;
}
var _6f1=this.formatOutput(_6f0);
if(_6f1!=this.element.innerHTML){
this.element.innerHTML=_6f1;
}
},formatOutput:function(_6f2){
var _6f3=parseInt(this.numDigits);
var _6f4=this.prefix+_6f2.lon.toFixed(_6f3)+this.separator+_6f2.lat.toFixed(_6f3)+this.suffix;
return _6f4;
},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,resolutionFactor:1,initialize:function(_6f5){
this.layers=[];
this.handlers={};
OpenLayers.Control.prototype.initialize.apply(this,[_6f5]);
},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 _6f6=this.map.baseLayer.clone();
this.layers=[_6f6];
}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 _6f7=OpenLayers.Util.getImagesLocation();
var img=_6f7+"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=_6f7+"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 _6f9=["dblclick","mousedown"];
for(var i=0,len=_6f9.length;i<len;i++){
OpenLayers.Event.observe(this.maximizeDiv,_6f9[i],OpenLayers.Event.stop);
OpenLayers.Event.observe(this.minimizeDiv,_6f9[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 _6fd=this.handlers.drag.last.x-px.x;
var _6fe=this.handlers.drag.last.y-px.y;
if(_6fd!=0||_6fe!=0){
var _6ff=this.rectPxBounds.top;
var _700=this.rectPxBounds.left;
var _701=Math.abs(this.rectPxBounds.getHeight());
var _702=this.rectPxBounds.getWidth();
var _703=Math.max(0,(_6ff-_6fe));
_703=Math.min(_703,this.ovmap.size.h-this.hComp-_701);
var _704=Math.max(0,(_700-_6fd));
_704=Math.min(_704,this.ovmap.size.w-this.wComp-_702);
this.setRectPxBounds(new OpenLayers.Bounds(_704,_703+_701,_704+_702,_703));
}
},mapDivClick:function(evt){
var _706=this.rectPxBounds.getCenterPixel();
var _707=evt.xy.x-_706.x;
var _708=evt.xy.y-_706.y;
var top=this.rectPxBounds.top;
var left=this.rectPxBounds.left;
var _70b=Math.abs(this.rectPxBounds.getHeight());
var _70c=this.rectPxBounds.getWidth();
var _70d=Math.max(0,(top+_708));
_70d=Math.min(_70d,this.ovmap.size.h-_70b);
var _70e=Math.max(0,(left+_707));
_70e=Math.min(_70e,this.ovmap.size.w-_70c);
this.setRectPxBounds(new OpenLayers.Bounds(_70e,_70d+_70b,_70e+_70c,_70d));
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(_711){
this.maximizeDiv.style.display=_711?"":"none";
this.minimizeDiv.style.display=_711?"none":"";
},update:function(){
if(this.ovmap==null){
this.createMap();
}
if(!this.isSuitableOverview()){
this.updateOverview();
}
this.updateRectToMap();
},isSuitableOverview:function(){
var _712=this.map.getExtent();
var _713=this.map.maxExtent;
var _714=new OpenLayers.Bounds(Math.max(_712.left,_713.left),Math.max(_712.bottom,_713.bottom),Math.min(_712.right,_713.right),Math.min(_712.top,_713.top));
if(this.ovmap.getProjection()!=this.map.getProjection()){
_714=_714.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject());
}
var _715=this.ovmap.getResolution()/this.map.getResolution();
return ((_715>this.minRatio)&&(_715<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(_714)));
},updateOverview:function(){
var _716=this.map.getResolution();
var _717=this.ovmap.getResolution();
var _718=_717/_716;
if(_718>this.maxRatio){
_717=this.minRatio*_716;
}else{
if(_718<=this.minRatio){
_717=this.maxRatio*_716;
}
}
var _719;
if(this.ovmap.getProjection()!=this.map.getProjection()){
_719=this.map.center.clone();
_719.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject());
}else{
_719=this.map.center;
}
this.ovmap.setCenter(_719,this.ovmap.getZoomForResolution(_717*this.resolutionFactor));
this.updateRectToMap();
},createMap:function(){
var _71a=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);
this.ovmap=new OpenLayers.Map(this.mapDiv,_71a);
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();
}
});
if(this.ovmap.getProjection()!=this.map.getProjection()){
var _71d=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;
var _71e=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;
this.resolutionFactor=_71d&&_71e?OpenLayers.INCHES_PER_UNIT[_71d]/OpenLayers.INCHES_PER_UNIT[_71e]:1;
}
},updateRectToMap:function(){
var _71f;
if(this.ovmap.getProjection()!=this.map.getProjection()){
_71f=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject());
}else{
_71f=this.map.getExtent();
}
var _720=this.getRectBoundsFromMapBounds(_71f);
if(_720){
this.setRectPxBounds(_720);
}
},updateMapToRect:function(){
var _721=this.getMapBoundsFromRectBounds(this.rectPxBounds);
if(this.ovmap.getProjection()!=this.map.getProjection()){
_721=_721.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject());
}
this.map.panTo(_721.getCenterLonLat());
},setRectPxBounds:function(_722){
var top=Math.max(_722.top,0);
var left=Math.max(_722.left,0);
var _725=Math.min(_722.top+Math.abs(_722.getHeight()),this.ovmap.size.h-this.hComp);
var _726=Math.min(_722.left+_722.getWidth(),this.ovmap.size.w-this.wComp);
var _727=Math.max(_726-left,0);
var _728=Math.max(_725-top,0);
if(_727<this.minRectSize||_728<this.minRectSize){
this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;
var _729=left+(_727/2)-(this.minRectSize/2);
var rTop=top+(_728/2)-(this.minRectSize/2);
this.extentRectangle.style.top=Math.round(rTop)+"px";
this.extentRectangle.style.left=Math.round(_729)+"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(_728)+"px";
this.extentRectangle.style.width=Math.round(_727)+"px";
}
this.rectPxBounds=new OpenLayers.Bounds(Math.round(left),Math.round(_725),Math.round(_726),Math.round(top));
},getRectBoundsFromMapBounds:function(_72b){
var _72c=new OpenLayers.LonLat(_72b.left,_72b.bottom);
var _72d=new OpenLayers.LonLat(_72b.right,_72b.top);
var _72e=this.getOverviewPxFromLonLat(_72c);
var _72f=this.getOverviewPxFromLonLat(_72d);
var _730=null;
if(_72e&&_72f){
_730=new OpenLayers.Bounds(_72e.x,_72e.y,_72f.x,_72f.y);
}
return _730;
},getMapBoundsFromRectBounds:function(_731){
var _732=new OpenLayers.Pixel(_731.left,_731.bottom);
var _733=new OpenLayers.Pixel(_731.right,_731.top);
var _734=this.getLonLatFromOverviewPx(_732);
var _735=this.getLonLatFromOverviewPx(_733);
return new OpenLayers.Bounds(_734.lon,_734.lat,_735.lon,_735.lat);
},getLonLatFromOverviewPx:function(_736){
var size=this.ovmap.size;
var res=this.ovmap.getResolution();
var _739=this.ovmap.getExtent().getCenterLonLat();
var _73a=_736.x-(size.w/2);
var _73b=_736.y-(size.h/2);
return new OpenLayers.LonLat(_739.lon+_73a*res,_739.lat-_73b*res);
},getOverviewPxFromLonLat:function(_73c){
var res=this.ovmap.getResolution();
var _73e=this.ovmap.getExtent();
var px=null;
if(_73e){
px=new OpenLayers.Pixel(Math.round(1/res*(_73c.lon-_73e.left)),Math.round(1/res*(_73e.top-_73c.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,{"keydown":this.defaultKeyPress});
this.activate();
},defaultKeyPress:function(evt){
switch(evt.keyCode){
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:
case 61:
case 187:
case 107:
this.map.zoomIn();
break;
case 45:
case 109:
case 189:
case 95:
this.map.zoomOut();
break;
}
},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});
OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,buttons:null,position:null,initialize:function(_742){
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 _746=new OpenLayers.Pixel(px.x+sz.w/2,px.y);
this._addButton("panup","north-mini.png",_746,sz);
px.y=_746.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",_746.add(0,sz.h*2),sz);
this._addButton("zoomin","zoom-plus-mini.png",_746.add(0,sz.h*3+5),sz);
this._addButton("zoomworld","zoom-world-mini.png",_746.add(0,sz.h*4+5),sz);
this._addButton("zoomout","zoom-minus-mini.png",_746.add(0,sz.h*5+5),sz);
return this.div;
},_addButton:function(id,img,xy,sz){
var _74b=OpenLayers.Util.getImagesLocation()+img;
var btn=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+id,xy,sz,_74b,"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 _752=new OpenLayers.Pixel(px.x+sz.w/2,px.y);
var _753=sz.w;
if(this.zoomWorldIcon){
_752=new OpenLayers.Pixel(px.x+sz.w,px.y);
}
this._addButton("panup","north-mini.png",_752,sz);
px.y=_752.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);
_753*=2;
}
this._addButton("panright","east-mini.png",px.add(_753,0),sz);
this._addButton("pandown","south-mini.png",_752.add(0,sz.h*2),sz);
this._addButton("zoomin","zoom-plus-mini.png",_752.add(0,sz.h*3+5),sz);
_752=this._addZoomBar(_752.add(0,sz.h*4+5));
this._addButton("zoomout","zoom-minus-mini.png",_752,sz);
return this.div;
},_addZoomBar:function(_754){
var _755=OpenLayers.Util.getImagesLocation();
var id=this.id+"_"+this.map.id;
var _757=this.map.getNumZoomLevels()-1-this.map.getZoom();
var _758=OpenLayers.Util.createAlphaImageDiv(id,_754.add(-1,_757*this.zoomStopHeight),new OpenLayers.Size(20,9),_755+"slider.png","absolute");
this.slider=_758;
this.sliderEvents=new OpenLayers.Events(this,_758,null,true,{includeXY: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=this.id+"_"+this.map.id;
div=OpenLayers.Util.createAlphaImageDiv(id,_754,new OpenLayers.Size(sz.w,this.zoomStopHeight),_755+"zoombar.png","absolute",null,"crop");
div.style.height=sz.h+"px";
}else{
div=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,_754,sz,_755+"zoombar.png");
}
this.zoombarDiv=div;
this.divEvents=new OpenLayers.Events(this,div,null,true,{includeXY: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(_758);
this.map.events.register("zoomend",this,this.moveZoomBar);
_754=_754.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());
return _754;
},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 _75f=(y-top)/this.zoomStopHeight;
if(!this.map.fractionalZoom){
_75f=Math.floor(_75f);
}
var zoom=(this.map.getNumZoomLevels()-1)-_75f;
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 _763=this.mouseDragStart.y-evt.xy.y;
var _764=OpenLayers.Util.pagePosition(this.zoombarDiv);
if((evt.clientY-_764[1])>0&&(evt.clientY-_764[1])<parseInt(this.zoombarDiv.style.height)-2){
var _765=parseInt(this.slider.style.top)-_763;
this.slider.style.top=_765+"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 _767=this.zoomStart.y-evt.xy.y;
var _768=this.map.zoom;
if(this.map.fractionalZoom){
_768+=_767/this.zoomStopHeight;
_768=Math.min(Math.max(_768,0),this.map.getNumZoomLevels()-1);
}else{
_768+=Math.round(_767/this.zoomStopHeight);
}
this.map.zoomTo(_768);
this.moveZoomBar();
this.mouseDragStart=null;
OpenLayers.Event.stop(evt);
}
},moveZoomBar:function(){
var _769=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;
this.slider.style.top=_769+"px";
},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});
OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(_76a){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},setMap:function(map){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
for(var i=0,len=this.map.controls.length;i<len;i++){
var _76e=this.map.controls[i];
if((_76e!=this)&&(_76e.CLASS_NAME=="OpenLayers.Control.ArgParser")){
if(_76e.displayProjection!=this.displayProjection){
this.displayProjection=_76e.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,len=this.layers.length;i<len;i++){
var _772=this.map.layers[i];
var c=this.layers.charAt(i);
if(c=="B"){
this.map.setBaseLayer(_772);
}else{
if((c=="T")||(c=="F")){
_772.setVisibility(c=="T");
}
}
}
}
},CLASS_NAME:"OpenLayers.Control.ArgParser"});
OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{argParserClass:OpenLayers.Control.ArgParser,element:null,base:"",displayProjection:null,initialize:function(_774,base,_776){
OpenLayers.Control.prototype.initialize.apply(this,[_776]);
this.element=OpenLayers.Util.getElement(_774);
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,len=this.map.controls.length;i<len;i++){
var _77a=this.map.controls[i];
if(_77a.CLASS_NAME==this.argParserClass.CLASS_NAME){
if(_77a.displayProjection!=this.displayProjection){
this.displayProjection=_77a.displayProjection;
}
break;
}
}
if(i==this.map.controls.length){
this.map.addControl(new this.argParserClass({"displayProjection":this.displayProjection}));
}
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.element){
this.div.className=this.displayClass;
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});
this.updateLink();
return this.div;
},updateLink:function(){
var href=this.base;
if(href.indexOf("?")!=-1){
href=href.substring(0,href.indexOf("?"));
}
href+="?"+OpenLayers.Util.getParameterString(this.createParams());
this.element.href=href;
},createParams:function(_77c,zoom,_77e){
_77c=_77c||this.map.getCenter();
var _77f=OpenLayers.Util.getParameters(this.base);
if(_77c){
_77f.zoom=zoom||this.map.getZoom();
var lat=_77c.lat;
var lon=_77c.lon;
if(this.displayProjection){
var _782=OpenLayers.Projection.transform({x:lon,y:lat},this.map.getProjectionObject(),this.displayProjection);
lon=_782.x;
lat=_782.y;
}
_77f.lat=Math.round(lat*100000)/100000;
_77f.lon=Math.round(lon*100000)/100000;
_77e=_77e||this.map.layers;
_77f.layers="";
for(var i=0,len=_77e.length;i<len;i++){
var _785=_77e[i];
if(_785.isBaseLayer){
_77f.layers+=(_785==this.map.baseLayer)?"B":"0";
}else{
_77f.layers+=(_785.getVisibility())?"T":"F";
}
}
}
return _77f;
},CLASS_NAME:"OpenLayers.Control.Permalink"});
OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(_786,_787){
OpenLayers.Control.prototype.initialize.apply(this,[_787]);
this.element=OpenLayers.Util.getElement(_786);
},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 _788=this.map.getScale();
if(!_788){
return;
}
if(_788>=9500&&_788<=950000){
_788=Math.round(_788/1000)+"K";
}else{
if(_788>=950000){
_788=Math.round(_788/1000000)+"M";
}else{
_788=Math.round(_788);
}
}
this.element.innerHTML=OpenLayers.i18n("scale",{"scaleDenom":_788});
},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(_789){
OpenLayers.Control.prototype.initialize.apply(this,[_789]);
},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 _78a=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(_78b){
var _78c=parseInt(Math.log(_78b)/Math.log(10));
var _78d=Math.pow(10,_78c);
var _78e=parseInt(_78b/_78d);
var _78f;
if(_78e>5){
_78f=5;
}else{
if(_78e>2){
_78f=2;
}else{
_78f=1;
}
}
return _78f*_78d;
},update:function(){
var res=this.map.getResolution();
if(!res){
return;
}
var _791=this.map.getUnits();
var _792=OpenLayers.INCHES_PER_UNIT;
var _793=this.maxWidth*res*_792[_791];
var _794;
var _795;
if(_793>100000){
_794=this.topOutUnits;
_795=this.bottomOutUnits;
}else{
_794=this.topInUnits;
_795=this.bottomInUnits;
}
var _796=_793/_792[_794];
var _797=_793/_792[_795];
var _798=this.getBarLen(_796);
var _799=this.getBarLen(_797);
_796=_798/_792[_791]*_792[_794];
_797=_799/_792[_791]*_792[_795];
var _79a=_796/res;
var _79b=_797/res;
this.eTop.style.width=Math.round(_79a)+"px";
this.eBottom.style.width=Math.round(_79b)+"px";
this.eTop.innerHTML=_798+" "+_794;
this.eBottom.innerHTML=_799+" "+_795;
},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(_79c){
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(_79e){
var _79f=this[_79e+"Layers"];
if(_79f){
for(var i=0,len=_79f.length;i<len;i++){
var _7a2=_79f[i];
OpenLayers.Event.stopObservingElement(_7a2.inputElem);
OpenLayers.Event.stopObservingElement(_7a2.labelSpan);
}
}
this[_79e+"LayersDiv"].innerHTML="";
this[_79e+"Layers"]=[];
},checkRedraw:function(){
var _7a3=false;
if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){
_7a3=true;
}else{
for(var i=0,len=this.layerStates.length;i<len;i++){
var _7a6=this.layerStates[i];
var _7a7=this.map.layers[i];
if((_7a6.name!=_7a7.name)||(_7a6.inRange!=_7a7.inRange)||(_7a6.id!=_7a7.id)||(_7a6.visibility!=_7a7.visibility)){
_7a3=true;
break;
}
}
}
return _7a3;
},redraw:function(){
if(!this.checkRedraw()){
return this.div;
}
this.clearLayersArray("base");
this.clearLayersArray("data");
var _7a8=false;
var _7a9=false;
var len=this.map.layers.length;
this.layerStates=new Array(len);
for(var i=0;i<len;i++){
var _7ac=this.map.layers[i];
this.layerStates[i]={"name":_7ac.name,"visibility":_7ac.visibility,"inRange":_7ac.inRange,"id":_7ac.id};
}
var _7ad=this.map.layers.slice();
if(!this.ascending){
_7ad.reverse();
}
for(var i=0,len=_7ad.length;i<len;i++){
var _7ac=_7ad[i];
var _7ae=_7ac.isBaseLayer;
if(_7ac.displayInLayerSwitcher){
if(_7ae){
_7a9=true;
}else{
_7a8=true;
}
var _7af=(_7ae)?(_7ac==this.map.baseLayer):_7ac.getVisibility();
var _7b0=document.createElement("input");
_7b0.id=this.id+"_input_"+_7ac.name;
_7b0.name=(_7ae)?"baseLayers":_7ac.name;
_7b0.type=(_7ae)?"radio":"checkbox";
_7b0.value=_7ac.name;
_7b0.checked=_7af;
_7b0.defaultChecked=_7af;
if(!_7ae&&!_7ac.inRange){
_7b0.disabled=true;
}
var _7b1={"inputElem":_7b0,"layer":_7ac,"layerSwitcher":this};
OpenLayers.Event.observe(_7b0,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,_7b1));
var _7b2=document.createElement("span");
if(!_7ae&&!_7ac.inRange){
_7b2.style.color="gray";
}
_7b2.innerHTML=_7ac.name;
_7b2.style.verticalAlign=(_7ae)?"bottom":"baseline";
OpenLayers.Event.observe(_7b2,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,_7b1));
var br=document.createElement("br");
var _7b4=(_7ae)?this.baseLayers:this.dataLayers;
_7b4.push({"layer":_7ac,"inputElem":_7b0,"labelSpan":_7b2});
var _7b5=(_7ae)?this.baseLayersDiv:this.dataLayersDiv;
_7b5.appendChild(_7b0);
_7b5.appendChild(_7b2);
_7b5.appendChild(br);
}
}
this.dataLbl.style.display=(_7a8)?"":"none";
this.baseLbl.style.display=(_7a9)?"":"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,len=this.baseLayers.length;i<len;i++){
var _7ba=this.baseLayers[i];
if(_7ba.inputElem.checked){
this.map.setBaseLayer(_7ba.layer,false);
}
}
for(var i=0,len=this.dataLayers.length;i<len;i++){
var _7ba=this.dataLayers[i];
_7ba.layer.setVisibility(_7ba.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(_7bd){
this.maximizeDiv.style.display=_7bd?"":"none";
this.minimizeDiv.style.display=_7bd?"none":"";
this.layersDiv.style.display=_7bd?"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=this.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 _7be=OpenLayers.Util.getImagesLocation();
var sz=new OpenLayers.Size(18,18);
var img=_7be+"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=_7be+"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,EVENT_TYPES:["featureadded"],featureAdded:function(){
},handlerOptions:null,initialize:function(_7c4,_7c5,_7c6){
this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);
OpenLayers.Control.prototype.initialize.apply(this,[_7c6]);
this.callbacks=OpenLayers.Util.extend({done:this.drawFeature},this.callbacks);
this.layer=_7c4;
this.handler=new _7c5(this,this.callbacks,this.handlerOptions);
},drawFeature:function(_7c7){
var _7c8=new OpenLayers.Feature.Vector(_7c7);
this.layer.addFeatures([_7c8]);
this.featureAdded(_7c8);
this.events.triggerEvent("featureadded",{feature:_7c8});
},CLASS_NAME:"OpenLayers.Control.DrawFeature"});
OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(_7c9,_7ca){
},onDrag:function(_7cb,_7cc){
},onComplete:function(_7cd,_7ce){
},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(_7cf,_7d0){
OpenLayers.Control.prototype.initialize.apply(this,[_7d0]);
this.layer=_7cf;
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(_7d1){
if(!this.handlers.drag.dragging){
this.feature=_7d1;
this.handlers.drag.activate();
this.over=true;
this.map.div.style.cursor="move";
}else{
if(this.feature.id==_7d1.id){
this.over=true;
}else{
this.over=false;
}
}
},downFeature:function(_7d2){
this.lastPixel=_7d2;
this.onStart(this.feature,_7d2);
},moveFeature:function(_7d3){
var res=this.map.getResolution();
this.feature.geometry.move(res*(_7d3.x-this.lastPixel.x),res*(this.lastPixel.y-_7d3.y));
this.layer.drawFeature(this.feature);
this.lastPixel=_7d3;
this.onDrag(this.feature,_7d3);
},upFeature:function(_7d5){
if(!this.over){
this.handlers.drag.deactivate();
this.feature=null;
this.map.div.style.cursor="default";
}else{
this.map.div.style.cursor="move";
}
},doneDragging:function(_7d6){
this.onComplete(this.feature,_7d6);
},outFeature:function(_7d7){
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==_7d7.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(_7d9,_7da){
this.layer=_7d9;
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,68];
this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;
OpenLayers.Control.prototype.initialize.apply(this,[_7da]);
if(!(this.deleteCodes instanceof Array)){
this.deleteCodes=[this.deleteCodes];
}
var _7db=this;
var _7dc={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle};
this.selectControl=new OpenLayers.Control.SelectFeature(_7d9,_7dc);
this.layer.events.on({"beforefeatureselected":this.beforeSelectFeature,"featureselected":this.selectFeature,"featureunselected":this.unselectFeature,scope:this});
var _7dd={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(_7de,_7df){
_7db.dragStart.apply(_7db,[_7de,_7df]);
},onDrag:function(_7e0){
_7db.dragVertex.apply(_7db,[_7e0]);
},onComplete:function(_7e1){
_7db.dragComplete.apply(_7db,[_7e1]);
}};
this.dragControl=new OpenLayers.Control.DragFeature(_7d9,_7dd);
var _7e2={keydown:this.handleKeypress};
this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,_7e2)};
},destroy:function(){
this.layer.events.un({"beforefeatureselected":this.beforeSelectFeature,"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 _7e3=false;
if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){
this.layer.removeFeatures(this.vertices,{silent:true});
this.layer.removeFeatures(this.virtualVertices,{silent:true});
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();
_7e3=true;
}
return _7e3;
},beforeSelectFeature:function(_7e4){
return this.layer.events.triggerEvent("beforefeaturemodified",{feature:_7e4.feature});
},selectFeature:function(_7e5){
this.feature=_7e5.feature;
this.resetVertices();
this.dragControl.activate();
this.onModificationStart(this.feature);
},unselectFeature:function(_7e6){
this.layer.removeFeatures(this.vertices,{silent:true});
this.vertices=[];
this.layer.destroyFeatures(this.virtualVertices,{silent:true});
this.virtualVertices=[];
if(this.dragHandle){
this.layer.destroyFeatures([this.dragHandle],{silent:true});
delete this.dragHandle;
}
if(this.radiusHandle){
this.layer.destroyFeatures([this.radiusHandle],{silent:true});
delete this.radiusHandle;
}
this.feature=null;
this.dragControl.deactivate();
this.onModificationEnd(_7e6.feature);
this.layer.events.triggerEvent("afterfeaturemodified",{feature:_7e6.feature});
},dragStart:function(_7e7,_7e8){
if(_7e7!=this.feature&&!_7e7.geometry.parent&&_7e7!=this.dragHandle&&_7e7!=this.radiusHandle){
if(this.feature){
this.selectControl.clickFeature.apply(this.selectControl,[this.feature]);
}
if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,_7e7.geometry.CLASS_NAME)!=-1){
this.selectControl.clickFeature.apply(this.selectControl,[_7e7]);
this.dragControl.overFeature.apply(this.dragControl,[_7e7]);
this.dragControl.lastPixel=_7e8;
this.dragControl.handlers.drag.started=true;
this.dragControl.handlers.drag.start=_7e8;
this.dragControl.handlers.drag.last=_7e8;
}
}
},dragVertex:function(_7e9){
if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){
if(this.feature!=_7e9){
this.feature=_7e9;
}
}else{
if(_7e9._index){
_7e9.geometry.parent.addComponent(_7e9.geometry,_7e9._index);
delete _7e9._index;
OpenLayers.Util.removeItem(this.virtualVertices,_7e9);
this.vertices.push(_7e9);
}else{
if(_7e9==this.dragHandle){
this.layer.removeFeatures(this.vertices,{silent:true});
this.vertices=[];
if(this.radiusHandle){
this.layer.destroyFeatures([this.radiusHandle],{silent:true});
this.radiusHandle=null;
}
}
}
if(this.virtualVertices.length>0){
this.layer.destroyFeatures(this.virtualVertices,{silent:true});
this.virtualVertices=[];
}
this.layer.drawFeature(this.feature,this.selectControl.renderIntent);
}
this.layer.drawFeature(_7e9);
},dragComplete:function(_7ea){
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,{silent:true});
this.vertices=[];
}
if(this.virtualVertices.length>0){
this.layer.removeFeatures(this.virtualVertices,{silent:true});
this.virtualVertices=[];
}
if(this.dragHandle){
this.layer.destroyFeatures([this.dragHandle],{silent:true});
this.dragHandle=null;
}
if(this.radiusHandle){
this.layer.destroyFeatures([this.radiusHandle],{silent:true});
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(evt){
var code=evt.keyCode;
if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,code)!=-1){
var _7ed=this.dragControl.feature;
if(_7ed&&OpenLayers.Util.indexOf(this.vertices,_7ed)!=-1&&!this.dragControl.handlers.drag.dragging&&_7ed.geometry.parent){
_7ed.geometry.parent.removeComponent(_7ed.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 _7ee=this;
function collectComponentVertices(_7ef){
var i,_7f1,_7f2,len;
if(_7ef.CLASS_NAME=="OpenLayers.Geometry.Point"){
_7f1=new OpenLayers.Feature.Vector(_7ef);
_7ee.vertices.push(_7f1);
}else{
var _7f4=_7ef.components.length;
if(_7ef.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){
_7f4-=1;
}
for(i=0;i<_7f4;++i){
_7f2=_7ef.components[i];
if(_7f2.CLASS_NAME=="OpenLayers.Geometry.Point"){
_7f1=new OpenLayers.Feature.Vector(_7f2);
_7ee.vertices.push(_7f1);
}else{
collectComponentVertices(_7f2);
}
}
if(_7ef.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){
for(i=0,len=_7ef.components.length;i<len-1;++i){
var _7f5=_7ef.components[i];
var _7f6=_7ef.components[i+1];
if(_7f5.CLASS_NAME=="OpenLayers.Geometry.Point"&&_7f6.CLASS_NAME=="OpenLayers.Geometry.Point"){
var x=(_7f5.x+_7f6.x)/2;
var y=(_7f5.y+_7f6.y)/2;
var _7f9=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(x,y),null,_7ee.virtualStyle);
_7f9.geometry.parent=_7ef;
_7f9._index=i+1;
_7ee.virtualVertices.push(_7f9);
}
}
}
}
};
collectComponentVertices.call(this,this.feature.geometry);
this.layer.addFeatures(this.virtualVertices,{silent:true});
this.layer.addFeatures(this.vertices,{silent:true});
},collectDragHandle:function(){
var _7fa=this.feature.geometry;
var _7fb=_7fa.getBounds().getCenterLonLat();
var _7fc=new OpenLayers.Geometry.Point(_7fb.lon,_7fb.lat);
var _7fd=new OpenLayers.Feature.Vector(_7fc);
_7fc.move=function(x,y){
OpenLayers.Geometry.Point.prototype.move.call(this,x,y);
_7fa.move(x,y);
};
this.dragHandle=_7fd;
this.layer.addFeatures([this.dragHandle],{silent:true});
},collectRadiusHandle:function(){
var _800=this.feature.geometry;
var _801=_800.getBounds();
var _802=_801.getCenterLonLat();
var _803=new OpenLayers.Geometry.Point(_802.lon,_802.lat);
var _804=new OpenLayers.Geometry.Point(_801.right,_801.bottom);
var _805=new OpenLayers.Feature.Vector(_804);
var _806=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);
var _807=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);
_804.move=function(x,y){
OpenLayers.Geometry.Point.prototype.move.call(this,x,y);
var dx1=this.x-_803.x;
var dy1=this.y-_803.y;
var dx0=dx1-x;
var dy0=dy1-y;
if(_807){
var a0=Math.atan2(dy0,dx0);
var a1=Math.atan2(dy1,dx1);
var _810=a1-a0;
_810*=180/Math.PI;
_800.rotate(_810,_803);
}
if(_806){
var l0=Math.sqrt((dx0*dx0)+(dy0*dy0));
var l1=Math.sqrt((dx1*dx1)+(dy1*dy1));
_800.resize(l1/l0,_803);
}
};
this.radiusHandle=_805;
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(_814){
OpenLayers.Control.prototype.initialize.apply(this,[_814]);
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,len=this.controls.length;i<len;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,len=this.controls.length;i<len;i++){
this.controls[i].deactivate();
}
return true;
}else{
return false;
}
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
for(var i=0,len=this.controls.length;i<len;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,len=this.controls.length;i<len;i++){
var _81e=this.controls[i].panel_div;
if(this.controls[i].active){
_81e.className=this.controls[i].displayClass+"ItemActive";
}else{
_81e.className=this.controls[i].displayClass+"ItemInactive";
}
this.div.appendChild(_81e);
}
}
},activateControl:function(_81f){
if(!this.active){
return false;
}
if(_81f.type==OpenLayers.Control.TYPE_BUTTON){
_81f.trigger();
this.redraw();
return;
}
if(_81f.type==OpenLayers.Control.TYPE_TOGGLE){
if(_81f.active){
_81f.deactivate();
}else{
_81f.activate();
}
this.redraw();
return;
}
for(var i=0,len=this.controls.length;i<len;i++){
if(this.controls[i]!=_81f){
if(this.controls[i].type!=OpenLayers.Control.TYPE_TOGGLE){
this.controls[i].deactivate();
}
}
}
_81f.activate();
},addControls:function(_822){
if(!(_822 instanceof Array)){
_822=[_822];
}
this.controls=this.controls.concat(_822);
for(var i=0,len=_822.length;i<len;i++){
var _825=document.createElement("div");
var _826=document.createTextNode(" ");
_822[i].panel_div=_825;
if(_822[i].title!=""){
_822[i].panel_div.title=_822[i].title;
}
OpenLayers.Event.observe(_822[i].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,_822[i]));
OpenLayers.Event.observe(_822[i].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop));
}
if(this.map){
for(var i=0,len=_822.length;i<len;i++){
this.map.addControl(_822[i]);
_822[i].deactivate();
_822[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(_829,_82a){
var test=(typeof _82a.test=="function");
var _82c=OpenLayers.Array.filter(this.controls,function(item){
return item[_829]==_82a||(test&&_82a.test(item[_829]));
});
return _82c;
},getControlsByName:function(_82e){
return this.getControlsBy("name",_82e);
},getControlsByClass:function(_82f){
return this.getControlsBy("CLASS_NAME",_82f);
},CLASS_NAME:"OpenLayers.Control.Panel"});
OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,box:false,onSelect:function(){
},onUnselect:function(){
},geometryTypes:null,layer:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(_830,_831){
OpenLayers.Control.prototype.initialize.apply(this,[_831]);
this.layer=_830;
var _832={click:this.clickFeature,clickout:this.clickoutFeature};
if(this.hover){
_832.over=this.overFeature;
_832.out=this.outFeature;
}
this.callbacks=OpenLayers.Util.extend(_832,this.callbacks);
this.handlers={feature:new OpenLayers.Handler.Feature(this,_830,this.callbacks,{geometryTypes:this.geometryTypes})};
if(this.box){
this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"});
}
},activate:function(){
if(!this.active){
this.handlers.feature.activate();
if(this.box&&this.handlers.box){
this.handlers.box.activate();
}
}
return OpenLayers.Control.prototype.activate.apply(this,arguments);
},deactivate:function(){
if(this.active){
this.handlers.feature.deactivate();
if(this.handlers.box){
this.handlers.box.deactivate();
}
}
return OpenLayers.Control.prototype.deactivate.apply(this,arguments);
},unselectAll:function(_833){
var _834;
for(var i=this.layer.selectedFeatures.length-1;i>=0;--i){
_834=this.layer.selectedFeatures[i];
if(!_833||_833.except!=_834){
this.unselect(_834);
}
}
},clickFeature:function(_836){
if(!this.hover){
var _837=(OpenLayers.Util.indexOf(this.layer.selectedFeatures,_836)>-1);
if(_837){
if(this.toggleSelect()){
this.unselect(_836);
}else{
if(!this.multipleSelect()){
this.unselectAll({except:_836});
}
}
}else{
if(!this.multipleSelect()){
this.unselectAll({except:_836});
}
this.select(_836);
}
}
},multipleSelect:function(){
return this.multiple||this.handlers.feature.evt[this.multipleKey];
},toggleSelect:function(){
return this.toggle||this.handlers.feature.evt[this.toggleKey];
},clickoutFeature:function(_838){
if(!this.hover&&this.clickout){
this.unselectAll();
}
},overFeature:function(_839){
if(this.hover&&(OpenLayers.Util.indexOf(this.layer.selectedFeatures,_839)==-1)){
this.select(_839);
}
},outFeature:function(_83a){
if(this.hover){
this.unselect(_83a);
}
},select:function(_83b){
var cont=this.layer.events.triggerEvent("beforefeatureselected",{feature:_83b});
if(cont!==false){
this.layer.selectedFeatures.push(_83b);
var _83d=this.selectStyle||this.renderIntent;
this.layer.drawFeature(_83b,_83d);
this.layer.events.triggerEvent("featureselected",{feature:_83b});
this.onSelect(_83b);
}
},unselect:function(_83e){
this.layer.drawFeature(_83e,"default");
OpenLayers.Util.removeItem(this.layer.selectedFeatures,_83e);
this.layer.events.triggerEvent("featureunselected",{feature:_83e});
this.onUnselect(_83e);
},selectBox:function(_83f){
if(_83f instanceof OpenLayers.Bounds){
var _840=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_83f.left,_83f.bottom));
var _841=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_83f.right,_83f.top));
var _842=new OpenLayers.Bounds(_840.lon,_840.lat,_841.lon,_841.lat);
if(!this.multipleSelect()){
this.unselectAll();
}
var _843=this.multiple;
this.multiple=true;
for(var i=0,len=this.layer.features.length;i<len;++i){
var _846=this.layer.features[i];
if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,_846.geometry.CLASS_NAME)>-1){
if(_842.toGeometry().intersects(_846.geometry)){
if(OpenLayers.Util.indexOf(this.layer.selectedFeatures,_846)==-1){
this.select(_846);
}
}
}
}
this.multiple=_843;
}
},setMap:function(map){
this.handlers.feature.setMap(map);
if(this.box){
this.handlers.box.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(_848){
OpenLayers.Control.prototype.initialize.apply(this,[_848]);
this.registry=OpenLayers.Util.extend({"moveend":function(){
return {center:this.map.getCenter(),resolution:this.map.getResolution()};
}},this.registry);
this.clear();
var _849={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};
OpenLayers.Util.extend(_849,this.previousOptions);
this.previous=new OpenLayers.Control.Button(_849);
var _84a={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};
OpenLayers.Util.extend(_84a,this.nextOptions);
this.next=new OpenLayers.Control.Button(_84a);
},onPreviousChange:function(_84b,_84c){
if(_84b&&!this.previous.active){
this.previous.activate();
}else{
if(!_84b&&this.previous.active){
this.previous.deactivate();
}
}
},onNextChange:function(_84d,_84e){
if(_84d&&!this.next.active){
this.next.activate();
}else{
if(!_84d&&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 _851=this.previousStack.shift();
var _852=this.previousStack.shift();
if(_852!=undefined){
this.nextStack.unshift(_851);
this.previousStack.unshift(_852);
this.restoring=true;
this.restore(_852);
this.restoring=false;
this.onNextChange(this.nextStack[0],this.nextStack.length);
this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);
}else{
this.previousStack.unshift(_851);
}
return _852;
},nextTrigger:function(){
var _853=this.nextStack.shift();
if(_853!=undefined){
this.previousStack.unshift(_853);
this.restoring=true;
this.restore(_853);
this.restoring=false;
this.onNextChange(this.nextStack[0],this.nextStack.length);
this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);
}
return _853;
},clear:function(){
this.previousStack=[];
this.nextStack=[];
},restore:function(_854){
var zoom=this.map.getZoomForResolution(_854.resolution);
this.map.setCenter(_854.center,zoom);
},setListeners:function(){
this.listeners={};
for(var type in this.registry){
this.listeners[type]=OpenLayers.Function.bind(function(){
if(!this.restoring){
var _857=this.registry[type].apply(this,arguments);
this.previousStack.unshift(_857);
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 _858=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]);
}
_858=true;
if(this.previousStack.length==0){
this.initStack();
}
}
}
return _858;
},initStack:function(){
if(this.map.getCenter()){
this.listeners.moveend();
}
},deactivate:function(){
var _85a=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();
}
_85a=true;
}
}
return _85a;
},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(_85c){
if(_85c){
this.bounds=_85c.clone();
}
},clearBounds:function(){
this.bounds=null;
if(this.parent){
this.parent.clearBounds();
}
},extendBounds:function(_85d){
var _85e=this.getBounds();
if(!_85e){
this.setBounds(_85d);
}else{
this.bounds.extend(_85d);
}
},getBounds:function(){
if(this.bounds==null){
this.calculateBounds();
}
return this.bounds;
},calculateBounds:function(){
},atPoint:function(_85f,_860,_861){
var _862=false;
var _863=this.getBounds();
if((_863!=null)&&(_85f!=null)){
var dX=(_860!=null)?_860:0;
var dY=(_861!=null)?_861:0;
var _866=new OpenLayers.Bounds(this.bounds.left-dX,this.bounds.bottom-dY,this.bounds.right+dX,this.bounds.top+dY);
_862=_866.containsLonLat(_85f);
}
return _862;
},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,_869){
var _86a=false;
var _86b=seg1.x1-seg2.x1;
var _86c=seg1.y1-seg2.y1;
var _86d=seg1.x2-seg1.x1;
var _86e=seg1.y2-seg1.y1;
var _86f=seg2.y2-seg2.y1;
var _870=seg2.x2-seg2.x1;
var d=(_86f*_86d)-(_870*_86e);
var n1=(_870*_86c)-(_86f*_86b);
var n2=(_86d*_86c)-(_86e*_86b);
if(d==0){
if(n1==0&&n2==0){
_86a=true;
}
}else{
var _874=n1/d;
var _875=n2/d;
if(_874>=0&&_874<=1&&_875>=0&&_875<=1){
if(!_869){
_86a=true;
}else{
var x=seg1.x1+(_874*_86d);
var y=seg1.y1+(_874*_86e);
_86a=new OpenLayers.Geometry.Point(x,y);
}
}
}
return _86a;
};
OpenLayers.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(x,y,_87a,_87b){
OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
this.x=x;
this.y=y;
this.width=_87a;
this.height=_87b;
},calculateBounds:function(){
this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height);
},getLength:function(){
var _87c=(2*this.width)+(2*this.height);
return _87c;
},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(_87e){
OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
this.components=[];
if(_87e!=null){
this.addComponents(_87e);
}
},destroy:function(){
this.components.length=0;
this.components=null;
},clone:function(){
var _87f=eval("new "+this.CLASS_NAME+"()");
for(var i=0,len=this.components.length;i<len;i++){
_87f.addComponent(this.components[i].clone());
}
OpenLayers.Util.applyDefaults(_87f,this);
return _87f;
},getComponentsString:function(){
var _882=[];
for(var i=0,len=this.components.length;i<len;i++){
_882.push(this.components[i].toShortString());
}
return _882.join(",");
},calculateBounds:function(){
this.bounds=null;
if(this.components&&this.components.length>0){
this.setBounds(this.components[0].getBounds());
for(var i=1,len=this.components.length;i<len;i++){
this.extendBounds(this.components[i].getBounds());
}
}
},addComponents:function(_887){
if(!(_887 instanceof Array)){
_887=[_887];
}
for(var i=0,len=_887.length;i<len;i++){
this.addComponent(_887[i]);
}
},addComponent:function(_88a,_88b){
var _88c=false;
if(_88a){
if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,_88a.CLASS_NAME)>-1)){
if(_88b!=null&&(_88b<this.components.length)){
var _88d=this.components.slice(0,_88b);
var _88e=this.components.slice(_88b,this.components.length);
_88d.push(_88a);
this.components=_88d.concat(_88e);
}else{
this.components.push(_88a);
}
_88a.parent=this;
this.clearBounds();
_88c=true;
}
}
return _88c;
},removeComponents:function(_88f){
if(!(_88f instanceof Array)){
_88f=[_88f];
}
for(var i=_88f.length-1;i>=0;--i){
this.removeComponent(_88f[i]);
}
},removeComponent:function(_891){
OpenLayers.Util.removeItem(this.components,_891);
this.clearBounds();
},getLength:function(){
var _892=0;
for(var i=0,len=this.components.length;i<len;i++){
_892+=this.components[i].getLength();
}
return _892;
},getArea:function(){
var area=0;
for(var i=0,len=this.components.length;i<len;i++){
area+=this.components[i].getArea();
}
return area;
},move:function(x,y){
for(var i=0,len=this.components.length;i<len;i++){
this.components[i].move(x,y);
}
},rotate:function(_89c,_89d){
for(var i=0,len=this.components.length;i<len;++i){
this.components[i].rotate(_89c,_89d);
}
},resize:function(_8a0,_8a1,_8a2){
for(var i=0;i<this.components.length;++i){
this.components[i].resize(_8a0,_8a1,_8a2);
}
},equals:function(_8a4){
var _8a5=true;
if(!_8a4||!_8a4.CLASS_NAME||(this.CLASS_NAME!=_8a4.CLASS_NAME)){
_8a5=false;
}else{
if(!(_8a4.components instanceof Array)||(_8a4.components.length!=this.components.length)){
_8a5=false;
}else{
for(var i=0,len=this.components.length;i<len;++i){
if(!this.components[i].equals(_8a4.components[i])){
_8a5=false;
break;
}
}
}
}
return _8a5;
},transform:function(_8a8,dest){
if(_8a8&&dest){
for(var i=0,len=this.components.length;i<len;i++){
var _8ac=this.components[i];
_8ac.transform(_8a8,dest);
}
this.bounds=null;
}
return this;
},intersects:function(_8ad){
var _8ae=false;
for(var i=0,len=this.components.length;i<len;++i){
_8ae=_8ad.intersects(this.components[i]);
if(_8ae){
break;
}
}
return _8ae;
},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(_8b4){
var _8b5=0;
if((this.x!=null)&&(this.y!=null)&&(_8b4!=null)&&(_8b4.x!=null)&&(_8b4.y!=null)){
var dx2=Math.pow(this.x-_8b4.x,2);
var dy2=Math.pow(this.y-_8b4.y,2);
_8b5=Math.sqrt(dx2+dy2);
}
return _8b5;
},equals:function(geom){
var _8b9=false;
if(geom!=null){
_8b9=((this.x==geom.x&&this.y==geom.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(geom.x)&&isNaN(geom.y)));
}
return _8b9;
},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(_8bc,_8bd){
_8bc*=Math.PI/180;
var _8be=this.distanceTo(_8bd);
var _8bf=_8bc+Math.atan2(this.y-_8bd.y,this.x-_8bd.x);
this.x=_8bd.x+(_8be*Math.cos(_8bf));
this.y=_8bd.y+(_8be*Math.sin(_8bf));
this.clearBounds();
},resize:function(_8c0,_8c1,_8c2){
_8c2=(_8c2==undefined)?1:_8c2;
this.x=_8c1.x+(_8c0*_8c2*(this.x-_8c1.x));
this.y=_8c1.y+(_8c0*(this.y-_8c1.y));
this.clearBounds();
},intersects:function(_8c3){
var _8c4=false;
if(_8c3.CLASS_NAME=="OpenLayers.Geometry.Point"){
_8c4=this.equals(_8c3);
}else{
_8c4=_8c3.intersects(this);
}
return _8c4;
},transform:function(_8c5,dest){
if((_8c5&&dest)){
OpenLayers.Projection.transform(this,_8c5,dest);
this.bounds=null;
}
return this;
},CLASS_NAME:"OpenLayers.Geometry.Point"});
OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(_8c7){
OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments);
},addPoint:function(_8c8,_8c9){
this.addComponent(_8c8,_8c9);
},removePoint:function(_8ca){
this.removeComponent(_8ca);
},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});
OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(_8cb){
OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments);
},getLength:function(){
var _8cc=0;
if(this.components&&(this.components.length>1)){
for(var i=1,len=this.components.length;i<len;i++){
_8cc+=this.components[i-1].distanceTo(this.components[i]);
}
}
return _8cc;
},CLASS_NAME:"OpenLayers.Geometry.Curve"});
OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(_8cf){
OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments);
},removeComponent:function(_8d0){
if(this.components&&(this.components.length>2)){
OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);
}
},intersects:function(_8d1){
var _8d2=false;
var type=_8d1.CLASS_NAME;
if(type=="OpenLayers.Geometry.LineString"||type=="OpenLayers.Geometry.LinearRing"||type=="OpenLayers.Geometry.Point"){
var _8d4=this.getSortedSegments();
var _8d5;
if(type=="OpenLayers.Geometry.Point"){
_8d5=[{x1:_8d1.x,y1:_8d1.y,x2:_8d1.x,y2:_8d1.y}];
}else{
_8d5=_8d1.getSortedSegments();
}
var seg1,_8d7,_8d8,_8d9,_8da,seg2,_8dc,_8dd;
outer:
for(var i=0,len=_8d4.length;i<len;++i){
seg1=_8d4[i];
_8d7=seg1.x1;
_8d8=seg1.x2;
_8d9=seg1.y1;
_8da=seg1.y2;
inner:
for(var j=0,jlen=_8d5.length;j<jlen;++j){
seg2=_8d5[j];
if(seg2.x1>_8d8){
break;
}
if(seg2.x2<_8d7){
continue;
}
_8dc=seg2.y1;
_8dd=seg2.y2;
if(Math.min(_8dc,_8dd)>Math.max(_8d9,_8da)){
continue;
}
if(Math.max(_8dc,_8dd)<Math.min(_8d9,_8da)){
continue;
}
if(OpenLayers.Geometry.segmentsIntersect(seg1,seg2)){
_8d2=true;
break outer;
}
}
}
}else{
_8d2=_8d1.intersects(this);
}
return _8d2;
},getSortedSegments:function(){
var _8e2=this.components.length-1;
var _8e3=new Array(_8e2);
for(var i=0;i<_8e2;++i){
point1=this.components[i];
point2=this.components[i+1];
if(point1.x<point2.x){
_8e3[i]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y};
}else{
_8e3[i]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y};
}
}
function byX1(seg1,seg2){
return seg1.x1-seg2.x1;
};
return _8e3.sort(byX1);
},CLASS_NAME:"OpenLayers.Geometry.LineString"});
OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(_8e7){
OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments);
},addComponent:function(_8e8,_8e9){
var _8ea=false;
var _8eb=this.components.pop();
if(_8e9!=null||!_8e8.equals(_8eb)){
_8ea=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments);
}
var _8ec=this.components[0];
OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[_8ec]);
return _8ea;
},removeComponent:function(_8ed){
if(this.components.length>4){
this.components.pop();
OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);
var _8ee=this.components[0];
OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[_8ee]);
}
},move:function(x,y){
for(var i=0,len=this.components.length;i<len-1;i++){
this.components[i].move(x,y);
}
},rotate:function(_8f3,_8f4){
for(var i=0,len=this.components.length;i<len-1;++i){
this.components[i].rotate(_8f3,_8f4);
}
},resize:function(_8f7,_8f8,_8f9){
for(var i=0,len=this.components.length;i<len-1;++i){
this.components[i].resize(_8f7,_8f8,_8f9);
}
},transform:function(_8fc,dest){
if(_8fc&&dest){
for(var i=0,len=this.components.length;i<len-1;i++){
var _900=this.components[i];
_900.transform(_8fc,dest);
}
this.bounds=null;
}
return this;
},getArea:function(){
var area=0;
if(this.components&&(this.components.length>2)){
var sum=0;
for(var i=0,len=this.components.length;i<len-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(_907){
var _908=OpenLayers.Number.limitSigDigs;
var digs=14;
var px=_908(_907.x,digs);
var py=_908(_907.y,digs);
function getX(y,x1,y1,x2,y2){
return (((x1-x2)*y)+((x2*y1)-(x1*y2)))/(y1-y2);
};
var _911=this.components.length-1;
var _912,end,x1,y1,x2,y2,cx,cy;
var _91a=0;
for(var i=0;i<_911;++i){
_912=this.components[i];
x1=_908(_912.x,digs);
y1=_908(_912.y,digs);
end=this.components[i+1];
x2=_908(end.x,digs);
y2=_908(end.y,digs);
if(y1==y2){
if(py==y1){
if(x1<=x2&&(px>=x1&&px<=x2)||x1>=x2&&(px<=x1&&px>=x2)){
_91a=-1;
break;
}
}
continue;
}
cx=_908(getX(py,x1,y1,x2,y2),digs);
if(cx==px){
if(y1<y2&&(py>=y1&&py<=y2)||y1>y2&&(py<=y1&&py>=y2)){
_91a=-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)){
++_91a;
}
}
var _91c=(_91a==-1)?1:!!(_91a&1);
return _91c;
},intersects:function(_91d){
var _91e=false;
if(_91d.CLASS_NAME=="OpenLayers.Geometry.Point"){
_91e=this.containsPoint(_91d);
}else{
if(_91d.CLASS_NAME=="OpenLayers.Geometry.LineString"){
_91e=_91d.intersects(this);
}else{
if(_91d.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){
_91e=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[_91d]);
}else{
for(var i=0,len=_91d.components.length;i<len;++i){
_91e=_91d.components[i].intersects(this);
if(_91e){
break;
}
}
}
}
}
return _91e;
},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});
OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(_921){
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,len=this.components.length;i<len;i++){
area-=Math.abs(this.components[i].getArea());
}
}
return area;
},containsPoint:function(_925){
var _926=this.components.length;
var _927=false;
if(_926>0){
_927=this.components[0].containsPoint(_925);
if(_927!==1){
if(_927&&_926>1){
var hole;
for(var i=1;i<_926;++i){
hole=this.components[i].containsPoint(_925);
if(hole){
if(hole===1){
_927=1;
}else{
_927=false;
}
break;
}
}
}
}
}
return _927;
},intersects:function(_92a){
var _92b=false;
var i,len;
if(_92a.CLASS_NAME=="OpenLayers.Geometry.Point"){
_92b=this.containsPoint(_92a);
}else{
if(_92a.CLASS_NAME=="OpenLayers.Geometry.LineString"||_92a.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){
for(i=0,len=this.components.length;i<len;++i){
_92b=_92a.intersects(this.components[i]);
if(_92b){
break;
}
}
if(!_92b){
for(i=0,len=_92a.components.length;i<len;++i){
_92b=this.containsPoint(_92a.components[i]);
if(_92b){
break;
}
}
}
}else{
for(i=0,len=_92a.components.length;i<len;++i){
_92b=this.intersects(_92a.components[i]);
if(_92b){
break;
}
}
}
}
if(!_92b&&_92a.CLASS_NAME=="OpenLayers.Geometry.Polygon"){
var ring=this.components[0];
for(i=0,len=ring.components.length;i<len;++i){
_92b=_92a.containsPoint(ring.components[i]);
if(_92b){
break;
}
}
}
return _92b;
},CLASS_NAME:"OpenLayers.Geometry.Polygon"});
OpenLayers.Geometry.Polygon.createRegularPolygon=function(_92f,_930,_931,_932){
var _933=Math.PI*((1/_931)-(1/2));
if(_932){
_933+=(_932/180)*Math.PI;
}
var _934,x,y;
var _937=[];
for(var i=0;i<_931;++i){
_934=_933+(i*2*Math.PI/_931);
x=_92f.x+(_930*Math.cos(_934));
y=_92f.y+(_930*Math.sin(_934));
_937.push(new OpenLayers.Geometry.Point(x,y));
}
var ring=new OpenLayers.Geometry.LinearRing(_937);
return new OpenLayers.Geometry.Polygon([ring]);
};
OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(_93a){
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(_93b){
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,locked:false,size:null,resolution:null,map:null,initialize:function(_93c,_93d){
this.container=OpenLayers.Util.getElement(_93c);
},destroy:function(){
this.container=null;
this.extent=null;
this.size=null;
this.resolution=null;
this.map=null;
},supported:function(){
return false;
},setExtent:function(_93e,_93f){
this.extent=_93e.clone();
if(_93f){
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(_941,_942){
if(_942==null){
_942=_941.style;
}
if(_941.geometry){
var _943=_941.geometry.getBounds();
if(_943){
if(!_943.intersectsBounds(this.extent)){
_942={display:"none"};
}
return this.drawGeometry(_941.geometry,_942,_941.id);
}
}
},drawGeometry:function(_944,_945,_946){
},clear:function(){
},getFeatureIdFromEvent:function(evt){
},eraseFeatures:function(_948){
if(!(_948 instanceof Array)){
_948=[_948];
}
for(var i=0,len=_948.length;i<len;++i){
this.eraseGeometry(_948[i].geometry);
}
},eraseGeometry:function(_94b){
},CLASS_NAME:"OpenLayers.Renderer"});
OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(_94c){
this.compare=_94c?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;
this.order=[];
this.indices={};
this.maxZIndex=0;
},insert:function(_94d){
if(this.exists(_94d)){
this.remove(_94d);
}
var _94e=_94d.id;
this.determineZIndex(_94d);
var _94f=-1;
var _950=this.order.length;
var _951;
while(_950-_94f>1){
_951=parseInt((_94f+_950)/2);
var _952=this.compare(this,_94d,OpenLayers.Util.getElement(this.order[_951]));
if(_952>0){
_94f=_951;
}else{
_950=_951;
}
}
this.order.splice(_950,0,_94e);
this.indices[_94e]=this.getZIndex(_94d);
var _953=_950+1;
return _953<this.order.length?OpenLayers.Util.getElement(this.order[_953]):null;
},remove:function(node){
var _955=node.id;
var _956=OpenLayers.Util.indexOf(this.order,_955);
if(_956>=0){
this.order.splice(_956,1);
delete this.indices[_955];
if(this.order.length>0){
var _957=this.order[this.order.length-1];
this.maxZIndex=this.indices[_957];
}else{
this.maxZIndex=0;
}
}
},clear:function(){
this.order=[];
this.indices={};
this.maxZIndex=0;
},exists:function(node){
return (this.indices[node.id]!=null);
},getZIndex:function(node){
return node._style.graphicZIndex;
},determineZIndex:function(node){
var _95b=node._style.graphicZIndex;
if(_95b==null){
_95b=this.maxZIndex;
node._style.graphicZIndex=_95b;
}else{
if(_95b>this.maxZIndex){
this.maxZIndex=_95b;
}
}
},CLASS_NAME:"OpenLayers.ElementsIndexer"});
OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(_95c,_95d,_95e){
var _95f=_95c.getZIndex(_95d);
var _960=0;
if(_95e){
var _961=_95c.getZIndex(_95e);
_960=_95f-_961;
}
return _960;
},Z_ORDER_DRAWING_ORDER:function(_962,_963,_964){
var _965=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(_962,_963,_964);
if(_964&&_965==0){
_965=1;
}
return _965;
},Z_ORDER_Y_ORDER:function(_966,_967,_968){
var _969=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(_966,_967,_968);
if(_968&&_969==0){
var _96a=_967._geometry.getBounds().bottom;
var _96b=_968._geometry.getBounds().bottom;
var _96c=_96b-_96a;
_969=(_96c==0)?1:_96c;
}
return _969;
}};
OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:"_background",minimumSymbolizer:{strokeLinecap:"round",strokeOpacity:1,strokeDashstyle:"solid",fillOpacity:1,pointRadius:0},initialize:function(_96d,_96e){
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);
if(_96e&&(_96e.zIndexing||_96e.yOrdering)){
this.indexer=new OpenLayers.ElementsIndexer(_96e.yOrdering);
}
},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);
}
}
if(this.indexer){
this.indexer.clear();
}
},getNodeType:function(_96f,_970){
},drawGeometry:function(_971,_972,_973){
var _974=_971.CLASS_NAME;
var _975=true;
if((_974=="OpenLayers.Geometry.Collection")||(_974=="OpenLayers.Geometry.MultiPoint")||(_974=="OpenLayers.Geometry.MultiLineString")||(_974=="OpenLayers.Geometry.MultiPolygon")){
for(var i=0,len=_971.components.length;i<len;i++){
_975=_975&&this.drawGeometry(_971.components[i],_972,_973);
}
return _975;
}
_975=false;
if(_972.display!="none"){
if(_972.backgroundGraphic){
this.redrawBackgroundNode(_971.id,_971,_972,_973);
}
_975=this.redrawNode(_971.id,_971,_972,_973);
}
if(_975==false){
var node=document.getElementById(_971.id);
if(node){
if(node._style.backgroundGraphic){
node.parentNode.removeChild(document.getElementById(_971.id+this.BACKGROUND_ID_SUFFIX));
}
node.parentNode.removeChild(node);
}
}
return _975;
},redrawNode:function(id,_97a,_97b,_97c){
var node=this.nodeFactory(id,this.getNodeType(_97a,_97b));
node._featureId=_97c;
node._geometry=_97a;
node._geometryClass=_97a.CLASS_NAME;
node._style=_97b;
var _97e=this.drawGeometryNode(node,_97a,_97b);
if(_97e===false){
return false;
}
node=_97e.node;
var _97f=this.indexer?this.indexer.insert(node):null;
if(_97f){
this.root.insertBefore(node,_97f);
}else{
this.root.appendChild(node);
}
this.postDraw(node);
return _97e.complete;
},redrawBackgroundNode:function(id,_981,_982,_983){
var _984=OpenLayers.Util.extend({},_982);
_984.externalGraphic=_984.backgroundGraphic;
_984.graphicXOffset=_984.backgroundXOffset;
_984.graphicYOffset=_984.backgroundYOffset;
_984.graphicZIndex=_984.backgroundGraphicZIndex;
_984.backgroundGraphic=null;
_984.backgroundXOffset=null;
_984.backgroundYOffset=null;
_984.backgroundGraphicZIndex=null;
return this.redrawNode(id+this.BACKGROUND_ID_SUFFIX,_981,_984,null);
},drawGeometryNode:function(node,_986,_987){
_987=_987||node._style;
OpenLayers.Util.applyDefaults(_987,this.minimumSymbolizer);
var _988={"isFilled":true,"isStroked":!!_987.strokeWidth};
var _989;
switch(_986.CLASS_NAME){
case "OpenLayers.Geometry.Point":
_989=this.drawPoint(node,_986);
break;
case "OpenLayers.Geometry.LineString":
_988.isFilled=false;
_989=this.drawLineString(node,_986);
break;
case "OpenLayers.Geometry.LinearRing":
_989=this.drawLinearRing(node,_986);
break;
case "OpenLayers.Geometry.Polygon":
_989=this.drawPolygon(node,_986);
break;
case "OpenLayers.Geometry.Surface":
_989=this.drawSurface(node,_986);
break;
case "OpenLayers.Geometry.Rectangle":
_989=this.drawRectangle(node,_986);
break;
default:
break;
}
node._style=_987;
node._options=_988;
if(_989!=false){
return {node:this.setStyle(node,_987,_988,_986),complete:_989};
}else{
return false;
}
},postDraw:function(node){
},drawPoint:function(node,_98c){
},drawLineString:function(node,_98e){
},drawLinearRing:function(node,_990){
},drawPolygon:function(node,_992){
},drawRectangle:function(node,_994){
},drawCircle:function(node,_996){
},drawSurface:function(node,_998){
},getFeatureIdFromEvent:function(evt){
var _99a=evt.target;
var _99b=_99a&&_99a.correspondingUseElement;
var node=_99b?_99b:(_99a||evt.srcElement);
var _99d=node._featureId;
return _99d;
},eraseGeometry:function(_99e){
if((_99e.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(_99e.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(_99e.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(_99e.CLASS_NAME=="OpenLayers.Geometry.Collection")){
for(var i=0,len=_99e.components.length;i<len;i++){
this.eraseGeometry(_99e.components[i]);
}
}else{
var _9a1=OpenLayers.Util.getElement(_99e.id);
if(_9a1&&_9a1.parentNode){
if(_9a1.geometry){
_9a1.geometry.destroy();
_9a1.geometry=null;
}
_9a1.parentNode.removeChild(_9a1);
if(this.indexer){
this.indexer.remove(_9a1);
}
if(_9a1._style.backgroundGraphic){
var _9a2=_99e.id+this.BACKGROUND_ID_SUFFIX;
var _9a3=OpenLayers.Util.getElement(_9a2);
if(_9a3&&_9a3.parentNode){
_9a3.parentNode.removeChild(_9a3);
}
}
}
}
},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;
},nodeTypeCompare:function(node,type){
},createNode:function(type,id){
},isComplexSymbol:function(_9ab){
return (_9ab!="circle")&&!!_9ab;
},CLASS_NAME:"OpenLayers.Renderer.Elements"});
OpenLayers.Renderer.symbol={"star":[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],"cross":[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],"x":[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],"square":[0,0,0,1,1,1,1,0,0,0],"triangle":[0,10,10,10,5,0,0,10]};
OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15000,translationParameters:null,symbolSize:{},initialize:function(_9ac){
if(!this.supported()){
return;
}
OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);
this.translationParameters={x:0,y:0};
},destroy:function(){
OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments);
},supported:function(){
var _9ad="http://www.w3.org/TR/SVG11/feature#";
return (document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(_9ad+"SVG","1.1")||document.implementation.hasFeature(_9ad+"BasicStructure","1.1")));
},inValidRange:function(x,y,_9b0){
var left=x+(_9b0?0:this.translationParameters.x);
var top=y+(_9b0?0:this.translationParameters.y);
return (left>=-this.MAX_PIXEL&&left<=this.MAX_PIXEL&&top>=-this.MAX_PIXEL&&top<=this.MAX_PIXEL);
},setExtent:function(_9b3,_9b4){
OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);
var _9b5=this.getResolution();
var left=-_9b3.left/_9b5;
var top=_9b3.top/_9b5;
if(_9b4){
this.left=left;
this.top=top;
var _9b8="0 0 "+this.size.w+" "+this.size.h;
this.rendererRoot.setAttributeNS(null,"viewBox",_9b8);
this.translate(0,0);
return true;
}else{
var _9b9=this.translate(left-this.left,top-this.top);
if(!_9b9){
this.setExtent(_9b3,true);
}
return _9b9;
}
},translate:function(x,y){
if(!this.inValidRange(x,y,true)){
return false;
}else{
var _9bc="";
if(x||y){
_9bc="translate("+x+","+y+")";
}
this.root.setAttributeNS(null,"transform",_9bc);
this.translationParameters={x:x,y:y};
return true;
}
},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(_9be,_9bf){
var _9c0=null;
switch(_9be.CLASS_NAME){
case "OpenLayers.Geometry.Point":
if(_9bf.externalGraphic){
_9c0="image";
}else{
if(this.isComplexSymbol(_9bf.graphicName)){
_9c0="use";
}else{
_9c0="circle";
}
}
break;
case "OpenLayers.Geometry.Rectangle":
_9c0="rect";
break;
case "OpenLayers.Geometry.LineString":
_9c0="polyline";
break;
case "OpenLayers.Geometry.LinearRing":
_9c0="polygon";
break;
case "OpenLayers.Geometry.Polygon":
case "OpenLayers.Geometry.Curve":
case "OpenLayers.Geometry.Surface":
_9c0="path";
break;
default:
break;
}
return _9c0;
},setStyle:function(node,_9c2,_9c3){
_9c2=_9c2||node._style;
_9c3=_9c3||node._options;
var r=parseFloat(node.getAttributeNS(null,"r"));
var _9c5=1;
var pos;
if(node._geometryClass=="OpenLayers.Geometry.Point"&&r){
if(_9c2.externalGraphic){
pos=this.getPosition(node);
if(_9c2.graphicWidth&&_9c2.graphicHeight){
node.setAttributeNS(null,"preserveAspectRatio","none");
}
var _9c7=_9c2.graphicWidth||_9c2.graphicHeight;
var _9c8=_9c2.graphicHeight||_9c2.graphicWidth;
_9c7=_9c7?_9c7:_9c2.pointRadius*2;
_9c8=_9c8?_9c8:_9c2.pointRadius*2;
var _9c9=(_9c2.graphicXOffset!=undefined)?_9c2.graphicXOffset:-(0.5*_9c7);
var _9ca=(_9c2.graphicYOffset!=undefined)?_9c2.graphicYOffset:-(0.5*_9c8);
var _9cb=_9c2.graphicOpacity||_9c2.fillOpacity;
node.setAttributeNS(null,"x",(pos.x+_9c9).toFixed());
node.setAttributeNS(null,"y",(pos.y+_9ca).toFixed());
node.setAttributeNS(null,"width",_9c7);
node.setAttributeNS(null,"height",_9c8);
node.setAttributeNS(this.xlinkns,"href",_9c2.externalGraphic);
node.setAttributeNS(null,"style","opacity: "+_9cb);
}else{
if(this.isComplexSymbol(_9c2.graphicName)){
var _9cc=_9c2.pointRadius*3;
var size=_9cc*2;
var id=this.importSymbol(_9c2.graphicName);
var href="#"+id;
pos=this.getPosition(node);
_9c5=this.symbolSize[id]/size;
if(node.getAttributeNS(this.xlinkns,"href")!=href){
node.setAttributeNS(this.xlinkns,"href",href);
}else{
if(size!=parseFloat(node.getAttributeNS(null,"width"))){
node.style.visibility="hidden";
this.container.scrollLeft=this.container.scrollLeft;
}
}
node.setAttributeNS(null,"width",size);
node.setAttributeNS(null,"height",size);
node.setAttributeNS(null,"x",pos.x-_9cc);
node.setAttributeNS(null,"y",pos.y-_9cc);
node.style.visibility="";
}else{
node.setAttributeNS(null,"r",_9c2.pointRadius);
}
}
if(typeof _9c2.rotation!="undefined"&&pos){
var _9d0=OpenLayers.String.format("rotate(${0} ${1} ${2})",[_9c2.rotation,pos.x,pos.y]);
node.setAttributeNS(null,"transform",_9d0);
}
}
if(_9c3.isFilled){
node.setAttributeNS(null,"fill",_9c2.fillColor);
node.setAttributeNS(null,"fill-opacity",_9c2.fillOpacity);
}else{
node.setAttributeNS(null,"fill","none");
}
if(_9c3.isStroked){
node.setAttributeNS(null,"stroke",_9c2.strokeColor);
node.setAttributeNS(null,"stroke-opacity",_9c2.strokeOpacity);
node.setAttributeNS(null,"stroke-width",_9c2.strokeWidth*_9c5);
node.setAttributeNS(null,"stroke-linecap",_9c2.strokeLinecap);
node.setAttributeNS(null,"stroke-linejoin","round");
node.setAttributeNS(null,"stroke-dasharray",this.dashStyle(_9c2,_9c5));
}else{
node.setAttributeNS(null,"stroke","none");
}
if(_9c2.pointerEvents){
node.setAttributeNS(null,"pointer-events",_9c2.pointerEvents);
}
if(_9c2.cursor!=null){
node.setAttributeNS(null,"cursor",_9c2.cursor);
}
return node;
},dashStyle:function(_9d1,_9d2){
var w=_9d1.strokeWidth*_9d2;
switch(_9d1.strokeDashstyle){
case "solid":
return "none";
case "dot":
return [1,4*w].join();
case "dash":
return [4*w,4*w].join();
case "dashdot":
return [4*w,4*w,1,4*w].join();
case "longdash":
return [8*w,4*w].join();
case "longdashdot":
return [8*w,4*w,1,4*w].join();
default:
return _9d1.strokeDashstyle.replace(/ /g,",");
}
},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");
},createDefs:function(){
var defs=this.nodeFactory("ol-renderer-defs","defs");
this.rendererRoot.appendChild(defs);
return defs;
},drawPoint:function(node,_9db){
return this.drawCircle(node,_9db,1);
},drawCircle:function(node,_9dd,_9de){
var _9df=this.getResolution();
var x=(_9dd.x/_9df+this.left);
var y=(this.top-_9dd.y/_9df);
if(this.inValidRange(x,y)){
node.setAttributeNS(null,"cx",x);
node.setAttributeNS(null,"cy",y);
node.setAttributeNS(null,"r",_9de);
return node;
}else{
return false;
}
},drawLineString:function(node,_9e3){
var _9e4=this.getComponentsString(_9e3.components);
if(_9e4.path){
node.setAttributeNS(null,"points",_9e4.path);
return (_9e4.complete?node:null);
}else{
return false;
}
},drawLinearRing:function(node,_9e6){
var _9e7=this.getComponentsString(_9e6.components);
if(_9e7.path){
node.setAttributeNS(null,"points",_9e7.path);
return (_9e7.complete?node:null);
}else{
return false;
}
},drawPolygon:function(node,_9e9){
var d="";
var draw=true;
var _9ec=true;
var _9ed,path;
for(var j=0,len=_9e9.components.length;j<len;j++){
d+=" M";
_9ed=this.getComponentsString(_9e9.components[j].components," ");
path=_9ed.path;
if(path){
d+=" "+path;
_9ec=_9ed.complete&&_9ec;
}else{
draw=false;
}
}
d+=" z";
if(draw){
node.setAttributeNS(null,"d",d);
node.setAttributeNS(null,"fill-rule","evenodd");
return _9ec?node:null;
}else{
return false;
}
},drawRectangle:function(node,_9f2){
var _9f3=this.getResolution();
var x=(_9f2.x/_9f3+this.left);
var y=(this.top-_9f2.y/_9f3);
if(this.inValidRange(x,y)){
node.setAttributeNS(null,"x",x);
node.setAttributeNS(null,"y",y);
node.setAttributeNS(null,"width",_9f2.width/_9f3);
node.setAttributeNS(null,"height",_9f2.height/_9f3);
return node;
}else{
return false;
}
},drawSurface:function(node,_9f7){
var d=null;
var draw=true;
for(var i=0,len=_9f7.components.length;i<len;i++){
if((i%3)==0&&(i/3)==0){
var _9fc=this.getShortString(_9f7.components[i]);
if(!_9fc){
draw=false;
}
d="M "+_9fc;
}else{
if((i%3)==1){
var _9fc=this.getShortString(_9f7.components[i]);
if(!_9fc){
draw=false;
}
d+=" C "+_9fc;
}else{
var _9fc=this.getShortString(_9f7.components[i]);
if(!_9fc){
draw=false;
}
d+=" "+_9fc;
}
}
}
d+=" Z";
if(draw){
node.setAttributeNS(null,"d",d);
return node;
}else{
return false;
}
},getComponentsString:function(_9fd,_9fe){
var _9ff=[];
var _a00=true;
var len=_9fd.length;
var _a02=[];
var str,_a04,j;
for(var i=0;i<len;i++){
_a04=_9fd[i];
_9ff.push(_a04);
str=this.getShortString(_a04);
if(str){
_a02.push(str);
}else{
if(i>0){
if(this.getShortString(_9fd[i-1])){
_a02.push(this.clipLine(_9fd[i],_9fd[i-1]));
}
}
if(i<len-1){
if(this.getShortString(_9fd[i+1])){
_a02.push(this.clipLine(_9fd[i],_9fd[i+1]));
}
}
_a00=false;
}
}
return {path:_a02.join(_9fe||","),complete:_a00};
},clipLine:function(_a07,_a08){
if(_a08.equals(_a07)){
return "";
}
var _a09=this.getResolution();
var maxX=this.MAX_PIXEL-this.translationParameters.x;
var maxY=this.MAX_PIXEL-this.translationParameters.y;
var x1=_a08.x/_a09+this.left;
var y1=this.top-_a08.y/_a09;
var x2=_a07.x/_a09+this.left;
var y2=this.top-_a07.y/_a09;
var k;
if(x2<-maxX||x2>maxX){
k=(y2-y1)/(x2-x1);
x2=x2<0?-maxX:maxX;
y2=y1+(x2-x1)*k;
}
if(y2<-maxY||y2>maxY){
k=(x2-x1)/(y2-y1);
y2=y2<0?-maxY:maxY;
x2=x1+(y2-y1)*k;
}
return x2+","+y2;
},getShortString:function(_a11){
var _a12=this.getResolution();
var x=(_a11.x/_a12+this.left);
var y=(this.top-_a11.y/_a12);
if(this.inValidRange(x,y)){
return x+","+y;
}else{
return false;
}
},getPosition:function(node){
return ({x:parseFloat(node.getAttributeNS(null,"cx")),y:parseFloat(node.getAttributeNS(null,"cy"))});
},importSymbol:function(_a16){
if(!this.defs){
this.defs=this.createDefs();
}
var id=this.container.id+"-"+_a16;
if(document.getElementById(id)!=null){
return id;
}
var _a18=OpenLayers.Renderer.symbol[_a16];
if(!_a18){
throw new Error(_a16+" is not a valid symbol name");
return;
}
var _a19=this.nodeFactory(id,"symbol");
var node=this.nodeFactory(null,"polygon");
_a19.appendChild(node);
var _a1b=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);
var _a1c="";
var x,y;
for(var i=0;i<_a18.length;i=i+2){
x=_a18[i];
y=_a18[i+1];
_a1b.left=Math.min(_a1b.left,x);
_a1b.bottom=Math.min(_a1b.bottom,y);
_a1b.right=Math.max(_a1b.right,x);
_a1b.top=Math.max(_a1b.top,y);
_a1c+=" "+x+","+y;
}
node.setAttributeNS(null,"points",_a1c);
var _a20=_a1b.getWidth();
var _a21=_a1b.getHeight();
var _a22=[_a1b.left-_a20,_a1b.bottom-_a21,_a20*3,_a21*3];
_a19.setAttributeNS(null,"viewBox",_a22.join(" "));
this.symbolSize[id]=Math.max(_a20,_a21)*3;
this.defs.appendChild(_a19);
return _a19.id;
},CLASS_NAME:"OpenLayers.Renderer.SVG"});
OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(_a23){
if(!this.supported()){
return;
}
if(!document.namespaces.olv){
document.namespaces.add("olv",this.xmlns);
var _a24=document.createStyleSheet();
_a24.addRule("olv\\:*","behavior: url(#default#VML); "+"position: absolute; display: inline-block;");
}
OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);
this.offset={x:0,y:0};
},destroy:function(){
OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments);
},supported:function(){
return !!(document.namespaces);
},setExtent:function(_a25,_a26){
OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);
var _a27=this.getResolution();
var left=_a25.left/_a27;
var top=_a25.top/_a27-this.size.h;
if(_a26){
this.offset={x:left,y:top};
left=0;
top=0;
}else{
left=left-this.offset.x;
top=top-this.offset.y;
}
var org=left+" "+top;
this.root.setAttribute("coordorigin",org);
var size=this.size.w+" "+this.size.h;
this.root.setAttribute("coordsize",size);
this.root.style.flip="y";
return true;
},setSize:function(size){
OpenLayers.Renderer.prototype.setSize.apply(this,arguments);
this.rendererRoot.style.width=this.size.w+"px";
this.rendererRoot.style.height=this.size.h+"px";
this.root.style.width=this.size.w+"px";
this.root.style.height=this.size.h+"px";
},getNodeType:function(_a2d,_a2e){
var _a2f=null;
switch(_a2d.CLASS_NAME){
case "OpenLayers.Geometry.Point":
if(_a2e.externalGraphic){
_a2f="olv:rect";
}else{
if(this.isComplexSymbol(_a2e.graphicName)){
_a2f="olv:shape";
}else{
_a2f="olv:oval";
}
}
break;
case "OpenLayers.Geometry.Rectangle":
_a2f="olv:rect";
break;
case "OpenLayers.Geometry.LineString":
case "OpenLayers.Geometry.LinearRing":
case "OpenLayers.Geometry.Polygon":
case "OpenLayers.Geometry.Curve":
case "OpenLayers.Geometry.Surface":
_a2f="olv:shape";
break;
default:
break;
}
return _a2f;
},setStyle:function(node,_a31,_a32,_a33){
_a31=_a31||node._style;
_a32=_a32||node._options;
var _a34=1;
if(node._geometryClass=="OpenLayers.Geometry.Point"){
if(_a31.externalGraphic){
var _a35=_a31.graphicWidth||_a31.graphicHeight;
var _a36=_a31.graphicHeight||_a31.graphicWidth;
_a35=_a35?_a35:_a31.pointRadius*2;
_a36=_a36?_a36:_a31.pointRadius*2;
var _a37=this.getResolution();
var _a38=(_a31.graphicXOffset!=undefined)?_a31.graphicXOffset:-(0.5*_a35);
var _a39=(_a31.graphicYOffset!=undefined)?_a31.graphicYOffset:-(0.5*_a36);
node.style.left=((_a33.x/_a37-this.offset.x)+_a38).toFixed();
node.style.top=((_a33.y/_a37-this.offset.y)-(_a39+_a36)).toFixed();
node.style.width=_a35+"px";
node.style.height=_a36+"px";
node.style.flip="y";
_a31.fillColor="none";
_a32.isStroked=false;
}else{
if(this.isComplexSymbol(_a31.graphicName)){
var _a3a=this.importSymbol(_a31.graphicName);
var _a3b=_a3a.extent;
var _a35=_a3b.getWidth();
var _a36=_a3b.getHeight();
node.setAttribute("path",_a3a.path);
node.setAttribute("coordorigin",_a3b.left+","+_a3b.bottom);
node.setAttribute("coordsize",_a35+","+_a36);
node.style.left=_a3b.left+"px";
node.style.top=_a3b.bottom+"px";
node.style.width=_a35+"px";
node.style.height=_a36+"px";
this.drawCircle(node,_a33,_a31.pointRadius);
node.style.flip="y";
}else{
this.drawCircle(node,_a33,_a31.pointRadius);
}
}
}
if(_a32.isFilled){
node.setAttribute("fillcolor",_a31.fillColor);
}else{
node.setAttribute("filled","false");
}
var _a3c=node.getElementsByTagName("fill");
var fill=(_a3c.length==0)?null:_a3c[0];
if(!_a32.isFilled){
if(fill){
node.removeChild(fill);
}
}else{
if(!fill){
fill=this.createNode("olv:fill",node.id+"_fill");
}
fill.setAttribute("opacity",_a31.fillOpacity);
if(node._geometryClass=="OpenLayers.Geometry.Point"&&_a31.externalGraphic){
if(_a31.graphicOpacity){
fill.setAttribute("opacity",_a31.graphicOpacity);
}
fill.setAttribute("src",_a31.externalGraphic);
fill.setAttribute("type","frame");
if(!(_a31.graphicWidth&&_a31.graphicHeight)){
fill.aspect="atmost";
}
}
if(fill.parentNode!=node){
node.appendChild(fill);
}
}
if(typeof _a31.rotation!="undefined"){
if(_a31.externalGraphic){
this.graphicRotate(node,_a38,_a39);
fill.setAttribute("opacity",0);
}else{
node.style.rotation=_a31.rotation;
}
}
if(_a32.isStroked){
node.setAttribute("strokecolor",_a31.strokeColor);
node.setAttribute("strokeweight",_a31.strokeWidth+"px");
}else{
node.setAttribute("stroked","false");
}
var _a3e=node.getElementsByTagName("stroke");
var _a3f=(_a3e.length==0)?null:_a3e[0];
if(!_a32.isStroked){
if(_a3f){
node.removeChild(_a3f);
}
}else{
if(!_a3f){
_a3f=this.createNode("olv:stroke",node.id+"_stroke");
node.appendChild(_a3f);
}
_a3f.setAttribute("opacity",_a31.strokeOpacity);
_a3f.setAttribute("endcap",!_a31.strokeLinecap||_a31.strokeLinecap=="butt"?"flat":_a31.strokeLinecap);
_a3f.setAttribute("dashstyle",this.dashStyle(_a31));
}
if(_a31.cursor!="inherit"&&_a31.cursor!=null){
node.style.cursor=_a31.cursor;
}
return node;
},graphicRotate:function(node,_a41,_a42){
var _a43=_a43||node._style;
var _a44=node._options;
var _a45,size;
if(!(_a43.graphicWidth&&_a43.graphicHeight)){
var img=new Image();
img.onreadystatechange=OpenLayers.Function.bind(function(){
if(img.readyState=="complete"||img.readyState=="interactive"){
_a45=img.width/img.height;
size=Math.max(_a43.pointRadius*2,_a43.graphicWidth||0,_a43.graphicHeight||0);
_a41=_a41*_a45;
_a43.graphicWidth=size*_a45;
_a43.graphicHeight=size;
this.graphicRotate(node,_a41,_a42);
}
},this);
img.src=_a43.externalGraphic;
return;
}else{
size=Math.max(_a43.graphicWidth,_a43.graphicHeight);
_a45=_a43.graphicWidth/_a43.graphicHeight;
}
var _a48=Math.round(_a43.graphicWidth||size*_a45);
var _a49=Math.round(_a43.graphicHeight||size);
node.style.width=_a48+"px";
node.style.height=_a49+"px";
var _a4a=document.getElementById(node.id+"_image");
if(!_a4a){
_a4a=this.createNode("olv:imagedata",node.id+"_image");
node.appendChild(_a4a);
}
_a4a.style.width=_a48+"px";
_a4a.style.height=_a49+"px";
_a4a.src=_a43.externalGraphic;
_a4a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader("+"src='', sizingMethod='scale')";
var _a4b=_a43.rotation*Math.PI/180;
var _a4c=Math.sin(_a4b);
var _a4d=Math.cos(_a4b);
var _a4e="progid:DXImageTransform.Microsoft.Matrix(M11="+_a4d+",M12="+(-_a4c)+",M21="+_a4c+",M22="+_a4d+",SizingMethod='auto expand')\n";
var _a4f=_a43.graphicOpacity||_a43.fillOpacity;
if(_a4f&&_a4f!=1){
_a4e+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+_a4f+")\n";
}
node.style.filter=_a4e;
var _a50=new OpenLayers.Geometry.Point(-_a41,-_a42);
var _a51=new OpenLayers.Bounds(0,0,_a48,_a49).toGeometry();
_a51.rotate(_a43.rotation,_a50);
var _a52=_a51.getBounds();
node.style.left=Math.round(parseInt(node.style.left)+_a52.left)+"px";
node.style.top=Math.round(parseInt(node.style.top)-_a52.bottom)+"px";
},postDraw:function(node){
var _a54=node._style.fillColor;
var _a55=node._style.strokeColor;
if(_a54=="none"&&node.getAttribute("fillcolor")!=_a54){
node.setAttribute("fillcolor",_a54);
}
if(_a55=="none"&&node.getAttribute("strokecolor")!=_a55){
node.setAttribute("strokecolor",_a55);
}
},setNodeDimension:function(node,_a57){
var bbox=_a57.getBounds();
if(bbox){
var _a59=this.getResolution();
var _a5a=new OpenLayers.Bounds((bbox.left/_a59-this.offset.x).toFixed(),(bbox.bottom/_a59-this.offset.y).toFixed(),(bbox.right/_a59-this.offset.x).toFixed(),(bbox.top/_a59-this.offset.y).toFixed());
node.style.left=_a5a.left+"px";
node.style.top=_a5a.top+"px";
node.style.width=_a5a.getWidth()+"px";
node.style.height=_a5a.getHeight()+"px";
node.coordorigin=_a5a.left+" "+_a5a.top;
node.coordsize=_a5a.getWidth()+" "+_a5a.getHeight();
}
},dashStyle:function(_a5b){
var dash=_a5b.strokeDashstyle;
switch(dash){
case "solid":
case "dot":
case "dash":
case "dashdot":
case "longdash":
case "longdashdot":
return dash;
default:
var _a5d=dash.split(/[ ,]/);
if(_a5d.length==2){
if(1*_a5d[0]>=2*_a5d[1]){
return "longdash";
}
return (_a5d[0]==1||_a5d[1]==1)?"dot":"dash";
}else{
if(_a5d.length==4){
return (1*_a5d[0]>=2*_a5d[1])?"longdashdot":"dashdot";
}
}
return "solid";
}
},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 _a63=type;
var _a64=_a63.indexOf(":");
if(_a64!=-1){
_a63=_a63.substr(_a64+1);
}
var _a65=node.nodeName;
_a64=_a65.indexOf(":");
if(_a64!=-1){
_a65=_a65.substr(_a64+1);
}
return (_a63==_a65);
},createRenderRoot:function(){
return this.nodeFactory(this.container.id+"_vmlRoot","div");
},createRoot:function(){
return this.nodeFactory(this.container.id+"_root","olv:group");
},drawPoint:function(node,_a67){
return this.drawCircle(node,_a67,1);
},drawCircle:function(node,_a69,_a6a){
if(!isNaN(_a69.x)&&!isNaN(_a69.y)){
var _a6b=this.getResolution();
node.style.left=((_a69.x/_a6b-this.offset.x).toFixed()-_a6a)+"px";
node.style.top=((_a69.y/_a6b-this.offset.y).toFixed()-_a6a)+"px";
var _a6c=_a6a*2;
node.style.width=_a6c+"px";
node.style.height=_a6c+"px";
return node;
}
return false;
},drawLineString:function(node,_a6e){
return this.drawLine(node,_a6e,false);
},drawLinearRing:function(node,_a70){
return this.drawLine(node,_a70,true);
},drawLine:function(node,_a72,_a73){
this.setNodeDimension(node,_a72);
var _a74=this.getResolution();
var _a75=_a72.components.length;
var _a76=new Array(_a75);
var comp,x,y;
for(var i=0;i<_a75;i++){
comp=_a72.components[i];
x=(comp.x/_a74-this.offset.x);
y=(comp.y/_a74-this.offset.y);
_a76[i]=" "+x.toFixed()+","+y.toFixed()+" l ";
}
var end=(_a73)?" x e":" e";
node.path="m"+_a76.join("")+end;
return node;
},drawPolygon:function(node,_a7d){
this.setNodeDimension(node,_a7d);
var _a7e=this.getResolution();
var path=[];
var _a80,i,j,len,ilen,comp,x,y;
for(j=0,len=_a7d.components.length;j<len;j++){
_a80=_a7d.components[j];
path.push("m");
for(i=0,ilen=_a80.components.length;i<ilen;i++){
comp=_a80.components[i];
x=comp.x/_a7e-this.offset.x;
y=comp.y/_a7e-this.offset.y;
path.push(" "+x.toFixed()+","+y.toFixed());
if(i==0){
path.push(" l");
}
}
path.push(" x ");
}
path.push("e");
node.path=path.join("");
return node;
},drawRectangle:function(node,_a89){
var _a8a=this.getResolution();
node.style.left=(_a89.x/_a8a-this.offset.x)+"px";
node.style.top=(_a89.y/_a8a-this.offset.y)+"px";
node.style.width=_a89.width/_a8a+"px";
node.style.height=_a89.height/_a8a+"px";
return node;
},drawSurface:function(node,_a8c){
this.setNodeDimension(node,_a8c);
var _a8d=this.getResolution();
var path=[];
var comp,x,y;
for(var i=0,len=_a8c.components.length;i<len;i++){
comp=_a8c.components[i];
x=comp.x/_a8d-this.offset.x;
y=comp.y/_a8d-this.offset.y;
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("");
return node;
},importSymbol:function(_a94){
var id=this.container.id+"-"+_a94;
var _a96=this.symbolCache[id];
if(_a96){
return _a96;
}
var _a97=OpenLayers.Renderer.symbol[_a94];
if(!_a97){
throw new Error(_a94+" is not a valid symbol name");
return;
}
var _a98=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);
var _a99=["m"];
for(var i=0;i<_a97.length;i=i+2){
x=_a97[i];
y=_a97[i+1];
_a98.left=Math.min(_a98.left,x);
_a98.bottom=Math.min(_a98.bottom,y);
_a98.right=Math.max(_a98.right,x);
_a98.top=Math.max(_a98.top,y);
_a99.push(x);
_a99.push(y);
if(i==0){
_a99.push("l");
}
}
_a99.push("x e");
var path=_a99.join(" ");
_a96={path:path,extent:_a98};
this.symbolCache[id]=_a96;
return _a96;
},CLASS_NAME:"OpenLayers.Renderer.VML"});
OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","refresh"],isBaseLayer:false,isFixed:false,isVector:true,features:null,selectedFeatures:null,unrenderedFeatures:null,reportError:true,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:false,initialize:function(name,_a9d){
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=[];
this.unrenderedFeatures={};
if(this.strategies){
for(var i=0,len=this.strategies.length;i<len;i++){
this.strategies[i].setLayer(this);
}
}
},destroy:function(){
if(this.strategies){
var _aa0,i,len;
for(i=0,len=this.strategies.length;i<len;i++){
_aa0=this.strategies[i];
if(_aa0.autoDestroy){
_aa0.destroy();
}
}
this.strategies=null;
}
if(this.protocol){
if(this.protocol.autoDestroy){
this.protocol.destroy();
}
this.protocol=null;
}
this.destroyFeatures();
this.features=null;
this.selectedFeatures=null;
this.unrenderedFeatures=null;
if(this.renderer){
this.renderer.destroy();
}
this.renderer=null;
this.geometryType=null;
this.drawn=null;
OpenLayers.Layer.prototype.destroy.apply(this,arguments);
},refresh:function(obj){
if(this.inRange&&this.visibility){
this.events.triggerEvent("refresh",obj);
}
},assignRenderer:function(){
for(var i=0,len=this.renderers.length;i<this.renderers.length;i++){
var _aa6=OpenLayers.Renderer[this.renderers[i]];
if(_aa6&&_aa6.prototype.supported()){
this.renderer=new _aa6(this.div,this.rendererOptions);
break;
}
}
},displayError:function(){
if(this.reportError){
OpenLayers.Console.userError(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());
}
if(this.strategies){
var _aa8,i,len;
for(i=0,len=this.strategies.length;i<len;i++){
_aa8=this.strategies[i];
if(_aa8.autoActivate){
_aa8.activate();
}
}
}
},removeMap:function(map){
if(this.strategies){
var _aac,i,len;
for(i=0,len=this.strategies.length;i<len;i++){
_aac=this.strategies[i];
if(_aac.autoActivate){
_aac.deactivate();
}
}
}
},onMapResize:function(){
OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);
this.renderer.setSize(this.map.getSize());
},moveTo:function(_aaf,_ab0,_ab1){
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
var _ab2=true;
if(!_ab1){
this.renderer.root.style.visibility="hidden";
this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";
this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";
var _ab3=this.map.getExtent();
_ab2=this.renderer.setExtent(_ab3,_ab0);
this.renderer.root.style.visibility="visible";
if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){
this.div.scrollLeft=this.div.scrollLeft;
}
if(!_ab0&&_ab2){
for(var i in this.unrenderedFeatures){
var _ab5=this.unrenderedFeatures[i];
this.drawFeature(_ab5);
}
}
}
if(!this.drawn||_ab0||!_ab2){
this.drawn=true;
var _ab5;
for(var i=0,len=this.features.length;i<len;i++){
if(i!=(this.features.length-1)){
this.renderer.locked=true;
}else{
this.renderer.locked=false;
}
_ab5=this.features[i];
this.drawFeature(_ab5);
}
}
},addFeatures:function(_ab7,_ab8){
if(!(_ab7 instanceof Array)){
_ab7=[_ab7];
}
var _ab9=!_ab8||!_ab8.silent;
if(_ab9){
var _aba={features:_ab7};
var ret=this.events.triggerEvent("beforefeaturesadded",_aba);
if(ret===false){
return;
}
_ab7=_aba.features;
}
for(var i=0,len=_ab7.length;i<len;i++){
if(i!=(_ab7.length-1)){
this.renderer.locked=true;
}else{
this.renderer.locked=false;
}
var _abe=_ab7[i];
if(this.geometryType&&!(_abe.geometry instanceof this.geometryType)){
var _abf=OpenLayers.i18n("componentShouldBe",{"geomType":this.geometryType.prototype.CLASS_NAME});
throw _abf;
}
this.features.push(_abe);
_abe.layer=this;
if(!_abe.style&&this.style){
_abe.style=OpenLayers.Util.extend({},this.style);
}
if(_ab9){
if(this.events.triggerEvent("beforefeatureadded",{feature:_abe})===false){
continue;
}
this.preFeatureInsert(_abe);
}
if(this.drawn){
this.drawFeature(_abe);
}
if(_ab9){
this.events.triggerEvent("featureadded",{feature:_abe});
this.onFeatureInsert(_abe);
}
}
if(_ab9){
this.events.triggerEvent("featuresadded",{features:_ab7});
}
},removeFeatures:function(_ac0,_ac1){
if(!_ac0||_ac0.length===0){
return;
}
if(!(_ac0 instanceof Array)){
_ac0=[_ac0];
}
var _ac2=!_ac1||!_ac1.silent;
for(var i=_ac0.length-1;i>=0;i--){
if(i!=0&&_ac0[i-1].geometry){
this.renderer.locked=true;
}else{
this.renderer.locked=false;
}
var _ac4=_ac0[i];
delete this.unrenderedFeatures[_ac4.id];
if(_ac2){
this.events.triggerEvent("beforefeatureremoved",{feature:_ac4});
}
this.features=OpenLayers.Util.removeItem(this.features,_ac4);
_ac4.layer=null;
if(_ac4.geometry){
this.renderer.eraseGeometry(_ac4.geometry);
}
if(OpenLayers.Util.indexOf(this.selectedFeatures,_ac4)!=-1){
OpenLayers.Util.removeItem(this.selectedFeatures,_ac4);
}
if(_ac2){
this.events.triggerEvent("featureremoved",{feature:_ac4});
}
}
if(_ac2){
this.events.triggerEvent("featuresremoved",{features:_ac0});
}
},destroyFeatures:function(_ac5,_ac6){
var all=(_ac5==undefined);
if(all){
_ac5=this.features;
}
if(_ac5){
this.removeFeatures(_ac5,_ac6);
for(var i=_ac5.length-1;i>=0;i--){
_ac5[i].destroy();
}
}
},drawFeature:function(_ac9,_aca){
if(typeof _aca!="object"){
var _acb=typeof _aca=="string"?_aca:_ac9.renderIntent;
_aca=_ac9.style||this.style;
if(!_aca){
_aca=this.styleMap.createSymbolizer(_ac9,_acb);
}
}
if(!this.renderer.drawFeature(_ac9,_aca)){
this.unrenderedFeatures[_ac9.id]=_ac9;
}else{
delete this.unrenderedFeatures[_ac9.id];
}
},eraseFeatures:function(_acc){
this.renderer.eraseFeatures(_acc);
},getFeatureFromEvent:function(evt){
if(!this.renderer){
OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));
return null;
}
var _ace=this.renderer.getFeatureIdFromEvent(evt);
return this.getFeatureById(_ace);
},getFeatureById:function(_acf){
var _ad0=null;
for(var i=0,len=this.features.length;i<len;++i){
if(this.features[i].id==_acf){
_ad0=this.features[i];
break;
}
}
return _ad0;
},onFeatureInsert:function(_ad3){
},preFeatureInsert:function(_ad4){
},getDataExtent:function(){
var _ad5=null;
if(this.features&&(this.features.length>0)){
var _ad5=this.features[0].geometry.getBounds();
for(var i=0,len=this.features.length;i<len;i++){
_ad5.extend(this.features[i].geometry.getBounds());
}
}
return _ad5;
},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(_ad8,_ad9){
this.rules=[];
this.setDefaultStyle(_ad8||OpenLayers.Feature.Vector.style["default"]);
OpenLayers.Util.extend(this,_ad9);
},destroy:function(){
for(var i=0,len=this.rules.length;i<len;i++){
this.rules[i].destroy();
this.rules[i]=null;
}
this.rules=null;
this.defaultStyle=null;
},createSymbolizer:function(_adc){
var _add=this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),_adc);
var _ade=this.rules;
var rule,_ae0;
var _ae1=[];
var _ae2=false;
for(var i=0,len=_ade.length;i<len;i++){
rule=_ade[i];
var _ae5=rule.evaluate(_adc);
if(_ae5){
if(rule instanceof OpenLayers.Rule&&rule.elseFilter){
_ae1.push(rule);
}else{
_ae2=true;
this.applySymbolizer(rule,_add,_adc);
}
}
}
if(_ae2==false&&_ae1.length>0){
_ae2=true;
for(var i=0,len=_ae1.length;i<len;i++){
this.applySymbolizer(_ae1[i],_add,_adc);
}
}
if(_ade.length>0&&_ae2==false){
_add.display="none";
}else{
_add.display="";
}
return _add;
},applySymbolizer:function(rule,_ae7,_ae8){
var _ae9=_ae8.geometry?this.getSymbolizerPrefix(_ae8.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];
var _aea=rule.symbolizer[_ae9]||rule.symbolizer;
return this.createLiterals(OpenLayers.Util.extend(_ae7,_aea),_ae8);
},createLiterals:function(_aeb,_aec){
var _aed=this.context||_aec.attributes||_aec.data;
for(var i in this.propertyStyles){
_aeb[i]=OpenLayers.Style.createLiteral(_aeb[i],_aed,_aec);
}
return _aeb;
},findPropertyStyles:function(){
var _aef={};
var _af0=this.defaultStyle;
this.addPropertyStyles(_aef,_af0);
var _af1=this.rules;
var _af2,_af3;
for(var i=0,len=_af1.length;i<len;i++){
var _af2=_af1[i].symbolizer;
for(var key in _af2){
_af3=_af2[key];
if(typeof _af3=="object"){
this.addPropertyStyles(_aef,_af3);
}else{
this.addPropertyStyles(_aef,_af2);
break;
}
}
}
return _aef;
},addPropertyStyles:function(_af7,_af8){
var _af9;
for(var key in _af8){
_af9=_af8[key];
if(typeof _af9=="string"&&_af9.match(/\$\{\w+\}/)){
_af7[key]=true;
}
}
return _af7;
},addRules:function(_afb){
this.rules=this.rules.concat(_afb);
this.propertyStyles=this.findPropertyStyles();
},setDefaultStyle:function(_afc){
this.defaultStyle=_afc;
this.propertyStyles=this.findPropertyStyles();
},getSymbolizerPrefix:function(_afd){
var _afe=OpenLayers.Style.SYMBOLIZER_PREFIXES;
for(var i=0,len=_afe.length;i<len;i++){
if(_afd.CLASS_NAME.indexOf(_afe[i])!=-1){
return _afe[i];
}
}
},CLASS_NAME:"OpenLayers.Style"});
OpenLayers.Style.createLiteral=function(_b01,_b02,_b03){
if(typeof _b01=="string"&&_b01.indexOf("${")!=-1){
_b01=OpenLayers.String.format(_b01,_b02,[_b03]);
_b01=(isNaN(_b01)||!_b01)?_b01:parseFloat(_b01);
}
return _b01;
};
OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text"];
OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(_b04,_b05){
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(_b04 instanceof OpenLayers.Style){
this.styles["default"]=_b04;
this.styles["select"]=_b04;
this.styles["temporary"]=_b04;
}else{
if(typeof _b04=="object"){
for(var key in _b04){
if(_b04[key] instanceof OpenLayers.Style){
this.styles[key]=_b04[key];
}else{
if(typeof _b04[key]=="object"){
this.styles[key]=new OpenLayers.Style(_b04[key]);
}else{
this.styles["default"]=new OpenLayers.Style(_b04);
this.styles["select"]=new OpenLayers.Style(_b04);
this.styles["temporary"]=new OpenLayers.Style(_b04);
break;
}
}
}
}
}
OpenLayers.Util.extend(this,_b05);
},destroy:function(){
for(var key in this.styles){
this.styles[key].destroy();
}
this.styles=null;
},createSymbolizer:function(_b08,_b09){
if(!_b08){
_b08=new OpenLayers.Feature.Vector();
}
if(!this.styles[_b09]){
_b09="default";
}
_b08.renderIntent=_b09;
var _b0a={};
if(this.extendDefault&&_b09!="default"){
_b0a=this.styles["default"].createSymbolizer(_b08);
}
return OpenLayers.Util.extend(_b0a,this.styles[_b09].createSymbolizer(_b08));
},addUniqueValueRules:function(_b0b,_b0c,_b0d,_b0e){
var _b0f=[];
for(var _b10 in _b0d){
_b0f.push(new OpenLayers.Rule({symbolizer:_b0d[_b10],context:_b0e,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:_b0c,value:_b10})}));
}
this.styles[_b0b].addRules(_b0f);
},CLASS_NAME:"OpenLayers.StyleMap"});
OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(_b11,_b12){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);
if(_b11){
this.position=_b11;
}
if(_b12){
this.direction=_b12;
}
this.measureDivs=[];
},destroy:function(){
for(var _b13 in this.buttons){
var btn=this.buttons[_b13];
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 _b16=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);
this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",_b16,sz,"Shift->Drag to zoom to area");
_b16=_b16.add((this.direction=="vertical"?0:sz.w),(this.direction=="vertical"?sz.h:0));
this._addButton("pan","panning-hand-off.png","panning-hand-on.png",_b16,sz,"Drag the map to pan.");
_b16=_b16.add((this.direction=="vertical"?0:sz.w),(this.direction=="vertical"?sz.h:0));
this.switchModeTo("pan");
return this.div;
},_addButton:function(id,img,_b19,xy,sz,_b1c){
var _b1d=OpenLayers.Util.getImagesLocation()+img;
var _b1e=OpenLayers.Util.getImagesLocation()+_b19;
var btn=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+id,xy,sz,_b1d,"absolute");
this.div.appendChild(btn);
btn.imgLocation=_b1d;
btn.activeImgLocation=_b1e;
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=_b1c;
btn.alt=_b1c;
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 _b23=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_b23,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 _b25="";
if(this.measureStart){
var _b26=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
_b25=OpenLayers.Util.distVincenty(this.measureStart,_b26);
_b25=Math.round(_b25*100)/100;
_b25=_b25+"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(_b25){
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=_b25;
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,len=this.measureDivs.length;i<len;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 _b2b=Math.abs(this.mouseDragStart.x-evt.xy.x);
var _b2c=Math.abs(this.mouseDragStart.y-evt.xy.y);
this.zoomBox.style.width=Math.max(1,_b2b)+"px";
this.zoomBox.style.height=Math.max(1,_b2c)+"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 _b2b=this.mouseDragStart.x-evt.xy.x;
var _b2c=this.mouseDragStart.y-evt.xy.y;
var size=this.map.getSize();
var _b2e=new OpenLayers.Pixel(size.w/2+_b2b,size.h/2+_b2c);
var _b2f=this.map.getLonLatFromViewPortPx(_b2e);
this.map.setCenter(_b2f,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(_b33){
OpenLayers.Control.Panel.prototype.initialize.apply(this,[_b33]);
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(_b35,_b36){
OpenLayers.Control.Panel.prototype.initialize.apply(this,[_b36]);
this.addControls([new OpenLayers.Control.Navigation()]);
var _b37=[new OpenLayers.Control.DrawFeature(_b35,OpenLayers.Handler.Point,{"displayClass":"olControlDrawFeaturePoint"}),new OpenLayers.Control.DrawFeature(_b35,OpenLayers.Handler.Path,{"displayClass":"olControlDrawFeaturePath"}),new OpenLayers.Control.DrawFeature(_b35,OpenLayers.Handler.Polygon,{"displayClass":"olControlDrawFeaturePolygon"})];
for(var i=0,len=_b37.length;i<len;i++){
_b37[i].featureAdded=function(_b3a){
_b3a.state=OpenLayers.State.INSERT;
};
}
this.addControls(_b37);
},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 _b3e=code.split("-");
_b3e[0]=_b3e[0].toLowerCase();
if(typeof OpenLayers.Lang[_b3e[0]]=="object"){
lang=_b3e[0];
}
if(_b3e[1]){
var _b3f=_b3e[0]+"-"+_b3e[1].toUpperCase();
if(typeof OpenLayers.Lang[_b3f]=="object"){
lang=_b3f;
}
}
if(!lang){
OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+_b3e.join("-")+" dictionary, falling back to default language");
lang=OpenLayers.Lang.defaultCode;
}
OpenLayers.Lang.code=lang;
},translate:function(key,_b41){
var _b42=OpenLayers.Lang[OpenLayers.Lang.getCode()];
var _b43=_b42[key];
if(!_b43){
_b43=key;
}
if(_b41){
_b43=OpenLayers.String.format(_b43,_b41);
}
return _b43;
}};
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 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":"","filterEvaluateNotImplemented":"evaluate is not implemented for this filter type."};


