(function(){window.olleh={isSSL:false,sslScheme:null,getResourceUrl:function(a){return this.isSSL?a.replace("http://",((this.sslScheme?this.sslScheme:"")+"//")):a},getScriptLocation:function(){var a="http://map.ktgis.com/MapAPI/";return this.getResourceUrl(a)},Browser_Name:"",Browser_Mobile:false};window.olleh.maps={setSecureUrl:function(a){olleh.isSSL=true;olleh.sslScheme=a;this.TileMapURL.BASEMAP=olleh.getResourceUrl(this.TileMapURL.BASEMAP);this.TileMapURL.AIRPHOTO=olleh.getResourceUrl(this.TileMapURL.AIRPHOTO);this.TileMapURL.HYBRID=olleh.getResourceUrl(this.TileMapURL.HYBRID);this.TileMapURL.TRAFFIC=olleh.getResourceUrl(this.TileMapURL.TRAFFIC);this.TileMapURL.DISTRICT=olleh.getResourceUrl(this.TileMapURL.DISTRICT);this.TileMapURL.ELECTION=olleh.getResourceUrl(this.TileMapURL.ELECTION);this.TileMapURL.CADASTRAL=olleh.getResourceUrl(this.TileMapURL.CADASTRAL);this.TileMapURL.ECOMAP=olleh.getResourceUrl(this.TileMapURL.ECOMAP)},TileMapURL:{BASEMAP:"http://map.ktgis.com/BaseMap/olleh7.10.1_1027/layers/_alllayers",AIRPHOTO:"http://map.ktgis.com/ServiceAir/version20110705",HYBRID:"http://map.ktgis.com/HybridMap/olleh6.03.1_0405_hyb/layers/_alllayers",TRAFFIC:"http://traffic.ktgis.com/NTraffic/TTileServlet/256",DISTRICT:"http://map.ktgis.com/HybridMap/election120226/layers/_alllayers",ELECTION:"http://map.ktgis.com/HybridMap/seoul120308_10/layers/_alllayers",CADASTRAL:"http://map.ktgis.com/CadastralMap/cadastral6.09.1_0914/layers/_alllayers",ECOMAP:"http://map.ktgis.com/BaseMap/light4.07.1_0725/layers/_alllayers"},TileFormat:{BASEMAP:"png",AIRPHOTO:"jpg",HYBRID:"png",TRAFFIC:"png",DISTRICT:"png",ELECTION:"png",CADASTRAL:"png",ECOMAP:"png"},MapTypeId:{BASEMAP:"BASEMAP",AIRPHOTO:"AIRPHOTO",HYBRID:"HYBRID",CADASTRAL:"CADASTRAL",ECOMAP:"ECOMAP"},ControlPosition:{BOTTOM:"BOTTOM",BOTTOM_LEFT:"BOTTOM_LEFT",BOTTOM_RIGHT:"BOTTOM_RIGHT",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP",TOP_LEFT:"TOP_LEFT",TOP_RIGHT:"TOP_RIGHT"},MapTypeControlStyle:{DEFAULT:"DEFAULT",DROPDOWN_MENU:"DROPDOWN_MENU",HORIZONTAL_BAR:"HORIZONTAL_BAR"},ScaleControlStyle:{DEFAULT:"DEFAULT"},ZoomControlStyle:{DEFAULT:"DEFAULT",LARGE:"LARGE",SMALL:"SMALL"},DirectionsTravelMode:{DRIVING:"DRIVING",TRAFFIC:"TRAFFIC"},DirectionsProjection:{Geographic:"0",TM_WEST:"1",TM_MID:"2",TM_EAST:"3",KATEC:"4",UTM_52:"5",UTM_51:"6",UTM_K:"7"},DirectionsTrafficType:{RECOMMEND:"RECOMMEND",BUS:"BUS",SUBWAY:"SUBWAY",BOTH:"BOTH"},DirectionsDrivePriority:{PRIORITY_0:"0",PRIORITY_1:"1",PRIORITY_2:"2",PRIORITY_3:"3",PRIORITY_4:"5"},DirecionsTrafficPriority:{PRIORITY_0:"0",PRIORITY_1:"1",PRIORITY_2:"2",PRIORITY_3:"3"},Animation:{BOUNCE:"1",DROP:"2"},MarkerCluster:{ImagePath:"../images/cluster/m",Extension:"png"}}})();olleh.VERSION="ollehMapAPI 2.0.0";olleh.Util={};olleh.Util.getElement=function(){var d=[];for(var c=0,a=arguments.length;c=0;a--){if(c[a]==b){c.splice(a,1);break}}return c};olleh.Util.clearArray=function(a){a.length=0};olleh.Util.indexOf=function(d,c){for(var b=0,a=d.length;b=0&&parseFloat(g)<1){d.style.filter="alpha(opacity="+(g*100)+")";d.style.opacity=g}else{if(parseFloat(g)==1){d.style.filter="";d.style.opacity=""}}};olleh.Util.createDiv=function(a,j,h,f,e,c,b,g){var d=document.createElement("div");if(f){d.style.backgroundImage="url("+f+")"}if(!a){a=olleh.Util.createUniqueID("KMapDiv")}if(!e){e="absolute"}olleh.Util.modifyDOMElement(d,a,j,h,e,c,b,g);return d};olleh.Util.createImage=function(a,h,g,e,d,c,f,j){var b=document.createElement("img");if(!a){a=olleh.Util.createUniqueID("KMapDiv")}if(!d){d="relative"}olleh.Util.modifyDOMElement(b,a,h,g,d,c,null,f);if(j){b.style.display="none";olleh.Event.observe(b,"load",olleh.Function.bind(olleh.Util.onImageLoad,b));olleh.Event.observe(b,"error",olleh.Function.bind(olleh.Util.onImageLoadError,b))}b.style.alt=a;b.galleryImg="no";if(e){b.src=e}return b};olleh.Util.setOpacity=function(b,a){olleh.Util.modifyDOMElement(b,null,null,null,null,null,null,a)};olleh.Util.onImageLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){this.style.backgroundColor="transparent";this.style.display=""}};olleh.Util.onImageLoadErrorColor="";olleh.IMAGE_RELOAD_ATTEMPTS=3;olleh.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._attempts<=olleh.IMAGE_RELOAD_ATTEMPTS){var d=this.urls;if(d&&d instanceof Array&&d.length>1){var e=this.src.toString();var c,a;for(a=0;c=d[a];a++){if(e.indexOf(c)!=-1){break}}var f=Math.floor(d.length*Math.random());var b=d[f];a=0;while(b==c&&a++<4){f=Math.floor(d.length*Math.random());b=d[f]}this.src=e.replace(c,b)}else{this.src=this.src}}else{this.style.backgroundColor=olleh.Util.onImageLoadErrorColor}this.style.display=""};olleh.Util.alphaHackNeeded=null;olleh.Util.alphaHack=function(){if(olleh.Util.alphaHackNeeded==null){var d=navigator.appVersion.split("MSIE");var a=parseFloat(d[1]);var b=false;try{b=!!(document.body.filters)}catch(c){}olleh.Util.alphaHackNeeded=(b&&(a>=5.5)&&(a<7))}return olleh.Util.alphaHackNeeded};olleh.Util.modifyAlphaImageDiv=function(a,b,k,j,g,f,c,d,h){olleh.Util.modifyDOMElement(a,b,k,j,f,null,null,h);var e=a.childNodes[0];if(g){e.src=g}olleh.Util.modifyDOMElement(e,a.id+"_innerImage",null,j,f,c);if(olleh.Util.alphaHack()){if(a.style.display!="none"){a.style.display="inline-block"}if(d==null){d="scale"}a.style.filter="progid:DXImageTransform.Microsoft"+".AlphaImageLoader(src='"+e.src+"', "+"sizingMethod='"+d+"')";if(parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)<1){a.style.filter+=" alpha(opacity="+a.style.opacity*100+")"}e.style.filter="alpha(opacity=0)"}};olleh.Util.createAlphaImageDiv=function(b,k,j,g,f,c,d,h,l){var a=olleh.Util.createDiv();var e=olleh.Util.createImage(null,null,null,null,null,null,null,false);a.appendChild(e);if(l){e.style.display="none";olleh.Event.observe(e,"load",olleh.Function.bind(olleh.Util.onImageLoad,a));olleh.Event.observe(e,"error",olleh.Function.bind(olleh.Util.onImageLoadError,a))}olleh.Util.modifyAlphaImageDiv(a,b,k,j,g,f,c,d,h);return a};olleh.Util.upperCaseObject=function(b){var a={};for(var c in b){a[c.toUpperCase()]=b[c]}return a};olleh.Util.applyDefaults=function(d,c){d=d||{};var b=typeof window.Event=="function"&&c instanceof window.Event;for(var a in c){if(d[a]===undefined||(!b&&c.hasOwnProperty&&c.hasOwnProperty(a)&&!d.hasOwnProperty(a))){d[a]=c[a]}}if(!b&&c&&c.hasOwnProperty&&c.hasOwnProperty("toString")&&!d.hasOwnProperty("toString")){d.toString=c.toString}return d};olleh.Util.getParameterString=function(h){var g=[];for(var c in h){var e=h[c];if((e!=null)&&(typeof e!="function")){var b;if(typeof e=="object"&&e.constructor==Array){var f=[];for(var d=0,a=e.length;d0)){if(!b){b=0}if(a[b].childNodes.length>1){return a.childNodes[1].nodeValue}else{if(a[b].childNodes.length==1){return a[b].firstChild.nodeValue}}}else{return""}};olleh.Util.getXmlNodeValue=function(a){var b=null;if(!a){return b}olleh.Util.Try(function(){b=a.text;if(!b){b=a.textContent}if(!b){b=a.firstChild?a.firstChild.nodeValue:null}},function(){b=a.textContent});return b};olleh.Util.mouseLeft=function(a,c){var b=(a.relatedTarget)?a.relatedTarget:a.toElement;while(b!=c&&b!=null){b=b.parentNode}return(b!=c)};olleh.Util.DEFAULT_PRECISION=14;olleh.Util.toFloat=function(b,a){if(!a){a=olleh.Util.DEFAULT_PRECISION}if(a==0){return parseFloat(b)}else{return parseFloat(parseFloat(b).toPrecision(a))}};olleh.Util.rad=function(a){return a*Math.PI/180};olleh.Util.distVincenty=function(g,c){var M=6378137,K=6356752.3142,G=1/298.257223563;var n=olleh.Util.rad(c.x-g.x);var J=Math.atan((1-G)*Math.tan(olleh.Util.rad(g.y)));var I=Math.atan((1-G)*Math.tan(olleh.Util.rad(c.y)));var m=Math.sin(J),j=Math.cos(J);var l=Math.sin(I),h=Math.cos(I);var r=n,o=2*Math.PI;var q=20;while(Math.abs(r-o)>1e-12&&--q>0){var z=Math.sin(r),e=Math.cos(r);var N=Math.sqrt((h*z)*(h*z)+(j*l-m*h*e)*(j*l-m*h*e));if(N==0){return 0}var E=m*l+j*h*e;var y=Math.atan2(N,E);var k=Math.asin(j*h*z/N);var F=Math.cos(k)*Math.cos(k);var p=E-2*m*l/F;var v=G/16*F*(4+G*(4-3*F));o=r;r=n+(1-v)*G*Math.sin(k)*(y+v*N*(p+v*E*(-1+2*p*p)))}if(q==0){return NaN}var u=F*(M*M-K*K)/(K*K);var x=1+u/16384*(4096+u*(-768+u*(320-175*u)));var w=u/1024*(256+u*(-128+u*(74-47*u)));var D=w*N*(p+w/4*(E*(-1+2*p*p)-w/6*p*(-3+4*N*N)*(-3+4*p*p)));var t=K*x*(y-D);var H=t.toFixed(3)/1000;return H};olleh.Util.getParameters=function(b){b=b||window.location.href;var a="";if(olleh.String.contains(b,"?")){var c=b.indexOf("?")+1;var e=olleh.String.contains(b,"#")?b.indexOf("#"):b.length;a=b.substring(c,e)}var o={};var d=a.split(/[&;]/);for(var h=0,k=d.length;h1)?(1/b):b;return a};olleh.Util.getResolutionFromScale=function(d,a){if(a==null){a="Meter"}var c=olleh.Util.normalizeScale(d);var b=1/(c*olleh.INCHES_PER_UNIT[a]*olleh.DOTS_PER_INCH);return b};olleh.Util.getScaleFromResolution=function(b,a){if(a==null){a="degrees"}var c=b*olleh.INCHES_PER_UNIT[a]*olleh.DOTS_PER_INCH;return c};olleh.Util.safeStopPropagation=function(a){olleh.Event.stop(a,true)};olleh.Util.pagePosition=function(f){var a=0,d=0;var b=f;var g=f;while(b){if(b==document.body){if(olleh.Element.getStyle(g,"position")=="absolute"){break}}a+=b.offsetTop||0;d+=b.offsetLeft||0;g=b;try{b=b.offsetParent}catch(c){break}}b=f;while(b){a-=b.scrollTop||0;d-=b.scrollLeft||0;b=b.parentNode}return[d,a]};olleh.Util.isEquivalentUrl=function(f,e,c){c=c||{};olleh.Util.applyDefaults(c,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var b=olleh.Util.createUrlObject(f,c);var a=olleh.Util.createUrlObject(e,c);for(var d in b){if(d!=="args"){if(b[d]!=a[d]){return false}}}for(var d in b.args){if(b.args[d]!=a.args[d]){return false}delete a.args[d]}for(var d in a.args){return false}return true};olleh.Util.createUrlObject=function(c,l){l=l||{};if(!(/^\w+:\/\//).test(c)){var g=window.location;var e=g.port?":"+g.port:"";var h=g.protocol+"//"+g.host.split(":").shift()+e;if(c.indexOf("/")===0){c=h+c}else{var f=g.pathname.split("/");f.pop();c=h+f.join("/")+"/"+c}}if(l.ignoreCase){c=c.toLowerCase()}var j=document.createElement("a");j.href=c;var d={};d.host=j.host.split(":").shift();d.protocol=j.protocol;if(l.ignorePort80){d.port=(j.port=="80"||j.port=="0")?"":j.port}else{d.port=(j.port==""||j.port=="0")?"80":j.port}d.hash=(l.ignoreHash||j.hash==="#")?"":j.hash;var b=j.search;if(!b){var k=c.indexOf("?");b=(k!=-1)?c.substr(k):""}d.args=olleh.Util.getParameters(b);d.pathname=(j.pathname.charAt(0)=="/")?j.pathname:"/"+j.pathname;return d};olleh.Util.removeTail=function(b){var c=null;var a=b.indexOf("?");var d=b.indexOf("#");if(a==-1){c=(d!=-1)?b.substr(0,d):b}else{c=(d!=-1)?b.substr(0,Math.min(a,d)):b.substr(0,a)}return c};olleh.Util.getBrowserName=function(){if(olleh.Browser_Name){return olleh.Browser_Name}else{var b="";var a=navigator.userAgent.toLowerCase();if(a.indexOf("mozilla")!=-1){if(a.indexOf("iphone")!=-1){b="iphone"}else{if(a.indexOf("ipod")!=-1){b="ipod"}else{if(a.indexOf("ipad")!=-1){b="ipad"}else{if(a.indexOf("android")!=-1){b="android"}else{if(a.indexOf("msie")!=-1){if(a.indexOf("9.0")!=-1){b="msie 9.0"}else{if(a.indexOf("8.0")!=-1){b="msie 8.0"}else{if(a.indexOf("7.0")!=-1){b="msie 7.0"}else{if(a.indexOf("6.0")!=-1){b="msie 6.0"}else{b="msie"}}}}}else{if(a.indexOf("safari")!=-1){b="safari"}else{if(a.indexOf("firefox")!=-1){b="firefox"}else{if(a.indexOf("chrome")!=-1){b="chrome"}else{b="unknown"}}}}}}}}}else{if(a.indexOf("opera")!=-1){b="opera"}}return b}};olleh.Util.getRenderedDimensions=function(b,q,r){var n,f;var e=r&&r._oner;var a=document.createElement("div");if(e){e.container=a}a.style.visibility="hidden";var p=(r&&r.containerElement)?r.containerElement:document.body;var o=false;var j=null;var m=p;while(m&&m.tagName.toLowerCase()!="body"){var k=olleh.Element.getStyle(m,"position");if(k=="absolute"){o=true;break}else{if(k&&k!="static"){break}}m=m.parentNode}if(o&&(p.clientHeight===0||p.clientWidth===0)){j=document.createElement("div");if(e){e.superContainer=j}j.style.visibility="hidden";j.style.position="absolute";j.style.overflow="visible";j.style.width=document.body.clientWidth+"px";j.style.height=document.body.clientHeight+"px";j.appendChild(a)}a.style.position="absolute";if(q){if(q.w){n=q.w;a.style.width=n+"px"}else{if(q.h){f=q.h;a.style.height=f+"px"}}}if(r&&r.displayClass){a.className=r.displayClass}var g=document.createElement("div");if(e){e.content=g}g.innerHTML=b;g.style.overflow="visible";if(g.childNodes){for(var d=0,c=g.childNodes.length;d'+d.attributes.description+"":null;var c=(d.attributes.name)?'
'+d.attributes.name+"
":null;if(d.style){if(d.style.balloonStyle&&a){if(d.style.balloonStyle.indexOf("${description}")!=-1){var e=d.style.balloonStyle.replace("${description}",a);b+=e}else{if(a){b+=d.style.balloonStyle;b+=a}}}else{if(a){b+=a}}}else{if(a){b+=a}}if(c&&b!=""){b=c+"
"+b}else{if(c){b=c}}return b};olleh.Util.stopAnimation=function(a){if(a._interval){window.clearInterval(a._interval);a._interval=null;if(a.map&&a.position){a.moveTo(a.map.getLayerPxFromCoord(a.position))}}};olleh.Util.removeObject=function(c){var b;for(var a in c){b=(a!="EVENT_TYPES")&&c[a];if(b){c[a]=null}b=a=null}};olleh.Util.purge=function(f){var c=f.attributes,e,b,g;if(c){b=c.length;for(e=0;ef){g=m}}}j+=g}return j};olleh.Util.addSetTimeOut=function(a,b,c){a&&window.setTimeout(function(){Function.call(a[b]&&a[b](c))},3)};olleh.Browser_Name=olleh.Util.getBrowserName();switch(olleh.Browser_Name){case"android":case"iphone":case"ipad":case"ipod":olleh.Browser_Mobile=true;break}olleh.String={startsWith:function(b,a){return(b.indexOf(a)==0)},contains:function(b,a){return(b.indexOf(a)!=-1)},trim:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(f){var d=f.split("-");var b=d[0];for(var c=1,a=d.length;c0){b=parseFloat(a.toPrecision(c))}return b},format:function(c,a,g,j){a=(typeof a!="undefined")?a:0;g=(typeof g!="undefined")?g:olleh.Number.thousandsSeparator;j=(typeof j!="undefined")?j:olleh.Number.decimalSeparator;if(a!=null){c=parseFloat(c.toFixed(a))}var b=c.toString().split(".");if(b.length==1&&a==null){a=0}var d=b[0];if(g){var e=/(-?[0-9]+)([0-9]{3})/;while(e.test(d)){d=d.replace(e,"$1"+g+"$2")}}var f;if(a==0){f=d}else{var h=b.length>1?b[1]:"0";if(a!=null){h=h+new Array(a-h.length+1).join("0")}f=d+j+h}return f}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=function(a){return olleh.Number.limitSigDigs(this,a)}}olleh.Function={bind:function(c,b){var a=Array.prototype.slice.apply(arguments,[2]);return function(){var d=a.concat(Array.prototype.slice.apply(arguments,[0]));return c.apply(b,d)}},bindAsEventListener:function(b,a){return function(c){return b.call(a,c||window.event)}}};if(!Function.prototype.bind){Function.prototype.bind=function(){Array.prototype.unshift.apply(arguments,[this]);return olleh.Function.bind.apply(null,arguments)}}if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=function(a){return olleh.Function.bindAsEventListener(this,a)}}olleh.Array={filter:function(g,f,b){var d=[];if(Array.prototype.filter){d=g.filter(f,b)}else{var a=g.length;if(typeof f!="function"){throw new TypeError()}for(var c=0;c1){b=arguments[e].prototype.initialize;arguments[e].prototype.initialize=function(){};c=new arguments[e];if(b===undefined){delete arguments[e].prototype.initialize}else{arguments[e].prototype.initialize=b}}f=arguments[e].prototype}else{f=arguments[e]}olleh.Util.extend(c,f)}d.prototype=c;return d};olleh.Class.isPrototype=function(){};olleh.Class.create=function(){return function(){if(arguments&&arguments[0]!=olleh.Class.isPrototype){this.initialize.apply(this,arguments)}}};olleh.Class.inherit=function(){var d=arguments[0];var e=new d(olleh.Class.isPrototype);for(var c=1,a=arguments.length;c=this.bottom)&&(e.bottom<=this.top))||((this.bottom>=e.bottom)&&(this.bottom<=e.top)));var f=(((e.top>=this.bottom)&&(e.top<=this.top))||((this.top>e.bottom)&&(this.top=this.left)&&(e.left<=this.right))||((this.left>=e.left)&&(this.left<=e.right)));var a=(((e.right>=this.left)&&(e.right<=this.right))||((this.right>=e.left)&&(this.right<=e.right)));d=((g||f)&&(c||a))}return d},toBBOX:function(b,e){if(b==null){b=6}var g=Math.pow(10,b);var g=Math.pow(10,b);var f=Math.round(this.left*g)/g;var d=Math.round(this.bottom*g)/g;var c=Math.round(this.right*g)/g;var a=Math.round(this.top*g)/g;if(e===true){return d+","+f+","+a+","+c}else{return f+","+d+","+c+","+a}},add:function(a,b){if((a==null)||(b==null)){return null}return new olleh.maps.Bounds(this.left+a,this.bottom+b,this.right+a,this.top+b)},containsPixel:function(b,a){return this.contains(b.x,b.y,a)},contains:function(b,d,a){if(a==null){a=true}if(b==null||d==null){return false}b=olleh.Util.toFloat(b);d=olleh.Util.toFloat(d);var c=false;if(a){c=((b>=this.left)&&(b<=this.right)&&(d>=this.bottom)&&(d<=this.top))}else{c=((b>this.left)&&(bthis.bottom)&&(dthis.right)){this.right=b.right}if((this.top==null)||(b.top>this.top)){this.top=b.top}}}return this},intersects:function(a){return this.intersectsBounds(a)},containsCoord:function(b,a){return this.contains(b.x,b.y,a)},union:function(a){return this.extend(a)},toSpan:function(){return new olleh.maps.Size(this.right-this.left,this.top-this.bottom)},getDoubleBounds:function(a){this.left=Math.ceil(this.left-(this.right-this.left));this.bottom=Math.ceil(this.bottom-(this.top-this.bottom));this.right=Math.ceil(this.right+(this.right-this.left));this.top=Math.ceil(this.top+(this.top-this.bottom));if(a&&a.maxExtent){if(this.lefta.maxExtent.right){this.right=Math.floor(a.maxExtent.right)}if(this.top>a.maxExtent.top){this.top=Math.floor(a.maxExtent.top)}}},CLASS_NAME:"olleh.maps.Bounds"});olleh.maps.Bounds.fromString=function(b){var a=b.split(",");return olleh.maps.Bounds.fromArray(a)};olleh.maps.Bounds.fromArray=function(a){return new olleh.maps.Bounds(parseFloat(a[0]),parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]))};olleh.maps.Bounds.fromSize=function(a){return new olleh.maps.Bounds(0,a.h,a.w,0)};olleh.maps.Bounds.oppositeQuadrant=function(a){var b="";b+=(a.charAt(0)=="t")?"b":"t";b+=(a.charAt(1)=="l")?"r":"l";return b};olleh.Element={visible:function(a){return olleh.Util.getElement(a).style.display!="none"},posHide:function(a){a.style.display="none"},posShow:function(a){a.style.display="block"},setSize:function(b,a,c){b.style.width=a;b.style.height=c;return b},setWidth:function(b,a){b.style.width=a;return b},setHeight:function(a,b){a.style.height=b;return a},setLeft:function(b,a){b.style.left=a;return b},setTop:function(b,a){b.style.top=a;return b},getSize:function(a){return{width:parseInt(a.style.width,10)||a.offsetWidth,height:parseInt(a.style.height,10)||a.offsetHeight}},toggle:function(){for(var c=0,a=arguments.length;c>2;g=((k&3)<<4)|(h>>4);e=((h&15)<<2)|(f>>6);d=f&63;if(isNaN(h)){e=d=64}else{if(isNaN(f)){d=64}}a=a+this._keyStr.charAt(j)+this._keyStr.charAt(g)+this._keyStr.charAt(e)+this._keyStr.charAt(d)}return a},decode:function(c){c=c+"";var a="";var k,h,f;var j,g,e,d;var b=0;c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(b>4);h=((g&15)<<4)|(e>>2);f=((e&3)<<6)|d;a=a+String.fromCharCode(k);if(e!=64){a=a+String.fromCharCode(h)}if(d!=64){a=a+String.fromCharCode(f)}}a=olleh.UTF8.decode(a);return a}};olleh.UTF8={encode:function(b){b=b+"";b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d191)&&(e<224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&31)<<6)|(c2&63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&15)<<12)|((c2&63)<<6)|(c3&63));d+=3}}}return b},URLEncode:function(a){return escape(this._utf8_encode(a))},URLDecode:function(a){return this._utf8_decode(unescape(a))}};olleh.Geometry=olleh.Class({id:null,parent:null,bounds:null,zIndex:-1,initialize:function(){this.id=olleh.Util.createUniqueID(this.CLASS_NAME+"_")},remove:function(){this.id=null;this.bounds=null;this.parent=null},clone:function(){return new olleh.Geometry()},setBounds:function(a){if(a){if(this.bounds&&this.bounds.equals(a)){return}this.bounds=a.clone()}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds()}},extendBounds:function(b){var a=this.getBounds();if(!a){this.setBounds(b)}else{this.bounds.extend(b)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},distanceTo:function(b,a){},getVertices:function(a){},atPoint:function(h,g,e){var c=false;var d=this.getBounds();if((d!=null)&&(h!=null)){var b=(g!=null)?g:0;var a=(e!=null)?e:0;var f=new olleh.maps.Bounds(this.bounds.left-b,this.bounds.bottom-a,this.bounds.right+b,this.bounds.top+a);c=f.containsCoord(h)}return c},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},getMap:function(){if(this.map){return this.map}},getCenter:function(){var a=this.getBounds();return a.getCenterCoord()},CLASS_NAME:"olleh.Geometry"});olleh.Geometry.segmentsIntersect=function(a,H,b){var s=b&&b.point;var z=b&&b.tolerance;var f=false;var B=a.x1-H.x1;var F=a.y1-H.y1;var o=a.x2-a.x1;var w=a.y2-a.y1;var t=H.y2-H.y1;var l=H.x2-H.x1;var D=(t*o)-(l*w);var e=(l*F)-(t*B);var c=(o*F)-(w*B);if(D==0){if(e==0&&c==0){f=true}}else{var E=e/D;var C=c/D;if(E>=0&&E<=1&&C>=0&&C<=1){if(!s){f=true}else{var h=a.x1+(E*o);var g=a.y1+(E*w);f=new olleh.maps.Point(h,g)}}}if(z){var r;if(f){if(s){var n=[a,H];var A,h,g;outer:for(var v=0;v<2;++v){A=n[v];for(var u=1;u<3;++u){h=A["x"+u];g=A["y"+u];r=Math.sqrt(Math.pow(h-f.x,2)+Math.pow(g-f.y,2));if(r=1){g=a;e=f}else{g=b+h*n;e=j+h*m}}return{distance:Math.sqrt(Math.pow(g-c,2)+Math.pow(e-k,2)),x:g,y:e}};olleh.maps.Point=olleh.Class(olleh.Geometry,{x:null,y:null,initialize:function(a,b){olleh.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(a);this.y=parseFloat(b)},clone:function(a){if(a==null){a=new olleh.maps.Point(this.x,this.y)}olleh.Util.applyDefaults(a,this);return a},calculateBounds:function(){this.bounds=null;this.setBounds(new olleh.maps.Bounds(this.x,this.y,this.x,this.y))},distanceTo:function(f,k){var d=!(k&&k.edge===false);var a=d&&k&&k.details;var b,e,h,c,g,j;if(f instanceof olleh.maps.Point){e=this.x;h=this.y;c=f.x;g=f.y;b=Math.sqrt(Math.pow(e-c,2)+Math.pow(h-g,2));j=!a?b:{x0:e,y0:h,x1:c,y1:g,distance:b}}else{j=f.distanceTo(this,k);if(a){j={x0:j.x1,y0:j.y1,x1:j.x0,y1:j.y0,distance:j.distance}}}return j},equals:function(a){var b=false;if(a!=null){b=((this.x==a.x&&this.y==a.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)))}return b},toShortString:function(){return(this.x+", "+this.y)},move:function(a,b){this.x=this.x+a;this.y=this.y+b;this.clearBounds()},rotate:function(d,b){d*=Math.PI/180;var a=this.distanceTo(b);var c=d+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+(a*Math.cos(c));this.y=b.y+(a*Math.sin(c));this.clearBounds()},getCentroid:function(){return new olleh.maps.Point(this.x,this.y)},resize:function(c,a,b){b=(b==undefined)?1:b;this.x=a.x+(c*b*(this.x-a.x));this.y=a.y+(c*(this.y-a.y));this.clearBounds();return this},intersects:function(k,e){var c=false;if(k.CLASS_NAME=="olleh.maps.Point"){c=this.equals(k)}else{var h=(this.radius/2)*e;var f=this.x-h;var d=this.y-h;var b=this.x+h;var a=this.y+h;var g=new olleh.maps.Bounds(f,d,b,a);var j=g.toGeometry();c=j.intersects(k)}return c},transform:function(b,a){if((b&&a)){olleh.maps.Projection.transform(this,b,a);this.bounds=null}return this},getVertices:function(a){return[this]},toString:function(){return(this.x+", "+this.y)},getX:function(){return this.x},getY:function(){return this.y},CLASS_NAME:"olleh.maps.Point"}); Proj4js={defaultDatum:"WGS84",transform:function(e,b,a){if(!e.readyToUse||!b.readyToUse){this.reportError("Proj4js initialization for "+e.srsCode+" not yet complete");return a}if((e.srsProjNumber=="900913"&&b.datumCode!="WGS84")||(b.srsProjNumber=="900913"&&e.datumCode!="WGS84")){var d=Proj4js.WGS84;this.transform(e,d,a);e=d}if(e.projName=="longlat"){a.x*=Proj4js.common.D2R;a.y*=Proj4js.common.D2R}else{if(e.to_meter){a.x*=e.to_meter;a.y*=e.to_meter}e.inverse(a)}if(e.from_greenwich){a.x+=e.from_greenwich}a=this.datum_transform(e.datum,b.datum,a);if(b.from_greenwich){a.x-=b.from_greenwich}if(b.projName=="longlat"){a.x*=Proj4js.common.R2D;a.y*=Proj4js.common.R2D}else{b.forward(a);if(b.to_meter){a.x/=b.to_meter;a.y/=b.to_meter}}return a},datum_transform:function(d,b,a){if(d.compare_datums(b)){return a}if(d.datum_type==Proj4js.common.PJD_NODATUM||b.datum_type==Proj4js.common.PJD_NODATUM){return a}if(d.datum_type==Proj4js.common.PJD_GRIDSHIFT){alert("ERROR: Grid shift transformations are not implemented yet.")}if(b.datum_type==Proj4js.common.PJD_GRIDSHIFT){alert("ERROR: Grid shift transformations are not implemented yet.")}if(d.es!=b.es||d.a!=b.a||d.datum_type==Proj4js.common.PJD_3PARAM||d.datum_type==Proj4js.common.PJD_7PARAM||b.datum_type==Proj4js.common.PJD_3PARAM||b.datum_type==Proj4js.common.PJD_7PARAM){d.geodetic_to_geocentric(a);if(d.datum_type==Proj4js.common.PJD_3PARAM||d.datum_type==Proj4js.common.PJD_7PARAM){d.geocentric_to_wgs84(a)}if(b.datum_type==Proj4js.common.PJD_3PARAM||b.datum_type==Proj4js.common.PJD_7PARAM){b.geocentric_from_wgs84(a)}b.geocentric_to_geodetic(a)}if(b.datum_type==Proj4js.common.PJD_GRIDSHIFT){alert("ERROR: Grid shift transformations are not implemented yet.")}return a},reportError:function(a){},extend:function(a,e){a=a||{};if(e){for(var d in e){var b=e[d];if(b!==undefined){a[d]=b}}}return a},Class:function(){var b=function(){this.initialize.apply(this,arguments)};var a={};var e;for(var d=0;d-1)&&(b+e==g.length)){this.libPath=g.slice(0,-e);break}}}return this.libPath||""},loadScript:function(e,f,d,a){var b=document.createElement("script");b.defer=false;b.type="text/javascript";b.id=e;b.src=e;b.onload=f;b.onerror=d;b.loadCheck=a;if(/MSIE/.test(navigator.userAgent)){b.onreadystatechange=this.checkReadyState}document.getElementsByTagName("head")[0].appendChild(b)},checkReadyState:function(){if(this.readyState=="loaded"){if(!this.loadCheck()){this.onerror()}else{this.onload()}}}};Proj4js.Proj=Proj4js.Class({readyToUse:false,title:null,projName:null,units:null,datum:null,x0:0,y0:0,initialize:function(d){this.srsCodeInput=d;if(d.indexOf("urn:")==0){var a=d.split(":");if((a[1]=="ogc"||a[1]=="x-ogc")&&(a[2]=="def")&&(a[3]=="crs")){d=a[4]+":"+a[a.length-1]}}else{if(d.indexOf("http://")==0){var b=d.split("#");if(b[0].match(/epsg.org/)){d="EPSG:"+b[1]}else{if(b[0].match(/RIG.xml/)){d="IGNF:"+b[1]}}}}this.srsCode=d.toUpperCase();if(this.srsCode.indexOf("EPSG")==0){this.srsCode=this.srsCode;this.srsAuth="epsg";this.srsProjNumber=this.srsCode.substring(5)}else{if(this.srsCode.indexOf("IGNF")==0){this.srsCode=this.srsCode;this.srsAuth="IGNF";this.srsProjNumber=this.srsCode.substring(5)}else{if(this.srsCode.indexOf("CRS")==0){this.srsCode=this.srsCode;this.srsAuth="CRS";this.srsProjNumber=this.srsCode.substring(4)}else{this.srsAuth="";this.srsProjNumber=this.srsCode}}}this.loadProjDefinition()},loadProjDefinition:function(){if(Proj4js.defs[this.srsCode]){this.defsLoaded();return}var a=Proj4js.getScriptLocation()+"defs/"+this.srsAuth.toUpperCase()+this.srsProjNumber+".js";Proj4js.loadScript(a,Proj4js.bind(this.defsLoaded,this),Proj4js.bind(this.loadFromService,this),Proj4js.bind(this.checkDefsLoaded,this))},loadFromService:function(){var a=Proj4js.defsLookupService+"/"+this.srsAuth+"/"+this.srsProjNumber+"/proj4js/";Proj4js.loadScript(a,Proj4js.bind(this.defsLoaded,this),Proj4js.bind(this.defsFailed,this),Proj4js.bind(this.checkDefsLoaded,this))},defsLoaded:function(){this.parseDefs();this.loadProjCode(this.projName)},checkDefsLoaded:function(){if(Proj4js.defs[this.srsCode]){return true}else{return false}},defsFailed:function(){Proj4js.reportError("failed to load projection definition for: "+this.srsCode);Proj4js.defs[this.srsCode]=Proj4js.defs["WGS84"];this.defsLoaded()},loadProjCode:function(b){if(Proj4js.Proj[b]){this.initTransforms();return}var a=Proj4js.getScriptLocation()+"projCode/"+b+".js";Proj4js.loadScript(a,Proj4js.bind(this.loadProjCodeSuccess,this,b),Proj4js.bind(this.loadProjCodeFailure,this,b),Proj4js.bind(this.checkCodeLoaded,this,b))},loadProjCodeSuccess:function(a){if(Proj4js.Proj[a].dependsOn){this.loadProjCode(Proj4js.Proj[a].dependsOn)}else{this.initTransforms()}},loadProjCodeFailure:function(a){Proj4js.reportError("failed to find projection file for: "+a)},checkCodeLoaded:function(a){if(Proj4js.Proj[a]){return true}else{return false}},initTransforms:function(){Proj4js.extend(this,Proj4js.Proj[this.projName]);this.init();this.readyToUse=true},parseDefs:function(){this.defData=Proj4js.defs[this.srsCode];var e,b;if(!this.defData){return}var a=this.defData.split("+");for(var f=0;f1e-7){a=d*b;return((1-d*d)*(b/(1-a*a)-(0.5/d)*Math.log((1-a)/(1+a))))}else{return(2*b)}},asinz:function(a){if(Math.abs(a)>1){a=(a>1)?1:-1}return Math.asin(a)},e0fn:function(a){return(1-0.25*a*(1+a/16*(3+1.25*a)))},e1fn:function(a){return(0.375*a*(1+0.25*a*(1+0.46875*a)))},e2fn:function(a){return(0.05859375*a*a*(1+0.75*a))},e3fn:function(a){return(a*a*a*(35/3072))},mlfn:function(f,e,d,b,a){return(f*a-e*Math.sin(2*a)+d*Math.sin(4*a)-b*Math.sin(6*a))},srat:function(a,b){return(Math.pow((1-a)/(1+a),b))},sign:function(a){if(a<0){return(-1)}else{return(1)}},adjust_lon:function(a){a=(Math.abs(a)this.HALF_PI){return +Number.NaN}if(d==this.HALF_PI){return Number.POSITIVE_INFINITY}if(d==-1*this.HALF_PI){return -1*Number.POSITIVE_INFINITY}var a=e*b;return Math.log(Math.tan((this.HALF_PI+d)/2))+e*Math.log((1-a)/(1+a))/2},fL:function(b,a){return 2*Math.atan(b*Math.exp(a))-this.HALF_PI},invlatiso:function(f,d){var b=this.fL(1,d);var e=0;var a=0;do{e=b;a=f*Math.sin(e);b=this.fL(Math.exp(f*Math.log((1+a)/(1-a))/2),d)}while(Math.abs(b-e)>1e-12);return b},sinh:function(a){var b=Math.exp(a);b=(b-1/b)/2;return b},cosh:function(a){var b=Math.exp(a);b=(b+1/b)/2;return b},tanh:function(a){var b=Math.exp(a);b=(b-1/b)/(b+1/b);return b},asinh:function(a){var b=(a>=0?1:-1);return b*(Math.log(Math.abs(a)+Math.sqrt(a*a+1)))},acosh:function(a){return 2*Math.log(Math.sqrt((a+1)/2)+Math.sqrt((a-1)/2))},atanh:function(a){return Math.log((a-1)/(a+1))/2},gN:function(b,g,f){var d=g*f;return b/Math.sqrt(1-d*d)}};Proj4js.datum=Proj4js.Class({initialize:function(b){this.datum_type=Proj4js.common.PJD_WGS84;if(b.datumCode&&b.datumCode=="none"){this.datum_type=Proj4js.common.PJD_NODATUM}if(b&&b.datum_params){for(var a=0;a3){if(b.datum_params[3]!=0||b.datum_params[4]!=0||b.datum_params[5]!=0||b.datum_params[6]!=0){this.datum_type=Proj4js.common.PJD_7PARAM;b.datum_params[3]*=Proj4js.common.SEC_TO_RAD;b.datum_params[4]*=Proj4js.common.SEC_TO_RAD;b.datum_params[5]*=Proj4js.common.SEC_TO_RAD;b.datum_params[6]=(b.datum_params[6]/1000000)+1}}}if(b){this.a=b.a;this.b=b.b;this.es=b.es;this.ep2=b.ep2;this.datum_params=b.datum_params}},compare_datums:function(a){if(this.datum_type!=a.datum_type){return false}else{if(this.a!=a.a||Math.abs(this.es-a.es)>5e-11){return false}else{if(this.datum_type==Proj4js.common.PJD_3PARAM){return(this.datum_params[0]==a.datum_params[0]&&this.datum_params[1]==a.datum_params[1]&&this.datum_params[2]==a.datum_params[2])}else{if(this.datum_type==Proj4js.common.PJD_7PARAM){return(this.datum_params[0]==a.datum_params[0]&&this.datum_params[1]==a.datum_params[1]&&this.datum_params[2]==a.datum_params[2]&&this.datum_params[3]==a.datum_params[3]&&this.datum_params[4]==a.datum_params[4]&&this.datum_params[5]==a.datum_params[5]&&this.datum_params[6]==a.datum_params[6])}else{if(this.datum_type==Proj4js.common.PJD_GRIDSHIFT){return strcmp(pj_param(this.params,"snadgrids").s,pj_param(a.params,"snadgrids").s)==0}else{return true}}}}}},geodetic_to_geocentric:function(d){var q=d.x;var j=d.y;var e=d.z?d.z:0;var f;var b;var a;var m=0;var o;var l;var h;var g;if(j<-Proj4js.common.HALF_PI&&j>-1.001*Proj4js.common.HALF_PI){j=-Proj4js.common.HALF_PI}else{if(j>Proj4js.common.HALF_PI&&j<1.001*Proj4js.common.HALF_PI){j=Proj4js.common.HALF_PI}else{if((j<-Proj4js.common.HALF_PI)||(j>Proj4js.common.HALF_PI)){Proj4js.reportError("geocent:lat out of range:"+j);return null}}}if(q>Proj4js.common.PI){q-=(2*Proj4js.common.PI)}l=Math.sin(j);g=Math.cos(j);h=l*l;o=this.a/(Math.sqrt(1-this.es*h));f=(o+e)*g*Math.cos(q);b=(o+e)*g*Math.sin(q);a=((o*(1-this.es))+e)*l;d.x=f;d.y=b;d.z=a;return m},geocentric_to_geodetic:function(C){var H=1e-12;var D=(H*H);var g=30;var q;var j;var a;var u;var b;var r;var o;var G;var F;var m;var z;var w;var f;var E;var h=C.x;var e=C.y;var d=C.z?C.z:0;var l;var B;var v;f=false;q=Math.sqrt(h*h+e*e);j=Math.sqrt(h*h+e*e+d*d);if(q/this.aD&&E0){h=Proj4js.common.HALF_PI}else{if(d<0){h=-Proj4js.common.HALF_PI}else{b=true;h=0;if(a>0){z=Proj4js.common.HALF_PI}else{if(a<0){z=-Proj4js.common.HALF_PI}else{z=Proj4js.common.HALF_PI;q=-this.b;return}}}}}u=e*e+d*d;f=Math.sqrt(u);w=a*Proj4js.common.AD_C;m=Math.sqrt(w*w+u);l=w/m;g=f/m;E=l*l*l;r=a+this.b*this.ep2*E;o=f-this.a*this.es*g*g*g;j=Math.sqrt(r*r+o*o);D=r/j;C=o/j;v=this.a/Math.sqrt(1-this.es*D*D);if(C>=Proj4js.common.COS_67P5){q=f/C-v}else{if(C<=-Proj4js.common.COS_67P5){q=f/-C-v}else{q=a/D+v*(this.es-1)}}if(b==false){z=Math.atan(D/C)}B.x=h;B.y=z;B.z=q;return B},geocentric_to_wgs84:function(b){if(this.datum_type==Proj4js.common.PJD_3PARAM){b.x+=this.datum_params[0];b.y+=this.datum_params[1];b.z+=this.datum_params[2]}else{if(this.datum_type==Proj4js.common.PJD_7PARAM){var g=this.datum_params[0];var e=this.datum_params[1];var l=this.datum_params[2];var f=this.datum_params[3];var m=this.datum_params[4];var j=this.datum_params[5];var h=this.datum_params[6];var d=h*(b.x-j*b.y+m*b.z)+g;var a=h*(j*b.x+b.y-f*b.z)+e;var o=h*(-m*b.x+f*b.y+b.z)+l;b.x=d;b.y=a;b.z=o}}},geocentric_from_wgs84:function(d){if(this.datum_type==Proj4js.common.PJD_3PARAM){d.x-=this.datum_params[0];d.y-=this.datum_params[1];d.z-=this.datum_params[2]}else{if(this.datum_type==Proj4js.common.PJD_7PARAM){var h=this.datum_params[0];var e=this.datum_params[1];var m=this.datum_params[2];var g=this.datum_params[3];var o=this.datum_params[4];var l=this.datum_params[5];var j=this.datum_params[6];var f=(d.x-h)/j;var b=(d.y-e)/j;var a=(d.z-m)/j;d.x=f+l*b-o*a;d.y=-l*f+b+g*a;d.z=o*f-g*b+a}}}});Proj4js.Point=Proj4js.Class({initialize:function(a,e,d){if(typeof a=="object"){this.x=a[0];this.y=a[1];this.z=a[2]||0}else{if(typeof a=="string"){var b=a.split(",");this.x=parseFloat(b[0]);this.y=parseFloat(b[1]);this.z=parseFloat(b[2])||0}else{this.x=a;this.y=e;this.z=d||0}}},clone:function(){return new Proj4js.Point(this.x,this.y,this.z)},toString:function(){return("x="+this.x+",y="+this.y)},toShortString:function(){return(this.x+", "+this.y)}});Proj4js.PrimeMeridian={"greenwich":0,"lisbon":-9.131906111111,"paris":2.337229166667,"bogota":-74.080916666667,"madrid":-3.687938888889,"rome":12.452333333333,"bern":7.439583333333,"jakarta":106.807719444444,"ferro":-17.666666666667,"brussels":4.367975,"stockholm":18.058277777778,"athens":23.7163375,"oslo":10.722916666667};Proj4js.Ellipsoid={"MERIT":{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},"SGS85":{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},"GRS80":{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},"IAU76":{a:6378140,rf:298.257,ellipseName:"IAU 1976"},"airy":{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},"APL4.":{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},"NWL9D":{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},"mod_airy":{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},"andrae":{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},"aust_SA":{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},"GRS67":{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},"bessel":{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},"bess_nam":{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},"clrk66":{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},"clrk80":{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},"CPM":{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},"delmbr":{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},"engelis":{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},"evrst30":{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},"evrst48":{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},"evrst56":{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},"evrst69":{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},"evrstSS":{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},"fschr60":{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},"fschr60m":{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},"fschr68":{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},"helmert":{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},"hough":{a:6378270,rf:297,ellipseName:"Hough"},"intl":{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},"kaula":{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},"lerch":{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},"mprts":{a:6397300,rf:191,ellipseName:"Maupertius 1738"},"new_intl":{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},"plessis":{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},"krass":{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},"SEasia":{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},"walbeck":{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},"WGS60":{a:6378165,rf:298.3,ellipseName:"WGS 60"},"WGS66":{a:6378145,rf:298.25,ellipseName:"WGS 66"},"WGS72":{a:6378135,rf:298.26,ellipseName:"WGS 72"},"WGS84":{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},"sphere":{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};Proj4js.Datum={"WGS84":{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},"GGRS87":{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},"NAD83":{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},"NAD27":{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},"potsdam":{towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},"carthage":{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},"hermannskogel":{towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},"ire65":{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},"nzgd49":{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},"OSGB36":{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"}};Proj4js.WGS84=new Proj4js.Proj("WGS84");Proj4js.Datum["OSB36"]=Proj4js.Datum["OSGB36"];Proj4js.Proj.aea={init:function(){if(Math.abs(this.lat1+this.lat2)Proj4js.common.EPSLN){this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1)}else{this.ns0=this.con}this.c=this.ms1*this.ms1+this.ns0*this.qs1;this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0},forward:function(f){var g=f.x;var e=f.y;this.sin_phi=Math.sin(e);this.cos_phi=Math.cos(e);var b=Proj4js.common.qsfnz(this.e3,this.sin_phi,this.cos_phi);var j=this.a*Math.sqrt(this.c-this.ns0*b)/this.ns0;var d=this.ns0*Proj4js.common.adjust_lon(g-this.long0);var a=j*Math.sin(d)+this.x0;var h=this.rh-j*Math.cos(d)+this.y0;f.x=a;f.y=h;return f},inverse:function(f){var h,a,b,d,g,e;f.x-=this.x0;f.y=this.rh-f.y+this.y0;if(this.ns0>=0){h=Math.sqrt(f.x*f.x+f.y*f.y);b=1}else{h=-Math.sqrt(f.x*f.x+f.y*f.y);b=-1}d=0;if(h!=0){d=Math.atan2(b*f.x,b*f.y)}b=h*this.ns0/this.a;a=(this.c-b*b)/this.ns0;if(this.e3>=1e-10){b=1-0.5*(1-this.es)*Math.log((1-this.e3)/(1+this.e3))/this.e3;if(Math.abs(Math.abs(b)-Math.abs(a))>1e-10){e=this.phi1z(this.e3,a)}else{if(a>=0){e=0.5*PI}else{e=-0.5*PI}}}else{e=this.phi1z(e3,a)}g=Proj4js.common.adjust_lon(d/this.ns0+this.long0);f.x=g;f.y=e;return f},phi1z:function(j,a){var b,d,e;var h=Proj4js.common.asinz(0.5*a);if(jProj4js.common.HALF_PI){Proj4js.reportError("equi:Inv:DataError")}var d=Proj4js.common.adjust_lon(this.long0+b.x/(this.a*Math.cos(this.lat0)));b.x=d;b.y=a}};Proj4js.Proj.merc={init:function(){if(this.lat_ts){if(this.sphere){this.k0=Math.cos(this.lat_ts)}else{this.k0=Proj4js.common.msfnz(this.es,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}},forward:function(f){var g=f.x;var e=f.y;if(e*Proj4js.common.R2D>90&&e*Proj4js.common.R2D<-90&&g*Proj4js.common.R2D>180&&g*Proj4js.common.R2D<-180){Proj4js.reportError("merc:forward: llInputOutOfRange: "+g+" : "+e);return null}var a,h;if(Math.abs(Math.abs(e)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN){Proj4js.reportError("merc:forward: ll2mAtPoles");return null}else{if(this.sphere){a=this.x0+this.a*this.k0*Proj4js.common.adjust_lon(g-this.long0);h=this.y0+this.a*this.k0*Math.log(Math.tan(Proj4js.common.FORTPI+0.5*e))}else{var d=Math.sin(e);var b=Proj4js.common.tsfnz(this.e,e,d);a=this.x0+this.a*this.k0*Proj4js.common.adjust_lon(g-this.long0);h=this.y0-this.a*this.k0*Math.log(b)}f.x=a;f.y=h;return f}},inverse:function(e){var a=e.x-this.x0;var g=e.y-this.y0;var f,d;if(this.sphere){d=Proj4js.common.HALF_PI-2*Math.atan(Math.exp(-g/this.a*this.k0))}else{var b=Math.exp(-g/(this.a*this.k0));d=Proj4js.common.phi2z(this.e,b);if(d==-9999){Proj4js.reportError("merc:inverse: lat = -9999");return null}}f=Proj4js.common.adjust_lon(this.long0+a/(this.a*this.k0));e.x=f;e.y=d;return e}};Proj4js.Proj.utm={dependsOn:"tmerc",init:function(){if(!this.zone){Proj4js.reportError("utm:init: zone must be specified for UTM");return}this.lat0=0;this.long0=((6*Math.abs(this.zone))-183)*Proj4js.common.D2R;this.x0=500000;this.y0=this.utmSouth?10000000:0;this.k0=0.9996;Proj4js.Proj["tmerc"].init.apply(this);this.forward=Proj4js.Proj["tmerc"].forward;this.inverse=Proj4js.Proj["tmerc"].inverse}};Proj4js.Proj.eqdc={init:function(){if(!this.mode){this.mode=0}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.sinphi=Math.sin(this.lat1);this.cosphi=Math.cos(this.lat1);this.ms1=Proj4js.common.msfnz(this.e,this.sinphi,this.cosphi);this.ml1=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1);if(this.mode!=0){if(Math.abs(this.lat1+this.lat2)=Proj4js.common.EPSLN){this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)}else{this.ns=this.sinphi}}else{this.ns=this.sinphi}this.g=this.ml1+this.ms1/this.ns;this.ml0=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0);this.rh=this.a*(this.g-this.ml0)},forward:function(e){var f=e.x;var d=e.y;var j=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,d);var h=this.a*(this.g-j);var b=this.ns*Proj4js.common.adjust_lon(f-this.long0);var a=this.x0+h*Math.sin(b);var g=this.y0+this.rh-h*Math.cos(b);e.x=a;e.y=g;return e},inverse:function(e){e.x-=this.x0;e.y=this.rh-e.y+this.y0;var a,h;if(this.ns>=0){var h=Math.sqrt(e.x*e.x+e.y*e.y);var a=1}else{h=-Math.sqrt(e.x*e.x+e.y*e.y);a=-1}var b=0;if(h!=0){b=Math.atan2(a*e.x,a*e.y)}var g=this.g-h/this.a;var d=this.phi3z(this.ml,this.e0,this.e1,this.e2,this.e3);var f=Proj4js.common.adjust_lon(this.long0+b/this.ns);e.x=f;e.y=d;return e},phi3z:function(j,h,g,f,e){var d;var a;d=j;for(var b=0;b<15;b++){a=(j+g*Math.sin(2*d)-f*Math.sin(4*d)+e*Math.sin(6*d))/h-d;d+=a;if(Math.abs(a)<=1e-10){return d}}Proj4js.reportError("PHI3Z-CONV:Latitude failed to converge after 15 iterations");return null}};Proj4js.Proj.tmerc={init:function(){this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.ml0=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(d){var a=d.x;var q=d.y;var g=Proj4js.common.adjust_lon(a-this.long0);var e;var z,v;var w=Math.sin(q);var m=Math.cos(q);if(this.sphere){var u=m*Math.sin(g);if((Math.abs(Math.abs(u)-1))<1e-10){Proj4js.reportError("tmerc:forward: Point projects into infinity");return(93)}else{z=0.5*this.a*this.k0*Math.log((1+u)/(1-u));e=Math.acos(m*Math.cos(g)/Math.sqrt(1-u*u));if(q<0){e=-e}v=this.a*this.k0*(e-this.lat0)}}else{var l=m*g;var j=Math.pow(l,2);var o=this.ep2*Math.pow(m,2);var r=Math.tan(q);var B=Math.pow(r,2);e=1-this.es*Math.pow(w,2);var f=this.a/Math.sqrt(e);var h=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,q);z=this.k0*f*l*(1+j/6*(1-B+o+j/20*(5-18*B+Math.pow(B,2)+72*o-58*this.ep2)))+this.x0;v=this.k0*(h-this.ml0+f*r*(j*(0.5+j/24*(5-B+9*o+4*Math.pow(o,2)+j/30*(61-58*B+Math.pow(B,2)+600*o-330*this.ep2)))))+this.y0}d.x=z;d.y=v;return d},inverse:function(D){var l,e;var M;var F;var q=6;var o,j;if(this.sphere){var I=Math.exp(D.x/(this.a*this.k0));var H=0.5*(I-1/I);var K=this.lat0+D.y/(this.a*this.k0);var G=Math.cos(K);l=Math.sqrt((1-G*G)/(1+H*H));o=Proj4js.common.asinz(l);if(K<0){o=-o}if((H==0)&&(G==0)){j=this.long0}else{j=Proj4js.common.adjust_lon(Math.atan2(H,G)+this.long0)}}else{var v=D.x-this.x0;var u=D.y-this.y0;l=(this.ml0+u/this.k0)/this.a;e=l;for(F=0;true;F++){M=((l+this.e1*Math.sin(2*e)-this.e2*Math.sin(4*e)+this.e3*Math.sin(6*e))/this.e0)-e;e+=M;if(Math.abs(M)<=Proj4js.common.EPSLN){break}if(F>=q){Proj4js.reportError("tmerc:inverse: Latitude failed to converge");return(95)}}if(Math.abs(e)0)||(Math.abs(h)<=Proj4js.common.EPSLN)){var m=this.a*f*e*Math.sin(q);var l=this.y0+this.a*f*(this.cos_p14*a-this.sin_p14*e*o)}else{Proj4js.reportError("orthoFwdPointError")}d.x=m;d.y=l;return d},inverse:function(b){var h;var g;var e,l;var j;var d;var a,f;b.x-=this.x0;b.y-=this.y0;h=Math.sqrt(b.x*b.x+b.y*b.y);if(h>this.a+1e-7){Proj4js.reportError("orthoInvDataError")}g=Proj4js.common.asinz(h/this.a);e=Math.sin(g);l=Math.cos(g);a=this.long0;if(Math.abs(h)<=Proj4js.common.EPSLN){f=this.lat0}f=Proj4js.common.asinz(l*this.sin_p14+(b.y*e*this.cos_p14)/h);d=Math.abs(lat0)-Proj4js.common.HALF_PI;if(Math.abs(d)<=Proj4js.common.EPSLN){if(this.lat0>=0){a=Proj4js.common.adjust_lon(this.long0+Math.atan2(b.x,-b.y))}else{a=Proj4js.common.adjust_lon(this.long0-Math.atan2(-b.x,b.y))}}d=l-this.sin_p14*Math.sin(f);if((Math.abs(d)>=Proj4js.common.EPSLN)||(Math.abs(x)>=Proj4js.common.EPSLN)){a=Proj4js.common.adjust_lon(this.long0+Math.atan2((b.x*e*this.cos_p14),(d*h)))}b.x=a;b.y=f;return b}};Proj4js.Proj.somerc={init:function(){var b=this.lat0;this.lambda0=this.long0;var a=Math.sin(b);var f=this.a;var d=this.rf;var g=1/d;var j=2*g-Math.pow(g,2);var h=this.e=Math.sqrt(j);this.R=f*Math.sqrt(1-j)/(1-j*Math.pow(a,2));this.alpha=Math.sqrt(1+j/(1-j)*Math.pow(Math.cos(b),4));this.b0=Math.asin(a/this.alpha);this.K=Math.log(Math.tan(Math.PI/4+this.b0/2))-this.alpha*Math.log(Math.tan(Math.PI/4+b/2))+this.alpha*h/2*Math.log((1+h*a)/(1-h*a))},forward:function(g){var l=Math.log(Math.tan(Math.PI/4-g.y/2));var h=this.e/2*Math.log((1+this.e*Math.sin(g.y))/(1-this.e*Math.sin(g.y)));var e=-this.alpha*(l+h)+this.K;var a=2*(Math.atan(Math.exp(e))-Math.PI/4);var d=this.alpha*(g.x-this.lambda0);var j=Math.atan(Math.sin(d)/(Math.sin(this.b0)*Math.tan(a)+Math.cos(this.b0)*Math.cos(d)));var f=Math.asin(Math.cos(this.b0)*Math.sin(a)-Math.sin(this.b0)*Math.cos(a)*Math.cos(d));g.y=this.R/2*Math.log((1+Math.sin(f))/(1-Math.sin(f)))+this.y0;g.x=this.R*j+this.x0;return g},inverse:function(e){var d=e.x-this.x0;var f=e.y-this.y0;var q=d/this.R;var g=2*(Math.atan(Math.exp(f/this.R))-Math.PI/4);var m=Math.asin(Math.cos(this.b0)*Math.sin(g)+Math.sin(this.b0)*Math.cos(g)*Math.cos(q));var o=Math.atan(Math.sin(q)/(Math.cos(this.b0)*Math.cos(q)-Math.sin(this.b0)*Math.tan(g)));var l=this.lambda0+o/this.alpha;var j=0;var r=m;var a=-1000;var h=0;while(Math.abs(r-a)>1e-7){if(++h>20){Proj4js.reportError("omercFwdInfinity");return}j=1/this.alpha*(Math.log(Math.tan(Math.PI/4+m/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(r))/2));a=r;r=2*Math.atan(Math.exp(j))-Math.PI/2}e.x=l;e.y=r;return e}};Proj4js.Proj.stere={ssfn_:function(a,d,b){d*=b;return(Math.tan(0.5*(Proj4js.common.HALF_PI+a))*Math.pow((1-d)/(1+d),0.5*b))},TOL:1e-8,NITER:8,CONV:1e-10,S_POLE:0,N_POLE:1,OBLIQ:2,EQUIT:3,init:function(){this.phits=this.lat_ts?this.lat_ts:Proj4js.common.HALF_PI;var a=Math.abs(this.lat0);if((Math.abs(a)-Proj4js.common.HALF_PI)Proj4js.common.EPSLN?this.OBLIQ:this.EQUIT}this.phits=Math.abs(this.phits);if(this.es){var b;switch(this.mode){case this.N_POLE:case this.S_POLE:if(Math.abs(this.phits-Proj4js.common.HALF_PI)=Proj4js.common.EPSLN?Math.cos(this.phits)/Math.tan(Proj4js.common.FORTPI-0.5*this.phits):2*this.k0;break}}},forward:function(d){var b=d.x;b=Proj4js.common.adjust_lon(b-this.long0);var g=d.y;var l,h;if(this.sphere){var a,e,j,f;a=Math.sin(g);e=Math.cos(g);j=Math.cos(b);f=Math.sin(b);switch(this.mode){case this.EQUIT:h=1+e*j;if(h<=Proj4js.common.EPSLN){F_ERROR}h=this.akm1/h;l=h*e*f;h*=a;break;case this.OBLIQ:h=1+this.sinph0*a+this.cosph0*e*j;if(h<=Proj4js.common.EPSLN){F_ERROR}h=this.akm1/h;l=h*e*f;h*=this.cosph0*a-this.sinph0*e*j;break;case this.N_POLE:j=-j;g=-g;case this.S_POLE:if(Math.abs(g-Proj4js.common.HALF_PI)0)||(Math.abs(h)<=Proj4js.common.EPSLN)){x=this.x0+this.a*f*e*Math.sin(m)/h;y=this.y0+this.a*f*(this.cos_p14*a-this.sin_p14*e*l)/h}else{Proj4js.reportError("orthoFwdPointError");x=this.x0+this.infinity_dist*e*Math.sin(m);y=this.y0+this.infinity_dist*(this.cos_p14*a-this.sin_p14*e*l)}d.x=x;d.y=y;return d},inverse:function(f){var a;var h;var b,d;var j;var g,e;f.x=(f.x-this.x0)/this.a;f.y=(f.y-this.y0)/this.a;f.x/=this.k0;f.y/=this.k0;if((a=Math.sqrt(f.x*f.x+f.y*f.y))){j=Math.atan2(a,this.rc);b=Math.sin(j);d=Math.cos(j);e=Proj4js.common.asinz(d*this.sin_p14+(f.y*b*this.cos_p14)/a);g=Math.atan2(f.x*b,a*this.cos_p14*d-f.y*this.sin_p14*b);g=Proj4js.common.adjust_lon(this.long0+g)}else{e=this.phic0;g=0}f.x=g;f.y=e;return f}};Proj4js.Proj.sinu={init:function(){this.R=6370997},forward:function(e){var a,g,b;var f=e.x;var d=e.y;b=Proj4js.common.adjust_lon(f-this.long0);a=this.R*b*Math.cos(d)+this.x0;g=this.R*d+this.y0;e.x=a;e.y=g;return e},inverse:function(d){var b,a,e;d.x-=this.x0;d.y-=this.y0;b=d.y/this.R;if(Math.abs(b)>Proj4js.common.HALF_PI){Proj4js.reportError("sinu:Inv:DataError")}a=Math.abs(b)-Proj4js.common.HALF_PI;if(Math.abs(a)>Proj4js.common.EPSLN){a=this.long0+d.x/(this.R*Math.cos(b));e=Proj4js.common.adjust_lon(a)}else{e=this.long0}d.x=e;d.y=b;return d}};Proj4js.Proj.vandg={init:function(){this.R=6370997},forward:function(d){var a=d.x;var u=d.y;var B=Proj4js.common.adjust_lon(a-this.long0);var z,v;if(Math.abs(u)<=Proj4js.common.EPSLN){z=this.x0+this.R*B;v=this.y0}var f=Proj4js.common.asinz(2*Math.abs(u/Proj4js.common.PI));if((Math.abs(B)<=Proj4js.common.EPSLN)||(Math.abs(Math.abs(u)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN)){z=this.x0;if(u>=0){v=this.y0+Proj4js.common.PI*this.R*Math.tan(0.5*f)}else{v=this.y0+Proj4js.common.PI*this.R*-Math.tan(0.5*f)}}var q=0.5*Math.abs((Proj4js.common.PI/B)-(B/Proj4js.common.PI));var e=q*q;var r=Math.sin(f);var o=Math.cos(f);var l=o/(r+o-1);var j=l*l;var h=l*(2/r-1);var w=h*h;var b=Proj4js.common.PI*this.R*(q*(l-w)+Math.sqrt(e*(l-w)*(l-w)-(w+e)*(j-w)))/(w+e);if(B<0){b=-b}z=this.x0+b;b=Math.abs(b/(Proj4js.common.PI*this.R));if(u>=0){v=this.y0+Proj4js.common.PI*this.R*Math.sqrt(1-b*b-2*q*b)}else{v=this.y0-Proj4js.common.PI*this.R*Math.sqrt(1-b*b-2*q*b)}d.x=z;d.y=v;return d},inverse:function(f){var w;var a,q,v,l,j,h;var m,g;var e;var u;var b;var r;var o;f.x-=this.x0;f.y-=this.y0;b=Proj4js.common.PI*this.R;a=f.x/b;q=f.y/b;v=a*a+q*q;l=-Math.abs(q)*(1+v);j=l-2*q*q+a*a;h=-2*l+1+2*q*q+v*v;o=q*q/h+(2*j*j*j/h/h/h-9*l*j/h/h)/27;e=(l-j*j/3/h)/h;u=2*Math.sqrt(-e/3);b=((3*o)/e)/u;if(Math.abs(b)>1){if(b>=0){b=1}else{b=-1}}r=Math.acos(b)/3;if(f.y>=0){lat=(-u*Math.cos(r+Proj4js.common.PI/3)-j/3/h)*Proj4js.common.PI}else{lat=-(-u*Math.cos(r+PI/3)-j/3/h)*Proj4js.common.PI}if(Math.abs(a)0;--a){b=2*Math.atan(num*Proj4js.common.srat(this.e*Math.sin(e.y),-0.5*this.e))-Proj4js.common.HALF_PI;if(Math.abs(b-e.y)0){if(this.lat0>=0){this.f=this.d+Math.sqrt(this.d*this.d-1)}else{this.f=this.d-Math.sqrt(this.d*this.d-1)}}else{this.f=this.d}this.el=this.f*Math.pow(this.ts,this.bl)}if(this.mode!=0){this.g=0.5*(this.f-1/this.f);this.gama=Proj4js.common.asinz(Math.sin(this.alpha)/this.d);this.longc=this.longc-Proj4js.common.asinz(this.g*Math.tan(this.gama))/this.bl;this.con=Math.abs(this.lat0);if((this.con>Proj4js.common.EPSLN)&&(Math.abs(this.con-Proj4js.common.HALF_PI)>Proj4js.common.EPSLN)){this.singam=Math.sin(this.gama);this.cosgam=Math.cos(this.gama);this.sinaz=Math.sin(this.alpha);this.cosaz=Math.cos(this.alpha);if(this.lat0>=0){this.u=(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}else{this.u=-(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}}else{Proj4js.reportError("omerc:Init:DataError")}}else{this.sinphi=Math.sin(this.at1);this.ts1=Proj4js.common.tsfnz(this.e,this.lat1,this.sinphi);this.sinphi=Math.sin(this.lat2);this.ts2=Proj4js.common.tsfnz(this.e,this.lat2,this.sinphi);this.h=Math.pow(this.ts1,this.bl);this.l=Math.pow(this.ts2,this.bl);this.f=this.el/this.h;this.g=0.5*(this.f-1/this.f);this.j=(this.el*this.el-this.l*this.h)/(this.el*this.el+this.l*this.h);this.p=(this.l-this.h)/(this.l+this.h);this.dlon=this.lon1-this.lon2;if(this.dlon<-Proj4js.common.PI){this.lon2=this.lon2-2*Proj4js.common.PI}if(this.dlon>Proj4js.common.PI){this.lon2=this.lon2+2*Proj4js.common.PI}this.dlon=this.lon1-this.lon2;this.longc=0.5*(this.lon1+this.lon2)-Math.atan(this.j*Math.tan(0.5*this.bl*this.dlon)/this.p)/this.bl;this.dlon=Proj4js.common.adjust_lon(this.lon1-this.longc);this.gama=Math.atan(Math.sin(this.bl*this.dlon)/this.g);this.alpha=Proj4js.common.asinz(this.d*Math.sin(this.gama));if(Math.abs(this.lat1-this.lat2)<=Proj4js.common.EPSLN){Proj4js.reportError("omercInitDataError")}else{this.con=Math.abs(this.lat1)}if((this.con<=Proj4js.common.EPSLN)||(Math.abs(this.con-HALF_PI)<=Proj4js.common.EPSLN)){Proj4js.reportError("omercInitDataError")}else{if(Math.abs(Math.abs(this.lat0)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN){Proj4js.reportError("omercInitDataError")}}this.singam=Math.sin(this.gam);this.cosgam=Math.cos(this.gam);this.sinaz=Math.sin(this.alpha);this.cosaz=Math.cos(this.alpha);if(this.lat0>=0){this.u=(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}else{this.u=-(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}}},forward:function(B){var l;var e,I;var H;var G,u,d;var g,C,E;var z,m,F;var v,D;var w;var a;var h;var f=B.x;var j=B.y;e=Math.sin(j);a=Proj4js.common.adjust_lon(f-this.longc);F=Math.sin(this.bl*a);if(Math.abs(Math.abs(j)-Proj4js.common.HALF_PI)>Proj4js.common.EPSLN){h=Proj4js.common.tsfnz(this.e,j,e);z=this.el/(Math.pow(h,this.bl));w=0.5*(z-1/z);u=0.5*(z+1/z);v=(w*this.singam-F*this.cosgam)/u;g=Math.cos(this.bl*a);if(Math.abs(g)<1e-7){m=this.al*this.bl*a}else{m=this.al*Math.atan((w*this.cosgam+F*this.singam)/g)/this.bl;if(g<0){m=m+Proj4js.common.PI*this.al/this.bl}}}else{if(j>=0){v=this.singam}else{v=-this.singam}m=this.al*j/this.bl}if(Math.abs(Math.abs(v)-1)<=Proj4js.common.EPSLN){Proj4js.reportError("omercFwdInfinity")}D=0.5*this.al*Math.log((1-v)/(1+v))/this.bl;m=m-this.u;var r=this.x0+D*this.cosaz+m*this.sinaz;var o=this.y0+m*this.cosaz-D*this.sinaz;B.x=r;B.y=o;return B},inverse:function(v){var I;var j;var f;var e,H;var G;var E,o,d;var g,w,C;var z,l,u,r,h;var D,m,F;var a;var B;v.x-=this.x0;v.y-=this.y0;B=0;z=v.x*this.cosaz-v.y*this.sinaz;l=v.y*this.cosaz+v.x*this.sinaz;l=l+this.u;u=Math.exp(-this.bl*z/this.al);r=0.5*(u-1/u);o=0.5*(u+1/u);D=Math.sin(this.bl*l/this.al);m=(D*this.cosgam+r*this.singam)/o;if(Math.abs(Math.abs(m)-1)<=Proj4js.common.EPSLN){lon=this.longc;if(m>=0){lat=Proj4js.common.HALF_PI}else{lat=-Proj4js.common.HALF_PI}}else{g=1/this.bl;h=Math.pow((this.el/Math.sqrt((1+m)/(1-m))),g);lat=Proj4js.common.phi2z(this.e,h);j=this.longc-Math.atan2((r*this.cosgam-D*this.singam),g)/this.bl;lon=Proj4js.common.adjust_lon(j)}v.x=lon;v.y=lat;return v}};Proj4js.Proj.lcc={init:function(){if(!this.lat2){this.lat2=this.lat0}if(!this.k0){this.k0=1}if(Math.abs(this.lat1+this.lat2)Proj4js.common.EPSLN){this.ns=Math.log(l/j)/Math.log(b/a)}else{this.ns=h}this.f0=l/(this.ns*Math.pow(b,this.ns));this.rh=this.a*this.f0*Math.pow(d,this.ns);if(!this.title){this.title="Lambert Conformal Conic"}},forward:function(f){var g=f.x;var e=f.y;if(e<=90&&e>=-90&&g<=180&&g>=-180){}else{Proj4js.reportError("lcc:forward: llInputOutOfRange: "+g+" : "+e);return null}var a=Math.abs(Math.abs(e)-Proj4js.common.HALF_PI);var d,h;if(a>Proj4js.common.EPSLN){d=Proj4js.common.tsfnz(this.e,e,Math.sin(e));h=this.a*this.f0*Math.pow(d,this.ns)}else{a=e*this.ns;if(a<=0){Proj4js.reportError("lcc:forward: No Projection");return null}h=0}var b=this.ns*Proj4js.common.adjust_lon(g-this.long0);f.x=this.k0*(h*Math.sin(b))+this.x0;f.y=this.k0*(this.rh-h*Math.cos(b))+this.y0;return f},inverse:function(f){var h,a,d;var e,g;x=(f.x-this.x0)/this.k0;y=(this.rh-(f.y-this.y0)/this.k0);if(this.ns>0){h=Math.sqrt(x*x+y*y);a=1}else{h=-Math.sqrt(x*x+y*y);a=-1}var b=0;if(h!=0){b=Math.atan2((a*x),(a*y))}if((h!=0)||(this.ns>0)){a=1/this.ns;d=Math.pow((h/(this.a*this.f0)),a);e=Proj4js.common.phi2z(this.e,d);if(e==-9999){return null}}else{e=-Proj4js.common.HALF_PI}g=Proj4js.common.adjust_lon(b/this.ns+this.long0);f.x=g;f.y=e;return f}};Proj4js.Proj.laea={S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4,init:function(){var a=Math.abs(this.lat0);if(Math.abs(a-Proj4js.common.HALF_PI)0){var b;this.qp=Proj4js.common.qsfnz(this.e,1);this.mmf=0.5/(1-this.es);this.apa=this.authset(this.es);switch(this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(0.5*this.qp);this.dd=1/this.rq;this.xmf=1;this.ymf=0.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(0.5*this.qp);b=Math.sin(this.lat0);this.sinb1=Proj4js.common.qsfnz(this.e,b)/this.qp;this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1);this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*b*b)*this.rq*this.cosb1);this.ymf=(this.xmf=this.rq)/this.dd;this.xmf*=this.dd;break}}else{if(this.mode==this.OBLIQ){this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0)}}},forward:function(f){var u,o;var v=f.x;var l=f.y;v=Proj4js.common.adjust_lon(v-this.long0);if(this.sphere){var r,h,d;d=Math.sin(l);h=Math.cos(l);r=Math.cos(v);switch(this.mode){case this.EQUIT:o=(this.mode==this.EQUIT)?1+h*r:1+this.sinph0*d+this.cosph0*h*r;if(o<=Proj4js.common.EPSLN){Proj4js.reportError("laea:fwd:y less than eps");return null}o=Math.sqrt(2/o);u=o*h*Math.sin(v);o*=(this.mode==this.EQUIT)?d:this.cosph0*d-this.sinph0*h*r;break;case this.N_POLE:r=-r;case this.S_POLE:if(Math.abs(l+this.phi0)=0){u=(m=Math.sqrt(e))*j;o=r*((this.mode==this.S_POLE)?m:-m)}else{u=o=0}break}}f.x=this.a*u+this.x0;f.y=this.a*o+this.y0;return f},inverse:function(b){b.x-=this.x0;b.y-=this.y0;var j=b.x/this.a;var g=b.y/this.a;if(this.sphere){var r=0,m,d=0;m=Math.sqrt(j*j+g*g);var f=m*0.5;if(f>1){Proj4js.reportError("laea:Inv:DataError");return null}f=2*Math.asin(f);if(this.mode==this.OBLIQ||this.mode==this.EQUIT){d=Math.sin(f);r=Math.cos(f)}switch(this.mode){case this.EQUIT:f=(Math.abs(m)<=Proj4js.common.EPSLN)?0:Math.asin(g*d/m);j*=d;g=r*m;break;case this.OBLIQ:f=(Math.abs(m)<=Proj4js.common.EPSLN)?this.phi0:Math.asin(r*sinph0+g*d*cosph0/m);j*=d*cosph0;g=(r-Math.sin(f)*sinph0)*m;break;case this.N_POLE:g=-g;f=Proj4js.common.HALF_PI-f;break;case this.S_POLE:f-=Proj4js.common.HALF_PI;break}lam=(g==0&&(this.mode==this.EQUIT||this.mode==this.OBLIQ))?0:Math.atan2(j,g)}else{var l,e,a,h,o=0;switch(this.mode){case this.EQUIT:case this.OBLIQ:j/=this.dd;g*=this.dd;h=Math.sqrt(j*j+g*g);if(h(2*Proj4js.common.HALF_PI*this.a)){Proj4js.reportError("aeqdInvDataError");return}var f=h/this.a;var e=Math.sin(f);var l=Math.cos(f);var a=this.long0;var g;if(Math.abs(h)<=Proj4js.common.EPSLN){g=this.lat0}else{g=Proj4js.common.asinz(l*this.sin_p12+(b.y*e*this.cos_p12)/h);var d=Math.abs(this.lat0)-Proj4js.common.HALF_PI;if(Math.abs(d)<=Proj4js.common.EPSLN){if(lat0>=0){a=Proj4js.common.adjust_lon(this.long0+Math.atan2(b.x,-b.y))}else{a=Proj4js.common.adjust_lon(this.long0-Math.atan2(-b.x,b.y))}}else{d=l-this.sin_p12*Math.sin(g);if((Math.abs(d)=50){Proj4js.reportError("moll:Fwd:IterationError")}}f/=2;if(Proj4js.common.PI/2-Math.abs(j)0.999999999999){a=0.999999999999}var b=Math.asin(a);var f=Proj4js.common.adjust_lon(this.long0+(e.x/(0.900316316158*this.a*Math.cos(b))));if(f<(-Proj4js.common.PI)){f=-Proj4js.common.PI}if(f>Proj4js.common.PI){f=Proj4js.common.PI}a=(2*b+Math.sin(2*b))/Proj4js.common.PI;if(Math.abs(a)>1){a=1}var d=Math.asin(a);e.x=f;e.y=d;return e}};olleh.maps.ScreenProjection=olleh.Class({map:null,initialize:function(a){this.map=a},toCoord:function(a){if(this.map){return this.map.getCoordFromPixel(a)}},toPixel:function(a){if(this.map){return this.map.getPixelFromCoord(a)}},containerPixelToCoord:function(a){if(this.map){return this.map.getCoordFromLayerPx(a)}},coordToContainerPixel:function(a){if(this.map){return this.map.getLayerPxFromCoord(a)}},CLASS_NAME:"olleh.maps.ScreenProjection"});olleh.Tween=olleh.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:false,initialize:function(a){this.easing=(a)?a:olleh.Easing.Expo.easeOut},start:function(d,b,e,a){this.playing=true;this.begin=d;this.finish=b;this.duration=e;this.callbacks=a.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(olleh.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 g={};for(var d in this.begin){var a=this.begin[d];var e=this.finish[d];var h=e-a;g[d]=this.easing.apply(this,[this.time,a,h,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,g)}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:"olleh.Tween"});olleh.Panning={CLASS_NAME:"olleh.Panning"};olleh.Panning.Linear={easeIn:function(e,a,g,f){return g*e/f+a},easeOut:function(e,a,g,f){return g*e/f+a},easeInOut:function(e,a,g,f){return g*e/f+a},CLASS_NAME:"olleh.Panning.Linear"};olleh.Panning.Expo={easeIn:function(e,a,g,f){return(e==0)?a:g*Math.pow(2,10*(e/f-1))+a},easeOut:function(e,a,g,f){return(e==f)?a+g:g*(-Math.pow(2,-10*e/f)+1)+a},easeInOut:function(e,a,g,f){if(e==0){return a}if(e==f){return a+g}if((e/=f/2)<1){return g/2*Math.pow(2,10*(e-1))+a}return g/2*(-Math.pow(2,-10*--e)+2)+a},CLASS_NAME:"olleh.Panning.Expo"};olleh.Panning.Quad={easeIn:function(e,a,g,f){return g*(e/=f)*e+a},easeOut:function(e,a,g,f){return -g*(e/=f)*(e-2)+a},easeInOut:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e+a}return -g/2*((--e)*(e-2)-1)+a},CLASS_NAME:"olleh.Panning.Quad"};olleh.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(a){return a.target||a.srcElement},isSingleTouch:function(a){return a.touches&&a.touches.length==1},isMultiTouch:function(a){return a.touches&&a.touches.length>1},isLeftClick:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1))||(a.button==0))},isRightClick:function(a){return(((a.which)&&(a.which==3))||((a.button)&&(a.button==2)))},stop:function(b,a){if(!a){if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}},findElement:function(d,b){var a=olleh.Event.element(d);while(a.parentNode&&(!a.tagName||(a.tagName.toUpperCase()!=b.toUpperCase()))){a=a.parentNode}return a},observe:function(b,e,d,a){var f=olleh.Util.getElement(b);a=a||false;if(e=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||f.attachEvent)){e="keydown"}if(!this.observers){this.observers={}}if(!f._eventCacheID){var g="eventCacheID_";if(f.id){g=f.id+"_"+g}f._eventCacheID=olleh.Util.createUniqueID(g)}var h=f._eventCacheID;if(!this.observers[h]){this.observers[h]=[]}this.observers[h].push({"element":f,"name":e,"observer":d,"useCapture":a});if(f.addEventListener){f.addEventListener(e,d,a)}else{if(f.attachEvent){f.attachEvent("on"+e,d)}}},stopObservingElement:function(a){var b=olleh.Util.getElement(a);var d=b._eventCacheID;this._removeElementObservers(olleh.Event.observers[d])},_removeElementObservers:function(f){if(f&&f.length>0){for(var b=f.length-1;b>=0;b--){var d=f[b];if(d==undefined){continue}var a=new Array(d.element,d.name,d.observer,d.useCapture);var e=olleh.Event.stopObserving.apply(this,a)}}},stopObserving:function(j,a,h,b){b=b||false;var g=olleh.Util.getElement(j);var e=g._eventCacheID;if(a=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||g.detachEvent){a="keydown"}}var m=false;var d=olleh.Event.observers[e];if(d){var f=0;while(!m&&f0){a.events.unregister(b,a.scope,null)}}},clearListeners:function(a,b){if(!a&&!a.events&&!a.events.listeners){return}for(var d in a.events.listeners){if(d!="scope"&&d==b&&a.events.listeners[d].slice().length>0){a.events.unregister(d,a.scope,null)}}},removeListener:function(a){if(a&&a.object&&a.object.events){a.object.events.unregister(a.type,a.object,a.func)}},trigger:function(a,b,d){if(a&&a.events){a.events.triggerEvent(b,d)}}};olleh.maps.Events=olleh.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","touchcancel"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:false,clearMouseListener:null,eventOn:true,initialize:function(b,d,f,e,a){olleh.Util.extend(this,a);this.object=b;this.fallThrough=e;this.listeners={};this.eventTypes=[];if(d!=null){this.eventHandler=olleh.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=olleh.Function.bind(this.clearMouseCache,this);this.attachToElement(d)}if(f){this.addEventTypes(f)}},destroy:function(){if(this.element){olleh.Event.stopObservingElement(this.element);if(this.element.hasScrollEvent){olleh.Event.stopObserving(window,"scroll",this.clearMouseListener)}}this.element=null;this.listeners=null;this.object=null;this.fallThrough=null;this.eventHandler=null;this.eventTypes=null},addEventTypes:function(d){if(d!=null&&olleh.Util.isArray(d)){for(var b=0,a=d.length;b0){return new olleh.maps.Pixel((a.touches[0].pageX-this.element.offsets[0]-this.element.lefttop[0]),(a.touches[0].pageY-this.element.offsets[1]-this.element.lefttop[1]))}else{return new olleh.maps.Pixel((a.pageX-this.element.offsets[0]-this.element.lefttop[0]),(a.pageY-this.element.offsets[1]-this.element.lefttop[1]))}}},setEventOn:function(a){this.eventOn=a},getEventOn:function(){return this.eventOn},CLASS_NAME:"olleh.maps.Events"});olleh.maps.Projection=olleh.Class({proj:null,projCode:null,initialize:function(b,a){olleh.Util.extend(this,a);this.projCode=b;if(window.Proj4js){this.proj=new Proj4js.Proj(b)}},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(a){if(a&&a.getCode){return this.getCode()==a.getCode()}else{return false}},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"olleh.maps.Projection"});olleh.maps.Projection.transforms={};olleh.maps.Projection.addTransform=function(d,b,a){if(!olleh.maps.Projection.transforms[d]){olleh.maps.Projection.transforms[d]={}}olleh.maps.Projection.transforms[d][b]=a};olleh.maps.Projection.transform=function(a,d,b){if(d.proj&&b.proj){a=Proj4js.transform(d.proj,b.proj,a)}else{if(d&&b&&olleh.maps.Projection.transforms[d.getCode()]&&olleh.maps.Projection.transforms[d.getCode()][b.getCode()]){olleh.maps.Projection.transforms[d.getCode()][b.getCode()](a)}}return a};olleh.maps.Map=olleh.Class(olleh.maps.MVCObject,{Z_INDEX_BASE:{BaseLayer:0,Control:900,ZoomBox:1000},EVENT_TYPES:["movestart","move","moveend","zoomstart","zoomend","bounds_changed","center_changed","maptypeid_changed","projection_changed","zoom_changed"],div:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,size:null,dragging:false,panRatio:1000,viewRequestID:0,tileSize:null,projection:"UTM_K",units:"Meter",resolution:null,resolutions:null,maxResolution:2048,minResolution:0.5,numZoomLevels:14,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,styleSheet:null,eventListeners:null,panTween:null,panMethod:olleh.Panning.Expo.easeOut,panDuration:100,layers:null,baseLayer:null,bLayer:null,sLayer:null,hLayer:null,dLayer:null,eLayer:null,csLayer:null,tLayer:null,i1fLayer:null,ib1fLayer:null,measureLayer:null,controls:null,mapControl:null,mapTypeController:null,copyrightController:null,scaleController:null,panController:null,zoomController:null,unloadDestroy:null,updateSizeDestroy:null,panes:null,popups:null,mapTypeId:olleh.maps.MapTypeId.BASEMAP,center:null,zoom:0,backgroundColor:null,disableDoubleClickZoom:false,draggable:true,draggableCursor:"",draggingCursor:"",minZoom:new Number(0),maxZoom:new Number(13),keyboardShortcuts:true,scrollwheel:true,disableDefaultUI:false,noClear:true,mapTypeControl:true,mapTypeControlOptions:null,copyrightControl:true,copyrightControlOptions:null,scaleControl:false,scaleControlOptions:null,panControl:false,panControlOptions:null,zoomControl:false,zoomControlOptions:null,selectFeature:true,selectFeatureControl:null,dragMarkerHandler:null,divClientWidth:0,divClientHeight:0,paddingForPopups:null,markerMovingDisplaySwitch:true,vectorMovingDisplaySwitch:true,initialize:function(b,a){this.layers=new Array();this.popups=new Array();this.paddingForPopups=new olleh.maps.Bounds(50,50,50,50);this.draggableCursor=olleh.Util.setCursor("url("+olleh.Util.getImagesLocation()+"openhand.cur)",8,0);this.draggingCursor=olleh.Util.setCursor("url("+olleh.Util.getImagesLocation()+"closedhand.cur)",6,0);olleh.Util.extend(this,a);olleh.Browser_Name=olleh.Util.getBrowserName();switch(olleh.Browser_Name){case"android":case"iphone":case"ipad":case"ipod":olleh.Browser_Mobile=true;this.markerMovingDisplaySwitch=false;this.vectorMovingDisplaySwitch=false;break}this.tileSize=new olleh.maps.Size(olleh.maps.Map.TILE_WIDTH,olleh.maps.Map.TILE_HEIGHT);this.maxExtent=new olleh.maps.Bounds(olleh.maps.Map.MAX_LEFT,olleh.maps.Map.MAX_BOTTOM,olleh.maps.Map.MAX_RIGHT,olleh.maps.Map.MAX_TOP);this.restrictedExtent=new olleh.maps.Bounds(olleh.maps.Map.MAX_LEFT,olleh.maps.Map.MAX_BOTTOM,olleh.maps.Map.MAX_RIGHT,olleh.maps.Map.MAX_TOP);this.panRatio=this.maxExtent.right-this.maxExtent.left;this.initStyleSheet();this.initDiv(b);this.initEvent();this.initControl();this.updateSize();this.loadTMS();this.initPanes();this.setMinMaxZoom();document.oncontextmenu=new Function("return false")},initEvent:function(){var a=[this.viewPortDiv,this.EVENT_TYPES,true,{includeXY:true}];olleh.maps.MVCObject.prototype.initialize.apply(this,a);this.updateSizeDestroy=olleh.Function.bind(this.updateSize,this);olleh.Event.observe(window,"resize",this.updateSizeDestroy);this.unloadDestroy=olleh.Function.bind(this.destroy,this);olleh.Event.observe(window,"unload",this.unloadDestroy)},initDiv:function(a){this.div=a?a:null;if(!this.div){this.div=document.createElement("div");this.div.style.height="1px";this.div.style.width="1px"}this.divClientWidth=this.div.clientWidth;this.divClientHeight=this.div.clientHeight;if(olleh.Browser_Name=="msie 7.0"||olleh.Browser_Name=="msie 6.0"){if(this.div.clientWidth==null){if(!this.div.style.width||this.div.style.width=="100%"){this.div.style.width=document.documentElement.offsetWidth}}else{this.div.style.width=this.divClientWidth}if(this.div.clientHeight==null){if(!this.div.style.height||this.div.style.height=="100%"){this.div.style.height=document.documentElement.offsetHeight}}else{if(this.div.clientHeight==19){this.div.style.height=document.documentElement.offsetHeight}else{this.div.style.height=this.divClientHeight}}}if(this.backgroundColor){this.div.style.backgroundColor=this.backgroundColor}this.viewPortDiv=olleh.Util.createDiv("olleh_Main",new olleh.maps.Pixel(0,0),new olleh.maps.Size("100%","100%"),null,"absolute",null,"hidden");this.viewPortDiv.style.zIndex=0;this.div.appendChild(this.viewPortDiv);this.layerContainerDiv=olleh.Util.createDiv("olleh_TileContainer");this.layerContainerDiv.style.zIndex=0;this.viewPortDiv.appendChild(this.layerContainerDiv);this.setCursor(this.draggableCursor)},initStyleSheet:function(){this.styleSheet=olleh.getScriptLocation()+"theme/style.css";if(this.styleSheet){var f=true;var d=document.getElementsByTagName("link");for(var e=0,a=d.length;e=0;--a){this.controls[a].destroy()}this.controls=null}if(this.layers!=null){for(var a=this.layers.length-1;a>=0;--a){this.layers[a].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;this.paddingForPopups=null},setMinMaxZoom:function(){if(this.minZoom){if(this.minZoom>this.maxZoom){this.minZoom=this.maxZoom;this.setZoom(this.maxZoom)}else{if(this.zoomthis.maxZoom){this.setZoom(this.maxZoom)}}}else{this.maxZoom=13}},initPanes:function(){this.panes=new Array();for(var b=0;b<7;b++){var e="olleh_Pane"+b;var a=olleh.Util.createDiv(e);a.style.zIndex=100+b;a.style.left="0";a.style.top="0";switch(b){case 0:var d=new olleh.maps.MeasureLayer(e,{div:a,visibility:true,minResolution:0.25});d.setMap(this);this.layerContainerDiv.appendChild(d.div);this.selectFeatureControl=new olleh.SelectFeature(d);this.selectFeatureControl.setMap(this);this.layers.push(d);this.panes.push(d);break;case 1:var d=new olleh.maps.ImageLayer(e,{div:a,visibility:true,minResolution:0.25});d.setMap(this);this.layerContainerDiv.appendChild(d.div);this.layers.push(d);this.panes.push(d);break;case 3:var d=new olleh.maps.MarkerLayer(e,{div:a,visibility:true,minResolution:0.25});d.setMap(this);this.layerContainerDiv.appendChild(d.div);this.layers.push(d);this.panes.push(d);break;case 4:var d=new olleh.Layer(e,{div:a,visibility:true,minResolution:0.25});d.display=function(f){};d.setMap(this);this.layerContainerDiv.appendChild(d.div);this.layers.push(d);this.panes.push(d);break;case 6:this.layerContainerDiv.appendChild(a);this.panes.push(a);break;default:this.layerContainerDiv.appendChild(a);this.panes.push(a);break}}},updateSize:function(){this.events.clearMouseCache();var b=this.getCurrentSize();var e=this.getSize();if(e==null){this.size=e=b}if(!b.equals(e)){this.size=b;for(var d=0,a=this.layers.length;d=0;--a){this.popups[a].close()}}d.map=this;this.popups.push(d);var b=d.draw();if(b){b.style.zIndex=(d.zIndex!=null)?d.zIndex:this.popups.length;this.panes[6].appendChild(b)}return b},removeInfoWindow:function(a){olleh.Util.removeItem(this.popups,a);if(a.div){try{this.panes[6].removeChild(a.div)}catch(b){}}a.map=null},getCurrentSize:function(){var a=new olleh.maps.Size(this.div.clientWidth,this.div.clientHeight);if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){var b=olleh.Element.getDimensions(this.div);a.w=b.width;a.h=b.height}if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){a.w=parseInt(this.div.style.width);a.h=parseInt(this.div.style.height)}return a},getSize:function(){var a=null;if(this.size!=null){a=this.size.clone()}return a},getTileSize:function(){return this.tileSize},getMaxExtent:function(b){var a=null;if(this.maxExtent){a=this.maxExtent}return a},calculateBounds:function(a,b){var f=null;if(a==null){a=this.getCenter()}if(b==null){b=this.getResolution()}if((a!=null)&&(b!=null)){var e=this.getSize();var g=e.w*b;var d=e.h*b;f=new olleh.maps.Bounds(a.x-g/2,a.y-d/2,a.x+g/2,a.y+d/2)}return f},addControlToMap:function(b,a){b.outsideViewport=(b.div!=null);b.setMap(this);var d=b.draw();if(d){if(!b.outsideViewport){d.style.zIndex=a;this.viewPortDiv.appendChild(d)}}},getControl:function(f){var b=null;for(var d=0,a=this.controls.length;d=this.minZoom)&&(a<=this.maxZoom))},zoomToMaxExtent:function(d){var b=(d)?d.restricted:true;var a=this.getMaxExtent({"restricted":b});this.zoomToExtent(a)},setMouseWheel:function(a){if(this.mapControl.CLASS_NAME=="olleh.MouseControl"){if(a==true){this.mapControl.removeWheelObserving();this.mapControl.registerWheelEvents()}else{this.mapControl.removeWheelObserving()}}},getResolution:function(){var a=null;var b=this.getZoom();if(this.baseLayer!=null){a=this.baseLayer.getResolutionForZoom(b)}return a},getCoordFromViewPortPx:function(a){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getCoordFromViewPortPx(a)}return b},getViewPortPxFromCoord:function(b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getViewPortPxFromCoord(b)}return a},getCoordFromPixel:function(a){return this.getCoordFromViewPortPx(a)},getPixelFromCoord:function(b){var a=this.getViewPortPxFromCoord(b);a.x=Math.round(a.x);a.y=Math.round(a.y);return a},getViewPortPxFromLayerPx:function(e){var d=null;if(e!=null){var b=parseInt(this.layerContainerDiv.style.left);var a=parseInt(this.layerContainerDiv.style.top);d=e.add(b,a)}return d},getLayerPxFromViewPortPx:function(d){var e=null;if(d!=null){var b=-parseInt(this.layerContainerDiv.style.left);var a=-parseInt(this.layerContainerDiv.style.top);e=d.add(b,a);if(isNaN(e.x)||isNaN(e.y)){e=null}}return e},getCoordFromLayerPx:function(a){a=this.getViewPortPxFromLayerPx(a);return this.getCoordFromViewPortPx(a)},getLayerPxFromCoord:function(b){var a=this.getPixelFromCoord(b);return this.getLayerPxFromViewPortPx(a)},setCursor:function(b,a,d){this.div.focus();this.div.style.cursor=olleh.Util.setCursor(b,a,d)},getProjectionObject:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.projection}return a},drawControl:null,areaReset:function(){if(this.drawControl){if(this.drawControl.type=="area"){if(this.drawControl.drawCancel(true)){return}}else{this.distanceReset()}}},area:function(b){if(!olleh.Browser_Mobile){this.areaReset();this.setCursor("url("+olleh.Util.getImagesLocation()+"area.cur)");var a={fillColor:"#06b3f5",fillOpacity:0.3,strokeColor:"#06b3f5",strokeOpacity:0.7,strokeWeight:5,strokeLinecap:"round",strokeDashstyle:"solid",cursor:"inherit"};this.drawControl=new olleh.DrawControl(this.panes[0],olleh.Handler.AreaPolygon,null,a,"area",b);this.controls.push(this.drawControl);this.addControlToMap(this.drawControl,this.Z_INDEX_BASE["Control"]+20);this.drawControl.activate()}else{alert("모바일에서는 지원하지 않습니다.")}},areaClear:function(){this.measureClear()},measureClear:function(){this.panes[0].removeMeasureFeatures();this.panes[0].removeMeasures()},distanceReset:function(){if(this.drawControl){if(this.drawControl.type=="distance"){if(this.drawControl.drawCancel(true)){return}}else{this.areaReset()}}},distance:function(b){if(!olleh.Browser_Mobile){this.distanceReset();this.setCursor("url("+olleh.Util.getImagesLocation()+"distance.cur)");var a={fillColor:"#f11d47",fillOpacity:0.7,strokeColor:"#f11d47",strokeOpacity:0.7,strokeWeight:5,strokeLinecap:"round",strokeDashstyle:"solid",cursor:"inherit"};this.drawControl=new olleh.DrawControl(this.panes[0],olleh.Handler.DistancePath,null,a,"distance",b);this.controls.push(this.drawControl);this.addControlToMap(this.drawControl,this.Z_INDEX_BASE["Control"]+20);this.drawControl.activate()}else{alert("모바일에서는 지원하지 않습니다.")}},distanceClear:function(){this.measureClear()},getCenter:function(){var a=null;if(this.center){a=this.center.clone()}return a},getBounds:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getBounds()}return a},getProjection:function(){var a=this.getProjectionObject();return a?a.getCode():null},getZoom:function(){return this.zoom},getMaxZoom:function(){return this.maxZoom},getZoomForBounds:function(d,b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getZoomForExtent(d,b)}return a},isValidCoord:function(d){var b=false;if(d!=null){var a=this.getMaxExtent();b=a.containsCoord(d)}return b},moveTo:function(m,q,v){if(!v){v={caller:"setCenter"}}var p=v.dragging;var d=v.forceZoomChange;var h=v.noEvent;if(this.panTween&&v.caller=="setCenter"){this.panTween.stop()}if(!this.center&&!this.isValidCoord(m)){m=this.maxExtent.getCenterCoord()}if(this.restrictedExtent!=null){if(m==null){m=this.getCenter()}if(q==null){q=this.getZoom()}var e=this.baseLayer.getResolutionForZoom(q);var r=this.calculateBounds(m,e);if(!this.restrictedExtent.containsBounds(r)){var u=this.restrictedExtent.getCenterCoord();if(r.getWidth()>this.restrictedExtent.getWidth()){m=new olleh.maps.Coord(u.x,m.y)}else{if(r.leftthis.restrictedExtent.right){m=m.add(this.restrictedExtent.right-r.right,0)}}}if(r.getHeight()>this.restrictedExtent.getHeight()){m=new olleh.maps.Coord(m.x,u.y)}else{if(r.bottomthis.restrictedExtent.top){m=m.add(0,this.restrictedExtent.top-r.top)}}}}}var b=d||((this.isValidZoomLevel(q))&&(q!=this.getZoom()));var f=(this.isValidCoord(m))&&(!m.equals(this.center));if(b||f||!p){if(!this.dragging&&!h){this.events.triggerEvent("movestart")}if(f){if((!b)&&(this.center)){this.centerLayerContainer(m)}this.center=m.clone();this.events.triggerEvent("center_changed")}if((b)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.center.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px"}if(b){this.zoom=q;this.resolution=this.baseLayer.getResolutionForZoom(q);this.viewRequestID++;this.events.triggerEvent("zoomstart")}var a=this.getBounds();if(this.baseLayer.visibility){this.baseLayer.moveTo(a,b,p);if(p){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{"zoomChanged":b});this.events.triggerEvent("bounds_changed")}}a=this.baseLayer.getBounds();for(var g=0,l=this.layers.length;g0){for(var g=0;g=this.minResolution)&&(a<=this.maxResolution))}return b},setIsBaseLayer:function(a){if(a!=this.isBaseLayer){this.isBaseLayer=a}},initResolutions:function(){var p=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var b=["projection","units"];var e={};for(var f=0,j=p.length;f1){a=Math.pow((e.maxResolution/e.minResolution),(1/(e.numZoomLevels-1)))}for(var f=0;fb){break}b=h}else{if(this.resolutions[e](f.w-this.map.paddingForPopups.right)){d.x=f.w-this.map.paddingForPopups.right-this.size.w}}if(e.y(f.h-this.map.paddingForPopups.bottom)){d.y=f.h-this.map.paddingForPopups.bottom-this.size.h}}var b=e.x-d.x;var a=e.y-d.y;this.map.panBy(b,a)}},wheelEventCallback:function(a){olleh.Event.stop(a,true)},registerEvents:function(){this.events=new olleh.maps.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,"touchstart":this.onmousedown,"touchend":this.onmouseup,"touchmove":this.onmousemove,scope:this});if(this.groupDiv){if(olleh.Browser_Name=="firefox"){olleh.maps.event.addDomListener(this.groupDiv,"DOMMouseScroll",olleh.Function.bindAsEventListener(this.wheelEventCallback,this))}else{olleh.maps.event.addDomListener(this.groupDiv,"mousewheel",olleh.Function.bindAsEventListener(this.wheelEventCallback,this))}}},onmousedown:function(a){document.onselectstart=function(){return false};this.mousedown=true;olleh.Event.stop(a,true)},onmousemove:function(a){if(this.mousedown){olleh.Event.stop(a,true)}},onmouseup:function(a){if(this.mousedown){this.mousedown=false;olleh.Event.stop(a,true)}},onclick:function(a){olleh.Event.stop(a,true)},onmouseout:function(a){this.mousedown=false},ondblclick:function(a){olleh.Event.stop(a,true)},getPosition:function(){return this.coord},setPosition:function(a){this.updateCoord(a)},CLASS_NAME:"olleh.Popup"});olleh.Popup.WIDTH=200;olleh.Popup.HEIGHT=200;olleh.Popup.COLOR="white";olleh.Popup.OPACITY=1;olleh.Popup.BORDER="0px";olleh.Tile=olleh.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(e,a,f,b,d){this.layer=e;this.position=a.clone();this.bounds=f.clone();this.url=b;this.size=d.clone();this.id=olleh.Util.createUniqueID("KMap_Tile_");this.events=new olleh.maps.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(a){if(a==null){a=new olleh.Tile(this.layer,this.position,this.bounds,this.url,this.size)}olleh.Util.applyDefaults(a,this);return a},draw:function(){var a=this.layer.maxExtent;var b=(a&&this.bounds.intersectsBounds(a,false));this.shouldDraw=b;if(!this.shouldDraw){this.clear()}return this.shouldDraw},moveTo:function(b,a,d){if(d==null){d=true}this.bounds=b.clone();this.position=a.clone();if(d){this.draw()}},setOpacity:function(){},clear:function(){},getBoundsFromBaseLayer:function(a){var e=this.layer.map.getCoordFromLayerPx(a);var d=a.clone();d.x+=this.size.w;d.y+=this.size.h;var b=this.layer.map.getCoordFromLayerPx(d);if(e.x>b.x){if(e.x<0){e.x=-180-(e.x+180)}else{b.x=180+b.x+180}}var f=new olleh.maps.Bounds(e.x,b.y,b.x,e.y);return f},showTile:function(){if(this.shouldDraw){this.show()}},show:function(){},hide:function(){},CLASS_NAME:"olleh.Tile"});olleh.Image=olleh.Class(olleh.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:true,isFirstDraw:true,backBufferTile:null,initialize:function(e,a,f,b,d){olleh.Tile.prototype.initialize.apply(this,arguments);this.url=b;this.frame=document.createElement("div");this.frame.style.overflow="hidden";this.frame.style.position="absolute";this.layerAlphaHack=this.layer.alpha&&olleh.Util.alphaHack()},destroy:function(){if(this.imgDiv!=null){if(this.layerAlphaHack){olleh.Event.stopObservingElement(this.imgDiv.childNodes[0].id)}olleh.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.src=olleh.Util.getImagesLocation()+"nodata.png"}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);olleh.Tile.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new olleh.Image(this.layer,this.position,this.bounds,this.url,this.size)}a=olleh.Tile.prototype.clone.apply(this,[a]);a.imgDiv=null;return a},draw:function(b){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)}var a=olleh.Tile.prototype.draw.apply(this,arguments);if(olleh.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(a){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.startTransitionOriginal()}else{if(this.backBufferTile){this.backBufferTile.clear()}}}else{if(a&&this.isFirstDraw){this.events.register("loadend",this,this.showTile);this.isFirstDraw=false}}if(!a){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 a=this.layer.maxExtent;var b=(a&&this.bounds.intersectsBounds(a,false));if(b){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()}this.backBufferTile.hide()}},renderTile:function(){if(this.imgDiv==null){this.initImgDiv()}this.imgDiv.viewRequestID=this.layer.map.viewRequestID;if(this.layer.async){this.layer.getURLasync(this.bounds,this,"url",this.positionImage)}else{if(this.layer.url instanceof Array){this.imgDiv.urls=this.layer.url.slice()}this.url=this.layer.getURL(this.bounds);this.positionImage()}return true},positionImage:function(){if(this.layer==null){return}olleh.Util.modifyDOMElement(this.frame,null,this.position,this.size);var a=this.layer.getImageSize();if(this.layerAlphaHack){olleh.Util.modifyAlphaImageDiv(this.imgDiv,null,null,a,this.url)}else{olleh.Util.modifyDOMElement(this.imgDiv,null,null,a);this.imgDiv.src=this.url}},clear:function(){if(this.imgDiv){this.hide();if(olleh.Image.useBlankTile){this.imgDiv.src=olleh.Util.getImagesLocation()+"nodata.png"}}},initImgDiv:function(){var e=this.layer.imageOffset;var b=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=olleh.Util.createAlphaImageDiv(null,e,b,null,"absolute",null,null,null,true)}else{this.imgDiv=olleh.Util.createImage(null,e,b,null,"absolute",null,null,true)}this.imgDiv.className="TileImage";this.frame.style.zIndex=this.isBackBuffer?0:1;this.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);if(this.layer.opacity!=null){olleh.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity)}this.imgDiv.map=this.layer.map;var d=function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("loadend")}};if(this.layerAlphaHack){olleh.Event.observe(this.imgDiv.childNodes[0],"load",olleh.Function.bind(d,this))}else{olleh.Event.observe(this.imgDiv,"load",olleh.Function.bind(d,this))}var a=function(){if(this.imgDiv._attempts>olleh.IMAGE_RELOAD_ATTEMPTS){d.call(this)}if(this.layer.name=="HYBRID"||this.layer.name=="TrafficLayer"||this.layer.name=="ELECTION"||this.layer.name=="CADASTRAL"){this.imgDiv.src=olleh.Util.getImagesLocation()+"256_256.png"}else{this.imgDiv.src=olleh.Util.getImagesLocation()+"nodata.png"}};olleh.Event.observe(this.imgDiv,"error",olleh.Function.bind(a,this))},checkImgURL:function(){if(this.layer){var a=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!olleh.Util.isEquivalentUrl(a,this.url)){this.hide()}}},startTransition:function(e){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return}if(e&&e!=1&&this.layer.transitionEffect=="buffer"){var d=new olleh.maps.Coord(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var b=new olleh.maps.Size(parseInt(this.backBufferTile.size.w*e),parseInt(this.backBufferTile.size.h*e));var a=this.layer.map.getLayerPxFromCoord(d);olleh.Util.modifyDOMElement(this.backBufferTile.frame,null,a,b);var f=this.backBufferTile.imageSize;f=new olleh.maps.Size(parseInt(f.w*e),parseInt(f.h*e));var g=this.backBufferTile.imageOffset;if(g){g=new olleh.maps.Pixel(parseInt(g.x*e),parseInt(g.y*e))}olleh.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,g,f);this.backBufferTile.show()}},startTransitionOriginal:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return}var e=1;if(this.backBufferTile.resolution){e=this.backBufferTile.resolution/this.layer.getResolution()}if(e!=1&&this.layer.transitionEffect=="buffer"){var d=new olleh.maps.Coord(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var b=new olleh.maps.Size(this.backBufferTile.size.w*e,this.backBufferTile.size.h*e);var a=this.layer.map.getLayerPxFromCoord(d);olleh.Util.modifyDOMElement(this.backBufferTile.frame,null,a,b);var f=this.backBufferTile.imageSize;f=new olleh.maps.Size(f.w*e,f.h*e);var g=this.backBufferTile.imageOffset;if(g){g=new olleh.maps.Pixel(g.x*e,g.y*e)}olleh.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,g,f);this.backBufferTile.show()}},show:function(){this.frame.style.display="";if(olleh.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"},setOpacity:function(a){olleh.Util.setOpacity(this.frame,a)},CLASS_NAME:"olleh.Image"});olleh.Image.useBlankTile=(olleh.Browser_Name=="safari"||olleh.Browser_Name=="opera"||olleh.Browser_Mobile);olleh.TileRequest=olleh.Class(olleh.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(e,d,f,b){var a=arguments;a=[e,b];olleh.Layer.prototype.initialize.apply(this,a);this.url=d;this.params=olleh.Util.extend({},f)},destroy:function(){this.url=null;this.params=null;olleh.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new olleh.TileRequest(this.name,this.url,this.params,this.options)}a=olleh.Layer.prototype.clone.apply(this,[a]);return a},setUrl:function(a){this.url=a},mergeNewParams:function(a){this.params=olleh.Util.extend(this.params,a);return this.redraw()},redraw:function(a){if(a){return this.mergeNewParams({"_Salt":Math.random()})}else{return olleh.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(f,e){var d=1;for(var b=0,a=f.length;b=l.bottom-m*this.buffer)||C=0)&&(d=0)){g=this.grid[l][d]}if((g!=null)&&(!g.queued)){b.unshift(g);g.queued=true;o=0;h=l;a=d}else{m=(m+1)%4;o++}}for(var e=0,f=b.length;e-this.tileSize.w*(b-1)){this.shiftColumn(true)}else{if(e.x<-this.tileSize.w*b){this.shiftColumn(false)}else{if(e.y>-this.tileSize.h*(b-1)){this.shiftRow(true)}else{if(e.y<-this.tileSize.h*b){this.shiftRow(false)}else{break}}}}}},shiftRow:function(q){var d=(q)?0:(this.grid.length-1);var b=this.grid;var g=b[d];var f=this.map.getResolution();var j=(q)?-this.tileSize.h:this.tileSize.h;var h=f*-j;var p=(q)?b.pop():b.shift();for(var l=0,o=g.length;lf){var g=this.grid.pop();for(var b=0,a=g.length;bd){for(var b=0,a=this.grid.length;b0)){b=new olleh.maps.Bounds();for(var e=0,a=this.markers.length,d;e0){this.removeMarker(this.markers[0])}}},drawMarker:function(a){if(this.map){var b=this.map.getLayerPxFromCoord(a.position);if(b==null){a.display(false)}else{if(!a.isDrawn()){this.div.appendChild(a.draw(b));if(a.captionObj){this.div.appendChild(a.drawCaption(b))}if(a.shadow){this.map.getPanes()[2].appendChild(a.drawShadow(b))}else{if(a.firstShadow){a.firstShadow=false;a.shadow=olleh.maps.Marker.defaultShadow();this.map.getPanes()[2].appendChild(a.drawShadow(b))}}if(a.animation){a.resetAnimation()}}else{a.moveTo(b);if(a.animation){a.resetAnimation()}}}}},display:function(a){},CLASS_NAME:"olleh.maps.MarkerLayer"});olleh.maps.ImageLayer=olleh.Class(olleh.Layer,{isBaseLayer:false,images:null,drawn:false,initialize:function(b,a){olleh.Layer.prototype.initialize.apply(this,arguments);this.images=[]},addImage:function(a){this.images.push(a);if(this.opacity!=null){a.setOpacity(this.opacity)}if(this.map&&this.map.getBounds()){a.map=this.map;this.drawImage(a)}},getBounds:function(){return this.getImagesExtent()},getImagesExtent:function(){var b=null;if(this.images&&(this.images.length>0)){var b=new olleh.maps.Bounds();for(var d=0,a=this.images.length;d0){this.removeImage(this.images[0])}}},drawImage:function(d){var b=this.map.getLayerPxFromCoord(new olleh.maps.Coord(d.bounds.left,d.bounds.top));if(b==null){d.hide()}else{if(d.onScreen()){if(!d.isDrawn()){var a=d.draw(b);this.div.appendChild(a)}else{d.moveTo(b)}}else{d.erase()}}},CLASS_NAME:"olleh.maps.ImageLayer"});olleh.maps.TMSLayer=olleh.Class(olleh.TileGrid,{isBaseLayer:false,tileOrigin:null,serverResolutions:null,initialize:function(e,d,b){var a=[];a.push(e,d,{},b);olleh.TileGrid.prototype.initialize.apply(this,a)},addTile:function(b,a){return new olleh.Image(this,a,b,null,this.tileSize)},clone:function(a){if(a==null){a=new olleh.maps.TMSLayer(this.name,this.url,this.options)}a=olleh.TileGrid.prototype.clone.apply(this,[a]);return a},removeLayer:function(){olleh.TileGrid.prototype.destroy.apply(this,arguments)},getURL:function(b){b=this.adjustBounds(b);var f=this.map.getResolution();var o=Math.floor((b.left-this.tileOrigin.x)/(f*this.tileSize.w));var l=Math.floor((this.tileOrigin.y-b.bottom)/(f*this.tileSize.h));var g=this.serverResolutions!=null?olleh.Util.indexOf(this.serverResolutions,f):this.map.getZoom();var h=new String(g);var q;if(h.length==1){q="0"+h}else{q=h}var e,a;var m=parseInt(o).toString(16);var j=parseInt(l-1).toString(16);if(m.length==1){e="0000000"+m}else{if(m.length==2){e="000000"+m}else{if(m.length==3){e="00000"+m}else{if(m.length==4){e="0000"+m}else{if(m.length==5){e="000"+m}else{if(m.length==6){e="00"+m}else{if(m.length==7){e="0"+m}else{e=m}}}}}}}if(j.length==1){a="0000000"+j}else{if(j.length==2){a="000000"+j}else{if(j.length==3){a="00000"+j}else{if(j.length==4){a="0000"+j}else{if(j.length==5){a="000"+j}else{if(j.length==6){a="00"+j}else{if(j.length==7){a="0"+j}else{a=j}}}}}}}var p="/l"+q+"/"+"r"+a+"/"+"c"+e+"."+this.type;var d=this.url;if(d instanceof Array){d=this.selectUrl(p,d)}return d+p},setMap:function(a){olleh.TileGrid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new olleh.maps.Coord(this.map.maxExtent.left,this.map.maxExtent.top)}},CLASS_NAME:"olleh.maps.TMSLayer"});olleh.maps.ImageMapType=olleh.Class(olleh.TileGrid,{isBaseLayer:false,tileOrigin:null,serverResolutions:null,mapTypeOptions:{},initialize:function(b){olleh.Util.extend(this.mapTypeOptions,b);if(this.mapTypeOptions.getURL){this.getURL=this.mapTypeOptions.getURL}else{return}var d={type:this.mapTypeOptions.imageType,minResolution:this.mapTypeOptions.map.baseLayer.getResolutionForZoom(this.mapTypeOptions.minZoom),maxResolution:this.mapTypeOptions.map.baseLayer.getResolutionForZoom(this.mapTypeOptions.maxZoom),numZoomLevels:this.mapTypeOptions.maxZoom-this.mapTypeOptions.minZoom+1,opacity:this.mapTypeOptions.opacity?this.mapTypeOptions.opacity:1};var a=[];a.push(this.mapTypeOptions.name,null,{},d);olleh.TileGrid.prototype.initialize.apply(this,a);if(this.mapTypeOptions.tileSize){this.tileSize=this.mapTypeOptions.tileSize}},addTile:function(b,a){return new olleh.Image(this,a,b,null,this.tileSize)},clone:function(a){if(a==null){a=new olleh.maps.ImageMapType(this.mapTypeOptions)}a=olleh.TileGrid.prototype.clone.apply(this,[a]);return a},removeLayer:function(){olleh.TileGrid.prototype.destroy.apply(this,arguments)},getURL:function(a){return null},setMap:function(a){if(a){olleh.TileGrid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new olleh.maps.Coord(this.map.maxExtent.left,this.map.maxExtent.top)}}},CLASS_NAME:"olleh.maps.ImageMapType"});olleh.maps.TrafficLayer=olleh.Class(olleh.TileGrid,{isBaseLayer:false,tileOrigin:null,serverResolutions:null,name:"TrafficLayer",url:olleh.maps.TileMapURL.TRAFFIC,options:{type:olleh.maps.TileFormat.TRAFFIC},initialize:function(){var a=[];a.push(this.name,this.url,{},this.options);olleh.TileGrid.prototype.initialize.apply(this,a)},addTile:function(b,a){return new olleh.Image(this,a,b,null,this.tileSize)},clone:function(a){if(a==null){a=new olleh.maps.TMSLayer(this.name,this.url,this.options)}a=olleh.TileGrid.prototype.clone.apply(this,[a]);return a},removeLayer:function(){olleh.TileGrid.prototype.destroy.apply(this,arguments)},getURL:function(b){b=this.adjustBounds(b);var f=this.map.getResolution();var o=Math.floor((b.left-this.tileOrigin.x)/(f*this.tileSize.w));var l=Math.floor((this.tileOrigin.y-b.bottom)/(f*this.tileSize.h));var g=this.serverResolutions!=null?olleh.Util.indexOf(this.serverResolutions,f):this.map.getZoom();var h=new String(g);var q;if(h.length==1){q="0"+h}else{q=h}var e,a;var m=parseInt(o).toString(16);var j=parseInt(l-1).toString(16);if(m.length==1){e="0000000"+m}else{if(m.length==2){e="000000"+m}else{if(m.length==3){e="00000"+m}else{if(m.length==4){e="0000"+m}else{if(m.length==5){e="000"+m}else{if(m.length==6){e="00"+m}else{if(m.length==7){e="0"+m}else{e=m}}}}}}}if(j.length==1){a="0000000"+j}else{if(j.length==2){a="000000"+j}else{if(j.length==3){a="00000"+j}else{if(j.length==4){a="0000"+j}else{if(j.length==5){a="000"+j}else{if(j.length==6){a="00"+j}else{if(j.length==7){a="0"+j}else{a=j}}}}}}}var p="/L"+q+"/"+"R"+a+"/"+"C"+e+"."+this.type;var d=this.url;if(d instanceof Array){d=this.selectUrl(p,d)}return d+p},setMap:function(a){if(a){olleh.TileGrid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new olleh.maps.Coord(this.map.maxExtent.left,this.map.maxExtent.top)}this.map.setLayerZIndex(this,this.map.Z_INDEX_BASE["BaseLayer"]+10);this.map.layerContainerDiv.appendChild(this.div);this.map.layers.push(this);this.visibility=true;this.redraw()}else{this.map.layerContainerDiv.removeChild(this.div);olleh.Util.removeItem(this.map.layers,this);this.map=a}},CLASS_NAME:"olleh.maps.TrafficLayer"});olleh.maps.OverlayView=olleh.Class(olleh.Layer,{EVENT_TYPES:["moveend"],initialize:function(){},destroy:function(){if(this.map!=null){olleh.Util.removeItem(this.map.layers,this)}this.projection=null;this.map=null;this.name=null;this.div=olleh.Util.createDiv("olleh_Pane5");this.div.style.zIndex=105;this.options=null;if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy()}this.eventListeners=null;this.events=null},moveend:function(){this.draw()},draw:function(){},setMap:function(a){if(a){this.addOptions(null);this.name="OverlayView";this.id=this.name;if(a.panes[5]!=null){this.div=a.panes[5]}this.events=new olleh.maps.Events(this,this.div,this.EVENT_TYPES);this.events.on(this);a.layers.push(this);olleh.Layer.prototype.setMap.apply(this,arguments);this.afterAdd();this.setVisibility(true)}else{this.destroy();this.afterRemove()}},getMap:function(){return this.map},show:function(){this.display(true)},hide:function(){this.display(false)},getPane:function(){if(this.map){return this.map.panes[5]}return null},CLASS_NAME:"olleh.maps.OverlayView"});olleh.Balloon=olleh.Class(olleh.Popup,{autoSize:true,panMapIfOutOfView:true,imageSize:new olleh.maps.Size(676,736),isAlphaImage:false,imageSrc:null,blocks:null,minSize:new olleh.maps.Size(105,10),maxSize:null,relativePosition:null,keepInMap:true,anchor:null,zIndex:1,positionFlag:false,_host:null,positionBlocks:{"tl":{"anchor":new olleh.maps.Pixel(40,-20),"padding":new olleh.maps.Bounds(10,24,10,10),"blocks":[{size:new olleh.maps.Size("auto","auto"),anchor:new olleh.maps.Bounds(0,22,8,0),position:new olleh.maps.Pixel(0,0)},{size:new olleh.maps.Size(8,"auto"),anchor:new olleh.maps.Bounds(null,22,0,0),position:new olleh.maps.Pixel(-638,0)},{size:new olleh.maps.Size("auto",8),anchor:new olleh.maps.Bounds(0,14,8,null),position:new olleh.maps.Pixel(0,-630)},{size:new olleh.maps.Size(8,8),anchor:new olleh.maps.Bounds(null,14,0,null),position:new olleh.maps.Pixel(-638,-630)},{size:new olleh.maps.Size(20,14),anchor:new olleh.maps.Bounds(null,5,30,null),position:new olleh.maps.Pixel(-23,-685)}]},"tr":{"anchor":new olleh.maps.Pixel(-40,-20),"padding":new olleh.maps.Bounds(10,24,10,10),"blocks":[{size:new olleh.maps.Size("auto","auto"),anchor:new olleh.maps.Bounds(0,22,8,0),position:new olleh.maps.Pixel(0,0)},{size:new olleh.maps.Size(8,"auto"),anchor:new olleh.maps.Bounds(null,22,0,0),position:new olleh.maps.Pixel(-638,0)},{size:new olleh.maps.Size("auto",8),anchor:new olleh.maps.Bounds(0,14,8,null),position:new olleh.maps.Pixel(0,-630)},{size:new olleh.maps.Size(8,8),anchor:new olleh.maps.Bounds(null,14,0,null),position:new olleh.maps.Pixel(-638,-630)},{size:new olleh.maps.Size(20,14),anchor:new olleh.maps.Bounds(30,5,null,null),position:new olleh.maps.Pixel(-23,-685)}]},"bl":{"anchor":new olleh.maps.Pixel(40,20),"padding":new olleh.maps.Bounds(10,10,10,24),"blocks":[{size:new olleh.maps.Size("auto","auto"),anchor:new olleh.maps.Bounds(0,8,8,14),position:new olleh.maps.Pixel(0,0)},{size:new olleh.maps.Size(8,"auto"),anchor:new olleh.maps.Bounds(null,8,0,14),position:new olleh.maps.Pixel(-638,0)},{size:new olleh.maps.Size("auto",8),anchor:new olleh.maps.Bounds(0,0,8,null),position:new olleh.maps.Pixel(0,-630)},{size:new olleh.maps.Size(8,8),anchor:new olleh.maps.Bounds(null,0,0,null),position:new olleh.maps.Pixel(-638,-630)},{size:new olleh.maps.Size(20,14),anchor:new olleh.maps.Bounds(null,null,30,2),position:new olleh.maps.Pixel(-128,-692)}]},"br":{"anchor":new olleh.maps.Pixel(-40,20),"padding":new olleh.maps.Bounds(10,10,10,24),"blocks":[{size:new olleh.maps.Size("auto","auto"),anchor:new olleh.maps.Bounds(0,8,8,14),position:new olleh.maps.Pixel(0,0)},{size:new olleh.maps.Size(8,"auto"),anchor:new olleh.maps.Bounds(null,8,0,14),position:new olleh.maps.Pixel(-638,0)},{size:new olleh.maps.Size("auto",8),anchor:new olleh.maps.Bounds(0,0,8,null),position:new olleh.maps.Pixel(0,-630)},{size:new olleh.maps.Size(8,8),anchor:new olleh.maps.Bounds(null,0,0,null),position:new olleh.maps.Pixel(-638,-630)},{size:new olleh.maps.Size(20,14),anchor:new olleh.maps.Bounds(30,null,null,2),position:new olleh.maps.Pixel(-128,-692)}]}},initialize:function(d,h,e,f,a,j,q,p,m,g,l){if(j){this.imageSrc=olleh.Util.getImagesLocation()+"cloud-popup-relative4.png"}if(a==null){for(var o in this.positionBlocks){switch(o){case"tr":this.positionBlocks[o].anchor=new olleh.maps.Pixel(-40,-5);break;case"tl":this.positionBlocks[o].anchor=new olleh.maps.Pixel(40,-5);break;case"br":this.positionBlocks[o].anchor=new olleh.maps.Pixel(-40,-2);break;case"bl":this.positionBlocks[o].anchor=new olleh.maps.Pixel(40,-2);break}}}else{for(var o in this.positionBlocks){switch(o){case"tr":this.positionBlocks[o].anchor=new olleh.maps.Pixel(-40,-a.size.h/2+2);break;case"tl":this.positionBlocks[o].anchor=new olleh.maps.Pixel(40,-a.size.h/2+2);break;case"br":this.positionBlocks[o].anchor=new olleh.maps.Pixel(-40,a.size.h/2-2);break;case"bl":this.positionBlocks[o].anchor=new olleh.maps.Pixel(40,a.size.h/2-2);break}}}this.maxSize=new olleh.maps.Size(p,660);var b=[d,h,e,f,null,q];olleh.Popup.prototype.initialize.apply(this,b);this.anchor=(a)?a:{size:new olleh.maps.Size(0,0),anchor:new olleh.maps.Pixel(0,0)};this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=this.zIndex;this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv.style.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%";this.zIndex=m;this.positionFlag=g;this._host=l},setAnchor:function(a){if(a){this.anchor.anchor=a}},destroy:function(){this.imageSrc=null;this.imageSize=null;this.isAlphaImage=null;this.positionBlocks=null;for(var a=0;athis.maxWidth){a.w=this.maxWidth}this.infoWindow.setSize(a)},close:function(){if(this.map!=null&&this.infoWindow!=null){if(olleh.infoWindowTemp.container){if(olleh.infoWindowTemp.container.style){if(olleh.infoWindowTemp.container.style.width){olleh.infoWindowTemp.container.style.width=""}if(olleh.infoWindowTemp.container.style.height){olleh.infoWindowTemp.container.style.height=""}}}if(olleh.infoWindowTemp.content){if(olleh.infoWindowTemp.content.innerHTML){olleh.infoWindowTemp.content.innerHTML=""}}if(this.infoWindow){if(this.map){this.map.removeInfoWindow(this.infoWindow);this.map=null}this.infoWindow.destroy();this.infoWindow.feature=null;this.infoWindow=null}if(this.marker){this.marker.infoWin=null;this.marker=null}if(this._oner){this._oner.infoWindow=null;this._oner=null}}},getContent:function(){return this.content},getPosition:function(){return this.position},getZIndex:function(){return this.zIndex},open:function(h,e,b){if(this.infoWindow!=null||h==null){return}var a=null,j=null,f=null;if(e&&e.CLASS_NAME=="olleh.maps.Marker"){a=e.position;var d=e.icon.size?e.icon.size:new olleh.maps.Size(0,0);j=(this.pixelOffset)?this.pixelOffset.oppositeSign():e.icon.anchor.oppositeSign();if(this.pixelOffset){j=this.pixelOffset.oppositeSign();f={size:d,anchor:j}}else{j=e.icon.anchor.oppositeSign();f={size:d,anchor:j}}}else{a=(this.position!=null)?this.position:null;j=(this.pixelOffset)?this.pixelOffset.oppositeSign():new olleh.maps.Pixel(0,0);f={size:new olleh.maps.Size(0,0),anchor:j}}if(a==null){return}this.feature=new olleh.Feature(h,a,this.content,this.overFlow,this.bgFlag,f,this.disableAutoPan,this.maxWidth,this.zIndex,this.positionFlag);this.infoWindow=this.feature.createPopup(this);if(e){e.infoWin=this.infoWindow;this.marker=e}this.infoWindow.setZIndex(this.zIndex);if(this.cBox){this.infoWindow.addCloseBox();var g=this.cBoxCallback||function(l){this.close();olleh.Event.stop(l)};olleh.Event.observe(this.infoWindow.closeDiv,"click",olleh.Function.bindAsEventListener(g,this))}this.childDiv=h.addInfoWindow(this.infoWindow,b);this.map=h},setContent:function(b){var d,a;if(b){d=b.split("");d=a.split(""").join('"');this.content=d;if(this.infoWindow){this.infoWindow.setContentHTML(this.content);if(this.marker){this.infoWindow.setPosition(this.marker.position)}}}},setPixelOffset:function(a){if(a){this.pixelOffset=a;if(this.infoWindow){this.infoWindow.setAnchor(a.oppositeSign());this.infoWindow.updatePosition()}}},setOptions:function(a){for(var b in a){switch(b){case"content":this.setContent(a.content);break;case"disableAutoPan":this.disableAutoPan=a.disableAutoPan;break;case"position":this.setPosition(a.position);break;case"zIndex":this.setZIndex(a.zIndex);break;case"maxWidth":this.maxWidth=a.maxWidth;break;case"pixelOffset":this.setPixelOffset(a.pixelOffset);break;case"cBox":this.cBox=a.cBox;break;case"cBoxCallback":this.cBoxCallback=a.cBoxCallback;break;case"positionFlag":this.positionFlag=a.positionFlag;break;case"bgFlag":this.bgFlag=a.bgFlag;break}}},setPosition:function(b,a){if(b){this.position=b;if((this.marker==null&&this.infoWindow)||a){this.infoWindow.setPosition(b)}}},setZIndex:function(a){if(a){this.zIndex=a;if(this.infoWindow){this.infoWindow.setZIndex(a)}}},updatePosition:function(){this.infoWindow&&this.infoWindow.updatePosition()},CLASS_NAME:"InfoWindow"});olleh.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};olleh.Vector=olleh.Class(olleh.Feature,{VECTOR_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","touchstart","touchmove","touchend","touchcancel",],fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,renderIntent:null,layer:null,initialize:function(d,b,a){olleh.Feature.prototype.initialize.apply(this,[null,null,a]);this.id=olleh.Util.createUniqueID(this.CLASS_NAME+"_");this.geometry=d?d:null;this.state=null;this.attributes={};this.style={clickable:true,strokeColor:"#0000FF",strokeOpacity:0.8,strokeWeight:1,fillColor:"#0000FF",fillOpacity:0.35,zIndex:0,radius:1};if(b){this.style=olleh.Util.extend(this.style,b)}if(a){this.attributes=olleh.Util.extend(this.attributes,a)}},removeHandler:function(){if(this.layer){this.layer.destroyFeatures([this])}if(this.events){this.events.destroy()}if(this.infoWindow){this.infoWindow.close()}if(this.geometry){this.geometry.remove()}olleh.Feature.prototype.destroy.apply(this,arguments);this.unbindAll();olleh.Util.removeObject(this)},remove:function(){if(this.layer){this.layer.destroyFeatures([this]);this.layer=null}olleh.Util.addSetTimeOut(this,"removeHandler")},clone:function(){return new olleh.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(e){var d=false;if(this.layer&&this.layer.map){var a=this.layer.map.getBounds();if(e){var b=this.geometry.getBounds();d=a.intersectsBounds(b)}else{var f=a.toGeometry();d=f.intersects(this.geometry)}}return d},atPoint:function(e,d,b){var a=false;if(this.geometry){a=this.geometry.atPoint(e,d,b)}return a},destroyPopup:function(){},move:function(a){if(!this.layer||!this.geometry.move){return}var b;if(a.CLASS_NAME=="Coord"){b=this.layer.getViewPortPxFromCoord(a)}else{b=a}var e=this.layer.getViewPortPxFromCoord(this.geometry.getBounds().getCenterCoord());var d=this.layer.map.getResolution();this.geometry.move(d*(b.x-e.x),d*(e.y-b.y));this.layer.drawFeature(this);return e},toState:function(a){if(a==olleh.State.UPDATE){switch(this.state){case olleh.State.UNKNOWN:case olleh.State.DELETE:this.state=a;break;case olleh.State.UPDATE:case olleh.State.INSERT:break}}else{if(a==olleh.State.INSERT){switch(this.state){case olleh.State.UNKNOWN:break;default:this.state=a;break}}else{if(a==olleh.State.DELETE){switch(this.state){case olleh.State.INSERT:break;case olleh.State.DELETE:break;case olleh.State.UNKNOWN:case olleh.State.UPDATE:this.state=a;break}}else{if(a==olleh.State.UNKNOWN){this.state=a}}}}},setMap:function(a){if(a&&a!="null"){if(this.style&&this.style.map&&this.style.map.equals(a)){return}if(a.getPanes()){this.style.map=a;a.getPanes()[0].addFeatures([this]);this.layer=a.getPanes()[0]}this.notify("map")}else{if((a==null||a=="null")&&this.style.map){this.unbindAll();if(this.infoWindow){this.infoWindow.close();this.infoWindow=null}this.layer.destroyFeatures([this]);this.layer=null;this.style.map=null;this.notify("map")}}},getMap:function(){return this.style.map},refresh:function(){if(this.style.map&&this.style.map!=null){if(this.layer){this.layer.moveTo(null,true)}}else{if(this.layer){this.layer.removeFeatures([this]);this.layer=null}}},getBounds:function(){var a=this.bounds?this.bounds.clone():null;var b=this.geometry.getBounds();if(a&&b&&a.equals(b)){return a}this.bounds=b;this.notify("bounds");return this.bounds},getCenter:function(){return this.geometry.getCenter()},CLASS_NAME:"olleh.Vector"});olleh.Vector.style={"default":{fillColor:"#00D7FF",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#00D7FF",strokeOpacity:1,strokeWeight:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,radius:2,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"select":{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWeight:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,radius:2,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},"temporary":{fillColor:"#66cccc",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWeight:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,radius:2,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"delete":{display:"none"}};olleh.Handler=olleh.Class({id:null,control:null,map:null,keyMask:null,active:false,initialize:function(d,b,a){olleh.Util.extend(this,a);this.control=d;this.callbacks=b;if(d.map){this.setMap(d.map)}olleh.Util.extend(this,a);this.id=olleh.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(a){this.map=a},checkModifiers:function(a){if(this.keyMask==null){return true}var b=(a.shiftKey?olleh.Handler.MOD_SHIFT:0)|(a.ctrlKey?olleh.Handler.MOD_CTRL:0)|(a.altKey?olleh.Handler.MOD_ALT:0);return(b==this.keyMask)},activate:function(){if(this.active){return false}var d=olleh.maps.Events.prototype.BROWSER_EVENTS;for(var b=0,a=d.length;b=this.map.Z_INDEX_BASE["Feature"]){this.layer.setZIndex(a)}else{this.map.setLayerZIndex(this.layer,this.map.getLayerZIndex(this.layer))}},CLASS_NAME:"olleh.Handler.Feature"});olleh.Handler.DragMarkerHandler=olleh.Class(olleh.Handler,{touch:false,last:null,start:null,documentDrag:false,documentEvents:null,marker:null,mouseDown:false,mouseUp:true,selectIcon:null,selectShadow:null,selectInfoWin:null,selectCaption:null,_interval:null,_intervalValue:0,_intervalValueX:0,_intervalValueY:0,backUpMarkerAnchor:null,backUpShadowAnchor:null,initialize:function(e,d,a){olleh.Handler.prototype.initialize.apply(this,arguments);if(this.documentDrag===true){var b=this;this._docMove=function(f){b.mousemove({xy:{x:f.clientX,y:f.clientY},element:document})};this._docUp=function(f){b.mouseup({xy:{x:f.clientX,y:f.clientY}})}}},activate:function(){this._intervalValue=parseInt(15*this.map.getResolution());if(olleh.Handler.prototype.activate.apply(this,arguments)){return true}return false},deactivate:function(){if(this._interval){window.clearInterval(this._interval);this._interval=null}if(olleh.Handler.prototype.deactivate.apply(this,arguments)){this.touch=false;this.start=null;this.last=null;olleh.Element.removeClass(this.map.viewPortDiv,"olDragDown");return true}return false},dragstart:function(a){if(!this.marker.clickable){return true}if(this.mouseDown&&!this.mouseUp){this.deactivate();this.mouseDown=false;this.mouseUp=true}if(!this.mouseDown){this.start=this.map.events.getMousePosition(a);olleh.Util.stopAnimation(this.marker);this.activate();this.mouseDown=true;this.mouseUp=false;this.marker.events&&this.marker.events.triggerEvent("dragstart");olleh.Event.stop(a);return false}else{return true}},dragmove:function(a){if(this.mouseDown&&!this.mouseUp){a.xy||(a.xy=new olleh.maps.Pixel(a.clientX,a.clientY));if(!this.start.equals(a.xy)){if(!this.last){this.backUpMarkerAnchor=this.marker.icon.anchor.clone();this.marker.icon.anchor.y=this.marker.icon.getSize().h+10;if(this.marker.shadow&&this.marker.shadow.anchor){this.backUpShadowAnchor=this.marker.shadow.anchor.clone();this.marker.shadow.anchor.x-=10;this.marker.shadow.anchor.y+=this.marker.icon.getSize().h-this.backUpMarkerAnchor.y+10}!olleh.Browser_Mobile&&this.map.setCursor(this.map.draggingCursor)}this.last=a.xy;this.checkMoveMap(a);this.marker.events&&this.marker.events.triggerEvent("drag");olleh.Event.stop(a)}return false}else{return true}},dragend:function(a){if(this.mouseDown){if(this._interval){window.clearInterval(this._interval);this._interval=null}if(this.backUpMarkerAnchor){this.marker.icon.anchor.x=this.backUpMarkerAnchor.x;this.marker.icon.anchor.y=this.backUpMarkerAnchor.y;if(this.backUpShadowAnchor){this.marker.shadow.anchor.x=this.backUpShadowAnchor.x;this.marker.shadow.anchor.y=this.backUpShadowAnchor.y}this.marker.dragMarker(a.xy);if(this.selectIcon){this.map.viewPortDiv.removeChild(this.selectIcon.imageDiv);this.map.getPanes()[3].div.appendChild(this.selectIcon.imageDiv);if(this.selectCaption){this.map.viewPortDiv.removeChild(this.selectCaption.captionDiv);this.map.getPanes()[3].div.appendChild(this.selectCaption.captionDiv);this.selectCaption=null}if(this.selectShadow){this.map.viewPortDiv.removeChild(this.selectShadow.imageDiv);this.map.getPanes()[2].appendChild(this.selectShadow.imageDiv);this.selectShadow=null}if(this.selectInfoWin){this.map.viewPortDiv.removeChild(this.selectInfoWin.div);this.selectInfoWin.setPosition(this.marker.position,true);this.map.getPanes()[6].appendChild(this.selectInfoWin.div);this.selectInfoWin=null}this.selectIcon=null}if(this.marker.animation){this.marker.setAnimation(this.marker.animation)}this.deactivate();this.mouseDown=false;this.mouseUp=true;!olleh.Browser_Mobile&&this.map.setCursor(this.map.draggableCursor);this.marker.events&&this.marker.events.triggerEvent("dragend",a);if(this.marker["groupLayer"]){this.marker["isAdded"]=false;olleh.Util.addSetTimeOut(this.marker["groupLayer"],"repaint",null)}}else{this.deactivate();this.mouseDown=false;this.mouseUp=true;this.last=null}olleh.Event.stop(a);return false}else{return true}},touchstart:function(a){if(!this.touch){this.touch=true;this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,mousemove:this.mousemove,click:this.click,scope:this})}return this.dragstart(a)},touchmove:function(a){return this.dragmove(a)},touchend:function(b){b.xy=this.last;var a=this.dragend(b);!this.backUpAnchor&&this.marker.events&&this.marker.events.triggerEvent("click");if(this.backUpMarkerAnchor){olleh.Util.removeObject(this.backUpMarkerAnchor);this.backUpMarkerAnchor=null}if(this.backUpShadowAnchor){olleh.Util.removeObject(this.backUpShadowAnchor);this.backUpShadowAnchor=null}return a},mousedown:function(a){if(olleh.Event.isLeftClick(a)){return this.dragstart(a)}},mousemove:function(b){var a=this.dragmove(b);this.marker.events&&this.marker.events.triggerEvent(b.type);return a},mouseup:function(b){if(this._interval){window.clearInterval(this._interval);this._interval=null}var a=this.dragend(b);this.backUpAnchor&&this.marker.events&&this.marker.events.triggerEvent(b.type,b);olleh.Event.stop(b);if(this.backUpMarkerAnchor){olleh.Util.removeObject(this.backUpMarkerAnchor);this.backUpMarkerAnchor=null}if(this.backUpShadowAnchor){olleh.Util.removeObject(this.backUpShadowAnchor);this.backUpShadowAnchor=null}return false},click:function(b){var a=this.start&&this.last&&this.start.equals(this.last);if(a){this.marker.events&&this.marker.events.triggerEvent(b.type,b)}return a},adjustXY:function(a){var b=olleh.Util.pagePosition(this.map.viewPortDiv);a.xy.x-=b[0];a.xy.y-=b[1];b=null},addDocumentEvents:function(){olleh.Element.addClass(document.body,"olDragDown");this.documentEvents=true;olleh.Event.observe(document,"mousemove",this._docMove);olleh.Event.observe(document,"mouseup",this._docUp)},removeDocumentEvents:function(){olleh.Element.removeClass(document.body,"olDragDown");this.documentEvents=false;olleh.Event.stopObserving(document,"mousemove",this._docMove);olleh.Event.stopObserving(document,"mouseup",this._docUp)},checkMoveMap:function(b){var a=b.xy.x;var d=b.xy.y;if(a<50){if(d<50){this._intervalValueX=-this._intervalValue;this._intervalValueY=this._intervalValue}else{if(d>this.map.getCurrentSize().h-50){this._intervalValueX=-this._intervalValue;this._intervalValueY=-this._intervalValue}else{this._intervalValueX=-this._intervalValue;this._intervalValueY=0}}this.startMoveMap(b)}else{if(a>this.map.getCurrentSize().w-50){if(d<50){this._intervalValueX=this._intervalValue;this._intervalValueY=this._intervalValue}else{if(d>this.map.getCurrentSize().h-50){this._intervalValueX=this._intervalValue;this._intervalValueY=-this._intervalValue}else{this._intervalValueX=this._intervalValue;this._intervalValueY=0}}this.startMoveMap(b)}else{if(d<50){this._intervalValueX=0;this._intervalValueY=this._intervalValue;this.startMoveMap(b)}else{if(d>this.map.getCurrentSize().h-50){this._intervalValueX=0;this._intervalValueY=-this._intervalValue;this.startMoveMap(b)}else{if(this._interval){window.clearInterval(this._interval);this._interval=null}if(this.selectIcon){this.selectIcon.moveTo(b.xy);if(this.selectCaption){this.selectCaption.moveTo(b.xy)}if(this.selectShadow){this.selectShadow.moveTo(b.xy)}if(this.selectInfoWin){this.selectInfoWin.moveTo(b.xy)}}else{this.marker.dragMarker(b.xy)}}}}}a=d=null},startMoveMap:function(a){var d=this;var b=null;if(!d.selectIcon){d.selectIcon=d.marker.icon;if(d.selectIcon){d.map.getPanes()[3].div.removeChild(d.selectIcon.imageDiv);d.map.viewPortDiv.appendChild(d.selectIcon.imageDiv);d.selectCaption=d.marker.captionObj?d.marker.captionObj:null;if(d.selectCaption){d.map.getPanes()[3].div.removeChild(d.selectCaption.captionDiv);d.map.viewPortDiv.appendChild(d.selectCaption.captionDiv)}d.selectShadow=(d.marker.shadow&&(d.marker.flat==false))?d.marker.shadow:null;if(d.selectShadow){d.map.getPanes()[2].removeChild(d.selectShadow.imageDiv);d.map.viewPortDiv.appendChild(d.selectShadow.imageDiv)}d.selectInfoWin=d.marker.infoWin?d.marker.infoWin:null;if(d.selectInfoWin){d.map.getPanes()[6].removeChild(d.selectInfoWin.div);d.map.viewPortDiv.appendChild(d.selectInfoWin.div)}}}else{if(d.selectIcon){d.selectIcon.moveTo(a.xy);if(d.selectCaption){d.selectCaption.moveTo(a.xy)}if(d.selectShadow){d.selectShadow.moveTo(a.xy)}if(d.selectInfoWin){d.selectInfoWin.moveTo(a.xy)}}}if(!this._interval){this._interval=window.setInterval(function(){b=d.map.getCenter().add(d._intervalValueX,d._intervalValueY);d.map.setCenter(b);b=null},30)}},CLASS_NAME:"olleh.Handler.DragMarkerHandler"});olleh.Handler.DistancePath=olleh.Class(olleh.Handler,{point:null,layer:null,drawing:false,mouseDown:false,mouseUp:false,mouseMove:false,lastDown:null,lastUp:null,layerOptions:null,pointImage:null,line:null,mdiv:null,beforePoint:null,distance:0,drawStart:false,activeMeasure:true,firstPoint:false,moving:true,featureArray:[],tempLine:null,tempStyle:{fillColor:"#f11d47",fillOpacity:0.3,strokeColor:"#f11d47",strokeOpacity:0.3,strokeWeight:5,strokeLinecap:"round",strokeDashstyle:"solid"},tempPoint:[],initialize:function(f,e,a,d,b){this.style=d?olleh.Util.extend(d,{}):olleh.Util.extend(Vector.style["default"],{});this.layer=f.layer;olleh.Handler.prototype.initialize.apply(this,arguments);this.distanceID=olleh.Util.createUniqueID("distance_");this.featureArray=new Array()},activate:function(){if(!olleh.Handler.prototype.activate.apply(this,arguments)){return false}var a=olleh.Util.extend({displayInLayerSwitcher:false,calculateInRange:function(){return true}},this.layerOptions);return true},deactivate:function(){if(!olleh.Handler.prototype.deactivate.apply(this,arguments)){return false}this.removeMeasureFeature(this.distanceID);this.layer.removeMeasure(this.distanceID);return true},createFeature:function(d){var f=this.control.map.getCoordFromPixel(d);this.beforePoint=new olleh.maps.Point(f.x,f.y);this.point=new olleh.Vector(new olleh.maps.Point(f.x,f.y),this.style);this.tempPoint=[new olleh.Vector(new olleh.maps.Point(f.x,f.y),this.tempStyle),new olleh.Vector(new olleh.maps.Point(f.x,f.y),this.tempStyle)];this.line=new olleh.Vector(new olleh.Geometry.Polyline([this.point.geometry]),this.style);this.tempLine=new olleh.Vector(new olleh.Geometry.Polyline([this.tempPoint[0].geometry,this.tempPoint[1].geometry]),this.tempStyle);this.pointImage=this.createImagePoint(d,f);this.pointImage.style.opacity=this.tempStyle.strokeOpacity;this.pointImage.setAttribute("name",this.distanceID+"Temp");this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.tempLine],{silent:true});this.featureArray.push(this.point);if(this.mdiv==null){var b="Info";this.mdiv=olleh.Util.createDiv(b);this.mdiv.setAttribute("name",this.distanceID);this.layer.div.appendChild(this.mdiv);this.mdiv.style.zIndex=100}var a="Point";this.sdiv=olleh.Util.createDiv(a);this.sdiv.setAttribute("name",this.distanceID);this.layer.div.appendChild(this.sdiv);this.sdiv.style.left=(d.x-3)+"px";this.sdiv.style.top=(d.y+6)+"px";this.sdiv.style.width="40px";this.sdiv.style.height="24px";var e=olleh.Util.getImagesLocation()+"bt_road_start.png";this.sdiv.innerHTML="";this.layer.addMeasure(f,this.sdiv)},destroyFeature:function(){if(this.layer){this.layer.destroyFeatures()}this.line=null},removeMeasureFeature:function(a){this.layer.removeMeasureFeature(a)},removePoint:function(){if(this.point){this.layer.destroyFeatures([this.point])}},addImagePoint:function(b){var g=this.control.map.getCoordFromPixel(b);this.tempPoint[0].geometry.x=g.x;this.tempPoint[0].geometry.y=g.y;this.point=new olleh.Vector(new olleh.maps.Point(g.x,g.y),this.style);this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length);this.createImagePoint(b,g);this.callback("modify",[this.point.geometry,this.getSketch()]);this.drawFeature();var e=new olleh.maps.Point(g.x,g.y);var d=new Number(e.distanceTo(this.beforePoint));this.distance+=d;this.beforePoint=new olleh.maps.Point(g.x,g.y);if(this.drawStart){var a="Point";this.pdiv=olleh.Util.createDiv(a);this.pdiv.setAttribute("name",this.distanceID);this.pdiv.style.left=(b.x-3)+"px";this.pdiv.style.top=(b.y+6)+"px";var f;if(this.distance>1000){f=(this.distance/1000).toFixed(3)+"Km"}else{f=this.distance.toFixed(3)+"m"}this.pdiv.innerHTML="
"+f+"
";this.layer.div.appendChild(this.pdiv);this.layer.addMeasure(g,this.pdiv)}this.drawStart=true},createImagePoint:function(b,f){var e=olleh.Util.getImagesLocation()+"distance_icon.png";var a="PointImage";var d=olleh.Util.createAlphaImageDiv(a,new olleh.maps.Pixel(b.x-5,b.y-5),new olleh.maps.Size(10,10),e,"absolute");d.setAttribute("name",this.distanceID);this.layer.div.appendChild(d);this.layer.addMeasure(f,d);return d},moveImagePoint:function(a){if(this.point==null||this.point.geometry==null){return}this.pointImage.style.left=(a.x-5)+"px";this.pointImage.style.top=(a.y-5)+"px"},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.featureArray.push(this.point)},drawTempLineFeature:function(a){if(this.point==null||this.point.geometry==null){return}var b=this.control.map.getCoordFromPixel(a);this.tempPoint[1].geometry.x=b.x;this.tempPoint[1].geometry.y=b.y;this.tempPoint[1].geometry.clearBounds();this.layer.drawFeature(this.tempLine,this.tempStyle)},drawDistance:function(a){if(this.point==null||this.point.geometry==null){return}if((a.xy!=null)&&(this.mdiv!=null)){this.mdiv.style.left=(a.xy.x+20)+"px";this.mdiv.style.top=(a.xy.y-20)+"px"}var h=this.control.map.getCoordFromPixel(new olleh.maps.Pixel(a.xy.x,a.xy.y));var g=new olleh.maps.Point(h.x,h.y);var e=new Number(g.distanceTo(this.beforePoint));var b=new Number(this.distance+e);var f="";if(b>1000){this.disString=(b/1000).toFixed(3);f=" Km"}else{this.disString=b.toFixed(3);f=" m"}this.mdiv.style.left=(a.xy.x+10)+"px";this.mdiv.style.top=(a.xy.y)+"px";this.mdiv.style.width="155px";this.mdiv.style.height="50px";var d="
"+"

총거리"+this.disString+""+f+"

"+"
마우스를 더블클릭하면 마침
";this.mdiv.innerHTML=d},getSketch:function(){return this.line},getGeometry:function(){var a=this.line&&this.line.geometry;return a},mousedown:function(a){if(olleh.Event.isRightClick(a)){return true}else{this.mouseUp=false;if(this.activeMeasure){this.map.setCursor("url("+olleh.Util.getImagesLocation()+"distance.cur)");this.mouseDown=true;this.lastDown=a.xy;this.drawing=true;if(!this.mouseUp){this.map.mapControl.defaultMouseDown(a)}return false}else{return true}}},mousemove:function(a){if(this.drawing){if(this.mouseUp){this.map.setCursor("url("+olleh.Util.getImagesLocation()+"distance.cur)");this.drawTempLineFeature(a.xy);this.moveImagePoint(a.xy);this.drawDistance(a)}else{if(this.mouseDown){this.mouseMove=true;this.map.mapControl.defaultMouseMove(a)}}}return true},mouseup:function(a){if(olleh.Event.isRightClick(a)){this.rightclick(a);return true}else{this.mouseDown=false;this.mouseUp=true;this.map.mapControl.defaultMouseUp(a);if(this.drawing){this.drawDistance(a);this.map.setCursor("url("+olleh.Util.getImagesLocation()+"distance.cur)");if(!this.mouseMove){if(this.persist){this.destroyFeature()}if(!this.firstPoint&&this.lastUp==null){this.createFeature(a.xy);this.firstPoint=true}else{if(this.lastUp!=null){this.firstPoint=false}}if(this.lastUp&&this.lastUp.equals(a.xy)){return false}this.addImagePoint(a.xy);this.lastUp=a.xy}else{this.moveImagePoint(a.xy)}this.mouseMove=false;return false}return true}},rightclick:function(a){if(this.activeMeasure){if(this.point==null||this.point.geometry==null){this.drawCancel(false)}else{this.addImagePoint(a.xy);this.drawEventEnd(a.xy)}return false}else{return true}},dblclick:function(a){if(this.activeMeasure){this.drawEventEnd(a.xy);return false}else{return true}},buttonDown:function(a){this.beforePoint=null;this.distance=0;this.disString="";this.drawStart=false;this.control.deactivate();this.mdiv=null;olleh.Event.stop(a)},drawEventEnd:function(a){this.layer.destroyFeatures([this.tempLine]);this.featureArray.push(this.line);this.layer.removeMeasure(this.distanceID+"Temp");this.layer.addMeasureFeature(this.distanceID,this.featureArray);this.layer.div.removeChild(this.pdiv);var g=olleh.Util.getImagesLocation()+"bt_road_close.png";var b="Close";var d=olleh.Util.createAlphaImageDiv(b,new olleh.maps.Pixel(a.x+6,a.y-3),new olleh.maps.Size(18,17),g,"absolute");d.style.cursor="pointer";d.setAttribute("name",this.distanceID);this.layer.div.appendChild(d);var j=this.layer.map.getCoordFromPixel(a);this.layer.addMeasure(j,d);olleh.Event.observe(d,"mousedown",olleh.Function.bindAsEventListener(this.buttonDown,d));d.control=this.control;d.beforePoint=this.beforePoint;d.distance=this.distance;d.disString=this.disString;d.drawStart=this.drawStart;d.mdiv=this.mdiv;this.mdiv.style.left=(a.x+6)+"px";this.mdiv.style.top=(a.y+17)+"px";var h;var f="";if(this.distance>1000){h=(this.distance/1000).toFixed(3);f=" Km"}else{h=this.distance.toFixed(3);f=" m"}var e="
"+"

총거리"+h+""+f+"

";this.mdiv.innerHTML=e;this.layer.addMeasure(j,this.mdiv);this.layer.map.setCursor("default");this.finalizeMeasure();this.activeMeasure=false;this.layer.map.removeControl(this.control);this.layer.map.drawControl=null},drawCancel:function(a){this.layer.map.setCursor("default");this.activeMeasure=false;this.finalizeMeasure();if(this.line){this.layer.destroyFeatures([this.line]);this.layer.destroyFeatures([this.tempLine]);this.layer.removeMeasure(this.distanceID);this.layer.removeMeasure(this.distanceID+"Temp")}this.deactivate();this.layer.map.drawControl=null;return false},finalizeMeasure:function(b){var a=b?"cancel":"end";this.drawing=false;this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.callback(a,[this.getGeometry(),this.style,null])},cancel:function(){this.finalizeMeasure(true)},CLASS_NAME:"olleh.Handler.DistancePath"});olleh.Handler.AreaPolygon=olleh.Class(olleh.Handler,{point:null,layer:null,drawing:false,mouseDown:false,mouseUp:false,mouseMove:false,lastDown:null,lastUp:null,layerOptions:null,areaString:"",areaID:null,pointImage:null,line:null,firstPoint:false,polygon:null,area:0,adiv:null,activeMeasure:true,featureArray:[],initialize:function(f,e,a,d,b){this.style=d?olleh.Util.extend(d,{}):olleh.Util.extend(Vector.style["default"],{});this.layer=f.layer;olleh.Handler.prototype.initialize.apply(this,arguments);this.areaID=olleh.Util.createUniqueID("area_");this.featureArray=new Array()},activate:function(){if(!olleh.Handler.prototype.activate.apply(this,arguments)){return false}var a=olleh.Util.extend({displayInLayerSwitcher:false,calculateInRange:function(){return true}},this.layerOptions);return true},deactivate:function(){if(!olleh.Handler.prototype.deactivate.apply(this,arguments)){return false}this.removeMeasureFeature(this.areaID);this.layer.removeMeasure(this.areaID);return true},createFeature:function(a){var d=this.control.map.getCoordFromPixel(a);this.point=new olleh.Vector(new olleh.maps.Point(d.x,d.y),this.style);this.polygon=new olleh.Vector(new olleh.maps.LinearRing({path:[this.point.geometry]}),this.style);this.pointImage=this.createImagePoint(a,d);this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.polygon],{silent:true});this.featureArray.push(this.point);if(this.adiv==null){var b="Info";this.adiv=olleh.Util.createDiv(b);this.adiv.setAttribute("name",this.areaID);this.layer.div.appendChild(this.adiv);this.adiv.style.zIndex=100}},destroyFeature:function(){if(this.layer){this.layer.destroyFeatures()}this.polygon=null},removeMeasureFeature:function(a){this.layer.removeMeasureFeature(a)},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);this.featureArray.push(this.point)},getSketch:function(){return this.polygon},getGeometry:function(){var a=null;if(this.polygon){a=this.polygon.geometry}return a},rightclick:function(a){if(this.activeMeasure){if(this.polygon==null||this.polygon.geometry==null){this.drawCancel(false)}else{this.addImagePoint(a.xy);this.drawEventEnd(a.xy)}return false}else{return true}},dblclick:function(a){if(this.activeMeasure){this.drawEventEnd(a.xy);return false}else{return true}},buttonDown:function(a){this.control.deactivate();olleh.Event.stop(a)},modifyImageFeature:function(a){if(this.point==null||this.point.geometry==null){return}var b=this.control.map.getCoordFromPixel(a);this.point.geometry.x=b.x;this.point.geometry.y=b.y;this.callback("modify",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.drawFeature()},addImagePoint:function(a){var b=this.control.map.getCoordFromPixel(a);this.point=new olleh.Vector(new olleh.maps.Point(b.x,b.y),this.style);this.polygon.geometry.addComponent(this.point.geometry,this.polygon.geometry.components.length);this.createImagePoint(a,b);this.callback("modify",[this.point.geometry,this.getSketch()]);this.drawFeature()},createImagePoint:function(b,f){var e=olleh.Util.getImagesLocation()+"area_icon.png";var a="PointImage";var d=olleh.Util.createAlphaImageDiv(a,new olleh.maps.Pixel(b.x-5,b.y-5),new olleh.maps.Size(10,10),e,"absolute");d.setAttribute("name",this.areaID);this.layer.div.appendChild(d);this.layer.addMeasure(f,d);return d},moveImagePoint:function(a){if(this.point==null||this.point.geometry==null){return}this.pointImage.style.left=(a.x-5)+"px";this.pointImage.style.top=(a.y-5)+"px"},showInfo:function(b){if(this.point==null||this.point.geometry==null){return}if(this.adiv.style==null){return}this.adiv.style.left=(b.x+10)+"px";this.adiv.style.top=(b.y)+"px";this.adiv.style.width="122px";this.adiv.style.height="30px";var a="
마우스를 더블클릭하면 마침
";this.adiv.innerHTML=a},mousedown:function(a){if(olleh.Event.isRightClick(a)){return true}else{this.mouseUp=false;if(this.activeMeasure){this.map.setCursor("url("+olleh.Util.getImagesLocation()+"area.cur)");this.mouseDown=true;this.lastDown=a.xy;this.drawing=true;if(!this.mouseUp){this.map.mapControl.defaultMouseDown(a)}return false}else{return true}}},mousemove:function(a){if(this.drawing){if(this.mouseUp){this.map.setCursor("url("+olleh.Util.getImagesLocation()+"area.cur)");this.modifyImageFeature(a.xy);this.moveImagePoint(a.xy);this.showInfo(a.xy)}else{if(this.mouseDown){this.mouseMove=true;this.map.mapControl.defaultMouseMove(a)}}}return true},mouseup:function(a){if(olleh.Event.isRightClick(a)){this.rightclick(a);return true}else{this.mouseDown=false;this.mouseUp=true;this.map.mapControl.defaultMouseUp(a);if(this.drawing){this.showInfo(a.xy);this.map.setCursor("url("+olleh.Util.getImagesLocation()+"area.cur)");if(!this.mouseMove){if(!this.firstPoint&&this.lastUp==null){this.createFeature(a.xy);this.firstPoint=true}else{if(this.lastUp!=null){this.firstPoint=false}}if(this.lastUp&&this.lastUp.equals(a.xy)){return false}this.addImagePoint(a.xy);this.lastUp=a.xy}this.mouseMove=false;return false}return true}},drawEventEnd:function(b){this.featureArray.push(this.polygon);this.layer.addMeasureFeature(this.areaID,this.featureArray);var g=olleh.Util.getImagesLocation()+"bt_road_close2.png";var d="Close";var e=olleh.Util.createAlphaImageDiv(d,new olleh.maps.Pixel(b.x+6,b.y-3),new olleh.maps.Size(18,17),g,"absolute");e.style.cursor="pointer";e.setAttribute("name",this.areaID);this.layer.div.appendChild(e);var h=this.layer.map.getCoordFromPixel(b);this.layer.addMeasure(h,e);olleh.Event.observe(e,"mousedown",olleh.Function.bindAsEventListener(this.buttonDown,e));e.control=this.control;this.adiv.style.left=(b.x+6)+"px";this.adiv.style.top=(b.y+17)+"px";this.adiv.style.width="155px";this.adiv.style.height="25px";var f=" ㎡";this.area=Math.abs(this.getGeometry().getArea());this.areaString=(this.area).toFixed(0);var a="
"+"

총면적"+this.areaString+""+f+"

";this.adiv.innerHTML=a;this.layer.addMeasure(h,this.adiv);this.layer.map.setCursor("default");this.activeMeasure=false;this.finalizeMeasure();this.layer.map.removeControl(this.control);this.layer.map.drawControl=null},drawCancel:function(a){this.layer.map.setCursor("default");this.activeMeasure=false;this.finalizeMeasure();if(this.polygon){this.layer.destroyFeatures([this.polygon]);this.layer.removeMeasure(this.areaID)}this.deactivate();this.layer.map.drawControl=null;return false},finalizeMeasure:function(b){var a=b?"cancel":"end";this.drawing=false;this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.callback(a,[this.getGeometry(),this.style,null])},geometryClone:function(){var a=this.getGeometry();return a&&a.clone()},cancel:function(){this.finalizeMeasure(true)},CLASS_NAME:"olleh.Handler.AreaPolygon"});olleh.Control=olleh.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"],controlSize:new olleh.maps.Size(0,0),controlPadding:5,controlLeft:0,controlBottom:0,controlRight:0,controlTop:0,initialize:function(a){this.displayClass=this.CLASS_NAME.replace("olleh.","k").replace(/\./g,"");olleh.Util.extend(this,a);this.events=new olleh.maps.Events(this,null,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}if(this.id==null){this.id=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 a in this.handlers){if(this.handlers.hasOwnProperty(a)&&typeof this.handlers[a].destroy=="function"){this.handlers[a].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}},setMap:function(a){this.map=a;if(this.handler){this.handler.setMap(a)}},initPosition:function(){if(this.div){var a=new olleh.maps.Size(this.map.getCurrentSize().w,this.map.getCurrentSize().h);switch(this.controlPosition){case olleh.maps.ControlPosition.BOTTOM:this.div.style.left=a.w/2-this.controlSize.w/2+this.controlLeft+"px";this.div.style.bottom=this.controlBottom+this.controlPadding+"px";this.div.style.right=null;this.div.style.top=null;break;case olleh.maps.ControlPosition.BOTTOM_LEFT:this.div.style.left=this.controlLeft+this.controlPadding+"px";this.div.style.bottom=this.controlBottom+this.controlPadding+"px";this.div.style.right=null;this.div.style.top=null;break;case olleh.maps.ControlPosition.BOTTOM_RIGHT:this.div.style.right=this.controlRight+this.controlPadding+"px";this.div.style.bottom=this.controlBottom+this.controlPadding+"px";this.div.style.left=null;this.div.style.top=null;break;case olleh.maps.ControlPosition.LEFT:this.div.style.left=this.controlLeft+this.controlPadding+"px";this.div.style.top=a.h/2-this.controlSize.h/2+this.controlTop+"px";this.div.style.right=null;this.div.style.bottom=null;break;case olleh.maps.ControlPosition.RIGHT:this.div.style.right=this.controlRight+this.controlPadding+"px";this.div.style.top=a.h/2-this.controlSize.h/2+this.controlTop+"px";this.div.style.left=null;this.div.style.bottom=null;break;case olleh.maps.ControlPosition.TOP:this.div.style.left=a.w/2-this.controlSize.w/2+this.controlLeft+"px";this.div.style.top=this.controlTop+this.controlPadding+"px";this.div.style.right=null;this.div.style.bottom=null;break;case olleh.maps.ControlPosition.TOP_LEFT:this.div.style.left=this.controlLeft+this.controlPadding+"px";this.div.style.top=this.controlTop+this.controlPadding+"px";this.div.style.right=null;this.div.style.bottom=null;break;case olleh.maps.ControlPosition.TOP_RIGHT:this.div.style.right=this.controlRight+this.controlPadding+"px";this.div.style.top=this.controlTop+this.controlPadding+"px";this.div.style.left=null;this.div.style.bottom=null;break}this.div.style.width=this.controlSize.w+"px";this.div.style.height=this.controlSize.h+"px"}},draw:function(){if(this.div==null){this.div=olleh.Util.createDiv(this.id);this.div.className=this.displayClass;if(!this.allowSelection){this.div.className+=" KMapControlNoSelect";this.div.setAttribute("unselectable","on",0);this.div.onselectstart=function(){return(false)}}if(this.title!=""){this.div.title=this.title}this.div.style.display="none"}return this.div},moveTo:function(a){if((a!=null)&&(this.div!=null)){this.div.style.left=a.x+"px";this.div.style.top=a.y+"px"}},activate:function(){if(this.active){return false}if(this.handler){this.handler.activate()}this.active=true;if(this.map){olleh.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("activate");return true},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()}this.active=false;if(this.map){olleh.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("deactivate");return true}return false},cancel:function(){if(this.active){if(this.handler){this.handler.cancel()}this.active=false}},drawCancel:function(a){return this.handler.drawCancel(a)},CLASS_NAME:"olleh.Control"});olleh.Control.TYPE_BUTTON=1;olleh.Control.TYPE_TOGGLE=2;olleh.Control.TYPE_TOOL=3;olleh.MouseControl=olleh.Class(olleh.Control,{element:null,performedDrag:false,wheelObserver:null,isEventUse:true,wheelUp_timer:null,clickCheckDownPoint:null,initialize:function(){olleh.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map.events.unregister("mousemove",this,this.redraw);if(this.handler){this.handler.destroy()}this.handler=null;this.removeDefaultEvent();olleh.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);olleh.Event.stopObserving(window,"mousewheel",this.wheelObserver);olleh.Event.stopObserving(document,"mousewheel",this.wheelObserver);this.wheelObserver=null;olleh.Control.prototype.destroy.apply(this,arguments)},removeWheelObserving:function(){olleh.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);olleh.Event.stopObserving(window,"mousewheel",this.wheelObserver);olleh.Event.stopObserving(document,"mousewheel",this.wheelObserver);this.wheelObserver=null},removeDefaultEvent:function(){this.map.events.un({"click":this.defaultClick,"dblclick":this.defaultDblClick,"mousedown":this.defaultMouseDown,"mouseup":this.defaultMouseUp,"mousemove":this.defaultMouseMove,"mouseout":this.defaultMouseOut,"mouseover":this.defaultMouseOver,scope:this});this.isEventUse=false},addDefaultEvent:function(){this.map.events.on({"click":this.defaultClick,"dblclick":this.defaultDblClick,"mousedown":this.defaultMouseDown,"mouseup":this.defaultMouseUp,"mousemove":this.defaultMouseMove,"mouseout":this.defaultMouseOut,"mouseover":this.defaultMouseOver,scope:this});this.isEventUse=true},changeWheelObserving:function(a){this.wheelObserver=olleh.Function.bindAsEventListener(this.onWheelEvent,this);olleh.Event.observe(window,"DOMMouseScroll",this.wheelObserver,a);olleh.Event.observe(window,"mousewheel",this.wheelObserver,a);olleh.Event.observe(document,"mousewheel",this.wheelObserver,a)},setMap:function(a){olleh.Control.prototype.setMap.apply(this,arguments);this.addDefaultEvent();this.registerWheelEvents()},draw:function(){olleh.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div}return this.div},redraw:function(a){var b;if(a==null){b=new olleh.maps.Coord(0,0)}else{if(this.lastXy==null||Math.abs(a.xy.x-this.lastXy.x)>this.granularity||Math.abs(a.xy.y-this.lastXy.y)>this.granularity){this.lastXy=a.xy;return}b=this.map.getCoordFromPixel(a.xy);if(!b){return}this.lastXy=a.xy}},registerWheelEvents:function(){this.wheelObserver=olleh.Function.bindAsEventListener(this.onWheelEvent,this);olleh.Event.observe(window,"DOMMouseScroll",this.wheelObserver);olleh.Event.observe(window,"mousewheel",this.wheelObserver);olleh.Event.observe(document,"mousewheel",this.wheelObserver)},defaultClick:function(b){if(olleh.Event.isLeftClick(b)){if(this.clickCheckDownPoint&&b.xy&&this.clickCheckDownPoint.equals(b.xy)){var a=!this.performedDrag;this.performedDrag=false;this.clickCheckDownPoint=null;return true}else{this.clickCheckDownPoint=null;return false}}return},defaultDblClick:function(b){if(!this.map.disableDoubleClickZoom){var d=this.map.getZoom()+1;if(!this.map.isValidZoomLevel(d)){d=this.map.getZoom()}var a=this.map.getCoordFromViewPortPx(b.xy);this.map.moveTo(a,d)}return true},defaultMouseDown:function(a){this.clickCheckDownPoint=a.xy.clone();if(!olleh.Event.isLeftClick(a)){return}this.mouseDragStart=a.xy.clone();this.map.setCursor(this.map.draggingCursor);this.performedDrag=false;if(a.shiftKey){this.map.div.style.cursor="crosshair";this.zoomBox=olleh.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.opacity="0.3";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE["ZoomBox"];this.map.viewPortDiv.appendChild(this.zoomBox)}document.onselectstart=function(){return false};olleh.Event.stop(a)},defaultMouseMove:function(f){this.mousePosition=f.xy?f.xy.clone():this.map?this.map.events.getMousePosition(f):null;if(this.map.draggable){if(this.mouseDragStart!=null){var e=this.mouseDragStart.x-f.xy.x;var b=this.mouseDragStart.y-f.xy.y;if(!this.performedDrag&&(e!=0||b!=0)){this.performedDrag=true;this.map.isMovingDisplayFeaturesHandler(false)}if(this.performedDrag){if(this.zoomBox){e=Math.abs(e);b=Math.abs(b);this.zoomBox.style.width=Math.max(1,e)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(f.xy.x
';this.wheelUpBoxAction(this.element)},wheelDownBox:function(a){if(a!=null){this.div.style.top=(a.xy.y-60)+"px";this.div.style.left=(a.xy.x-80)+"px"}olleh.Element.posShow(this.element);this.element.innerHTML='
';this.wheelDownBoxAction(this.element)},wheelUpBoxAction:function(b){var d=this;var a=true;this.wheelDown_timer&&window.clearInterval(this.wheelDown_timer);this.wheelUp_timer&&window.clearInterval(this.wheelUp_timer);this.wheelUp_timer=null;this.wheelDown_timer=null;olleh.Element.setSize(b,"60px","45px");this.wheelUp_timer=window.setInterval(function(){var e=olleh.Element.getSize(b);if(a){a=false;d.map.isMovingDisplayFeaturesHandler(true)}if(e.width<160){olleh.Element.setWidth(b,(e.width+6)+"px");olleh.Element.setLeft(b,(parseInt(b.style.left.replace("px",""))-3)+"px");olleh.Element.setHeight(b,(e.height+4)+"px");olleh.Element.setTop(b,(parseInt(b.style.top.replace("px",""))-2)+"px")}else{if(e.width>=160){olleh.Element.posHide(b);window.clearInterval(d.wheelUp_timer);d.wheelUp_timer=null;d.map.isMovingDisplayFeaturesHandler(true)}}},30)},wheelDownBoxAction:function(b){var d=this;var a=true;this.wheelUp_timer&&window.clearInterval(this.wheelUp_timer);this.wheelDown_timer&&window.clearInterval(this.wheelDown_timer);this.wheelUp_timer=null;this.wheelDown_timer=null;olleh.Element.setSize(b,"160px","120px");this.wheelDown_timer=window.setInterval(function(){var e=olleh.Element.getSize(b);if(a){a=false;d.map.isMovingDisplayFeaturesHandler(true)}if(e.width>60){olleh.Element.setWidth(b,(e.width-6)+"px");olleh.Element.setLeft(b,(parseInt(b.style.left.replace("px",""))+3)+"px");olleh.Element.setHeight(b,(e.height-4)+"px");olleh.Element.setTop(b,(parseInt(b.style.top.replace("px",""))+2)+"px")}else{if(e.width<=60){olleh.Element.posHide(b);window.clearInterval(d.wheelDown_timer);d.wheelUp_timer=null}}},30)},zoomBoxEnd:function(b){if(this.mouseDragStart!=null){if(Math.abs(this.mouseDragStart.x-b.xy.x)>5||Math.abs(this.mouseDragStart.y-b.xy.y)>5){var j=this.map.getCoordFromViewPortPx(this.mouseDragStart);var a=this.map.getCoordFromViewPortPx(b.xy);var h=Math.max(j.y,a.y);var d=Math.min(j.y,a.y);var g=Math.min(j.x,a.x);var e=Math.max(j.x,a.x);var f=new olleh.maps.Bounds(g,d,e,h);this.map.setBounds(f)}else{var a=this.map.getCoordFromViewPortPx(b.xy);this.map.setCenter(new olleh.maps.Coord((a.x),(a.y)),this.map.getZoom()+1)}this.removeZoomBox()}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null},onWheelEvent:function(d){var b=false;var a=olleh.Event.element(d);while(a!=null){if(this.map&&a==this.map.div){b=true;break}a=a.parentNode}if(b){var f=0;if(!d){d=window.event}if(d.wheelDelta){f=d.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){f=-f}}else{if(d.detail){f=-d.detail/3}}if(f){d.xy=this.mousePosition;if(f<0){f=-1;this.defaultWheelDown(d,f)}else{f=1;this.defaultWheelUp(d,f)}}olleh.Event.stop(d)}},wheelChange:function(j,d){var l=new Number(this.map.getZoom());var o=new Number(d);var g=new Number(l+o);if(!this.map.isValidZoomLevel(g)){return}var m=this.map.getSize();var f=m.w/2-j.xy.x;var e=j.xy.y-m.h/2;var h=this.map.baseLayer.getResolutionForZoom(g);var a=this.map.getCoordFromPixel(j.xy);var b=new olleh.maps.Coord(a.x+f*h,a.y+e*h);this.map.setCenter(b,g)},CLASS_NAME:"olleh.MouseControl"});olleh.TouchControl=olleh.Class(olleh.Control,{element:null,performedDrag:false,isEventUse:true,touchXY:null,oldCenter:null,initialize:function(){olleh.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map.events.unregister("touchmove",this,this.redraw);if(this.handler){this.handler.destroy()}this.handler=null;this.touchXY=null;this.removeDefaultEvent();olleh.Control.prototype.destroy.apply(this,arguments)},removeDefaultEvent:function(){this.map.events.un({"touchstart":this.defaultTouchstart,"touchend":this.defaultTouchend,"touchmove":this.defaultTouchmove,"touchcancel":this.defaultTouchcancel,scope:this});this.isEventUse=false},addDefaultEvent:function(){this.map.events.on({"touchstart":this.defaultTouchstart,"touchend":this.defaultTouchend,"touchmove":this.defaultTouchmove,"touchcancel":this.defaultTouchcancel,scope:this});this.isEventUse=true},setMap:function(a){olleh.Control.prototype.setMap.apply(this,arguments)},draw:function(){olleh.Control.prototype.draw.apply(this,arguments);this.addDefaultEvent();if(!this.element){this.div.left="";this.div.top="";this.element=this.div}return this.div},redraw:function(a){var b;if(a==null){b=new Coord(0,0)}else{if(this.lastXy==null||Math.abs(a.xy.x-this.lastXy.x)>this.granularity||Math.abs(a.xy.y-this.lastXy.y)>this.granularity){this.lastXy=a.xy;return}b=this.map.getCoordFromPixel(a.xy);if(!b){return}this.lastXy=a.xy}},defaultTouchstart:function(a){this.oldCenter=this.map.getCenter();this.performedDrag=false;this.touchDrag=false;if(a.touches.length==1){this.touchXY=a.xy;this.touchDragStart=new olleh.maps.Pixel(a.touches[0].pageX,a.touches[0].pageY);olleh.Event.stop(a)}else{if(a.touches.length>1){this.touchXY=null;var d=new olleh.maps.Pixel(a.touches[0].pageX,a.touches[0].pageY);var b=new olleh.maps.Pixel(a.touches[1].pageX,a.touches[1].pageY);this.multiTouchDis1=Math.sqrt(Math.pow(b.x-d.x,2)+Math.pow(b.y-d.y,2));this.multiTouchDis2=0}}return true},defaultTouchmove:function(f){if(this.map.draggable){if(f.touches.length==1){this.touchPosition=new olleh.maps.Pixel(f.touches[0].pageX,f.touches[0].pageY);if(this.touchDragStart!=null){var e=this.touchDragStart.x-this.touchPosition.x;var b=this.touchDragStart.y-this.touchPosition.y;var g=this.map.getSize();var a=new olleh.maps.Pixel(g.w/2+e,g.h/2+b);var d=this.map.getCoordFromViewPortPx(a);this.map.setCenter(d,null,true);if(!this.performedDrag&&!this.touchDragStart.equals(this.touchPosition)){this.performedDrag=true;this.map.isMovingDisplayFeaturesHandler(false)}this.touchDragStart=this.touchPosition}}else{if(f.touches.length>1){var j=new olleh.maps.Pixel(f.touches[0].pageX,f.touches[0].pageY);var h=new olleh.maps.Pixel(f.touches[1].pageX,f.touches[1].pageY);this.multiTouchDis2=Math.sqrt(Math.pow(h.x-j.x,2)+Math.pow(h.y-j.y,2));if(!this.touchDrag){this.touchDrag=true;this.map.isMovingDisplayFeaturesHandler(false)}return false}}return true}},defaultTouchend:function(a){if(this.touchDrag){if(this.multiTouchDis2!=0&&(this.multiTouchDis1-this.multiTouchDis2)>20){if(this.map.getZoom()-1>=0){this.map.setCenter(this.oldCenter,this.map.getZoom()-1)}}else{if(this.multiTouchDis2!=0&&(this.multiTouchDis1-this.multiTouchDis2)<-20){if(this.map.getNumZoomLevels()>=this.map.getZoom()+1){this.map.setCenter(this.oldCenter,this.map.getZoom()+1)}}}this.multiTouchDis2=null;this.multiTouchDis1=null;this.touchDragStart=null}else{if(this.performedDrag){this.map.setCenter(this.map.center);this.touchDragStart=null}else{if(a.object&&a.object.CLASS_NAME!="olleh.Vector"&&a.object.events){if(this.touchXY){a.xy=this.touchXY;a.object.events.triggerEvent("click",a)}}}}this.map.isMovingDisplayFeaturesHandler(true);return true},defaultTouchcancel:function(a){this.touchDragStart=null;this.multiTouchDis2=null;this.multiTouchDis1=null},CLASS_NAME:"olleh.TouchControl"});olleh.KeyboardControl=olleh.Class(olleh.Control,{autoActivate:true,slideFactor:200,initialize:function(){olleh.Control.prototype.initialize.apply(this,arguments);this.handler=new olleh.Handler.Keyboard(this,{"keydown":this.defaultKeyPress})},draw:function(){},defaultKeyPress:function(a){switch(a.keyCode){case olleh.Event.KEY_LEFT:this.map.panBy(-this.slideFactor,0);break;case olleh.Event.KEY_RIGHT:this.map.panBy(this.slideFactor,0);break;case olleh.Event.KEY_UP:this.map.panBy(0,-this.slideFactor);break;case olleh.Event.KEY_DOWN:this.map.panBy(0,this.slideFactor);break;case 33:var b=this.map.getSize();this.map.panBy(0,-0.75*b.h);break;case 34:var b=this.map.getSize();this.map.panBy(0,0.75*b.h);break;case 35:var b=this.map.getSize();this.map.panBy(0.75*b.w,0);break;case 36:var b=this.map.getSize();this.map.panBy(-0.75*b.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:"olleh.KeyboardControl"});olleh.ScaleControl=olleh.Class(olleh.Control,{maxWidth:50,topOutUnits:"km",topInUnits:"m",eTop:null,eBottom:null,controlSize:new olleh.maps.Size(102,50),style:olleh.maps.ScaleControlStyle.DEFAULT,controlPosition:olleh.maps.ControlPosition.BOTTOM_RIGHT,initialize:function(a){olleh.Control.prototype.initialize.apply(this,[a])},setOptions:function(a){if(a){this.style=a.style?a.style:this.style;this.controlPosition=a.position?a.position:this.controlPosition}},setPosition:function(a){if(this.div!=null){this.div.style.left=a.x;this.div.style.top=a.y}},setDisplay:function(a){if(this.div!=null){this.div.style.display=a?"":"none"}},initPosition:function(){if(this.map.mapTypeControl){if(this.map.mapTypeController.controlPosition==this.controlPosition){this.controlTop=this.map.mapTypeController.controlSize.h+this.controlPadding;this.controlBottom=this.map.mapTypeController.controlSize.h+this.controlPadding;if(this.controlPosition=="LEFT"||this.controlPosition=="RIGHT"){this.controlTop+=this.controlSize.h/2-this.map.mapTypeController.controlSize.h/2}}else{this.controlTop=0;this.controlBottom=0}}if(this.map.zoomControl){if(this.map.zoomController.controlPosition==this.controlPosition){this.controlTop+=this.map.zoomController.controlSize.h+this.controlPadding;this.controlBottom+=this.map.zoomController.controlSize.h+this.controlPadding}}else{if(this.map.panControl){if(this.map.panController.controlPosition==this.controlPosition){this.controlTop+=this.map.panController.controlSize.h+this.controlPadding;this.controlBottom+=this.map.panController.controlSize.h+this.controlPadding}}}if(this.map.copyrightControl){if(this.map.copyrightController.controlPosition==this.controlPosition){this.controlTop+=this.map.copyrightController.controlSize.h+this.controlPadding;this.controlBottom+=this.map.copyrightController.controlSize.h+this.controlPadding}}olleh.Control.prototype.initPosition.apply(this,arguments)},redraw:function(){this.draw()},draw:function(){olleh.Control.prototype.draw.apply(this,arguments);this.initPosition();if(!this.eTop){this.div.style.position="absolute";this.div.style.width=this.controlSize.w+"px";this.div.style.height=this.controlSize.h+"px";this.eTop=document.createElement("div");this.eTop.className=this.displayClass+"Top";var a=this.topInUnits.length;this.div.appendChild(this.eTop);this.eTop.style.position="relative";this.eTop.style.textAlign="right";this.eTop.style.right="5%";this.eTop.style.top="15%";this.eTop.style.color="black";this.eTop.style.fontSize="12px";this.eTop.style.fontWeight="bolder";if((this.topOutUnits=="")||(this.topInUnits=="")){this.eTop.style.visibility="hidden"}else{this.eTop.style.visibility="visible"}this.eBottom=olleh.Util.createDiv("scale",null,new olleh.maps.Size(102,30));this.eBottom.className="ScaleImg";this.eBottom.style.zIndex=this.div.style.zIndex;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(b){var e=parseInt(Math.log(b)/Math.log(10));var a=Math.pow(10,e);var d=parseInt(b/a);var f;if(d>5){f=5}else{if(d>2){f=2}else{f=1}}return f*a},update:function(){var e=this.map.getResolution();if(!e){return}var g=this.map.units;var h=olleh.INCHES_PER_UNIT;var f=this.maxWidth*e*h[g];var d;if(f>100000){d=this.topOutUnits}else{d=this.topInUnits}var b=f/h[d];var a=b.toFixed(0);if(this.eTop.style.visibility=="visible"){this.eTop.innerHTML=""+a+" "+d}},CLASS_NAME:"olleh.ScaleControl"});olleh.DrawControl=olleh.Class(olleh.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],featureAdded:function(){},handlerOptions:null,type:"",initialize:function(b,f,a,e,d,h){this.type=d;this.EVENT_TYPES=olleh.DrawControl.prototype.EVENT_TYPES.concat(olleh.Control.prototype.EVENT_TYPES);olleh.Control.prototype.initialize.apply(this,[a]);this.callbacks=olleh.Util.extend({done:function(m,l,j){this.draw(m,l,j)},end:function(){if(h!=null){h.call()}}},this.callbacks);this.layer=b;var g=this.layer.styleMap&&this.layer.styleMap.styles.temporary;if(g){this.handlerOptions=this.handlerOptions||{};this.handlerOptions.layerOptions=olleh.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new olleh.StyleMap({"default":g})})}this.handler=new f(this,this.callbacks,this.handlerOptions,e,d)},draw:function(f,d,b){var a=new olleh.Vector(f,d);var e=this.layer.events.triggerEvent("sketchcomplete",{feature:a});if(e!==false){a.state=olleh.State.INSERT;this.layer.addFeatures([a]);this.featureAdded(a);this.events.triggerEvent("featureadded",{feature:a})}},CLASS_NAME:"olleh.DrawControl"});olleh.MapTypeControl=olleh.Class(olleh.Control,{state:olleh.maps.MapTypeId.BASEMAP,divEvents:null,buttons:[],position:null,allowSelection:true,centered:null,mapTypeIds:[olleh.maps.MapTypeId.BASEMAP,olleh.maps.MapTypeId.AIRPHOTO,olleh.maps.MapTypeId.HYBRID,olleh.maps.MapTypeId.CADASTRAL,olleh.maps.MapTypeId.ECOMAP],style:olleh.maps.MapTypeControlStyle.DEFAULT,controlPosition:olleh.maps.ControlPosition.TOP_LEFT,controlSize:new olleh.maps.Size(260,27),initialize:function(a){this.position=new olleh.maps.Pixel(olleh.MapTypeControl.X,olleh.MapTypeControl.Y);olleh.Control.prototype.initialize.apply(this,arguments)},setOptions:function(a){if(a){this.mapTypeIds=a.mapTypeIds?a.mapTypeIds:this.mapTypeIds;this.style=a.style?a.style:this.style;this.controlPosition=a.position?a.position:this.controlPosition}},setPosition:function(a){if(this.div!=null){this.div.style.left=a.x;this.div.style.top=a.y}},setDisplay:function(a){if(this.div!=null){this.div.style.display=a?"":"none"}},getDisplay:function(){if(this.div!=null){return this.div.style.display}return false},destroy:function(){olleh.Control.prototype.destroy.apply(this,arguments);this.removeButtons();this.buttons=null;this.position=null},setMap:function(a){olleh.Control.prototype.setMap.apply(this,arguments)},draw:function(){olleh.Control.prototype.draw.apply(this,arguments);this.initPosition();switch(this.style){case olleh.maps.MapTypeControlStyle.DEFAULT:return this.drawDefault();break;case olleh.maps.MapTypeControlStyle.DROPDOWN_MENU:return this.drawDropdownMenu();break;case olleh.maps.MapTypeControlStyle.HORIZONTAL_BAR:return this.drawHorizontalBar();break}},initPosition:function(){var a=this.mapTypeIds.length;if(this.style==olleh.maps.MapTypeControlStyle.DROPDOWN_MENU){a=1}else{if(this.style==olleh.maps.MapTypeControlStyle.DEFAULT){a=3}}if(this.style==olleh.maps.MapTypeControlStyle.DEFAULT){this.controlSize=new olleh.maps.Size(a*52+11+4,27)}else{if(this.style==olleh.maps.MapTypeControlStyle.DROPDOWN_MENU){this.controlSize=new olleh.maps.Size(89,27)}else{if(this.style==olleh.maps.MapTypeControlStyle.HORIZONTAL_BAR){this.controlSize=new olleh.maps.Size(a*74+4,27)}}}if(this.map.copyrightControl){if(this.map.copyrightController.controlPosition==this.controlPosition){this.controlTop=this.map.copyrightController.controlSize.h+this.controlPadding;this.controlBottom=this.map.copyrightController.controlSize.h+this.controlPadding}else{this.controlTop=0;this.controlBottom=0}}else{this.controlTop=0;this.controlBottom=0}olleh.Control.prototype.initPosition.apply(this,arguments)},drawHorizontalBar:function(){this.buttons=new Array(this.mapTypeIds.length);var b=new olleh.maps.Pixel(0,0);for(var a=0;a=0;--a){if(this.buttons[a]){this.removeMapTypeButton(this.buttons[a])}}},buttonMouseDown:function(a){if(!olleh.Event.isLeftClick(a)){return}this.control.buttonDown(this.action,a)},buttonTouchDown:function(a){this.control.buttonDown(this.action,a)},buttonDown:function(b,a){switch(b){case olleh.maps.MapTypeId.BASEMAP:this.state=olleh.maps.MapTypeId.BASEMAP;this.map.setMapType(olleh.maps.MapTypeId.BASEMAP);break;case olleh.maps.MapTypeId.AIRPHOTO:this.state=olleh.maps.MapTypeId.AIRPHOTO;this.map.setMapType(olleh.maps.MapTypeId.AIRPHOTO);break;case olleh.maps.MapTypeId.ECOMAP:this.state=olleh.maps.MapTypeId.ECOMAP;this.map.setMapType(olleh.maps.MapTypeId.ECOMAP);break;case olleh.maps.MapTypeId.HYBRID:this.state=olleh.maps.MapTypeId.HYBRID;this.map.setMapType(olleh.maps.MapTypeId.HYBRID);break;case olleh.maps.MapTypeId.CADASTRAL:this.state=olleh.maps.MapTypeId.CADASTRAL;this.map.setMapType(olleh.maps.MapTypeId.CADASTRAL);break;default:this.map.getLayer(b).setVisibility(!this.map.getLayer(b).getVisibility());break}olleh.Event.stop(a)},CLASS_NAME:"olleh.MapTypeControl"});olleh.MapTypeControl.X=0;olleh.MapTypeControl.Y=0;olleh.CopyrightControl=olleh.Class(olleh.Control,{copyrightContents:"지도 데이터 © KT",controlPosition:olleh.maps.ControlPosition.BOTTOM_LEFT,controlSize:new olleh.maps.Size(150,11),initialize:function(a){olleh.Control.prototype.initialize.apply(this,arguments)},setPosition:function(a){if(this.div!=null){this.div.style.left=a.x;this.div.style.top=a.y}},setOptions:function(a){if(a){this.controlPosition=a.position?a.position:this.controlPosition}},setDisplay:function(a){if(this.div!=null){this.div.style.display=a?"":"none"}},destroy:function(){olleh.Control.prototype.destroy.apply(this,arguments)},setMap:function(a){olleh.Control.prototype.setMap.apply(this,arguments)},initPosition:function(){olleh.Control.prototype.initPosition.apply(this,arguments)},redraw:function(){this.draw()},draw:function(){olleh.Control.prototype.draw.apply(this,arguments);this.initPosition();this.div.style.width=this.controlSize.w+"px";this.div.style.height=this.controlSize.h+"px";this.div.style.color="black";this.div.style.fontSize="12px";this.div.style.fontWeight="bolder";this.div.innerHTML=this.copyrightContents;return this.div},CLASS_NAME:"olleh.CopyrightControl"});olleh.PanControl=olleh.Class(olleh.Control,{slideFactor:100,slideRatio:null,buttons:[],allowSelection:true,controlPosition:olleh.maps.ControlPosition.TOP_RIGHT,controlSize:new olleh.maps.Size(60,66),initialize:function(a){olleh.Control.prototype.initialize.apply(this,arguments)},setPosition:function(a){if(this.div!=null){this.div.style.left=a.x;this.div.style.top=a.y}},setOptions:function(a){if(a){this.controlPosition=a.position?a.position:this.controlPosition}},setDisplay:function(a){if(this.div!=null){this.div.style.display=a?"":"none"}},destroy:function(){olleh.Control.prototype.destroy.apply(this,arguments);this.removeButtons();this.buttons=null;this.position=null},redraw:function(){if(this.div!=null){this.removeButtons()}this.draw()},setMap:function(a){olleh.Control.prototype.setMap.apply(this,arguments)},initPosition:function(){if(this.map.mapTypeControl){if(this.map.mapTypeController.controlPosition==this.controlPosition){this.controlTop=this.map.mapTypeController.controlSize.h+this.controlPadding;this.controlBottom=this.map.mapTypeController.controlSize.h+this.controlPadding;if(this.controlPosition=="LEFT"||this.controlPosition=="RIGHT"){this.controlTop+=this.controlSize.h/2-this.map.mapTypeController.controlSize.h/2}}else{this.controlTop=0;this.controlBottom=0}}else{this.controlTop=0;this.controlBottom=0}if(this.map.zoomControl){if(this.map.zoomController.controlPosition==this.controlPosition){this.controlLeft=this.map.zoomController.controlSize.w+this.controlPadding;this.controlRight=this.map.zoomController.controlSize.w+this.controlPadding}else{this.controlLeft=0;this.controlRight=0}}else{this.controlLeft=0;this.controlRight=0}if(this.map.copyrightControl){if(this.map.copyrightController.controlPosition==this.controlPosition){this.controlTop+=this.map.copyrightController.controlSize.h+this.controlPadding;this.controlBottom+=this.map.copyrightController.controlSize.h+this.controlPadding}}olleh.Control.prototype.initPosition.apply(this,arguments)},draw:function(){olleh.Control.prototype.draw.apply(this,arguments);this.initPosition();this.buttons=[];var a=new olleh.maps.Pixel(0,6);this.addPanImg("blank","maptype/bg_obiquecontrol.png",a,new olleh.maps.Size(60,60));this.addPanImg("blank","maptype/btn_n.png",a.add(24,-4),new olleh.maps.Size(12,12));this.addPanImg("panup","maptype/btn_north.png",a.add(23,10),new olleh.maps.Size(15,12));this.addPanImg("panleft","maptype/btn_west.png",a.add(10,22),new olleh.maps.Size(12,15));this.addPanImg("panright","maptype/btn_east.png",a.add(38,22),new olleh.maps.Size(12,15));this.addPanImg("pandown","maptype/btn_south.png",a.add(23,37),new olleh.maps.Size(15,12));return this.div},addPanImg:function(a,e,l,h){var g=olleh.Util.getImagesLocation()+e;var b=document.createElement("img");b.style.left=l.x+"px";b.style.top=l.y+"px";b.style.width=h.w+"px";b.style.height=h.h+"px";b.src=g;b.style.position="absolute";b.style.cursor="pointer";this.div.appendChild(b);if(olleh.Browser_Mobile){olleh.Event.observe(b,"touchstart",olleh.Function.bindAsEventListener(this.buttonTouchDown,b))}else{olleh.Event.observe(b,"mousedown",olleh.Function.bindAsEventListener(this.buttonMouseDown,b));olleh.Event.observe(b,"dblclick",olleh.Function.bindAsEventListener(this.doubleClick,b));olleh.Event.observe(b,"click",olleh.Function.bindAsEventListener(this.doubleClick,b))}b.action=a;b.control=this;b.map=this.map;if(!this.slideRatio){var d=this.slideFactor;var f=function(){return d}}else{var j=this.slideRatio;var f=function(m){return this.map.getSize()[m]*j}}b.control.getSlideFactor=f;this.buttons.push(b);return b},removeButton:function(a){olleh.Event.stopObservingElement(a);a.map=null;this.div.removeChild(a);olleh.Util.removeItem(this.buttons,a)},removeButtons:function(){for(var a=this.buttons.length-1;a>=0;--a){this.removeButton(this.buttons[a])}},doubleClick:function(a){olleh.Event.stop(a);return false},buttonMouseDown:function(a){if(!olleh.Event.isLeftClick(a)){return}this.control.buttonDown(this.action,a)},buttonTouchDown:function(a){this.control.buttonDown(this.action,a)},buttonDown:function(b,a){switch(b){case"panup":this.map.panBy(0,-this.getSlideFactor("h"));break;case"pandown":this.map.panBy(0,this.getSlideFactor("h"));break;case"panleft":this.map.panBy(-this.getSlideFactor("w"),0);break;case"panright":this.map.panBy(this.getSlideFactor("w"),0);break}olleh.Event.stop(a)},CLASS_NAME:"olleh.PanControl"});olleh.ZoomControl=olleh.Class(olleh.Control,{zoomStopWidth:31,zoomStopHeight:9,slideStart:12,slider:null,sliderEvents:null,zoomBarDiv:null,zoomBarInfoDiv:null,infoEvents:null,divEvents:null,buttons:null,position:null,allowSelection:true,style:olleh.maps.ZoomControlStyle.DEFAULT,controlPosition:olleh.maps.ControlPosition.TOP_RIGHT,controlSize:new olleh.maps.Size(55,189),zoombarSize:new olleh.maps.Size(26,137),zoombarInfoSize:new olleh.maps.Size(29,114),initialize:function(a){this.position=new olleh.maps.Pixel(olleh.ZoomControl.X,olleh.ZoomControl.Y);olleh.Control.prototype.initialize.apply(this,arguments)},setPosition:function(a){if(this.div!=null){this.div.style.left=a.x;this.div.style.top=a.y}},setOptions:function(a){if(a){this.controlPosition=a.position?a.position:this.controlPosition;this.style=a.style?a.style:this.style}},setDisplay:function(a){if(this.div!=null){this.div.style.display=a?"":"none"}},destroy:function(){olleh.Control.prototype.destroy.apply(this,arguments);this.removeButtons();this.buttons=null;this.position=null},redraw:function(){if(this.div!=null){this.removeButtons();if(this.zoombarDiv){this.removeZoomBar()}}this.draw()},setMap:function(a){olleh.Control.prototype.setMap.apply(this,arguments)},initPosition:function(){if(this.map.mapTypeControl){if(this.map.mapTypeController.controlPosition==this.controlPosition){this.controlTop=this.map.mapTypeController.controlSize.h+this.controlPadding;this.controlBottom=this.map.mapTypeController.controlSize.h+this.controlPadding;if(this.controlPosition=="LEFT"||this.controlPosition=="RIGHT"){this.controlTop+=this.controlSize.h/2-this.map.mapTypeController.controlSize.h/2}}else{this.controlTop=0;this.controlBottom=0}}else{this.controlTop=0;this.controlBottom=0}if(this.map.copyrightControl){if(this.map.copyrightController.controlPosition==this.controlPosition){this.controlTop+=this.map.copyrightController.controlSize.h+this.controlPadding;this.controlBottom+=this.map.copyrightController.controlSize.h+this.controlPadding}}olleh.Control.prototype.initPosition.apply(this,arguments)},draw:function(){olleh.Control.prototype.draw.apply(this,arguments);switch(this.style){case olleh.maps.ZoomControlStyle.DEFAULT:case olleh.maps.ZoomControlStyle.LARGE:this.controlSize=new olleh.maps.Size(55,189),this.initPosition();this.buttons=[];var a=new olleh.maps.Pixel(0,0);this.addZoomBarInfo(a);this.addZoomBar(a);this.addButton("zoomin","maptype/zoom_plus.png",a.add(29,0),new olleh.maps.Size(26,26));this.addButton("zoomout","maptype/zoom_minus.png",a.add(29,163),new olleh.maps.Size(26,26));break;case olleh.maps.ZoomControlStyle.SMALL:this.controlSize=new olleh.maps.Size(45,50),this.initPosition();this.buttons=[];var a=new olleh.maps.Pixel(0,0);this.addButton("zoomin","maptype/zoom_plus.png",a.add(12,5),new olleh.maps.Size(20,20));this.addButton("zoomout","maptype/zoom_minus.png",a.add(12,30),new olleh.maps.Size(20,20));break}return this.div},addZoomBarInfo:function(a){var b=olleh.Util.getImagesLocation();var d=olleh.Util.createDiv("MapControl_ZoombarInfo",a.add(0,37.5),this.zoombarInfoSize);this.zoomBarInfoDiv=d;this.zoomBarInfoDiv.style.display="none";a=new olleh.maps.Pixel(0,0);this.addInfoButton(this.zoomBarInfoDiv,"street","maptype/street.png",a.add(0,9),new olleh.maps.Size(29,15));this.addInfoButton(this.zoomBarInfoDiv,"dong","maptype/dong.png",a.add(0,27),new olleh.maps.Size(29,15));this.addInfoButton(this.zoomBarInfoDiv,"sigun","maptype/sigun.png",a.add(0,54),new olleh.maps.Size(29,15));this.addInfoButton(this.zoomBarInfoDiv,"sido","maptype/sido.png",a.add(0,80),new olleh.maps.Size(29,15));this.addInfoButton(this.zoomBarInfoDiv,"country","maptype/country.png",a.add(0,108),new olleh.maps.Size(29,15));this.infoEvents=new olleh.maps.Events(this,this.zoomBarInfoDiv,null,true,{includeXY:true});this.infoEvents.on({"mouseover":this.zoomBarInfoOn,"mouseout":this.zoomBarInfoOff});this.div.appendChild(this.zoomBarInfoDiv)},addZoomBar:function(b){var e=olleh.Util.getImagesLocation();var g=olleh.Util.createDiv("MapControl_Zoombar",b.add(29,26),this.zoombarSize,e+"maptype/zoombar.png");g.style.cursor="pointer";this.zoombarDiv=g;this.divEvents=new olleh.maps.Events(this,this.zoombarDiv,null,true,{includeXY:true});if(olleh.Browser_Mobile){this.divEvents.on({"touchstart":this.divClick})}else{this.divEvents.on({"click":this.divClick,"mouseover":this.zoomBarInfoOn,"mouseout":this.zoomBarInfoOff})}this.div.appendChild(this.zoombarDiv);this.startTop=parseInt(this.zoombarDiv.style.top);var f="MapControl_Slider";var a=((this.map.getNumZoomLevels()==14?this.map.getNumZoomLevels()-1:this.map.getNumZoomLevels())-this.map.getZoom()-1)*this.zoomStopHeight+this.startTop+this.slideStart;var d=olleh.Util.createAlphaImageDiv(f,b.add(this.zoomStopWidth,a),new olleh.maps.Size(26,15),this.getZoomImageLocation(),"relative");d.style.cursor="pointer";this.slider=d;this.sliderEvents=new olleh.maps.Events(this,this.slider,null,true,{includeXY:true});if(!olleh.Browser_Mobile){this.sliderEvents.on({"mousedown":this.zoomBarDown,"mousemove":this.zoomBarDrag,"mouseup":this.zoomBarUp,"mouseover":this.zoomBarInfoOn,"mouseout":this.zoomBarInfoOff})}this.div.appendChild(this.slider);if(this.map.zoomControl){this.map.events.register("zoomend",this,this.moveZoomBar)}},addInfoButton:function(h,g,a,f,e){var d=olleh.Util.getImagesLocation()+a;var b=olleh.Util.createAlphaImageDiv("MapControl_"+g,f,e,d,"absolute");b.style.cursor="pointer";h.appendChild(b);if(olleh.Browser_Mobile){olleh.Event.observe(b,"touchstart",olleh.Function.bindAsEventListener(this.buttonDown,b))}else{olleh.Event.observe(b,"mousedown",olleh.Function.bindAsEventListener(this.buttonDown,b));olleh.Event.observe(b,"dblclick",olleh.Function.bindAsEventListener(this.doubleClick,b))}b.action=g;b.map=this.map;return h},addButton:function(h,a,g,f){var e=olleh.Util.getImagesLocation()+a;var b=olleh.Util.createAlphaImageDiv("MapControl_"+h,g,f,e,"absolute");b.style.cursor="pointer";this.div.appendChild(b);if(olleh.Browser_Mobile){olleh.Event.observe(b,"touchstart",olleh.Function.bindAsEventListener(this.buttonDown,b))}else{var d=new olleh.maps.Events(this,b,null,true,{includeXY:true});d.on({"mouseover":this.zoomBarInfoOn,"mouseout":this.zoomBarInfoOff});olleh.Event.observe(b,"mousedown",olleh.Function.bindAsEventListener(this.buttonDown,b));olleh.Event.observe(b,"dblclick",olleh.Function.bindAsEventListener(this.doubleClick,b))}b.action=h;b.map=this.map;this.buttons.push(b);return b},removeZoomBar:function(){if(!olleh.Browser_Mobile){this.sliderEvents.un({"mousedown":this.zoomBarDown,"mousemove":this.zoomBarDrag,"mouseup":this.zoomBarUp})}this.sliderEvents.destroy();if(olleh.Browser_Mobile){this.divEvents.un({"touchstart":this.divClick})}else{this.divEvents.un({"click":this.divClick})}this.divEvents.destroy();if(!olleh.Browser_Mobile){this.infoEvents.un({"mouseover":this.zoomBarInfoOn,"mouseout":this.zoomBarInfoOff})}this.infoEvents.destroy();this.div.removeChild(this.zoombarDiv);this.zoombarDiv=null;this.div.removeChild(this.slider);this.slider=null;this.div.removeChild(this.zoomBarInfoDiv);this.zoomBarInfoDiv=null;this.map.events.unregister("zoomend",this,this.moveZoomBar)},passEventToSlider:function(a){this.sliderEvents.handleBrowserEvent(a)},divClick:function(a){var e;if(olleh.Browser_Mobile){e=a.xy.y}else{if(!olleh.Event.isLeftClick(a)){return}e=a.xy.y}var d=(e-this.slideStart-12)/this.zoomStopHeight;var b=(this.map.getNumZoomLevels()-1)-d;if(b>14||b<0){return}b=parseInt(Math.min(Math.max(b,0),this.map.getNumZoomLevels()-1));this.map.setZoom(b);olleh.Event.stop(a)},zoomBarInfoOn:function(a){if(this.zoomBarInfoDiv!=null){this.zoomBarInfoDiv.style.display="block"}},zoomBarInfoOff:function(a){if(this.zoomBarInfoDiv!=null){this.zoomBarInfoDiv.style.display="none"}},zoomBarDown:function(a){if(!olleh.Event.isLeftClick(a)){return}this.map.events.on({"mousemove":this.passEventToSlider,"mouseup":this.passEventToSlider,scope:this});this.mouseDragStart=a.xy.clone();this.zoomStart=a.xy.clone();this.zoombarDiv.offsets=null;olleh.Event.stop(a)},zoomBarDrag:function(b){if(this.mouseDragStart!=null){var a=this.mouseDragStart.y-b.xy.y;var e=olleh.Util.pagePosition(this.zoombarDiv);if((b.clientY-e[1])>6&&(b.clientY-e[1])=0;--a){this.removeButton(this.buttons[a])}},doubleClick:function(a){olleh.Event.stop(a);return false},buttonDown:function(a){switch(this.action){case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break;case"country":this.map.setZoom(0);break;case"sido":this.map.setZoom(3);break;case"sigun":this.map.setZoom(6);break;case"dong":this.map.setZoom(9);break;case"street":this.map.setZoom(11);break}olleh.Event.stop(a)},CLASS_NAME:"olleh.ZoomControl"});olleh.ZoomControl.X=4;olleh.ZoomControl.Y=4;olleh.SelectFeature=olleh.Class(olleh.Control,{EVENT_TYPES:["beforefeaturehighlighted","featurehighlighted","featureunhighlighted"],multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,highlightOnly:false,box:false,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(d,a){this.EVENT_TYPES=olleh.SelectFeature.prototype.EVENT_TYPES.concat(olleh.Control.prototype.EVENT_TYPES);olleh.Control.prototype.initialize.apply(this,[a]);if(this.scope===null){this.scope=this}this.initLayer(d);var b={click:this.clickFeature,clickout:this.clickoutFeature};if(this.hover){b.over=this.overFeature;b.out=this.outFeature}this.callbacks=olleh.Util.extend(b,this.callbacks);this.handlers={feature:new olleh.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})};if(this.box){this.handlers.box=new olleh.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"})}},initLayer:function(a){if(olleh.Util.isArray(a)){this.layers=a;this.layer=new olleh.maps.VectorLayer.RootContainer(this.id+"_container",{layers:a})}else{this.layer=a}},destroy:function(){if(this.active&&this.layers){this.map.removeLayer(this.layer)}olleh.Control.prototype.destroy.apply(this,arguments);if(this.layers){this.layer.destroy()}},activate:function(){if(!this.active){this.handlers.feature.activate();if(this.box&&this.handlers.box){this.handlers.box.activate()}}return olleh.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){this.handlers.feature.deactivate();if(this.handlers.box){this.handlers.box.deactivate()}}return olleh.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(b){var g=this.layers||[this.layer];var f,e;for(var a=0;a=0;--d){e=f.selectedFeatures[d];if(!b||b.except!=e){this.unselect(e)}}}},clickFeature:function(a){if(!this.hover){var b=(olleh.Util.indexOf(a.layer.selectedFeatures,a)>-1);if(b){if(this.toggleSelect()){this.unselect(a)}else{if(!this.multipleSelect()){this.unselectAll({except:a})}}}else{if(!this.multipleSelect()){this.unselectAll({except:a})}this.select(a)}}},multipleSelect:function(){return this.multiple||(this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey])},toggleSelect:function(){return this.toggle||(this.handlers.feature.evt&&this.handlers.feature.evt[this.toggleKey])},clickoutFeature:function(a){if(!this.hover&&this.clickout){this.unselectAll()}},overFeature:function(b){var a=b.layer;if(this.hover){if(this.highlightOnly){this.highlight(b)}else{if(olleh.Util.indexOf(a.selectedFeatures,b)==-1){this.select(b)}}}},outFeature:function(a){if(this.hover){if(this.highlightOnly){if(a._lastHighlighter==this.id){if(a._prevHighlighter&&a._prevHighlighter!=this.id){delete a._lastHighlighter;var b=this.map.getControl(a._prevHighlighter);if(b){b.highlight(a)}}else{this.unhighlight(a)}}}else{this.unselect(a)}}},highlight:function(d){var b=d.layer;var a=this.events.triggerEvent("beforefeaturehighlighted",{feature:d});if(a!==false){d._prevHighlighter=d._lastHighlighter;d._lastHighlighter=this.id;var e=this.selectStyle||this.renderIntent;b.drawFeature(d,e);this.events.triggerEvent("featurehighlighted",{feature:d})}},unhighlight:function(b){var a=b.layer;if(b._prevHighlighter==undefined){delete b._lastHighlighter}else{if(b._prevHighlighter==this.id){delete b._prevHighlighter}else{b._lastHighlighter=b._prevHighlighter;delete b._prevHighlighter}}a.drawFeature(b,b.style||b.layer.style||"default");this.events.triggerEvent("featureunhighlighted",{feature:b})},select:function(d){var a=this.onBeforeSelect.call(this.scope,d);var b=d.layer;if(a!==false){a=b.events.triggerEvent("beforefeatureselected",{feature:d});if(a!==false){b.selectedFeatures.push(d);this.highlight(d);if(!this.handlers.feature.lastFeature){this.handlers.feature.lastFeature=b.selectedFeatures[0]}b.events.triggerEvent("selected",{feature:d});this.onSelect.call(this.scope,d)}}},unselect:function(b){var a=b.layer;this.unhighlight(b);olleh.Util.removeItem(a.selectedFeatures,b);a.events.triggerEvent("unselected",{feature:b});this.onUnselect.call(this.scope,b)},selectBox:function(f){if(f instanceof olleh.maps.Bounds){var j=this.map.getLonLatFromPixel(new Oolleh.maps.Pixel(f.left,f.bottom));var o=this.map.getLonLatFromPixel(new olleh.maps.Pixel(f.right,f.top));var a=new olleh.maps.Bounds(j.lon,j.lat,o.lon,o.lat);if(!this.multipleSelect()){this.unselectAll()}var m=this.multiple;this.multiple=true;var e=this.layers||[this.layer];var g;for(var b=0;b-1){if(a.toGeometry().intersects(p.geometry)){if(olleh.Util.indexOf(g.selectedFeatures,p)==-1){this.select(p)}}}}}this.multiple=m}},setMap:function(a){this.handlers.feature.setMap(a);if(this.box){this.handlers.box.setMap(a)}olleh.Control.prototype.setMap.apply(this,arguments)},setLayer:function(b){var a=this.active;this.unselectAll();this.deactivate();if(this.layers){this.layer.destroy();this.layers=null}this.initLayer(b);this.handlers.feature.layer=this.layer;if(a){this.activate()}},CLASS_NAME:"olleh.SelectFeature"});olleh.maps.MapTypeRegistry=olleh.Class({map:null,mapTypeIds:[],mapTypeControl:null,mapTypeArray:[],initialize:function(a){if(a){this.map=a;this.mapTypeControl=this.map.getControl("olleh.MapTypeControl");this.mapTypeIds=this.mapTypeControl.mapTypeIds}else{return}},isAddedMapType:function(b){for(var a=0;a-1)){if(a!=null&&(a=0;--a){d=this.removeComponent(b[a])||d}return d},removeComponent:function(a){olleh.Util.removeItem(this.components,a);this.clearBounds();return true},getLength:function(){var d=0;for(var b=0,a=this.components.length;b1)){for(var b=1,a=this.components.length;b1)){var j,h;for(var e=1,a=f.components.length;e2)){olleh.Collection.prototype.removeComponent.apply(this,arguments)}},intersects:function(p){var d=false;var o=p.CLASS_NAME;if(o=="olleh.Geometry.Polyline"||o=="olleh.maps.LinearRing"||o=="olleh.maps.Point"){var u=this.getSortedSegments();var q;if(o=="olleh.maps.Point"){q=[{x1:p.x,y1:p.y,x2:p.x,y2:p.y}]}else{q=p.getSortedSegments()}var z,h,f,a,w,v,e,b;outer:for(var l=0,m=u.length;lf){break}if(v.x2Math.max(a,w)){continue}if(Math.max(e,b)0){var u=w.x10){a.unshift(v,1);Array.prototype.splice.apply(d,a);v+=a.length-2}if(e){for(var u=0,B=l.points.length;u0&&w.length>0){w.push(g.clone());o.push(new olleh.Geometry.Polyline(w))}}else{p=E.splitWith(this,b)}if(d&&d.length>1){f=true}else{d=[]}if(o&&o.length>1){m=true}else{o=[]}if(f||m){if(e){p=[o,d]}else{p=d}}return p},splitWith:function(b,a){return b.split(this,a)},getVertices:function(a){var b;if(a===true){b=[this.components[0],this.components[this.components.length-1]]}else{if(a===false){b=this.components.slice(1,this.components.length-1)}else{b=this.components.slice()}}return b},distanceTo:function(l,h){var m=!(h&&h.edge===false);var H=m&&h&&h.details;var v,f={};var B=Number.POSITIVE_INFINITY;if(l instanceof olleh.maps.Point){var w=this.getSortedSegments();var u=l.x;var r=l.y;var F;for(var D=0,E=w.length;Du&&((r>F.y1&&rF.y2))){break}}}if(H){f={distance:f.distance,x0:f.x,y0:f.y,x1:u,y1:r}}else{f=f.distance}}else{if(l instanceof olleh.Geometry.Polyline){var e=this.getSortedSegments();var d=l.getSortedSegments();var b,a,q,G,g;var p=d.length;var o={point:true};outer:for(var D=0,E=e.length;D4){this.components.pop();olleh.Collection.prototype.removeComponent.apply(this,arguments);var b=this.components[0];olleh.Collection.prototype.addComponent.apply(this,[b])}},move:function(b,e){for(var d=0,a=this.components.length;d2)){var h=0;var g=0;for(var e=0;e2)){var f=0;for(var e=0,d=this.components.length;e2){var j,h;for(var f=0;f=v&&m<=r)||v>=r&&(m<=v&&m>=r)){j=-1;break}}continue}f=z(w(l,v,e,r,b),o);if(f==m){if(e=e&&l<=b)||e>b&&(l<=e&&l>=b)){j=-1;break}}if(f<=m){continue}if(v!=r&&(fMath.max(v,r))){continue}if(e=e&&lb&&(l=b)){++j}}var u=(j==-1)?1:!!(j&1);return u},intersects:function(e){var b=false;if(e.CLASS_NAME=="olleh.maps.Point"){b=this.containsPoint(e)}else{if(e.CLASS_NAME=="olleh.Geometry.Polyline"){b=e.intersects(this)}else{if(e.CLASS_NAME=="olleh.maps.LinearRing"){b=olleh.Geometry.Polyline.prototype.intersects.apply(this,[e])}else{for(var d=0,a=e.components.length;d0)){d+=Math.abs(this.components[0].getArea());for(var b=1,a=this.components.length;b0)){e+=Math.abs(this.components[0].getGeodesicArea(b));for(var d=1,a=this.components.length;d0){d=this.components[0].containsPoint(a);if(d!==1){if(d&&f>1){var e;for(var b=1;b13)?13:a.maxZoom:13},getCaptionPixel:function(e){var a=document.createElement("div");var d=document.createElement("font");a.appendChild(d);document.body.appendChild(a);olleh.Util.modifyDOMElement(a,"ghost",new olleh.maps.Pixel(-900,-100),null,"absolute");d.size=this.fontSize;if(this.fontBold){d.style.fontWeight="bold"}else{d.style.fontWeight=""}d.face=this.fontFace;this.fontDiv.color=this.fontColor;d.innerHTML=e;var b=new olleh.maps.Size(a.clientWidth,a.clientHeight);if(a.clientWidth==null){b=new olleh.maps.Size(a.offsetWidth,a.offsetHeight)}if(olleh.Browser_Name=="msie 9.0"||olleh.Browser_Name=="msie 8.0"){b.w=b.w+1}document.body.removeChild(a);a=null;return b},setMap:function(a){this.map=a},remove:function(){this.erase();this.captionDiv=null;olleh.Util.removeObject(this)},setOptions:function(a){this.setCaptionStyle(a);this.size=this.getCaptionPixel(this.title);this.fontDiv.innerHTML=this.title;this.moveTo(this.px)},setSize:function(a){if(a!=null){this.size=a;olleh.Util.modifyDOMElement(this.captionDiv,null,null,this.size,"absolute")}},getSize:function(){return this.size.clone()},draw:function(a){olleh.Util.modifyDOMElement(this.captionDiv,null,null,this.size,"absolute");this.moveTo(a);return this.captionDiv},moveTo:function(b){if(this.map.getZoom()>=this.minZoom&&this.map.getZoom()<=this.maxZoom){if(this.visibleFlag){this.displayPerLevel(true)}else{this.displayPerLevel(false)}}else{this.displayPerLevel(false)}if(b!=null){this.px=b}if(this.captionDiv!=null){if(this.px==null){this.display(false)}else{var f=null;if(this.anchor){var d=b.offset(this.anchor.oppositeSign());var e=d.offset(new olleh.maps.Pixel(this.imgsize.w/2,this.imgsize.h));if(this.origin){e=d.offset(new olleh.maps.Pixel((this.imgsize.w-this.origin.x)/2,this.imgsize.h-this.origin.y))}var a=new olleh.maps.Pixel(this.size.w/2,0);if(this.position=="TOP"){a=new olleh.maps.Pixel(this.size.w/2,this.imgsize.h+this.size.h)}f=e.offset(a.oppositeSign())}else{var a=new olleh.maps.Pixel(this.size.w/2,0);f=b.offset(a.oppositeSign())}olleh.Util.modifyDOMElement(this.captionDiv,null,f,this.size)}}},display:function(a){this.visibleFlag=a;if(this.map.getZoom()>=this.minZoom&&this.map.getZoom()<=this.maxZoom){this.captionDiv.style.display=(a)?"":"none"}},displayPerLevel:function(a){this.captionDiv.style.display=(a)?"":"none"},isDrawn:function(){var a=(this.captionDiv&&this.captionDiv.parentNode&&(this.captionDiv.parentNode.nodeType!=11));return a},erase:function(){if(this.captionDiv&&this.captionDiv.parentNode){olleh.Element.remove(this.captionDiv)}},clone:function(){return new olleh.maps.MarkerCaption(this.title,size=(this.size)?this.size.clone():null,origin=(this.origin)?this.origin.clone():null,anchor=(this.anchor)?this.anchor.clone():null)},setZIndex:function(a){if(this.captionDiv){this.captionDiv.style.zIndex=a}},CLASS_NAME:"olleh.maps.MarkerCaption"});olleh.maps.GroundOverlay=olleh.Class({id:null,imageDiv:null,px:null,resolution:null,scaledSize:null,events:null,EVENT_TYPES:["click"],url:null,bounds:null,clickable:false,map:null,initialize:function(a,d,b){this.id=olleh.Util.createUniqueID(this.CLASS_NAME+"_");this.url=a;this.bounds=d;this.scaledSize=new olleh.maps.Size(0,0);this.imageDiv=olleh.Util.createAlphaImageDiv(this.id);this.events=new olleh.maps.Events(this,this.imageDiv,this.EVENT_TYPES);if(b){if(b.clickable!==undefined){this.clickable=b.clickable}if(b.map!==undefined){this.setMap(b.map)}}this.events.setEventOn(this.clickable)},removeEventOn:function(){var a=olleh.maps.event.addListener(this,"removeEvent",this.remove);olleh.maps.event.trigger(this,"removeEvent",{"removeEvent":a})},remove:function(a){if(this.events){olleh.maps.event.clearInstanceListeners(this);olleh.Event.stopObservingElement(this.imageDiv);this.events.destroy();this.events=null}if(this.map){this.map.getPanes()[1].removeImage(this);this.map=null}this.imageDiv.innerHTML="";this.imageDiv=null;if(this.infoWindow){this.infoWindow.close();this.infoWindow=null}olleh.Util.removeObject(this)},show:function(){if(this.imageDiv!=null){this.imageDiv.style.display="block"}},hide:function(){if(this.imageDiv!=null){this.imageDiv.style.display="none"}},setOpacity:function(a){olleh.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,a)},setSize:function(a){if(a!=null){this.size=a}this.draw()},setUrl:function(a){if(a!=null){this.url=a}this.draw()},draw:function(a){this.reSize();olleh.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.scaledSize,this.url,"absolute");this.moveTo(a);return this.imageDiv},moveTo:function(a){if(a!=null){this.px=a}if(this.imageDiv!=null){if(this.px==null){this.erase()}else{this.reSize();olleh.Util.modifyAlphaImageDiv(this.imageDiv,null,this.px,this.scaledSize)}}},reSize:function(){this.resolution=this.map.getResolution();this.scaledSize.w=(Math.abs(this.bounds.getWidth()))/this.resolution;this.scaledSize.h=(Math.abs(this.bounds.getHeight()))/this.resolution},isDrawn:function(){var a=(this.imageDiv&&this.imageDiv.parentNode&&(this.imageDiv.parentNode.nodeType!=11));return a},erase:function(){if(this.imageDiv!=null&&this.imageDiv.parentNode!=null){olleh.Element.remove(this.imageDiv)}},setCursor:function(a){if(this.imageDiv&&a){this.imageDiv.style.cursor=a}},onScreen:function(){var b=false;if(this.map){var a=this.map.getBounds();b=a.intersects(this.bounds)}return b},getBounds:function(){return this.bounds},getMap:function(){return this.map},getUrl:function(){return this.url},setMap:function(a){if(a&&a!="null"){this.map=a;this.map.getPanes()[1].addImage(this)}else{if((a==null||a=="null")&&this.map){this.map.getPanes()[1].removeImage(this);if(this.infoWindow){this.infoWindow.close();this.infoWindow=null}this.map=null}}},CLASS_NAME:"olleh.maps.GroundOverlay"});olleh.maps.Marker=olleh.Class(olleh.maps.MVCObject,{infoWin:null,clickable:true,draggable:false,flat:false,visible:true,zIndex:0,icon:null,shadow:null,position:null,map:null,caption:null,captionObj:null,id:null,cursor:"pointer",dragEvent:false,firstShadow:false,animation:null,_interval:null,_dragEvents:null,groupLayer:null,initialize:function(d){this.id=olleh.Util.createUniqueID(this.CLASS_NAME+"_");if(d.icon){var a=typeof d.icon;if(a=="object"){this.icon=d.icon}else{if(a=="string"){var b=olleh.maps.Marker.defaultSize();this.icon=new olleh.maps.MarkerImage(d.icon,b,new olleh.maps.Pixel(0,0),new olleh.maps.Pixel(b.w/2,b.h))}}}else{this.icon=olleh.maps.Marker.defaultIcon();this.firstShadow=false}if(d.caption){this.caption=d.caption;this.captionObj=new olleh.maps.MarkerCaption(d.caption,this.icon.size,this.icon.origin,this.icon.anchor)}if(d.position){this.position=d.position}if(d.animation){this.animation=d.animation}if(d.cursor){this.cursor=d.cursor}if(d.draggable){this.setDraggable(d.draggable)}this.icon.setCursor(this.cursor);olleh.Util.addSetTimeOut(this,"firstInit",d)},firstInit:function(a){if(!a){a={}}if(!this.position){this.position=new olleh.maps.Coord(0,0)}if(a.map&&!this.map&&a.map!="null"&&this.groupLayer==null){this.setMap(a.map)}var d;for(var b in a){d=a[b];if(d===undefined||d===null||d=="null"){continue}switch(b){case"clickable":this.setClickable(a.clickable);break;case"flat":this.setFlat(a.flat);break;case"shape":this.setShape(a.shape);break;case"title":this.setTitle(a.title);break;case"visible":this.setVisible(a.visible);break;case"zIndex":this.setZIndex(a.zIndex);break}}d=null;if(a.shadow){this.setShadow(a.shadow)}else{if(this.firstShadow){this.firstShadow=false;this.setShadow(olleh.maps.Marker.defaultShadow())}}},removeHandler:function(){this.events&&this.events.destroy();this.icon&&this.icon.remove();this.captionObj&&this.captionObj.remove();this.shadow&&this.shadow.remove();this.infoWin&&this.infoWin.close();this.unbindAll();olleh.Util.removeObject(this)},remove:function(){this.map&&this.map.getPanes()[3].removeMarker(this);olleh.Util.addSetTimeOut(this,"removeHandler")},display:function(a){this.icon.display(a);if(this.captionObj){this.captionObj.display(a)}if(this.shadow&&!this.flat){this.shadow.display(a)}},moveTo:function(a){if((a!=null)&&(this.icon!=null)){this.icon.moveTo(a);this.captionObj&&this.captionObj.moveTo(a);this.shadow&&this.shadow.moveTo(a);this.infoWin&&this.infoWin.updateCoord(this.position)}},dragMarker:function(b){if(b&&this.icon){var a=this.map.getLayerPxFromViewPortPx(b);this.moveTo(a);this.setPosition(this.map.getCoordFromPixel(b))}},onScreen:function(){if(this.map&&this.position){return this.map.getBounds().containsCoord(this.position)}return false},resetAnimation:function(){if(this.onScreen()){if(!this._interval){if(this.map&&!this.map.dragMarkerHandler.mouseDown||(this.map.dragMarkerHandler.marker&&this.map.dragMarkerHandler.marker.id!=this.id)){this.setAnimation(this.animation)}}}else{if(this._interval){window.clearInterval(this._interval);this._interval=null}}},setCaption:function(a){if(a==null){if(this.captionObj!=null){this.captionObj.remove();this.captionObj=null;this.caption=null}}else{this.caption=a;if(this.captionObj==null){this.captionObj=new olleh.maps.MarkerCaption(this.caption,this.icon.size,this.icon.origin,this.icon.anchor);this.captionObj.setMap(this.map);if(this.map){var b=this.map.getLayerPxFromCoord(this.position);this.map.getPanes()[3].div.appendChild(this.drawCaption(b))}}else{this.captionObj.setOptions(a)}}},getCaption:function(){return this.caption},setOpacity:function(a){this.icon.setOpacity(a);if(this.shadow!=null){this.shadow.setOpacity(a)}},setUrl:function(a){this.icon.setUrl(a)},setSize:function(a){if(a!=null){this.icon.setSize(a)}},draw:function(a){if(this.map==null){return}return this.drawIcon(a)},drawCaption:function(a){if(this.map==null){return}if(this.captionObj){return this.captionObj.draw(a)}return},drawIcon:function(a){if(this.icon){if(this.animation==olleh.maps.Animation.DROP){a.y=10}return this.icon.draw(a)}else{return null}},getAnimation:function(){return this.animation},playBounce:function(a){var e=this;var d=a.clone();var f=this.shadow?a.clone():null;var b=1;olleh.Util.stopAnimation(e);this._interval=window.setInterval(function(){if(d.y>=a.y||d.y<=a.y-25){b*=-1}d.y+=b;if(f){f.y=d.y;f.x-=b;e.shadow.moveTo(f)}e.icon.moveTo(d)},20)},playDrop:function(l){var h=this;var g=l.clone();var d=h.shadow?l.clone():null;var e=50;var b=1;var j=0;var a=0;var f=parseInt(this.map.layerContainerDiv.style.top.replace("px",""));olleh.Util.stopAnimation(this);g.y=f*-1;if(d){d.y=g.y;d.x=l.x+l.y+Math.abs(f)}this._interval=window.setInterval(function(){if((g.y>l.y||g.y<(l.y-50))&&j<3){if(j>0){b*=-1;j++}if(g.y>l.y){g.y=l.y;if(d){d.y=g.y;d.x=l.x}}}if(g.y>=(l.y-1)&&j==0){j++}if(b>=0){if(j==0){a+=Math.round(0.1*(a+e));g.y+=a;if(l.y>=g.y){h.icon.moveTo(g);if(d){d.y=g.y;d.x-=a;h.shadow.moveTo(d)}}}else{g.y+=0.1*e*b;h.icon.moveTo(g);if(d){d.y=g.y;d.x-=0.1*e*b;h.shadow.moveTo(d)}}}else{g.y+=0.1*e*b;h.icon.moveTo(g);if(d){d.y=g.y;d.x-=0.1*e*b;h.shadow.moveTo(d)}}if(l.y<=g.y&&j>=3){h.icon.moveTo(l);if(d){h.shadow.moveTo(l)}h.animation=null;g=null;d=null;e=null;b=null;j=null;a=null;f=null;olleh.Util.stopAnimation(h);h=null}},10)},setAnimation:function(a){if(this.icon&&a){if(this.visible){switch(a){case olleh.maps.Animation.BOUNCE:this.playBounce(this.map.getLayerPxFromCoord(this.position));break;case olleh.maps.Animation.DROP:this.playDrop(this.map.getLayerPxFromCoord(this.position));break}}else{olleh.Util.stopAnimation(this)}}else{olleh.Util.stopAnimation(this)}if(this.animation!=a){this.animation=a;this.notify("animation")}},drawShadow:function(a){if(this.shadow){if(this.flat){this.shadow.display(false)}else{this.shadow.display(true)}if(this.animation==olleh.maps.Animation.DROP){return this.shadow.draw(new olleh.maps.Pixel(-100,0))}else{return this.shadow.draw(a)}}else{return null}},erase:function(){if(this.icon!=null){this.icon.erase();if(this.captionObj){this.captionObj.erase()}if(this.shadow!=null){this.shadow.erase()}}},isDrawn:function(){return this.icon&&this.icon.isDrawn()},inflate:function(d){if(this.icon){var a=new olleh.maps.Size(this.icon.size.w*d,this.icon.size.h*d);this.icon.setSize(a);if(this.shadow!=null){var b=new olleh.maps.Size(this.shadow.size.w*d,this.shadow.size.h*d);this.shadow.setSize(b)}}},setIconTop:function(){this.icon.setZIndex(10000);if(this.shadow!=null){this.shadow.setZIndex(10000)}},setIconBack:function(){this.icon.setZIndex(this.zIndex);if(this.shadow!=null){this.shadow.setZIndex(this.zIndex)}},dragOnOff:function(a){if(this.dragEvent==a){return}if(a){var b=this;if(olleh.Browser_Mobile){this._dragEvents=olleh.maps.event.addDomListener(this.icon.imageDiv,"touchstart",function(d){if(b.map){b.map.dragMarkerHandler.marker=b;b.map.dragMarkerHandler.touchstart(d)}})}else{this._dragEvents=olleh.maps.event.addDomListener(this.icon.imageDiv,"mousedown",function(d){if(b.map){b.map.dragMarkerHandler.marker=b;b.map.dragMarkerHandler.mousedown(d)}})}this.dragEvent=true}else{if(this._dragEvents){olleh.maps.event.removeDomListener(this._dragEvents);this._dragEvents=null}this.dragEvent=false}this.draggable=a},getClickable:function(){return this.clickable},setClickable:function(a){if(this.clickable===a){return}if(this.events){this.events.setEventOn(a)}this.clickable=a;this.notify("clickable")},getCursor:function(){return this.cursor},setCursor:function(a){if(this.cursor==a){return}if(this.icon){this.icon.setCursor(a)}this.cursor=a;this.notify("cursor")},getDraggable:function(){return this.draggable},setDraggable:function(a){if(this.draggable===a){return}this.dragOnOff(a);this.notify("draggable")},getFlat:function(){return this.flat},setFlat:function(a){if(this.flat===a){return}if(this.shadow){if(a){this.shadow.display(false)}else{this.setShadow(this.shadow);this.shadow.display(true)}}this.flat=a;this.notify("flat")},getIcon:function(){if(this.icon){return this.icon}},setIcon:function(b){if(b){if(this.icon){if(this.icon.equals(b)){return}if(typeof b=="object"){for(var d in b){switch(d){case"url":this.icon.url=b.url;break;case"size":this.icon.size=b.size;break;case"origin":this.icon.origin=b.origin;break;case"anchor":this.icon.anchor=b.anchor;break;case"scaledSize":this.icon.scaledSize=b.scaledSize;break}}}else{if(typeof b=="string"){this.icon.url=b}}if(this.map){var a=this.map.getLayerPxFromCoord(this.position);this.icon.draw(a);if(this.captionObj){this.captionObj.imgsize=this.icon.size;this.captionObj.origin=this.icon.origin;this.captionObj.anchor=this.icon.anchor;this.captionObj.draw(a)}}}else{this.icon=b}this.notify("icon")}},setShadow:function(e){this.firstShadow=false;if(e&&e!=null){if(this.shadow&&this.shadow.equals(e)){return}if(this.map!=null){var a=this.map.getLayerPxFromCoord(this.position);if(this.shadow!=null){for(var b in e){switch(b){case"url":this.shadow.url=e.url;break;case"size":this.shadow.size=e.size;break;case"origin":this.shadow.origin=e.origin;break;case"anchor":this.shadow.anchor=e.anchor;break;case"scaledSize":this.shadow.scaledSize=e.scaledSize;break}}this.shadow.draw(a)}else{this.shadow=e;var d=this.shadow.draw(a);if(d){this.map.getPanes()[2].appendChild(d);if(this.flat){this.shadow.display(false)}}}}else{this.shadow=e}}else{if(this.shadow!=null){this.shadow.remove();this.shadow=e}else{this.shadow=e}}this.notify("shadow")},getMap:function(){return this.map},setMap:function(a){if(a&&a!="null"){if(this.map&&this.map.equals(a)){return}this.map=a;if(this.captionObj){this.captionObj.setMap(a)}this.map.getPanes()[3].addMarker(this);this.notify("map")}else{if((a==null||a=="null")&&this.map){this.unbindAll();this.map.getPanes()[3].removeMarker(this);if(this.infoWin!=null){this.infoWin.close();this.infoWin=null}this.map=null;this.notify("map")}}},setOptions:function(a){for(var b in a){switch(b){case"map":this.setMap(a.map);break;case"icon":this.setIcon(a.icon);break;case"clickable":this.setClickable(a.clickable);break;case"cursor":this.setCursor(a.cursor);break;case"draggable":this.setDraggable(a.draggable);break;case"flat":this.setFlat(a.flat);break;case"position":this.setPosition(a.position);break;case"shadow":this.setShadow(a.shadow);break;case"shape":this.setShape(a.shape);break;case"title":this.setTitle(a.title);break;case"visible":this.setVisible(a.visible);break;case"zIndex":this.setZIndex(a.zIndex);break;case"animation":this.setAnimation(a.animation);break;case"caption":this.setCaption(a.caption);break}}},getPosition:function(){if(this.position){return this.position}},setPosition:function(b){if(!b||(this.position&&this.position.equals(b))){return}if(this.map!=null){var a=this.map.getLayerPxFromCoord(b);olleh.Util.stopAnimation(this);this.moveTo(a)}this.position=b;if(this.map&&!this.map.dragMarkerHandler.mouseDown){this.setAnimation(this.animation)}this.notify("position")},getShadow:function(){return this.shadow},getShape:function(){if(this.shape){return this.shape}},setShape:function(a){if(this.shape==a){return}this.shape=a;this.notify("shape")},getTitle:function(){if(this.title){return this.title}},setTitle:function(a){if(this.title==a){return}if(this.icon){if(a==null||a==""){this.title="";this.icon.setTitle("")}else{this.title=a;this.icon.setTitle(a)}this.notify("title")}},getVisible:function(){return this.visible},setVisible:function(a){if(this.visible===a){return}this.display(a);this.visible=a;var b=this.animation;this.setAnimation(b);this.notify("visible")},getZIndex:function(){if(this.zIndex){return this.zIndex}},setZIndex:function(b){var a=parseInt(b);if(a){if(this.zIndex==a){return}this.zIndex=a;if(this.icon){this.icon.setZIndex(this.zIndex)}if(this.shadow){this.shadow.setZIndex(this.zIndex)}}a=null;this.notify("zindex")},getBounds:function(){if(this.position){return new olleh.maps.Bounds(this.position.x,this.position.y,this.position.x,this.position.y)}return null},CLASS_NAME:"olleh.maps.Marker"});olleh.maps.Marker.defaultSize=function(){return new olleh.maps.Size(21,30)};olleh.maps.Marker.defaultIcon=function(){var a=olleh.maps.Marker.defaultSize();return new olleh.maps.MarkerImage(olleh.Util.getImagesLocation()+"mark01.png",a,new olleh.maps.Pixel(0,0),new olleh.maps.Pixel(a.w/2,a.h),a.clone())};olleh.maps.Marker.defaultShadow=function(){var a=olleh.maps.Marker.defaultSize();return new olleh.maps.MarkerImage(olleh.Util.getImagesLocation()+"mark02.png",a,new olleh.maps.Pixel(0,0),new olleh.maps.Pixel(a.w/2,a.h),a.clone())};olleh.maps.Cluster=olleh.Class({map:null,markerClusterer:null,gridSize:null,minClusterSize:null,averageCenter:null,center:null,markers:null,bounds:null,clusterIcon:null,pane:null,initialize:function(a){this.markerClusterer=a;this.markers=[];this.pane=a.getPane();this.map=a.getMap();this.gridSize=a.getGridSize();this.minClusterSize=a.getMinClusterSize();this.averageCenter=a.getAverageCenter()},isMarkerAlreadyAdded:function(b){if(this.markers.indexOf){return this.markers.indexOf(b)!=-1}else{for(var d=0;d=this.markerClusterer.maxZoom){for(var g=0;g=this.markerClusterer.maxZoom){for(var b=0;b=this.markerClusterer.maxZoom){for(var b=0;bthis.markerClusterer.maxZoom){if(this.clusterIcon){this.clusterIcon.hide()}}}else{if(this.clusterIcon){this.clusterIcon.show(this.center)}}},CLASS_NAME:"olleh.maps.Cluster"});olleh.maps.ClusterIcon=olleh.Class({styles:null,padding:null,cluster:null,center:null,map:null,div:null,sums:null,visible:false,url:null,height:null,width:null,textColor:null,anchor:null,textSize:null,backgroundPosition:null,initialize:function(a,d,b){this.styles=d?d:[];this.padding=b||0;this.cluster=a;this.center=null;this.map=a.getMap();this.sums=null;this.afterAdd()},setCursor:function(a){if(this.div){this.div.style.cursor=a}},triggerClusterClick:function(){var a=this.cluster.getMarkerClusterer();if(a.getZoomOnClick()&&!a.map.mapControl.performedDrag){this.map.setBounds(this.cluster.getBounds())}this.setCursor("pointer")},setAttachCEvent:function(a){if(olleh.Browser_Mobile){olleh.maps.event.addDomListener(this.div,"touchend",function(){a.triggerClusterClick()})}else{olleh.maps.event.addDomListener(this.div,"click",function(){a.triggerClusterClick()});olleh.maps.event.addDomListener(this.div,"mousedown",function(b){a.setCursor("")})}},afterAdd:function(){this.div=document.createElement("DIV");this.cluster.pane.appendChild(this.div);this.setAttachCEvent(this)},getPosFromCoord:function(b){var a=this.map.getLayerPxFromCoord(b);a.x-=parseInt(this.width/2,10);a.y-=parseInt(this.height/2,10);return a},draw:function(){if(this.visible){var a=this.getPosFromCoord(this.center);this.div.style.top=a.y+"px";this.div.style.left=a.x+"px"}},hide:function(){if(this.div){this.div.style.display="none"}this.visible=false},show:function(a){if(this.div){var b=this.getPosFromCoord(this.center||a);this.div.style.top=b.y+"px";this.div.style.left=b.x+"px";this.div.style.display=""}this.visible=true},remove:function(){if(this.div){this.hide();this.div.parentNode&&this.div.parentNode.removeChild(this.div);this.div=null}},destroy:function(){if(this.div){this.div.parentNode&&this.div.parentNode.removeChild(this.div)}olleh.Util.removeObject(this)},afterRemove:function(){if(this.div&&this.div.parentNode){this.hide();this.div.parentNode.removeChild(this.div);this.div=null}},setSums:function(a){this.sums=a;this.text=a.text;this.index=a.index;this.useStyle()},useStyle:function(){var a=Math.max(0,this.sums.index-1);a=Math.min(this.styles.length-1,a);var b=this.styles[a];this.url=b.url;this.height=b.height;this.width=b.width;this.textColor=b.textColor;this.anchor=b.anchor;this.textSize=b.textSize;this.backgroundPosition=b.backgroundPosition;if(this.div){this.div.style.cssText=this.createCss();this.div.innerHTML=this.sums.text}},setCenter:function(a){this.center=a},createCss:function(){var e=[];e.push("background-image:url("+this.url+");");var b=this.backgroundPosition?this.backgroundPosition:"0 0";e.push("background-position:"+b+";");if(typeof this.anchor==="object"){if(typeof this.anchor[0]==="number"&&this.anchor[0]>0&&this.anchor[0]0&&this.anchor[1]0){for(e=0;e0){for(var f=0,b=this.markers.length;f0){for(d=0;d0){for(d=0;d0){for(f=0;f0){for(e=0;e1){a=parseInt((e+f)/2);var b=this.compare(this,d,olleh.Util.getElement(this.order[a]));if(b>0){e=a}else{f=a}}this.order.splice(f,0,g);this.indices[g]=this.getZIndex(d);return this.getNextElement(f)},remove:function(b){var e=b.id;var a=olleh.Util.indexOf(this.order,e);if(a>=0){this.order.splice(a,1);delete this.indices[e];if(this.order.length>0){var d=this.order[this.order.length-1];this.maxZIndex=this.indices[d]}else{this.maxZIndex=0}}},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(a){return(this.indices[a.id]!=null)},getZIndex:function(a){return a._style.graphicZIndex},determineZIndex:function(a){var b=a._style.graphicZIndex;if(b==null){b=this.maxZIndex;a._style.graphicZIndex=b}else{if(b>this.maxZIndex){this.maxZIndex=b}}},getNextElement:function(b){var a=b+1;if(a0){this.vectorRoot.removeChild(this.vectorRoot.firstChild)}}if(this.textRoot){while(this.textRoot.childNodes.length>0){this.textRoot.removeChild(this.textRoot.firstChild)}}if(this.indexer){this.indexer.clear()}},getNodeType:function(b,a){},drawGeometry:function(h,e,g){var d=h.CLASS_NAME;var j=true;if((d=="olleh.Collection")||(d=="olleh.MultiPoint")||(d=="MultiPolyLine")||(d=="MultiPolygon")){for(var b=0,a=h.components.length;b=-this.MAX_PIXEL&&e<=this.MAX_PIXEL&&d>=-this.MAX_PIXEL&&d<=this.MAX_PIXEL)},setExtent:function(b,e){olleh.Renderer.Elements.prototype.setExtent.apply(this,arguments);var a=this.getResolution();var g=-b.left/a;var f=b.top/a;if(e){this.left=g;this.top=f;var d="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",d);this.translate(0,0);return true}else{var h=this.translate(g-this.left,f-this.top);if(!h){this.setExtent(b,true)}return h}},translate:function(a,d){if(!this.inValidRange(a,d,true)){return false}else{var b="";if(a||d){b="translate("+a+","+d+")"}this.root.setAttributeNS(null,"transform",b);this.translationParameters={x:a,y:d};return true}},setSize:function(a){olleh.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(d,b){var a=null;switch(d.CLASS_NAME){case"olleh.maps.Point":if(b.externalGraphic){a="image"}else{if(this.isComplexSymbol(b.graphicName)){a="use"}else{a="circle"}}break;case"olleh.Geometry.Circle":a="circle";break;case"olleh.Geometry.Rectangle":a="rect";break;case"olleh.Geometry.Polyline":a="polyline";break;case"olleh.maps.LinearRing":a="polygon";break;case"olleh.Geometry.Polygon":case"olleh.Curve":case"Surface":a="path";break;default:break}return a},setStyle:function(f,d,q){d=d||f._style;q=q||f._options;var a=parseFloat(f.getAttributeNS(null,"r"));var j=1;var l;if(f._geometryClass=="olleh.maps.Point"&&a){f.style.visibility="";if(d.graphic===false){f.style.visibility="hidden"}else{if(d.externalGraphic){return f}else{if(this.isComplexSymbol(d.graphicName)){var h=radius*3;var p=h*2;var e=this.importSymbol(d.graphicName);var b="#"+e;l=this.getPosition(f);j=this.symbolSize[e]/p;var m=f.parentNode;var g=f.nextSibling;if(m){m.removeChild(f)}f.setAttributeNS(this.xlinkns,"href",b);f.setAttributeNS(null,"width",p);f.setAttributeNS(null,"height",p);f.setAttributeNS(null,"x",l.x-h);f.setAttributeNS(null,"y",l.y-h);if(g){m.insertBefore(f,g)}else{if(m){m.appendChild(f)}}}else{f.setAttributeNS(null,"r",d.radius)}}}if(typeof d.rotation!="undefined"&&l){var o=olleh.String.format("rotate(${0} ${1} ${2})",[d.rotation,l.x,l.y]);f.setAttributeNS(null,"transform",o)}}if(q.isFilled){f.setAttributeNS(null,"fill",d.fillColor);f.setAttributeNS(null,"fill-opacity",d.fillOpacity)}else{f.setAttributeNS(null,"fill","none")}if(q.isStroked){f.setAttributeNS(null,"stroke",d.strokeColor);f.setAttributeNS(null,"stroke-opacity",d.strokeOpacity);f.setAttributeNS(null,"stroke-width",d.strokeWeight*j);f.setAttributeNS(null,"stroke-linecap",d.strokeLinecap);f.setAttributeNS(null,"stroke-linejoin","round");f.setAttributeNS(null,"stroke-dasharray",this.dashStyle(d,j))}else{f.setAttributeNS(null,"stroke","none")}if(d.pointerolleh&&d.pointerolleh.maps.Events){f.setAttributeNS(null,"pointer-events",d.pointerolleh.maps.Events)}if(d.cursor!=null){f.setAttributeNS(null,"cursor",d.cursor)}return f},dashStyle:function(d,b){var a=d.strokeWeight*b;switch(d.strokeDashstyle){case"solid":return"none";case"dot":return[1,4*a].join();case"dash":return[4*a,4*a].join();case"dashdot":return[4*a,4*a,1,4*a].join();case"longdash":return[8*a,4*a].join();case"longdashdot":return[8*a,4*a,1,4*a].join();default:return d.strokeDashstyle.replace(/ /g,",")}},createNode:function(a,d){var b=document.createElementNS(this.xmlns,a);if(d){b.setAttributeNS(null,"id",d)}return b},nodeTypeCompare:function(b,a){return(a==b.nodeName)},createRenderRoot:function(){return this.createNode("svg",this.container.id+"_svgRoot")},createRoot:function(a){return this.createNode("g",this.container.id+a)},createDefs:function(){var a=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(a);return a},drawPoint:function(e,f){var d=this.getResolution();var b=Math.round(f.x/d+this.left);var g=Math.round(this.top-f.y/d);var a=Math.round(f.radius);if(this.inValidRange(b,g)){e.setAttributeNS(null,"cx",b);e.setAttributeNS(null,"cy",g);e.setAttributeNS(null,"r",a);return e}else{return false}},drawCircle:function(e,f){var d=this.getResolution();var b=Math.round(f.center.x/d+this.left);var g=Math.round(this.top-f.center.y/d);var a=Math.round(f.radius/d);if(this.inValidRange(b,g)){e.setAttributeNS(null,"cx",b);e.setAttributeNS(null,"cy",g);e.setAttributeNS(null,"r",a);return e}else{return false}},drawPolyLine:function(b,d){if(d.components.length<=0){return}var a=this.getComponentsString(d.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawLinearRing:function(b,d){if(d.components.length<=0){return}var a=this.getComponentsString(d.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawPolygon:function(b,l){if(l.components.length<=0){return}var h="";var m=true;var a=true;var e,o;for(var f=0,g=l.components.length;f0){if(l!=o[(o.length-1)]){o.push(l)}}else{o.push(l)}}else{if(d>0){if(this.getShortString(f[d-1])){if(l!=f[d-1]){o.push(this.clipLine(f[d],f[d-1]))}}}if(db){h=(l-m)/(d-e);d=d<0?-b:b;l=m+(d-e)*h}if(l<-a||l>a){h=(d-e)/(l-m);l=l<0?-a:a;d=e+(l-m)*h}return d+","+l},getShortString:function(b){var d=this.getResolution();var a=Math.round(b.x/d+this.left);var e=Math.round(this.top-b.y/d);if(this.inValidRange(a,e)){return a+","+e}else{return false}},getPosition:function(a){return({x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))})},importSymbol:function(f){if(!this.defs){this.defs=this.createDefs()}var b=this.container.id+"-"+f;if(document.getElementById(b)!=null){return b}var e=olleh.Renderer.symbol[f];if(!e){throw new Error(f+" is not a valid symbol name");return}var h=this.nodeFactory(b,"symbol");var d=this.nodeFactory(null,"polygon");h.appendChild(d);var p=new olleh.maps.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var m="";var l,j;for(var g=0;g=16777216){this.hitOverflow=e-16777215;e=e%16777216+1}var b="000000"+e.toString(16);var a=b.length;b="#"+b.substring(a-6,a);return b},setHitContextStyle:function(b,e,a){var d=this.featureIdToHex(e);if(b=="fill"){this.hitContext.globalAlpha=1;this.hitContext.fillStyle=d}else{if(b=="stroke"){this.hitContext.globalAlpha=1;this.hitContext.strokeStyle=d;this.hitContext.lineWidth=a.strokeWidth+2}else{this.hitContext.globalAlpha=0;this.hitContext.lineWidth=1}}},drawPoint:function(e,a,d){if(a.graphic!==false){if(!a.externalGraphic){var b=this.getLocalXY(e);if(a.fill!==false){this.setCanvasStyle("fill",a);this.canvas.beginPath();this.canvas.arc(b.x,b.y,e.radius,0,this.mathTwoPi,true);this.canvas.fill();if(this.hitDetection){this.setHitContextStyle("fill",d,a);this.hitContext.beginPath();this.hitContext.arc(b.x,b.y,e.radius,0,this.mathTwoPi,true);this.hitContext.fill()}}if(a.stroke!==false){this.setCanvasStyle("stroke",a);this.canvas.beginPath();this.canvas.arc(b.x,b.y,e.radius,0,this.mathTwoPi,true);this.canvas.stroke();if(this.hitDetection){this.setHitContextStyle("stroke",d,a);this.hitContext.beginPath();this.hitContext.arc(b.x,b.y,e.radius,0,this.mathTwoPi,true);this.hitContext.stroke()}}this.setCanvasStyle("reset")}}},drawPolyLine:function(d,a,b){if(d.components.length<=0){return}if(a.stroke!==false){this.setCanvasStyle("stroke",a);this.renderPath(this.canvas,d,a,b,"stroke");if(this.hitDetection){this.setHitContextStyle("stroke",b,a);this.renderPath(this.hitContext,d,a,b,"stroke")}this.setCanvasStyle("reset")}},renderPath:function(d,l,a,e,j){var g=l.components;d.beginPath();var b=this.getLocalXY(g[0]);if(!isNaN(b.x)&&!isNaN(b.y)){d.moveTo(b.x,b.y);for(var f=1,m=null,h=g.length;f=2*b[1]){return"longdash"}return(b[0]==1||b[1]==1)?"dot":"dash"}else{if(b.length==4){return(1*b[0]>=2*b[1])?"longdashdot":"dashdot"}}return"solid"}},createNode:function(a,d){var b=document.createElement(a);if(d){b.id=d}b.unselectable="on";b.onselectstart=function(){return(false)};return b},nodeTypeCompare:function(d,b){var e=b;var a=e.indexOf(":");if(a!=-1){e=e.substr(a+1)}var f=d.nodeName;a=f.indexOf(":");if(a!=-1){f=f.substr(a+1)}return(e==f)},createRenderRoot:function(){return this.createNode("div",this.container.id+"_vmlRoot")},createRoot:function(a){return this.createNode("kv:group",this.container.id+a)},drawPoint:function(e,f){if(!isNaN(f.x)&&!isNaN(f.y)){var b=this.getResolution();var a=f.radius;e.style.left=Math.round((f.x/b-this.offset.x).toFixed()-a)+"px";e.style.top=Math.round((f.y/b-this.offset.y).toFixed()-a)+"px";var d=a*2;e.style.width=d+"px";e.style.height=d+"px";return e}return false},drawCircle:function(e,h){if(!isNaN(h.center.x)&&!isNaN(h.center.y)){var b=this.getResolution();var a=Math.round(h.radius/b);var g=Math.round((h.center.x/b-this.offset.x)).toFixed();var f=Math.round((h.center.y/b-this.offset.y)).toFixed();e.style.left=(g-a)+"px";e.style.top=(f-a)+"px";var d=a*2;e.style.width=d+"px";e.style.height=d+"px";return e}return false},drawPolyLine:function(a,b){return this.drawLine(a,b,false)},drawLinearRing:function(a,b){return this.drawLine(a,b,true)},drawLine:function(f,u,o){if(u.components.length<=0){return}this.setNodeDimension(f,u);var l=new Array();var b=u.components.length;var d=this.map.getBounds();var e=d.scale(3);for(var m=0,q,v,r,h=this.getResolution(),g="",p="",a=null;m0){j.bottom=j.bottom-h;j.top=j.top+h}else{j.left=j.left-h;j.right=j.right+h}a={path:l,size:j.getWidth(),left:j.left,bottom:j.bottom};this.symbolCache[b]=a;return a},CLASS_NAME:"olleh.Renderer.VML"});olleh.Renderer.VML.LABEL_SHIFT={"l":0,"c":0.5,"r":1,"t":0,"m":0.5,"b":1};olleh.maps.VectorLayer=olleh.Class(olleh.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","selected","unselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","sketchstarted","sketchmodified","refresh"],isBaseLayer:false,isVector:true,features:null,selectedFeatures:null,unrenderedFeatures:null,style:null,styleMap:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,drawn:false,selectFeatureActive:false,initialize:function(b,a){this.EVENT_TYPES=olleh.maps.VectorLayer.prototype.EVENT_TYPES.concat(olleh.Layer.prototype.EVENT_TYPES);olleh.Layer.prototype.initialize.apply(this,arguments);if(b=="olleh_Pane0"){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 olleh.StyleMap()}this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};this.events.includeXY=true},removeLayer:function(){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.drawn=false;olleh.Layer.prototype.destroy.apply(this,arguments)},refresh:function(a){if(this.calculateInRange()&&this.visibility){this.events.triggerEvent("refresh",a)}},assignRenderer:function(){for(var d=0,a=this.renderers.length;d0){this.setSelectFeaures()}if(h){this.events.triggerEvent("featureadded",{feature:j});this.onFeatureInsert(j)}}if(h){this.events.triggerEvent("featuresadded",{features:e})}},removeFeatures:function(f,a){if(!f||f.length===0){return}if(f===this.features){return this.removeAllFeatures(a)}if(!(olleh.Util.isArray(f))){f=[f]}if(f===this.selectedFeatures){f=f.slice()}var e=!a||!a.silent;if(e){this.events.triggerEvent("beforefeaturesremoved",{features:f})}for(var d=f.length-1;d>=0;d--){if(d!=0&&f[d-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var b=f[d];delete this.unrenderedFeatures[b.id];if(e){this.events.triggerEvent("beforefeatureremoved",{feature:b})}this.features=olleh.Util.removeItem(this.features,b);b.layer=null;if(b.geometry){this.renderer.eraseFeatures(b)}if(olleh.Util.indexOf(this.selectedFeatures,b)!=-1){olleh.Util.removeItem(this.selectedFeatures,b)}if(e){this.events.triggerEvent("featureremoved",{feature:b})}}if(e){this.events.triggerEvent("featuresremoved",{features:f})}if(this.selectFeatureActive&&this.features.length==0){this.unSelectFeaures()}},removeAllFeatures:function(a){var e=!a||!a.silent;var f=this.features;if(e){this.events.triggerEvent("beforefeaturesremoved",{features:f})}var d;for(var b=f.length-1;b>=0;b--){d=f[b];if(e){this.events.triggerEvent("beforefeatureremoved",{feature:d})}d.layer=null;if(e){this.events.triggerEvent("featureremoved",{feature:d})}}this.renderer.clear();this.features=[];this.unrenderedFeatures={};this.selectedFeatures=[];if(e){this.events.triggerEvent("featuresremoved",{features:f})}if(this.selectFeatureActive&&this.features.length==0){this.unSelectFeaures()}},destroyFeatures:function(e,a){var d=(e==undefined);if(d){e=this.features}if(e){this.removeFeatures(e,a);for(var b=e.length-1;b>=0;b--){e[b].destroy()}}},destroyMeasureFeatures:function(d,a){if(d){this.removeFeatures(d,a);for(var b=d.length-1;b>=0;b--){d[b].destroy()}}},drawFeature:function(a,b){if(!this.drawn){return}if(typeof b!="object"){if(!b&&a.state===olleh.State.DELETE){b="delete"}var d=b||a.renderIntent;b=a.style||this.style;if(!b){b=this.styleMap.createSymbolizer(a,d)}}if(!this.renderer.drawFeature(a,b)){this.unrenderedFeatures[a.id]=a}else{delete this.unrenderedFeatures[a.id]}},eraseFeatures:function(a){this.renderer.eraseFeatures(a)},getFeatureFromEvent:function(a){if(!this.renderer){return null}return this.renderer.getFeatureIdFromEvent(a)},getFeatureBy:function(e,d){var b=null;for(var a=this.features.length-1;a>=0;a--){if(this.features[a][e]==d){b=this.features[a];break}}return b},getFeatureById:function(a){return this.getFeatureBy("id",a)},getFeatureByFid:function(a){return this.getFeatureBy("fid",a)},getFeaturesByAttribute:function(d,e){var b,a,f=[];for(b=this.features.length-1;b>=0;b--){a=this.features[b];if(a&&a.attributes){if(a.attributes[d]===e){f.push(a)}}}return f},onFeatureInsert:function(a){},preFeatureInsert:function(a){},getBounds:function(){return this.getDataExtent()},getDataExtent:function(){var b=null;var e=this.features;if(e&&(e.length>0)){b=new olleh.maps.Bounds();var f=null;for(var d=0,a=e.length;d0){for(var a=0;a0){for(b=0;b0){for(b=0;b0){d.getPanes()[0].addFeatures(this._Features)}if(!this.keepView&&this.format&&this.format._mapBounds){d.setBounds(this.format._mapBounds)}},setFeature:function(a){this._Features.push(a)},setMarker:function(a){this._Markers.push(a)},setGroundImage:function(a){this._GroundImages.push(a)},destroyFeatures:function(g,d){var f=(g==undefined);if(f){g=[this._Features,this._Markers,this._GroundImages]}if(g){if(olleh.Util.isArray(g)){for(var e=g.length-1,h,a;e>=0;e--){h=g[e];if(h){if(olleh.Util.isArray(h)){if(h.length>0){for(var b=h.length-1;b>=0;b--){a=h[b];a&&a["remove"]&&a["remove"]();a=null}}}else{h["remove"]&&h["remove"]()}}h=null}}else{g["remove"]&&g["remove"]()}}g=f=e=b=null},getUrl:function(){if(this.url){return this.url}else{return null}},getMetadata:function(){return this.kmlLayerMetadata},getDefaultView:function(){return this.getBounds()},getState:function(){return this.state},CLASS_NAME:"olleh.maps.KmlLayer"});olleh.maps.MeasureLayer=olleh.Class(olleh.maps.VectorLayer,{measureCoord:[],measureDIV:[],measureFeature:null,initialize:function(b,a){olleh.maps.VectorLayer.prototype.initialize.apply(this,arguments);this.measureFeature=new olleh.HashMap();this.isEventUse=true;this.measureCoord=[];this.measureDIV=[]},setMap:function(a){olleh.maps.VectorLayer.prototype.setMap.apply(this,arguments)},moveTo:function(a,b,j){olleh.Layer.prototype.moveTo.apply(this,arguments);var d=true;if(!j){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 l=this.map.getBounds();d=this.renderer.setExtent(l,b);if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft}this.renderer.root.style.visibility="visible";if(!b&&d){for(var e in this.unrenderedFeatures){var m=this.unrenderedFeatures[e];this.drawFeature(m);this.drawMeasure()}}}if(!this.drawn||b||!d){var g=this.features.slice(0),m=null,e=0,h;this.drawn=true;g=g.sort(function(p,o){return p.style.zIndex-o.style.zIndex});h=this.features.length;for(e=0;e0){g=true;for(var e=0,f=d.length;e0&&g==false){a.display="none"}return a},applySymbolizer:function(g,e,b){var a=b.geometry?this.getSymbolizerPrefix(b.geometry):olleh.Style.SYMBOLIZER_PREFIXES[0];var d=g.symbolizer[a]||g.symbolizer;if(this.defaultsPerSymbolizer===true){var f=this.defaultStyle;olleh.Util.applyDefaults(d,{radius:f.radius});if(d.stroke===true||d.graphic===true){olleh.Util.applyDefaults(d,{strokeWeight:f.strokeWeight,strokeColor:f.strokeColor,strokeOpacity:f.strokeOpacity,strokeDashstyle:f.strokeDashstyle,strokeLinecap:f.strokeLinecap})}if(d.fill===true||d.graphic===true){olleh.Util.applyDefaults(d,{fillColor:f.fillColor,fillOpacity:f.fillOpacity})}if(d.graphic===true){olleh.Util.applyDefaults(d,{radius:this.defaultStyle.radius,externalGraphic:this.defaultStyle.externalGraphic,graphicName:this.defaultStyle.graphicName,graphicOpacity:this.defaultStyle.graphicOpacity,graphicWidth:this.defaultStyle.graphicWidth,graphicHeight:this.defaultStyle.graphicHeight,graphicXOffset:this.defaultStyle.graphicXOffset,graphicYOffset:this.defaultStyle.graphicYOffset})}}return this.createLiterals(olleh.Util.extend(e,d),b)},createLiterals:function(e,d){var b=this.context||d.attributes||d.data;for(var a in this.propertyStyles){e[a]=olleh.Style.createLiteral(e[a],b,d)}return e},findPropertyStyles:function(){var e={};var g=this.defaultStyle;this.addPropertyStyles(e,g);var j=this.rules;var f,h;for(var d=0,a=j.length;d0){d=d.substring(a)}var b=olleh.Util.Try(olleh.Function.bind((function(){var e;if(window.ActiveXObject&&!this.xmldom){e=new ActiveXObject("Microsoft.XMLDOM")}else{e=this.xmldom}if(e){e.loadXML(d);return e}else{return new DOMParser().parseFromString(d,"text/xml")}}),this));if(this.keepData){this.data=b}return b},write:function(b){var d;if(this.xmldom){d=b.xml}else{var a=new XMLSerializer();if(b.nodeType==1){var e=document.implementation.createDocument("","",null);if(e.importNode){b=e.importNode(b,true)}e.appendChild(b);d=a.serializeToString(e)}else{d=a.serializeToString(b)}}return d},createElementNS:function(d,a){var b;if(this.xmldom){if(typeof d=="string"){b=this.xmldom.createNode(1,a,d)}else{b=this.xmldom.createNode(1,a,"")}}else{b=document.createElementNS(d,a)}return b},createTextNode:function(b){var a;if(this.xmldom){a=this.xmldom.createTextNode(b)}else{a=document.createTextNode(b)}return a},getElementsByTagNameNS:function(f,e,d){if(!f){return}var a=[];if(f.getElementsByTagNameNS){a=f.getElementsByTagNameNS(e,d)}else{var b=f.getElementsByTagName("*");var l,g;for(var h=0,j=b.length;h0){f=a.substring(0,b);d=a.substring(b+1)}else{if(e){f=this.namespaceAlias[e.namespaceURI]}else{f=this.defaultPrefix}d=a}var h=this.writers[f][d].apply(this,[g]);if(e){e.appendChild(h)}return h},getChildEl:function(d,a,b){return d&&this.getThisOrNextEl(d.firstChild,a,b)},getNextEl:function(d,a,b){return d&&this.getThisOrNextEl(d.nextSibling,a,b)},getThisOrNextEl:function(e,a,d){outer:for(var b=e;b;b=b.nextSibling){switch(b.nodeType){case 1:if((!a||a===(b.localName||b.nodeName.split(":").pop()))&&(!d||d===b.namespaceURI)){break outer}b=null;break outer;case 3:if(/^\s*$/.test(b.nodeValue)){break}case 4:case 6:case 12:case 10:case 11:b=null;break outer}}return b||null},lookupNamespaceURI:function(f,g){var e=null;if(f){if(f.lookupNamespaceURI){e=f.lookupNamespaceURI(g)}else{outer:switch(f.nodeType){case 1:if(f.namespaceURI!==null&&f.prefix===g){e=f.namespaceURI;break outer}var b=f.attributes.length;if(b){var a;for(var d=0;d0){a=f.length;for(d=0;d"+l.replace(/"+l.replace(/"+m.replace(/"+l.replace(/"+l.replace(/1000&&g.bottom>1000&&g.right>1000&&g.top>1000){return g}else{g.transform(this.internalProjection,this.externalProjection);return g}}},parseLinks:function(d,e){for(var f=0,a=d.length;f0){var a=this.parseGeometry[l.toLowerCase()];if(a){m=a.apply(this,[f[0]])}break}}if(this.extractAttributes){g=this.parseAttributes(b)}if(m.CLASS_NAME=="olleh.maps.Point"){o=new olleh.maps.Marker({position:m,cursor:"pointer"})}else{o=new olleh.Vector(m,null,g)}o.attributes=olleh.Util.extend(o.attributes,g);e=b.getAttribute("id")||b.getAttribute("name");if(e!=null){o.fid=e}return o},getStyle:function(b,a){var d=olleh.Util.removeTail(b);var g=olleh.Util.extend({},a);g.depth++;g.styleBaseUrl=d;if(!this.styles[b]&&!olleh.String.startsWith(b,"#")&&g.depth<=this.maxDepth&&!this.fetched[d]){var f=this.fetchLink(d);if(f){this.parseData(f,g)}}var e=olleh.Util.extend({},this.styles[b]);return e},parseGeometry:{point:function(f){var e=this.getElementsByTagNameNS(f,this.internalns,"coordinates");var g=[];if(e.length>0){var d=e[0].firstChild.nodeValue;d=d.replace(this.regExes.removeSpace,"");g=d.split(",")}var a=null;if(g.length>1){if(g.length==2){g[2]=null}if(g[0]>1000&&g[1]>1000){a=new olleh.maps.Point(g[0],g[1],g[2])}else{var b=new olleh.maps.Point(g[0],g[1]);b.transform(this.internalProjection,this.externalProjection);a=new olleh.maps.Point(b.getX(),b.getY(),g[2])}}else{throw"Bad coordinate string: "+d}return a},linestring:function(e,g){var f=this.getElementsByTagNameNS(e,this.internalns,"coordinates");var p=null;if(f.length>0){var d=this.getChildValue(f[0]);d=d.replace(this.regExes.trimSpace,"");d=d.replace(this.regExes.trimComma,",");var a=d.split(this.regExes.splitSpace);var l=a.length;if(l>=1){a=d.split(this.regExes.splitSpace)}var o=new Array(l);var m,j;for(var h=0;h1){if(m.length==2){m[2]=null}if(m[0]>1000&&m[1]>1000){o[h]=new olleh.maps.Point(m[0],m[1],m[2])}else{var b=new olleh.maps.Point(m[0],m[1]);b.transform(this.internalProjection,this.externalProjection);o[h]=new olleh.maps.Point(b.getX(),b.getY(),m[2])}}else{throw"Bad LineString point coordinates: "+a[h]}}if(l){if(g){p=new olleh.maps.LinearRing({path:o})}else{p=new olleh.Geometry.Polyline(o)}}else{throw"Bad LineString coordinates: "+d}}return p},polygon:function(g){var d=this.getElementsByTagNameNS(g,this.internalns,"LinearRing");var h=d.length;var f=new Array(h);if(h>0){var b;for(var e=0,a=d.length;e=1||o.length<=3){switch(o.length){case 1:m=o[0];break;case 3:default:m=o[1];break}if(m){if(m.nodeType==3||m.nodeType==4){var a=(b.prefix)?b.nodeName.split(":")[1]:b.nodeName;var l=olleh.Util.getXmlNodeValue(m);if(l){l=l.replace(this.regExes.trimSpace,"");f[a]=l}}}}}}return f},parseExtendedData:function(b){var e={};var d=b.getElementsByTagName("Data");for(var g=0,j=d.length;g0){var x=d.getElementsByTagName("POI")[0].getElementsByTagName("DATAS")[0];var h=d.getElementsByTagName("ADDRS")[0].getElementsByTagName("DATAS")[0];var l=x.childNodes;var n=h.childNodes;var f=new Array(g);var c=new Array(o);for(var s=0;s0&&!(o>0)){var x=d.getElementsByTagName("DATAS")[0];var l=x.childNodes;var f=new Array(g);for(var t=0;t0){for(var d=0,b=this.waypoints.length;dc.left){e.left=c.left}if(e.bottom>c.bottom){e.bottom=c.bottom}if(e.right";var n=(c.node_name!="")?c.node_name:"정보없음";var o=this.getRgTypeStr(c.type);var q="";var b="";if(o=="출발지"||o=="경유지"||o=="도착지"){r=o;if(o!="경유지"){q=this.directions.result.total_duration.text;b=this.directions.result.total_distance.text}}else{r=n}var e=(c.dir_name!="")?c.dir_name:"정보없음";l+=""+r+"";l+="
    ";l+="
  • 방면정보 : "+e+"
  • ";l+="
  • 구간거리 : "+c.nextdist+"m
  • ";l+="
  • 이정표 : "+o+"
  • ";if(b!=""){l+="
  • 총거리 : "+b+"
  • "}if(q!=""){l+="
  • 총시간 : "+q+"
  • "}l+="
"}else{if(this.travelMode=="TRAFFIC"){l+="
";if(c.startname){r=c.startname+"/"}if(c.endname){r+=c.endname}l+=" <"+r+">";l+="
    ";if(c.rgtype){var a="";var h="";var d="";if(c.distance&&c.distance!=""){d=c.distance;if(c.rgtype=="1"||c.rgtype=="2"||c.rgtype=="4"){d+=" 개"}else{if(c.rgtype=="3"){d+="m"}}}else{d="정보없음"}var f="";if(c.rgtype=="1"){var f=this.getMethodtypeStr(c.methodtype);h=c.lanename+" "+f;a="정거장갯수 : "+d}else{if(c.rgtype=="2"){h=c.lanename+" 지하철";a="정거장갯수 : "+d}else{if(c.rgtype=="3"){h="도보";if(c.distance){a="구간거리 : "+d}}else{if(c.rgtype=="4"){var m="";var g=i;while(m=="4"){g--;m=k[g-1].rgtype}if(m=="1"){h=c.lanename+"노선 버스 환승"}else{if(m=="2"){h=c.lanename+" 지하철 환승"}else{h=c.lanename+" 환승"}}a="정거장갯수 : "+d}}}}l+="
  • 이동수단 : "+h+"
  • ";l+="
  • "+a+"
  • ";if(i==0||(k.length-1)==i){l+="
  • 발생요금 : "+j.route_charge+"
  • ";l+="
  • 총거리 : "+j.route_totaldistance.text+"
  • ";l+="
  • 총시간 : "+j.route_totalduration.text+"
  • ";l+="
  • 버스 이용횟수 : "+j.route_buscount+"
  • ";l+="
  • 지하철 이용횟수 : "+j.route_subwaycount+"
  • "}}l+="
"}}l+="
";return{content:l,title:r}},drawRgs:function(c,o,a,m,k){var n=o.routes;if(n&&a){for(var f=0,d=n.length;f0){i.open(map,this)}else{i.close()}this.refer.direction=-(this.refer.direction)})}}},setOptions:function(a){if(a.map){this.map=a.map}if(a.markerOptions){this.markerOptions=a.markerOptions}if(!this.markerOptions.map){this.markerOptions.map=this.map}if(a.polylineOptions){this.polylineOptions=a.polylineOptions}this.keepView=(a.keepView!=null)?a.keepView:true;this.offMarkers=(a.offMarkers!=null)?a.offMarkers:false;this.offPolylines=(a.offPolylines!=null)?a.offPolylines:false;if(a.directions){this.directions=a.directions}if(this.getMap()){this.removeDirections()}this.setMap(this.map)},getRgTypeStr:function(a){if(a=="0"){return"안내없음"}else{if(a=="1"){return"직진"}else{if(a=="2"){return"1시 방향 우회전"}else{if(a=="3"){return"2시 방향 우회전"}else{if(a=="4"){return"우회전"}else{if(a=="5"){return"4시 방향 우회전"}else{if(a=="6"){return"5시 방향 우회전"}else{if(a=="7"){return"7시 방향 좌회전"}else{if(a=="8"){return"8시 방향 좌회전"}else{if(a=="9"){return"좌회전"}else{if(a=="10"){return"10시 방향 좌회전"}else{if(a=="11"){return"11시 방향 좌회전"}else{if(a=="12"){return"직진 방향에 고가도로 진입"}else{if(a=="13"){return"오른쪽 방향에 고가도로 진입"}else{if(a=="14"){return"왼쪽 방향에 고가도로 진입"}else{if(a=="15"){return"지하차도"}else{if(a=="16"){return"오른쪽 방향에 고가도로 옆 도로"}else{if(a=="17"){return"왼쪽 방향에 고가도로 옆 도로"}else{if(a=="18"){return"오른쪽 방향에 지하차도 옆 도로"}else{if(a=="19"){return"왼쪽 방향에 지하차도 옆 도로"}else{if(a=="20"){return"오른쪽 도로"}else{if(a=="21"){return"왼쪽 도로"}else{if(a=="22"){return"직진 방향에 고속도로 진입"}else{if(a=="23"){return"오른쪽 방향에 고속도로 진입"}else{if(a=="24"){return"왼쪽 방향에 고속도로 진입"}else{if(a=="25"){return"직진 방향에 도시고속도로 진입"}else{if(a=="26"){return"오른쪽 방향에 도시고속도로 진입"}else{if(a=="27"){return"왼쪽 방향에 도시고속도로 진입"}else{if(a=="28"){return"오른쪽 방향에 고속도로 출구"}else{if(a=="29"){return"왼쪽 방향에 고속도로 출구"}else{if(a=="30"){return"오른쪽 방향에 도시고속도로 출구"}else{if(a=="31"){return"왼쪽 방향에 도시고속도로 출구"}else{if(a=="32"){return"분기점에서 직진"}else{if(a=="33"){return"분기점에서 오른쪽"}else{if(a=="34"){return"분기점에서 왼쪽"}else{if(a=="35"){return"U-turn"}else{if(a=="36"){return"무발성 직진"}else{if(a=="37"){return"터널"}else{if(a=="38"){return"없음"}else{if(a=="39"){return"없음"}else{if(a=="40"){return"로터리에서 1시 방향"}else{if(a=="41"){return"로터리에서 2시 방향"}else{if(a=="42"){return"로터리에서 3시 방향"}else{if(a=="43"){return"로터리에서 4시 방향"}else{if(a=="44"){return"로터리에서 5시 방향"}else{if(a=="45"){return"로터리에서 6시 방향"}else{if(a=="46"){return"로터리에서 7시 방향"}else{if(a=="47"){return"로터리에서 8시 방향"}else{if(a=="48"){return"로터리에서 9시 방향"}else{if(a=="49"){return"로터리에서 10시 방향"}else{if(a=="50"){return"로터리에서 11시 방향"}else{if(a=="51"){return"로터리에서 12시 방향"}else{if(a=="999"){return"출발지"}else{if(a=="1000"){return"경유지"}else{if(a=="1001"){return"도착지"}else{return"안내없음"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},getMethodtypeStr:function(a){if(a=="1"){return"일반 버스"}else{if(a=="2"){return"좌석 버스"}else{if(a=="3"){return"마을 버스"}else{if(a=="4"){return"직행 좌석 버스"}else{if(a=="5"){return"공항 버스"}else{if(a=="6"){return"간선 급행 버스"}else{if(a=="7"){return"외곽 버스"}else{if(a=="8"){return"간선 버스"}else{if(a=="9"){return"지선 버스"}else{if(a=="10"){return"순환 버스"}else{if(a=="11"){return"광역 버스"}else{if(a=="12"){return"급행 버스"}else{if(a=="13"){return"급행 간선 버스"}else{if(a=="14"){return"지하철"}else{if(a=="15"){return"일반 버스"}else{if(a=="26"){return"좌석 버스"}else{if(a=="2000"){return"마을 버스"}else{if(a=="0"){return"걷기"}else{return"정보없음"}}}}}}}}}}}}}}}}}}},CLASS_NAME:"olleh.maps.DirectionsRenderer"});