var OrtoArea=[]; OrtoArea['80']=[]; OrtoArea['80'][0]=null; OrtoArea['80'][1]=null; OrtoArea['80'][2]=null; OrtoArea['80'][3]=null; OrtoArea['80'][4]=null; OrtoArea['80'][5]=null; OrtoArea['80'][6]=null; OrtoArea['80'][7]=null; OrtoArea['80'][8]=null; OrtoArea['80'][9]=null; OrtoArea['80'][10]=null; OrtoArea['80'][11]=null; OrtoArea['80'][12]=null; OrtoArea['80'][13]=null; OrtoArea['80'][14]=null; OrtoArea['250']=[]; OrtoArea['250'][0]=[{"mapid":1291, "imgW":731000, "imgH":348750, "minX":-592499.75, "maxX":-164624.75, "minY":-1336312.75, "maxY":-1132000.25, "coordS":1}]; OrtoArea['250'][1]=[{"mapid":1291, "imgW":488250, "imgH":233000, "minX":-592499.75, "maxX":-164624.75, "minY":-1336312.75, "maxY":-1132000.25, "coordS":1}]; OrtoArea['250'][2]=[{"mapid":1291, "imgW":366250, "imgH":174750, "minX":-592499.75, "maxX":-164624.75, "minY":-1336312.75, "maxY":-1132000.25, "coordS":1}]; OrtoArea['250'][3]=[{"mapid":1291, "imgW":244500,"imgH":116750,"minX":-592499.75,"maxX":-164624.75,"minY":-1336312.75,"maxY":-1132000.25,"coordS":1}]; OrtoArea['250'][4]=[{"mapid":1897, "imgW":37500, "imgH":18750, "minX":-597314.15, "maxX":-158564.15, "minY":-1344095.85000000, "maxY":-1124720.85, "coordS":1}]; OrtoArea['250'][5]=[{"mapid":1269, "imgW":25000, "imgH":12500, "minX":-597321.24, "maxX":-159321.24, "minY":-1343723.76000000, "maxY":-1124723.76, "coordS":1}]; OrtoArea['250'][6]=[{"mapid":1451, "imgW":18750, "imgH":9500, "minX":-597318.32, "maxX":-159318.32, "minY":-1346646.68000000, "maxY":-1124726.68, "coordS":1}]; OrtoArea['250'][7]=[{"mapid":1449, "imgW":12500, "imgH":6250, "minX":-597312.50, "maxX":-159812.50, "minY":-1343482.50000000, "maxY":-1124732.50, "coordS":1}]; OrtoArea['250'][8]=[{"mapid":1924, "imgW":4750, "imgH":2500, "minX":-597291.70, "maxX":-147941.70, "minY":-1361266.30000000, "maxY":-1124766.30, "coordS":1}]; OrtoArea['250'][9]=[{"mapid":1923, "imgW":3750, "imgH":2000, "minX":-597278.80, "maxX":-145778.80, "minY":-1365579.20000000, "maxY":-1124779.20, "coordS":1}]; OrtoArea['250'][10]=null; OrtoArea['250'][11]=null; OrtoArea['250'][12]=null; OrtoArea['250'][13]=null; OrtoArea['250'][14]=null; var Maps=[]; Maps['250']=[]; Maps['80']=[]; Maps['80'][0]=[{"mapid":1565, "imgW":2560, "imgH":1280, "minX":-597256.5, "maxX":-149256.5, "minY":-1348811.5, "maxY":-1124811.5, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":496063.26}]; Maps['80'][1]=[{"mapid":1565, "imgW":2560, "imgH":1280, "minX":-597256.5, "maxX":-149256.5, "minY":-1348811.5, "maxY":-1124811.5, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":496063.26}]; Maps['80'][2]=[{"mapid":1565, "imgW":2560, "imgH":1280, "minX":-597256.5, "maxX":-149256.5, "minY":-1348811.5, "maxY":-1124811.5, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":496063.26}]; Maps['80'][3]=[{"mapid":1565, "imgW":2560, "imgH":1280, "minX":-597256.5, "maxX":-149256.5, "minY":-1348811.5, "maxY":-1124811.5, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":496063.26}]; Maps['80'][4]=[{"mapid":1565, "imgW":2560, "imgH":1280, "minX":-597256.5, "maxX":-149256.5, "minY":-1348811.5, "maxY":-1124811.5, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":496063.26}]; Maps['80'][5]=[{"mapid":1565, "imgW":2560, "imgH":1280, "minX":-597256.5, "maxX":-149256.5, "minY":-1348811.5, "maxY":-1124811.5, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":496063.26}]; Maps['80'][6]=[{"mapid":1565, "imgW":2560, "imgH":1280, "minX":-597256.5, "maxX":-149256.5, "minY":-1348811.5, "maxY":-1124811.5, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":496063.26}]; Maps['80'][7]=[{"mapid":1565, "imgW":2560, "imgH":1280, "minX":-597256.5, "maxX":-149256.5, "minY":-1348811.5, "maxY":-1124811.5, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":496063.26}]; Maps['80'][8]=[{"mapid":1565, "imgW":2560, "imgH":1280, "minX":-597256.5, "maxX":-149256.5, "minY":-1348811.5, "maxY":-1124811.5, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":496063.26}]; Maps['80'][9]=[{"mapid":1565, "imgW":2560, "imgH":1280, "minX":-597256.5, "maxX":-149256.5, "minY":-1348811.5, "maxY":-1124811.5, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":496063.26}]; Maps['80'][10]=[{"mapid":1916, "imgW":1120, "imgH":1040, "minX":1328985.00000000, "maxX":5880665.00000000, "minY":3749426.00000000, "maxY":7975986.00000000, "centerX":3599110, "centerY":5912236, "coordS":2,"scale":11520006.22080000}]; Maps['80'][11]=[{"mapid":1916, "imgW":1120, "imgH":1040, "minX":1328985.00000000, "maxX":5880665.00000000, "minY":3749426.00000000, "maxY":7975986.00000000, "centerX":3599110, "centerY":5912236, "coordS":2,"scale":11520006.22080000}]; Maps['80'][12]=[{"mapid":1916, "imgW":1120, "imgH":1040, "minX":1328985.00000000, "maxX":5880665.00000000, "minY":3749426.00000000, "maxY":7975986.00000000, "centerX":3599110, "centerY":5912236, "coordS":2,"scale":11520006.22080000}]; Maps['80'][13]=[{"mapid":1916, "imgW":1120, "imgH":1040, "minX":1328985.00000000, "maxX":5880665.00000000, "minY":3749426.00000000, "maxY":7975986.00000000, "centerX":3599110, "centerY":5912236, "coordS":2,"scale":11520006.22080000}]; Maps['80'][14]=[{"mapid":1916, "imgW":1120, "imgH":1040, "minX":1328985.00000000, "maxX":5880665.00000000, "minY":3749426.00000000, "maxY":7975986.00000000, "centerX":3599110, "centerY":5912236, "coordS":2,"scale":11520006.22080000}]; Maps['250'][0]=[{"mapid":1291, "imgW":731000, "imgH":348750, "minX":-592499.75, "maxX":-164624.75, "minY":-1336312.75, "maxY":-1132000.25, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":1658.26861200}]; Maps['250'][1]=[{"mapid":1291, "imgW":488250, "imgH":233000, "minX":-592499.75, "maxX":-164624.75, "minY":-1336312.75, "maxY":-1132000.25, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":2483.15094700}]; Maps['250'][2]=[{"mapid":1291, "imgW":366250, "imgH":174750, "minX":-592499.75, "maxX":-164624.75, "minY":-1336312.75, "maxY":-1132000.25, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":3310.86793000}]; Maps['250'][3]=[{"mapid":1291, "imgW":244500, "imgH":116750, "minX":-592499.75, "maxX":-164624.75, "minY":-1336312.75, "maxY":-1132000.25, "centerX":-482959.49000000, "centerY":-1224612.86000000, "coordS":1,"scale":4960.63260000}]; Maps['250'][4]=[{"mapid":1897, "imgW":37500, "imgH":18750, "minX":-597314.15, "maxX":-158564.15, "minY":-1344095.85000000, "maxY":-1124720.85, "centerX":-377953.15, "centerY":-1234408.35, "coordS":1,"scale":33165.37224000}]; Maps['250'][5]=[{"mapid":1269, "imgW":25000, "imgH":12500, "minX":-597321.24000000, "maxX":-159321.24000000, "minY":-1343723.76000000, "maxY":-1124723.76000000, "centerX":-378321.24, "centerY":-1234223.76, "coordS":1,"scale":49663.01894400}]; Maps['250'][6]=[{"mapid":1451, "imgW":18750, "imgH":9500, "minX":-597318.32000000, "maxX":-159318.32000000, "minY":-1346646.68000000, "maxY":-1124726.68000000, "centerX":-378318.32, "centerY":-1235686.68, "coordS":1,"scale":66217.35859200}]; Maps['250'][7]=[{"mapid":1449, "imgW":12500, "imgH":6250, "minX":-597312.50000000, "maxX":-159812.50000000, "minY":-1343482.50000000, "maxY":-1124732.50000000, "centerX":-378562.5, "centerY":-1234107.5, "coordS":1,"scale":99212.65200000}]; Maps['250'][8]=[{"mapid":1924, "imgW":4750, "imgH":2500, "minX":-597291.70000000, "maxX":-147941.70000000, "minY":-1361266.30000000, "maxY":-1124766.30000000, "centerX":-372616.7, "centerY":-1243016.3, "coordS":1,"scale":268157.62512000}]; Maps['250'][9]=[{"mapid":1923, "imgW":3750, "imgH":2000, "minX":-597278.80000000, "maxX":-145778.80000000, "minY":-1365579.20000000, "maxY":-1124779.20000000, "centerX":-371528.8, "centerY":-1245179.2, "coordS":1,"scale":341291.52288000}]; Maps['250'][10]=[{"mapid":1919, "imgW":35750, "imgH":32500, "minX":1328985.00000000, "maxX":5869235.00000000, "minY":3848486.00000000, "maxY":7975986.00000000, "centerX":3599110, "centerY":5912236, "coordS":2,"scale":360000.19440000}]; Maps['250'][11]=[{"mapid":1915, "imgW":18000, "imgH":16250, "minX":1328985.00000000, "maxX":5900985.00000000, "minY":3848486.00000000, "maxY":7975986.00000000, "centerX":3614985, "centerY":5912236, "coordS":2,"scale":720000.38880000}]; Maps['250'][12]=[{"mapid":1911, "imgW":9000, "imgH":8250, "minX":1328985.00000000, "maxX":5900985.00000000, "minY":3784986.00000000, "maxY":7975986.00000000, "centerX":3614985, "centerY":5880486, "coordS":2,"scale":1440000.77760000}]; Maps['250'][13]=[{"mapid":1912, "imgW":4500, "imgH":4250, "minX":1328985.00000000, "maxX":5900985.00000000, "minY":3657986.00000000, "maxY":7975986.00000000, "centerX":3614985, "centerY":5816986, "coordS":2,"scale":2880001.55520000}]; Maps['250'][14]=[{"mapid":1913, "imgW":2250, "imgH":2250, "minX":1328985.00000000, "maxX":5900985.00000000, "minY":3403986.00000000, "maxY":7975986.00000000, "centerX":3614985, "centerY":5689986, "coordS":2,"scale":5760003.11040000}]; var parentform=null; var shpt=null; var shptZ=null; var restPt=null; function MOD(num,dv){var cnt;var diff;cnt=Math.floor(num/dv);diff=num-(cnt*dv);return {c:cnt,d:diff};} Ajax = Ajax.extend({abort: function (){this.transport.abort();}}); ConvKlasTrans= { RO:57.29577951308232, PI:3.141592653589793, GRFE:17.6665931667, GRFEK:17.6666666667, m2:function(z,e){return Math.exp(e*Math.log(z));}, decRad:function(uhel){return uhel/this.RO;}, xybl:function(x,y) { var b,l,m,gama; var yy,a,c,e2,ee,_384,ll,br,db,t,n,l1,l2,l3,eta2; var pas=3; yy=y; a=6378245; c=6356863.019; e2=0.673852541468/100; ee=0.669342162297/100; _384=15; b=x/111134.861084; br=b/this.RO; y=y-pas*1000000-500000; db=16036.480269*Math.sin(2*br); db=db-16.828067*Math.sin(4*br); db=db+0.021975*Math.sin(6*br); db=db-0.000031*Math.sin(8*br); t=Math.sin(br)/Math.cos(br); eta2=e2*Math.cos(br)*Math.cos(br); n=a*a/(c*Math.sqrt(eta2+1)); b=b+db*this.RO*(1+eta2)/n; b=b-(3*this.RO*t*db*db*eta2)*(1+eta2)/(2*n*n); b=b-(this.RO*db*db*db*eta2)*(1-t*t+2*eta2-6*t*t*eta2)/(2*n*n*n); br=b/this.RO; t=Math.sin(br)/Math.cos(br); eta2=e2*Math.cos(br)*Math.cos(br); n=a*a/(c*Math.sqrt(eta2+1)); l=_384; l1=(this.RO*y)/(n*Math.cos(br)); l=l+l1; l2=-(this.RO*y*y*y)*(1+2*t*t+eta2)/(6*n*n*n*Math.cos(br)); l=l+l2; l3=(this.RO*y*y*y*y*y)*(5+28*t*t+24*t*t*t*t+6*eta2+8*t*t*eta2)/(120*n*n*n*n*n*Math.cos(br)); l=l+l3; b=b-(this.RO*t*y*y)*(1+eta2)/(2*n*n); b=b+(this.RO*t*y*y*y*y)*(5+3*t*t+6*eta2-6*t*t*eta2-3*eta2*eta2-9*t*t*eta2*eta2)/(24*n*n*n*n); y=yy; l=l/this.RO; b=b/this.RO; ll=l-_384/this.RO; m=1+Math.cos(b)*Math.cos(b)*(1+eta2)*ll*ll/2+Math.cos(b)*Math.cos(b)*Math.cos(b)*Math.cos(b)*(5-4*t*t)*ll*ll*ll*ll/24; gama=Math.sin(b)*ll+Math.sin(b)*Math.cos(b)*Math.cos(b)*(1+3*eta2+2*eta2*eta2)*(ll*ll*ll/3)+Math.sin(b)*Math.cos(b)*Math.cos(b)*Math.cos(b)*Math.cos(b)*(2-t*t)*ll*ll*ll*ll*ll/15; return {b:b,l:l,m:m,gama:gama}; }, flxy:function(fi,_390) { var x,y,m,c; var ALFA=1.000597498372; var E=0.0816968303; var _397=1298039.0046; var K=1.003419164; var _399=6380703.6105; var _39a,u,v,s,d,tanu,eexp,vk,uk,sins,coss,sind,cosd,n,r; var a,_3aa,_3ab,_3ac; tanu=(1-E*Math.sin(fi))/(1+E*Math.sin(fi)); eexp=ALFA*E/2; tanu=this.m2(tanu,eexp); tanu=tanu*K*this.m2(Math.tan(fi/2+45/this.RO),ALFA); tanu=Math.atan(tanu)-45/this.RO; u=tanu*2; v=_390*ALFA; vk=this.decRad(42+31/60+31.41725/3600); uk=this.decRad(59+42/60+42.69689/3600); sins=Math.sin(uk)*Math.sin(u)+Math.cos(uk)*Math.cos(u)*Math.cos(vk-v); coss=Math.sqrt(1-sins*sins); s=Math.atan(sins/coss); sind=Math.cos(u)*Math.sin(vk-v)/(Math.sqrt(1-sins*sins)); cosd=Math.sqrt(1-sind*sind); d=Math.atan(sind/cosd); n=Math.sin(78.5/this.RO); _39a=d*n; r=_397*this.m2(Math.tan(84.25/this.RO),n); r=r/this.m2(Math.tan(45/this.RO+s/2),n); x=r*Math.cos(_39a); y=r*Math.sin(_39a); m=n*r/(_399*Math.cos(s)); a=(30+17/60+17.30311/3600)/this.RO; _3aa=Math.sin(a)*Math.sin(d)/Math.cos(u); _3ab=Math.sqrt(1-_3aa*_3aa); _3ac=Math.atan(_3aa/_3ab); c=_39a-_3ac; c=-c; return {x:x,y:y,m:m,c:c}; }, dBdL:function(x,y) { var db,dl; var kk,a,b,c,d,e,f,g,h,k,y,x; y=y/1000000; x=x/1000000; kk=6.4581309976; a=-25.2396636867; b=-6.31688387734; c=25.3931214924; d=6.479497342; e=2.8729496693; f=-7.3246633461; g=-2.42395424509; h=-1.1948940070888; k=-0.1977771878; db=kk+a*x+b*y+c*x*x+d*x*y+e*y*y+f*x*x*x+g*x*x*y+h*x*y*y+k*y*y*y; db=db/3600/this.RO; kk=2.763002544688; a=-21.17728368056; b=9.7515238404; c=20.98226652614; d=0.929265490037; e=-1.52922105939; f=-5.861019136333; g=-2.860928322308; h=0.8723432775432; k=0.438453018241; dl=kk+a*x+b*y+c*x*x+d*x*y+e*y*y+f*x*x*x+g*x*x*y+h*x*y*y+k*y*y*y; dl=dl/3600/this.RO; return {db:db,dl:dl}; }, xyfl:function(x,y) { var fi,_3be,m,c; var r,_3c2,q,s,a,u,v,d,sinu,cosu,tanu,vkv,_3cd,_3ce,_3cf; var _3d0,dfi,duh,n,_3d4,_3d5,_3d6; var _3d7=6380703.6105; r=Math.sqrt(x*x+y*y); _3c2=Math.atan(y/x); q=Math.tan(84.25/this.RO)*this.m2(1298039.0046/r,1/0.9799247046); s=2*Math.atan(q)-(90/this.RO); d=_3c2/Math.sin(78.5/this.RO); a=(30+17/60+17.30311/3600)/this.RO; sinu=Math.cos(a)*Math.sin(s)-Math.sin(a)*Math.cos(s)*Math.cos(d); cosu=Math.sqrt(1-sinu*sinu); tanu=sinu/cosu; u=Math.atan(tanu); v=(42+31/60+31.41725/3600)/this.RO; _3cd=Math.cos(s)*Math.sin(d)/Math.cos(u); _3ce=Math.sqrt(1-_3cd*_3cd); _3cf=_3cd/_3ce; vkv=Math.atan(_3cf); v=v-vkv; _3d0=u*this.RO-(49+27/60+35.84625/3600); duh=_3d0*0.36; dfi=10014.16023*duh-2.4130973*duh*duh; dfi=dfi+0.0128873*duh*duh*duh+0.0025186*duh*duh*duh*duh; dfi=dfi-0.0000025*duh*duh*duh*duh*duh; fi=(49.5+dfi/3600)/this.RO; _3be=v/1.0005974983; n=Math.sin(78.5/this.RO); m=n*r/(_3d7*Math.cos(s)); a=(30+17/60+17.30311/3600)/this.RO; _3d5=Math.sin(a)*Math.sin(d)/Math.cos(u); _3d6=Math.sqrt(1-_3d5*_3d5); _3d4=Math.atan(_3d5/_3d6); c=_3c2-_3d4; c=-c; return {fi:fi,lambdaf:_3be,m:m,c:c}; }, blxy:function(b,l) { var x,y,m,gama; var _3de,e22,e21,n,t,a,c,eta2,br,ee,ll,f2,f4,f6,f8,_3ed; var pas=3; a=6378245; c=6356863.019; e22=0.673852541468/100; ee=0.669342162297/100; e21=0.0066934216; _3de=15; ll=(l-_3de/this.RO); f2=b*2; f4=b*4; f6=b*6; f8=b*8; _3ed=111134.861084*b*this.RO-16036.480269*Math.sin(f2)+16.828067*Math.sin(f4)-0.021975*Math.sin(f6)+0.000031*Math.sin(f8); t=Math.sin(b)/Math.cos(b); eta2=e22*Math.cos(b)*Math.cos(b); n=a/Math.sqrt(1-e21*Math.sin(b)*Math.sin(b)); x=_3ed+n*Math.sin(b)*Math.cos(b)*(ll*ll/2); x=x+n*Math.sin(b)*Math.cos(b)*Math.cos(b)*Math.cos(b)*(5-t*t+9*eta2+4*eta2*eta2)*(ll*ll*ll*ll/24); y=n*Math.cos(b)*ll; y=y+n*Math.cos(b)*Math.cos(b)*Math.cos(b)*(1-t*t+eta2)*(ll*ll*ll/6); y=y+n*Math.cos(b)*Math.cos(b)*Math.cos(b)*Math.cos(b)*Math.cos(b)*(5-18*t*t+t*t*t*t+14*eta2-58*eta2*t*t)*(ll*ll*ll*ll*ll/120); y=y+500000+pas*1000000; m=1+Math.cos(b)*Math.cos(b)*(1+eta2)*ll*ll/2+Math.cos(b)*Math.cos(b)*Math.cos(b)*Math.cos(b)*(5-4*t*t)*ll*ll*ll*ll/24; gama=Math.sin(b)*ll+Math.sin(b)*Math.cos(b)*Math.cos(b)*(1+3*eta2+2*eta2*eta2)*(ll*ll*ll/3)+Math.sin(b)*Math.cos(b)*Math.cos(b)*Math.cos(b)*Math.cos(b)*(2-t*t)*ll*ll*ll*ll*ll/15; return {x:x,y:y,m:m,gama:gama}; }, bl84:function(fi,l) { var b42,l42; b42=fi+1.4/3600/this.RO; l42=l+6.2/3600/this.RO; if(l>(18/this.RO)) { b42=fi+1.2/3600/this.RO; l42=l+6.1/3600/this.RO; } return {b42:b42,l42:l42}; }, bl42:function(b42,l42) { var fi,l; fi=b42-1.4/3600/this.RO; l=l42-6.2/3600/this.RO; if(l42>(18/this.RO)) { fi=b42-1.2/3600/this.RO; l=l42-6.1/3600/this.RO; } return {fi:fi,l:l}; }, xybl84:function(x,y) { var fi,l; var _3fb=[]; var _3fc=[]; var _3fd,_3fe,_3ff,_400,fi,la,dx,dy; var _404; _3fd=50; _3fe=15; _3ff=703000; _400=1058000; _404=_3fe; _3fb[1]=0.1325132993*this.m2(10,-2); _3fb[2]=-0.8916429099*this.m2(10,-5); _3fb[3]=-0.1156917384*this.m2(10,-5); _3fb[4]=-0.229875025*this.m2(10,-13); _3fb[5]=0.2087176527*this.m2(10,-12); _3fb[6]=-0.8219794748*this.m2(10,-12); _3fb[7]=0.2191874854*this.m2(10,-19); _3fb[8]=0.5305545189*this.m2(10,-20); _3fb[9]=0.1760134043*this.m2(10,-18); _3fb[10]=0.6270628603*this.m2(10,-20); _3fc[1]=-0.1019442857*this.m2(10,-3); _3fc[2]=0.1794902692*this.m2(10,-5); _3fc[3]=-0.1383338939*this.m2(10,-4); _3fc[4]=-0.3294257309*this.m2(10,-12); _3fc[5]=0.2506009659*this.m2(10,-11); _3fc[6]=0.3291143794*this.m2(10,-12); _3fc[7]=0.4567560092*this.m2(10,-19); _3fc[8]=-0.4843979237*this.m2(10,-18); _3fc[9]=-0.1182561606*this.m2(10,-18); _3fc[10]=0.1641107774*this.m2(10,-18); dx=x-_400; dy=y-_3ff; fi=_3fd+_3fb[1]; fi=fi+_3fb[2]*dx; fi=fi+_3fb[3]*dy; fi=fi+_3fb[4]*dx*dx; fi=fi+_3fb[5]*dx*dy; fi=fi+_3fb[6]*dy*dy; fi=fi+_3fb[7]*dx*dx*dx; fi=fi+_3fb[8]*dx*dx*dy; fi=fi+_3fb[9]*dx*dy*dy; fi=fi+_3fb[10]*dy*dy*dy; la=_404+_3fc[1]; la=la+_3fc[2]*dx; la=la+_3fc[3]*dy; la=la+_3fc[4]*dx*dx; la=la+_3fc[5]*dx*dy; la=la+_3fc[6]*dy*dy; la=la+_3fc[7]*dx*dx*dx; la=la+_3fc[8]*dx*dx*dy; la=la+_3fc[9]*dx*dy*dy; la=la+_3fc[10]*dy*dy*dy; fi=fi/this.RO; l=la/this.RO; return {fi:fi,l:l}; }, blxy84:function(fi,l) { var x,y; var _409=[]; var _40a=[]; var _40b,_40c,_40d,_40e,dfi,dla,fi,_411; _40b=50; _40c=15; _40d=703000; _40e=1058000; _409[1]=0.1180672981*100; _409[2]=-0.1431119075*100000; _409[3]=-0.7109369068*100000; _409[4]=0.45272113114*0.1; _409[5]=0.146929752*10000; _409[6]=-0.6216573827*100; _409[7]=0.1746024222*10; _409[8]=0.1482366057*10; _409[9]=-0.1646574057*10; _409[10]=0.1930950004*10; _40a[1]=0.1471808238*1000; _40a[2]=-0.1102950611*1000000; _40a[3]=0.9224512054*10000; _40a[4]=-0.1335425822*100; _40a[5]=-0.1928902631*1000; _40a[6]=-0.4735502716*1000; _40a[7]=-0.4564660084*10; _40a[8]=-0.4355296392*10; _40a[9]=0.8911019558*10; _40a[10]=0.3614170182; fi=fi*this.RO; _411=l*this.RO; dfi=fi-_40b; dla=_411-_40c; y=_40d+_409[1]; y=y+_409[2]*dfi; y=y+_409[3]*dla; y=y+_409[4]*dfi*dfi; y=y+_409[5]*dfi*dla; y=y+_409[6]*dla*dla; y=y+_409[7]*dfi*dfi*dfi; y=y+_409[8]*dfi*dfi*dla; y=y+_409[9]*dfi*dla*dla; y=y+_409[10]*dla*dla*dla; x=_40e+_40a[1]; x=x+_40a[2]*dfi; x=x+_40a[3]*dla; x=x+_40a[4]*dfi*dfi; x=x+_40a[5]*dfi*dla; x=x+_40a[6]*dla*dla; x=x+_40a[7]*dfi*dfi*dfi; x=x+_40a[8]*dfi*dfi*dla; x=x+_40a[9]*dfi*dla*dla; x=x+_40a[10]*dla*dla*dla; return {x:x,y:y}; }, xy42:function(x42,y42) { var m,c; var fi,_417,b42,l42,pas,db42,dl42,m42,_41e; var r1=this.xybl(x42,y42); b42=r1.b; l42=r1.l; m42=r1.m; _41e=r1.gama; var r2=this.flxy(b42,l42+this.GRFE/this.RO); x=r2.x; y=r2.y; m=r2.m; c=r2.c; var r3=this.dBdL(x,y); db42=r3.db; dl42=r3.dl; fi=b42-db42; _417=l42-dl42+this.GRFEK/this.RO; var r4=this.flxy(fi,_417); return {x:r4.x,y:r4.y}; }, xysk:function(x,y) { var db,dl,b42,l42,_429,m42,fi,_42c,c,m; var r1=this.xyfl(x,y); fi=r1.fi; _42c=r1.lambdaf; m=r1.m; c=r1.c; var r2=this.dBdL(x,y); db=r2.db; dl=r2.dl; b42=fi+db; l42=_42c-this.GRFEK/this.RO+dl; var r3=this.blxy(b42,l42); return {x42:r3.x,y42:r3.y}; }, fg:function(a) { a=Math.abs(a); var d=Math.floor(a); var md=(a-d)*60; var m=Math.floor(md); var sd=Math.round((md-m)*60*100)/100; return d+"\xb0"+m+"'"+sd+"\""; }, doFoo:function(_437,_438) { var x=_437.x; var y=_437.y; var temp; switch(_437.cS) { case 0: switch(_438) { case 1: temp=this.c01(x,y); break; case 2: temp=this.c02(x,y); break; } break; case 1: switch(_438) { case 0: temp=this.c10(x,y); break; case 2: temp=this.c12(x,y); break; } break; case 2: switch(_438) { case 0: temp=this.c20(x,y); break; case 1: temp=this.c21(x,y); break; } break; } return {x:temp.x,y:temp.y,cS:_438}; }, c10:function(x,y) { if(x<0&&y<0) { var tmp=x; x=-y; y=-tmp; } var r=this.xybl84(x,y); return {x:r.fi*this.RO,y:r.l*this.RO}; }, c01:function(fi,l) { var r=this.blxy84(fi/this.RO,l/this.RO); return {x:-r.y,y:-r.x}; }, c20:function(x,y){var _445,_446,m42,_448;var r1=this.xybl(y,x);var r2=this.bl42(r1.b,r1.l);return {x:r2.fi*this.RO,y:r2.l*this.RO};}, c02:function(fi,l){var r1=this.bl84(fi/this.RO,l/this.RO);var r2=this.blxy(r1.b42,r1.l42);return {x:r2.y,y:r2.x};}, c21:function(x,y){var r=this.xy42(y,x);return {x:-r.y,y:-r.x};}, c12:function(x,y){if(x<0&&y<0){var tmp=x;x=-y;y=-tmp;}var r=this.xysk(x,y);return {x:r.y42,y:r.x42};}, fgeo:function(fi,l){var fs=(fi>0)?"N":"S";var ls=(l>0)?"E":"W";return{"lon":(this.fg(fi)+fs),"lat":(this.fg(l)+ls)};} }; function _aniMvHndl(map,posXo,posX,posYo,posY){chooseKey=false;var FX= new Fx.Styles(map,{duration:300,transition: Fx.Transitions.sineIn, onComplete:function(){$(map).makeTiles();map=null;FX=null;chooseKey=true;}});FX.start({'left': [posXo,posX],'top': [posYo,posY]});}; function makeTime(num){var ret=[];ret.hour=parseInt(num);num -= parseInt(num); num *= 60;ret.min = parseInt(num);return ret;} function roundM(roundx,len){var m=10;m=Math.pow(m,len);roundx=Math.round(roundx*m)/m;return roundx;} var inchesPerUnit = new Array(1, 12, 63360.0, 39.3701, 39370.1, 4374754); var urlprefix="http://mapy.atlas.sk/"; var dpi=72; var units=3; pGroups=[]; LAYERS=[0,1,10,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]; LAYERMAP={}; LAYERMAP['l0']={minscale:4,idlayer:0,on:true,editable:false}; LAYERMAP['l1']={minscale:12,idlayer:1,on:true,editable:false}; LAYERMAP['l9']={minscale:3,idlayer:9,on:true,editable:true}; LAYERMAP['l10']={minscale:12,idlayer:10,on:true,editable:true}; LAYERMAP['l11']={minscale:3,idlayer:11,on:true,editable:true}; LAYERMAP['l12']={minscale:3,idlayer:12,on:true,editable:true}; LAYERMAP['l13']={minscale:3,idlayer:13,on:false,editable:true}; LAYERMAP['l14']={minscale:3,idlayer:14,on:true,editable:true}; LAYERMAP['l15']={minscale:3,idlayer:15,on:false,editable:true}; LAYERMAP['l16']={minscale:3,idlayer:16,on:true,editable:true}; LAYERMAP['l17']={minscale:3,idlayer:17,on:false,editable:true}; LAYERMAP['l18']={minscale:3,idlayer:18,on:true,editable:true}; LAYERMAP['l19']={minscale:3,idlayer:19,on:true,editable:true}; LAYERMAP['l20']={minscale:3,idlayer:20,on:true,editable:true}; LAYERMAP['l21']={minscale:3,idlayer:21,on:true,editable:true}; LAYERMAP['l22']={minscale:3,idlayer:22,on:true,editable:true}; LAYERMAP['l23']={minscale:3,idlayer:23,on:true,editable:true}; LAYERMAP['l24']={minscale:3,idlayer:24,on:true,editable:true}; LAYERMAP['l25']={minscale:3,idlayer:25,on:true,editable:true}; LAYERMAP['l26']={minscale:3,idlayer:26,on:true,editable:true}; LAYERICONS={}; LAYERICONS['l0']={icon:'http://mapy.atlas.sk/design/layers/ikony/firma.gif',xo:-10,yo:-10,w:20,h:20};//firmy LAYERICONS['l1']={icon:'http://mapy.atlas.sk/design/layers/ikony/telecom.gif',xo:-10,yo:-10,w:20,h:20};//telecom LAYERICONS['l9']={icon:'http://mapy.atlas.sk/design/layers/ikony/kino3.gif',xo:-10,yo:-10,w:20,h:20};//kina LAYERICONS['l10']={icon:'http://mapy.atlas.sk/design/layers/ikony/letisko.gif',xo:-10,yo:-10,w:20,h:20};//letiska LAYERICONS['l11']={icon:'http://mapy.atlas.sk/design/layers/ikony/divadlo.gif',xo:-10,yo:-10,w:20,h:20};//divadla LAYERICONS['l12']={icon:'http://mapy.atlas.sk/design/layers/ikony/nemocnica.gif',xo:-10,yo:-10,w:20,h:20};//zdravie LAYERICONS['l13']={icon:'http://mapy.atlas.sk/design/layers/ikony/urad.gif',xo:-10,yo:-10,w:20,h:20};//velvyslanectva LAYERICONS['l14']={icon:'http://mapy.atlas.sk/design/layers/ikony/urad.gif',xo:-10,yo:-10,w:20,h:20};//ministerstva LAYERICONS['l15']={icon:'http://mapy.atlas.sk/design/layers/ikony/hasici.gif',xo:-10,yo:-10,w:20,h:20};//hasici LAYERICONS['l16']={icon:'http://mapy.atlas.sk/design/layers/ikony/lekaren.gif',xo:-10,yo:-10,w:20,h:20};//lekarne LAYERICONS['l17']={icon:'http://mapy.atlas.sk/design/layers/ikony/urad.gif',xo:-10,yo:-10,w:20,h:20};//skoly LAYERICONS['l18']={icon:'http://mapy.atlas.sk/design/layers/ikony/kostol.gif',xo:-10,yo:-10,w:20,h:20};//cirkev LAYERICONS['l19']={icon:'http://mapy.atlas.sk/design/layers/ikony/urad.gif',xo:-10,yo:-10,w:20,h:20};//institucie LAYERICONS['l20']={icon:'http://mapy.atlas.sk/design/layers/ikony/urad.gif',xo:-10,yo:-10,w:20,h:20};//nadacie LAYERICONS['l21']={icon:'http://mapy.atlas.sk/design/layers/ikony/posta.gif',xo:-10,yo:-10,w:20,h:20};//posty LAYERICONS['l22']={icon:'http://mapy.atlas.sk/design/layers/ikony/urad.gif',xo:-10,yo:-10,w:20,h:20};//prokuratury LAYERICONS['l23']={icon:'http://mapy.atlas.sk/design/layers/ikony/urad.gif',xo:-10,yo:-10,w:20,h:20};//vladne LAYERICONS['l24']={icon:'http://mapy.atlas.sk/design/layers/ikony/urad.gif',xo:-10,yo:-10,w:20,h:20};//danove LAYERICONS['l25']={icon:'http://mapy.atlas.sk/design/layers/ikony/policia.gif',xo:-10,yo:-10,w:20,h:20};//policia LAYERICONS['l26']={icon:'http://mapy.atlas.sk/design/layers/ikony/urad.gif',xo:-10,yo:-10,w:20,h:20};//ine urady _slider=({ ini:function(mapdiv) { this.mapdiv=mapdiv; $(this.mapdiv).slider=this.id; this.areaheight=77; this.step=(this.areaheight/($(mapdiv).scales.length-1)); this.setposition($(mapdiv).scale); }, onmousedown:function(e) { e=new Event(e); e.stop; document.mov=this.id; this.startpos=this.offsetTop; this.startcur=e.client.y+window.getScrollTop(); e=null; }, drag:function(e) { var pos=(this.startpos+((e.client.y+window.getScrollTop())-this.startcur)); if(pos>=0 && pos<=(this.areaheight)) { this.style.top=pos+'px'; } pos=null; }, onmouseup:function() { var cor=$(this.mapdiv).ShCoord(); $(this.mapdiv).zoomTo((Math.round(this.offsetTop/this.step)),{"x":cor.centerX, "y":cor.centerY,"cS":$(this.mapdiv).coordS}); cor=null; this.startpos=null; this.startcur=null; }, setposition:function(scale) { this.style.top=Math.round(this.step*scale)+'px'; } }); _slidearea=({ ini:function(slidbtn) { this.slidbtn=slidbtn; }, onmousedown:function(e) { e=new Event(e); e.stop; document.mov=this.id; $(this.slidbtn).style.top=((e.client.y+window.getScrollTop())-this.getTop()-5)+'px'; $(this.slidbtn).startpos=$(this.slidbtn).offsetTop; $(this.slidbtn).startcur=(e.client.y+window.getScrollTop()); e=null; }, drag:function(e) { $(this.slidbtn).drag(e); }, onmouseup:function() { $(this.slidbtn).onmouseup() } }) mapC=({ LPOINTS:{},//array of layer points LPOINTSD:{},//array of drawn layer points elements LPOINTSM:[],//array of layer point ids ini:function(mapW,mapH,ref,refmap) { this.getpoints=true; this.ismoving=false; this.dpi=72; this.units=3; this.refmap=refmap; this.refmapmoved=true; this.slider=false; this.isref=ref; this.centerx=null; this.centery=null; this.click=[]; this.aclick=[]; this.bords=[]; this.tiles=[]; this.tiles[0]=[]; this.tiles[1]=[]; this.atiles={}; this.maptype=0; this.scale=7; if(ref==true) { this.tileW=80; this.tileH=80; this.mapid='1565'; this.scales=new Array(Array(496063.26,1),Array(496063.26,1),Array(496063.26,1),Array(496063.26,1),Array(496063.26,1),Array(496063.26,1),Array(496063.26,1),Array(496063.26,1),Array(496063.26,1),Array(496063.26,1),Array(11520006.2208,2),Array(11520006.2208,2),Array(11520006.2208,2),Array(11520006.2208,2),Array(11520006.2208,2)); this.viewportW=mapW; this.viewportH=mapH; this.imgW=2492; this.imgH=1240; this.minX=-597247.5; this.maxX=-161147.5; this.minY=-1341812.5; this.maxY=-1124812.5; } else { this.tileW=250; this.tileH=250; this.mapid='1449'; this.scales=new Array(Array(1658.268612,1),Array(2483.150947,1),Array(3310.86793,1),Array(4960.6326,1),Array(33165.37224,1),Array(49663.018944,1),Array(66217.358592,1),Array(99212.652,1),Array(268157.62512,1),Array(341291.52288,1),Array(360000.1944,2),Array(720000.3888,2),Array(1440000.7776,2),Array(2880001.5552,2),Array(5760003.1104,2)); this.viewportW=mapW; this.viewportH=mapH; this.imgW=12485; this.imgH=6216; this.minX=-597312.5; this.maxX=-160337.5; this.minY=-1342292.5; this.maxY=-1124732.5; } this.coordS=1; var el=new Element('div'); el.id=this.id+'_updiv'; el.style.cssText='position:absolute;left:0px;top:0px;z-index:25;width:'+this.imgW+'px;height:'+this.imgH+'px;'; el.injectInside(this.id); el=null; delete el; this.WAdd=this.px2len(this.tileW); this.HAdd=this.px2len(this.tileH); this.style.cssText='left:0px;top:0px;width:'+this.imgW+'px;height:'+this.imgH+'px'; if(ref==true) this.refholder(); this.scaleimg(); }, scaleimg:function() { var el=$(this.id+'_scaleimg'); if(el) { el.src='http://mapy.atlas.sk/design/scales/'+(this.scales[this.scale][0])+'.gif'; } }, oncontextmenu:function(e) { e=new Event(e); e.preventDefault(); e=null; }, ondblclick:function(e) { if(!this.isref) { e=new Event(e); this.dblZoom(e); } }, ondragstart:function(e) { return false; }, onmousedown:function(e) { this.refmapmoved=false; this.start=[]; this.start.x=this.offsetLeft; this.start.y=this.offsetTop; var cor=this.ShCoord(); cor=null; e=new Event(e); e.stop(); e.stopPropagation(); this.mousepos(e.client.x,e.client.y); if(e.control==true) { this.newPlaceholder(); } else { document.mov=this.id; document.click=[]; document.click.x=e.client.x; document.click.y=e.client.y; document.dobreak=true; } e=null; }, onmouseup:function() { if($('PLACEHOLDER_'+this.id)) { this.finishPlaceholder(); return; } this.start=null; document.mov=null; document.click=null; document.dobreak=false; this.makeTiles(); }, onmousemove:function(e) { if(document.mov) { return; } var pholder=$('PLACEHOLDER_'+this.id); e=new Event(e); this.mousepos(e.client.x,e.client.y); if(!pholder && document.tool!='measure') { e=null; return; } if(pholder) { this.sizePlaceholder(); e=null; return; } e=null; }, mousepos:function(x,y) { this.aclick.y=y; this.aclick.x=x; this.click.y=y-this.getParent().getTop(); this.click.x=x-this.getParent().getLeft(); return {x:this.click.x,y:this.click.y}; }, px2len: function(pxs) { var len=this.scales[this.scale][0]*pxs/(dpi*inchesPerUnit[units]); return len; }, len2px: function(len) { var pxs=(len*(dpi*inchesPerUnit[units]))/this.scales[this.scale][0]; return pxs; }, dblZoom:function(e) { var cor=this.ShCoord(); var x=(cor.minX+(this.px2len(this.click.x))); var y=(cor.maxY-(this.px2len(this.click.y))); cor=null; if(e.shift) this.zoomOut(x,y); else this.zoomIn(x,y); }, whlZoom:function(whl) { var cor=this.ShCoord(); if(whl>0) this.zoomIn(cor.centerX,cor.centerY); else if(whl<0) this.zoomOut(cor.centerX,cor.centerY); }, zoomTo:function(scale,pt) { var scl=this.scale; if(pt.cS!=this.coordS) pt=ConvKlasTrans.doFoo(pt,this.coordS); var cX=pt.x; var cY=pt.y; if( (scale>=4 && scale<=7 && scale==scl) || (scale>7 && scale==scl) || (scale<4 && scale==scl && cX>=this.minX && cX<=this.maxX && cY>=this.minY && cY<=this.maxY && this.isref==false) ) //why to zoom if we dont need to ;) { if(this.slider!=false) $(this.slider).setposition(scl); this.moveTo(pt); } else { this.getmap(scale,pt); } }, zoomIn:function(cX,cY) { if(!cX || !cY) { var cor=this.ShCoord(); cX=cor.centerX; cY=cor.centerY; } if(this.scale>0) { this.zoomTo(this.scale-1,{"x":cX,"y":cY,"cS":this.coordS}); } else { return; } }, zoomOut:function(cX,cY) { if(!cX || !cY) { var cor=this.ShCoord(); cX=cor.centerX; cY=cor.centerY; } if(this.scale<(this.scales.length-1)) { this.zoomTo(this.scale+1,{"x":cX,"y":cY,"cS":this.coordS}); } else { return; } }, getmap: function(zoomL,ptobj) { if (zoomL<0 || zoomL>16) return; var ptobj=ptobj; var cX=ptobj.x; var cY=ptobj.y; var coordS=ptobj.cS; var zoomL=zoomL; var maparr; var maptyp=this.maptype; var zobj=null; while(zobj==null) { maparr=Maps[this.tileW][zoomL]; if((maptyp==1 || maptyp==2) && OrtoArea[this.tileW][zoomL]!=null && this.IsAvialOrto({"centerX":cX,"centerY":cY})) { maparr=OrtoArea[this.tileW][zoomL]; } else if(maptyp==1 || maptyp==2) { if(this.isref==false) { if(!whC) { whC=1; dC=1; Cookie.set("longb",whC,{duration:1024}); Cookie.set("dayb",dC,{duration:1}); showB=true } else if(!dC && whC<=3) { whC++; dC=1; Cookie.set("longb",whC,{duration:1024}); Cookie.set("dayb",dC,{duration:1}); showB=true; } if(showB==true) { $('floattext1').style.display='none'; $('floattext3').style.display='none'; $('floattext2').style.display='block'; $('floatsearch2').open('nuswitchdesk'); $('floatsearch2').timer=setTimeout('$(\'floatsearch2\').close();',8000); } } RefMax(); maparr=Maps[this.tileW][zoomL]; } maparr.forEach(function(item) { if(coordS!=item.coordS) { ptobj=ConvKlasTrans.doFoo(ptobj,item.coordS); coordS=item.coordS; } if(ptobj.x<=item.maxX && ptobj.x>=item.minX && ptobj.y>=item.minY && ptobj.y<=item.maxY) { zobj={"scale":zoomL,"mapid":item.mapid,"imgW":item.imgW,"imgH":item.imgH,"minX":item.minX,"maxX":item.maxX,"minY":item.minY,"maxY":item.maxY,"x":ptobj.x,"y":ptobj.y,"coordS":item.coordS}; } },this); maparr=null; if(zobj==null) { zoomL++; } else break; } this.setmap(zobj); }, setmap:function(opt) { this.scale=opt.scale; this.mapid=opt.mapid; this.imgW=opt.imgW; this.imgH=opt.imgH; this.minX=opt.minX; this.maxX=opt.maxX; this.minY=opt.minY; this.maxY=opt.maxY; this.coordS=opt.coordS; this.WAdd=this.px2len(this.tileW); this.HAdd=this.px2len(this.tileH); this.style.cssText='width:'+this.imgW+'px;height:'+this.imgH+'px;top:0px;left:0px;'; var el=$(this.id+'_updiv'); el.id=this.id+'_updiv'; el.style.cssText='position:absolute;left:0px;top:0px;z-index:25;width:'+this.imgW+'px;height:'+this.imgH+'px;'; el=null; if(this.slider!=false) $(this.slider).setposition(this.scale); if(opt.centerx) { this.centerx=opt.centerx; this.centery=opt.centery; } else { this.centerx=null; this.centery=null; } if(this.isref==false) { if(this.maptype==3 && this.scale<=7) { this.moveTo({"x":opt.x,"y":opt.y,"cS":opt.coordS},true); mpsww(3,true); return; } else if((this.maptype==1 || this.maptype==2) && !this.IsAvialOrto()) { this.moveTo({"x":opt.x,"y":opt.y,"cS":opt.coordS},true); mpsww(0,true); return; } var im=$('copyright'); if(im) { if(this.maptype==1 || this.maptype==2) { im.src='http://mapy.atlas.sk/design/copyright3.gif'; im.useMap='#copymap3'; } else { if(this.scale<10) { im.src='http://mapy.atlas.sk/design/copyright.gif'; im.useMap='#copymap1'; } else { im.src='http://mapy.atlas.sk/design/copyright2.gif'; im.useMap='#copymap2'; } } } } this.scaleimg(); this.moveTo({"x":opt.x,"y":opt.y,"cS":opt.coordS},true); opt=null; if (this.isref) this.refholderMove(); return; }, switchMapType:function(type) { var mapsArr; var cor=this.ShCoord(); var pt=null; if(type!=2) { for (tid in this.tiles[1]) { var til=this.tiles[1][tid]; if($type(til)=='element') { this.removeChild(til); this.tiles[1][tid]=null; } } } if(type!=this.maptype && (type==1 || type==2)) { mapsArr=OrtoArea[this.tileW][this.scale]; mapsArr.forEach(function(item) { if(cor.centerX>=item.minX && cor.centerX<=item.maxX && cor.centerY>=item.minY && cor.centerY<=item.maxY) pt=item; }); if(pt) { this.maptype=type; RefMin(); this.setmap({"scale":this.scale, "mapid":pt.mapid, "imgW":pt.imgW, "imgH":pt.imgH, "minX":pt.minX, "maxX":pt.maxX, "minY":pt.minY, "maxY":pt.maxY, "coordS":this.coordS, "x":cor.centerX, "y":cor.centerY}); } else { mpsww(0,true); } } else if(type!=this.maptype && type==3) { if(this.scale>7) { this.maptype=type; mapsArr=Maps[this.tileW][this.scale]; mapsArr.forEach(function(item) { if(cor.centerX>=item.minX && cor.centerX<=item.maxX && cor.centerY>=item.minY && cor.centerY<=item.maxY) pt=item; }); this.setmap({"scale":this.scale, "mapid":pt.mapid, "imgW":pt.imgW, "imgH":pt.imgH, "minX":pt.minX, "maxX":pt.maxX, "minY":pt.minY, "maxY":pt.maxY, "coordS":this.coordS, "x":cor.centerX, "y":cor.centerY}); } else { mpsww(3,true); } } else if(type!=this.maptype && type==0) { this.maptype=type; mapsArr=Maps[this.tileW][this.scale]; mapsArr.forEach(function(item) { if(cor.centerX>=item.minX && cor.centerX<=item.maxX && cor.centerY>=item.minY && cor.centerY<=item.maxY) pt=item; }); this.setmap({"scale":this.scale, "mapid":pt.mapid, "imgW":pt.imgW, "imgH":pt.imgH, "minX":pt.minX, "maxX":pt.maxX, "minY":pt.minY, "maxY":pt.maxY, "coordS":this.coordS, "x":cor.centerX, "y":cor.centerY}); } return; }, IsAvialOrto:function(pt) { var orto=false; if(this.scale<4) { if(pt) var pt=pt; else { var pt={}; var coord=this.ShCoord(); var p={x:coord.centerX,y:coord.centerY,cS:this.coordS}; if(this.coordS!=1) { p=ConvKlasTrans.doFoo(p,1); } pt.centerX=p.x; pt.centerY=p.y; } var oArr=OrtoArea[this.tileW][this.scale] if(oArr!=null) { oArr.forEach(function(item) { if(pt.centerX<=item.maxX && pt.centerX>=item.minX && pt.centerY>=item.minY && pt.centerY<=item.maxY) orto=true; }); } } return orto; }, checkOrto:function(pt) { var orto=false; var pt=pt; var oArr=OrtoArea[this.tileW][this.scale] if(oArr!=null) { oArr.forEach(function(item) { if(pt.centerX<=item.maxX && pt.centerX>=item.minX && pt.centerY>=item.minY && pt.centerY<=item.maxY) orto=true; }); } if(orto==false) { $('chnrm').src=MapSwitches[0].act; $('chort').src=MapSwitches[1].inact; $('chhybr').src=MapSwitches[2].inact; //this.switchMapType(0); } else { $('chnrm').src=MapSwitches[0].inact; $('chort').src=MapSwitches[1].inact; $('chhybr').src=MapSwitches[2].inact; switch(this.maptype) { case 0: $('chnrm').src=MapSwitches[0].act; break; case 1: $('chort').src=MapSwitches[1].act; break; case 2: $('chhybr').src=MapSwitches[2].act; break; } } }, simplNav:function(what) { var wdth=350; var cor=this.ShCoord(); var len=this.px2len(wdth); var cS=this.coordS; switch(what) { case 'left': if(this.refmap) this.refmapmoved=false; this.moveTo({"x":(cor.centerX-len),"y":cor.centerY,"cS":cS}); break; case 'right': if(this.refmap) this.refmapmoved=false; this.moveTo({"x":(cor.centerX+len),"y":cor.centerY,"cS":cS}); break; case 'up': if(this.refmap) this.refmapmoved=false; this.moveTo({"x":cor.centerX,"y":(cor.centerY+len),"cS":cS}); break; case 'down': if(this.refmap) this.refmapmoved=false; this.moveTo({"x":cor.centerX,"y":(cor.centerY-len),"cS":cS}); break; } }, moveTo: function(coord,noani) { if(coord.cS!=this.coordS) coord=ConvKlasTrans.doFoo(coord,this.coordS); if(!noani) noani=false; if(this.refmap) $(this.refmap).refmapmoved=true; var topP=Math.round(this.len2px(coord.y-this.maxY+this.px2len(this.viewportH/2))); var leftP=Math.round(this.len2px(this.minX+this.px2len(this.viewportW/2)-coord.x)); if(noani==true) { this.style.left=leftP+'px'; this.style.top=topP+'px'; this.makeTiles(); } else { _aniMvHndl(this.id,this.offsetLeft,leftP,this.offsetTop,topP); } return; }, DrawTile: function(x,y) { var coordX=this.minX+this.px2len(x*this.tileW); var coordY=this.maxY-this.px2len(y*this.tileH); var posX=Math.floor(this.tileW*x); var posY=Math.floor(this.tileH*y); var tiltyp=0; var maptyp=this.maptype; if(maptyp==1 || maptyp==2) tiltyp=1; var sr3="http://tile"+(Math.abs((x+y)%4)+1)+".automapy.sk/cache/tiles/"+this.scales[this.scale][0]+"/"+this.mapid+"/"+x+"_"+y+"."; sr1=sr3+((tiltyp==3&&this.scale>7)?"4.":"")+(tiltyp==1?"jpg":"gif"); sr2=sr3+"png"; var tid=x+"_"+y; var tile=this.tiles[0][tid]; if(!tile) { tile=document.createElement('img'); tile.className='tile'; tile.src=sr1; tile.style.cssText='width:'+this.tileW+'px;height:'+this.tileH+'px;left:'+posX+'px;top:'+posY+'px'; this.tiles[0][tid]=tile; return tile; } else { tile.src=sr1; tile.style.cssText='width:'+this.tileW+'px;height:'+this.tileH+'px;left:'+posX+'px;top:'+posY+'px'; //return false; } if(maptyp==2) { var tile=this.tiles[1][tid]; if(!tile) { tile=document.createElement('img'); tile.className='tile'; tile.src='./design/spacer.gif'; tile.style.cssText='width:'+tileW+'px;height:'+tileH+'px;left:'+posX+'px;top:'+posY+'px;z-index:6;background-image:url('+sr2+');#background-image:url(./design/spacer.gif);#filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+sr2+'\',sizingMethod=\'crop\')'; this.tiles[1][tid]=tile; frag.appendChild(tile); } else { tile.src='./design/spacer.gif'; tile.style.cssText='width:'+tileW+'px;height:'+tileH+'px;left:'+posX+'px;top:'+posY+'px;z-index:6;background-image:url('+sr2+');#background-image:url(./design/spacer.gif);#filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+sr2+'\',sizingMethod=\'crop\')'; } tile=null; } }, PurgeTiles: function() { var tiles=[[],[]]; var xtiles=this.tiles[0]; var atiles=this.atiles var maptyp=this.maptype; var til; for (tid in xtiles) { til=xtiles[tid]; if(!atiles[tid]) { if($type(til)=='element') { this.removeChild(til); til=null; } } else { tiles[0][tid]=til; } } if(this.maptype==2) { xtiles=this.tiles[1]; for (tid in xtiles) { til=xtiles[tid]; if(!atiles[tid]) { if($type(til)=='element') { this.removeChild(til); til=null; } } else { tiles[1][tid]=til; } } } this.tiles=tiles; delete til; delete tiles; }, makeTiles: function() { var cor=this.ShCoord(); pGroups=[]; if(!this.isref) { if(cor.centerX>this.maxX || cor.centerXthis.maxY || cor.centerY=4)?"2_":"")+x+"_"+y+"."; sr1=sr3+((tiltyp==3&&this.scale>7)?"4.":"")+(tiltyp==1?"jpg":"gif"); sr2=sr3+"png"; var tid=x+"_"+y; var tile=this.tiles[0][tid]; if(!tile) { tile=document.createElement('img'); tile.className='tile'; tile.src=sr1; tile.style.cssText='width:'+tileW+'px;height:'+tileH+'px;left:'+posX+'px;top:'+posY+'px;z-index:5;'; this.tiles[0][tid]=tile; frag.appendChild(tile); } else { tile.src=sr1; tile.style.cssText='width:'+tileW+'px;height:'+tileH+'px;left:'+posX+'px;top:'+posY+'px;z-index:5;'; } tile=null; if(maptyp==2) { var tile=this.tiles[1][tid]; if(!tile) { tile=document.createElement('img'); tile.className='tile'; tile.src='./design/spacer.gif'; tile.style.cssText='width:'+tileW+'px;height:'+tileH+'px;left:'+posX+'px;top:'+posY+'px;z-index:6;background-image:url('+sr2+');#background-image:url(./design/spacer.gif);#filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+sr2+'\',sizingMethod=\'crop\')'; this.tiles[1][tid]=tile; frag.appendChild(tile); } else { tile.src='./design/spacer.gif'; tile.style.cssText='width:'+tileW+'px;height:'+tileH+'px;left:'+posX+'px;top:'+posY+'px;z-index:6;background-image:url('+sr2+');#background-image:url(./design/spacer.gif);#filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+sr2+'\',sizingMethod=\'crop\')'; } tile=null; } delete tile; } } this.appendChild(frag); this.PurgeTiles(); cor=this.ShCoord(); if(this.refmap) $(this.refmap).refholderMove(); if(this.isref==false) { document.redrawmap(); if(this.bubble) { this.bubble.redraw(); } } if(this.isref==false && this.refmap) { if(this.scale!=$(this.refmap).scale) { $(this.refmap).getmap(this.scale,{"x":cor.centerX,"y":cor.centerY,"cS":this.coordS}); return; } } if(this.refmapmoved!=true && this.refmap) { this.refmapmoved=true; $(this.refmap).moveTo({"x":cor.centerX,"y":cor.centerY,"cS":this.coordS},true); cor=null; } return; }, getCommerceLayer:function() { pGroups=[]; var glayers=''; var scl=this.scale; var i=0; var q=0; var l; this.drawPoints(); for(i=0;i=scl && LAYERMAP['l'+l].on==true) { if(q==0) glayers+=''+l; else glayers+='|'+l; q++; } } if(glayers!='' && this.getpoints==true) { var cor=this.ShCoord(); var minx=cor.minX; var maxy=cor.maxY; if(this.coordS!=1) { var pt={x:minx,y:maxy,cS:this.coordS}; pt=ConvKlasTrans.doFoo(pt,1); minx=pt.x; maxy=pt.y; pt=null; } var maxx=minx+this.px2len(this.viewportW); var miny=maxy-this.px2len(this.viewportH); var poststr=''; poststr+='xmin='+minx; poststr+='&xmax='+maxx; poststr+='&ymin='+miny; poststr+='&ymax='+maxy; document.ajax("paid_points/index2.php",poststr+'&layers='+glayers,'$(\''+this.id+'\').makeCommerceLayer',this.id); } else { for(i=0;i=xmin && a.x<=xmax) || (b.x>=xmin && b.x<=xmax)) && ((a.y>=ymin && a.y<=ymax) || (b.y>=ymin && b.y<=ymax))) //boundingbox overlaps ? { if(zq==0) { gminx=a.x; gmaxx=a.x; gminy=a.y; gmaxy=a.y; } //geometry bbox if(a.xgmaxx) gmaxx=a.x; if(b.x>gmaxx) gmaxx=b.x; if(a.ygmaxy) gmaxy=a.y; if(b.y>gmaxy) gmaxy=b.y; ln=[]; ln.x1=a.x; ln.y1=a.y; ln.x2=b.x; ln.y2=b.y; lines[zq]=ln; zq++; } ln=null; a=null; b=null; } var cpos=this.coordToPos(gminx,gmaxy); var diffx=Math.round(this.len2px(gmaxx-gminx)); var diffy=Math.round(this.len2px(gmaxy-gminy)); el=$('geometry_'+this.id); if(el) el.remove(); el=document.createElement("canvas"); var iscanv=true; try { cx=el.getContext("2d"); } catch(e) { iscanv=false; } if(iscanv==true) { var dx=new Element('div'); dx.id='geometry_'+this.id; dx.injectInside(this); el.injectInside(dx); dx.style.position='absolute'; dx.style.zIndex='7'; dx.style.left=(cpos.px-10)+'px'; dx.style.top=(cpos.py-10)+'px'; dx.style.width=(diffx+20)+'px'; dx.style.height=(diffy+20)+'px'; el.style.position='absolute'; el.style.zIndex='999'; el.width=(diffx+20); el.height=(diffy+20); cx.lineWidth=8; cx.strokeStyle = "#dd0000"; cx.lineStyle="thickbetweenthin"; cx.lineCap= "round"; cx.globalAlpha="0.7"; cx.beginPath(); } var i=0; var lnstr=''; zq=0; lines.forEach(function(ln) { var acor=this.coordToPos(ln.x1,ln.y1,gminx,gmaxy); var bcor=this.coordToPos(ln.x2,ln.y2,gminx,gmaxy); if(iscanv==false) { lnstr+=(zq==0?'':',')+acor.px+','+acor.py+','+bcor.px+','+bcor.py; } else { if(zq==0) { cx.moveTo((acor.px+10),(acor.py+10)); cx.lineTo((bcor.px+10),(bcor.py+10)); } else { cx.lineTo((bcor.px+10),(bcor.py+10)); } } acor=null; bcor=null; zq++; },this); if(iscanv==true) { cx.stroke(); dx=null; } else { el=new Element('v:polyline'); el.id='geometry_'+this.id; el.style.position='absolute'; el.style.zIndex='7'; el.style.left=(cpos.px?cpos.px:'0')+'px'; el.style.top=(cpos.py?cpos.py:'0')+'px'; el.style.width=(diffx?diffx:'0')+'px'; el.style.height=(diffy?diffy:'0')+'px'; el.filled="no"; el.points=lnstr; el.injectInside(this); var stroke=new Element('v:stroke'); stroke.injectInside(el); el.strokeweight="8px"; el.strokecolor="#dd0000"; stroke.opacity='0.7'; stroke.linestyle='thickbetweenthin'; stroke.endcap='round'; stroke=null; } el=null; cx=null; } }, ShCoord: function() { var coordArr=[]; coordArr.minX=this.minX-this.px2len(this.offsetLeft); coordArr.maxY=this.maxY+this.px2len(this.offsetTop); coordArr.centerX=coordArr.minX+this.px2len(this.viewportW/2); coordArr.centerY=coordArr.maxY-this.px2len(this.viewportH/2); return coordArr; }, DrawRowCol:function(z,what) { var frag = document.createDocumentFragment(); var minX=this.minX; var maxY=this.maxY; var WAdd=this.WAdd; var HAdd=this.HAdd; var tileW=this.tileW; var tileH=this.tileH; var mapid=this.mapid; var scl=this.scales[this.scale][0]; var ymin=this.bords.ymin; var ymax=this.bords.ymax; var xmin=this.bords.xmin; var xmax=this.bords.xmax; var sr1,sr3; var tiltyp=0; var maptyp=this.maptype; if(maptyp==1 || maptyp==2) tiltyp=1; else if(maptyp==3) tiltyp=3; var tileadr=".automapy.sk/cache/tiles.new/"+this.scales[this.scale][0]+"/"+mapid+"/"; if(what=="x") { if(z>=xmax) { this.bords.xmax=z; z--; } else if(z=4)?"2_":"")+z+"_"+i+"."; sr1=sr3+((tiltyp==3&&this.scale>7)?"4.":"")+(tiltyp==1?"jpg":"gif"); var tid=z+"_"+i; var tile=this.tiles[0][tid]; if(!tile) { tile=document.createElement('img'); tile.className='tile'; tile.src=sr1; tile.style.cssText='width:'+tileW+'px;height:'+tileH+'px;left:'+posX+'px;top:'+posY+'px'; this.tiles[0][tid]=tile; frag.appendChild(tile); } else { tile.src=sr1; tile.style.cssText='width:'+tileW+'px;height:'+tileH+'px;left:'+posX+'px;top:'+posY+'px'; } tile=null; } } else if(what=="y") { if(z>=ymax) this.bords.ymax=z; if(z=4)?"2_":"")+i+"_"+z+"."; sr1=sr3+((tiltyp==3&&this.scale>7)?"4.":"")+(tiltyp==1?"jpg":"gif"); var tid=i+"_"+z; var tile=this.tiles[0][tid]; if(!tile) { tile=document.createElement('img'); tile.className='tile'; tile.src=sr1; tile.style.cssText='width:'+tileW+'px;height:'+tileH+'px;left:'+posX+'px;top:'+posY+'px'; this.tiles[0][tid]=tile; frag.appendChild(tile); } else { tile.src=sr1; tile.style.cssText='width:'+tileW+'px;height:'+tileH+'px;left:'+posX+'px;top:'+posY+'px'; } tile=null; } } this.appendChild(frag); }, MapMover: function(leftPos,topPos) { var cor=this.ShCoord(); var xmin=Math.floor((cor.minX-this.minX)/this.WAdd ); var xmax=Math.ceil(((cor.minX-this.minX)+this.px2len(this.viewportW))/this.WAdd); var ymin=Math.floor(((this.maxY-cor.maxY)/this.HAdd)); var ymax=Math.ceil((((this.maxY-cor.maxY)+this.px2len(this.viewportH))/this.HAdd)); cor=null; if(xminthis.bords.xmax) this.DrawRowCol(xmax, 'x'); if(ymin=this.bords.ymax) this.DrawRowCol(ymax, 'y'); }, drag:function(e) { document.dobreak=true; var x=e.client.x-document.click.x; var y=e.client.y-document.click.y; var posX=Math.round(this.start.x+x); var posY=Math.round(this.start.y+y); this.style.cssText='left:'+posX+'px;top:'+posY+'px;width:'+this.imgW+'px;height:'+this.imgH+'px'; this.MapMover(posX,posY); if(this.refmap) $(this.refmap).refholderMove(); }, newPlaceholder:function() { document.resetTool(); document.startpos=[]; var cor=this.ShCoord(); var x=(cor.minX+(this.px2len(this.click.x))); var y=(cor.maxY-(this.px2len(this.click.y+window.getScrollTop()))); var px=Math.abs(this.minX-x); var py=Math.abs(this.maxY-y); px=Math.round(this.len2px(px)); py=Math.round(this.len2px(py)); var ptid='PLACEHOLDER_'+this.id; var el=$(ptid); if(!el) { document.resetTool(); el=new Element('div'); el.id=ptid; el.className='placeholder'; el.injectInside(this.id); } document.startpos.x=px; document.startpos.y=py; el.style.left=px+'px'; el.style.top=py+'px'; el.style.width='0px'; el.style.height='0px'; el=null; }, sizePlaceholder:function() { var ptid='PLACEHOLDER_'+this.id; var el=$(ptid); var cor=this.ShCoord(); var x=(cor.minX+(this.px2len(this.click.x))); var y=(cor.maxY-(this.px2len(this.click.y+window.getScrollTop()))); var px=Math.abs(this.minX-x); var py=Math.abs(this.maxY-y); px=Math.round(this.len2px(px)); py=Math.round(this.len2px(py)); var leftPos=(px<=document.startpos.x)?px:document.startpos.x; var topPos=(py<=document.startpos.y)?py:document.startpos.y; el.style.width=(Math.abs(document.startpos.x-px))+'px'; el.style.height=(Math.abs(document.startpos.y-py))+'px'; el.style.left=leftPos+'px'; el.style.top=topPos+'px'; el=null; }, finishPlaceholder:function() { var ptid='PLACEHOLDER_'+this.id; var el=$(ptid); var xscale=(this.px2len(el.offsetWidth)*(dpi*inchesPerUnit[units]))/this.viewportW; var cY=this.maxY-this.px2len(el.offsetTop+el.offsetHeight/2); var cX=this.minX+this.px2len(el.offsetLeft+el.offsetWidth/2); var i=0; var sc=0; el.remove(); el=null; for(i=this.scale;i>=0;i--) { if((i-1)>=0 && xscale<=this.scales[i][0] && xscale>=this.scales[i-1][0]) { sc=i; break; } } this.zoomTo(sc,{"x":cX,"y":cY,"cS":this.coordS}); }, bboxZoom:function(ptmin,ptmax) { if(ptmin.cS!=this.coordS) ptmin=ConvKlasTrans.doFoo(ptmin,this.coordS); if(ptmax.cS!=this.coordS) ptmax=ConvKlasTrans.doFoo(ptmax,this.coordS); var sc=0; var cY=ptmax.y+((ptmin.y-ptmax.y)/2); var cX=ptmax.x+((ptmin.x-ptmax.x)/2); var xscalew=(Math.abs(ptmax.x-ptmin.x)*(dpi*inchesPerUnit[units]))/this.viewportW; var xscaleh=(Math.abs(ptmax.y-ptmin.y)*(dpi*inchesPerUnit[units]))/this.viewportH; var xscale=((xscalew>xscaleh)?xscalew:xscaleh); for(var i=(this.scales.length-1);i>=0;i--) { if((i-1)>=0 && xscale<=this.scales[i][0] && xscale>=this.scales[i-1][0]) { sc=i; break; } } this.zoomTo(sc,{"x":cX,"y":cY,"cS":this.coordS}); }, getGPS:function(cx,cy) { if($('RCMENU_'+this.id)) { $('RCMENU_'+this.id).remove(); } if(this.isref==true) return; if(!cx || !cy) { var cor=this.ShCoord(); var x=(cor.minX+(this.px2len(this.click.x))); var y=(cor.maxY-(this.px2len(this.click.y))); } else { var x=cx; var y=cy; } var point=ConvKlasTrans.doFoo({"x":x,"y":y,"cS":this.coordS},0); var gps=ConvKlasTrans.fgeo(point.x,point.y); this.showGPS({"x":x,"y":y,"lon":gps.lon,"lat":gps.lat}); }, hideGPS:function() { if($('GPS_'+this.id)) { $('GPS_'+this.id).remove(); } }, showGPS:function(p) { if($('RCMENU_'+this.id)) { $('RCMENU_'+this.id).remove(); } document.resetTool(); var pcor=this.coordToPos(p.x,p.y); ptid='GPS_'+this.id; var el=$(ptid); if(!el) { el=new Element('div'); el.id=ptid; el.className='pointdiv'; el.injectInside(this.id); el.style.zIndex='999'; smdiv=new Element('div'); smdiv.className='labeldiv'; smdiv.injectInside(el); nmdiv=new Element('div'); nmdiv.className='bubble'; nmdiv.injectInside(smdiv); var str=''; str+='
'; str+='
'; str+=''; str+='
 
'; str+='
GPS súradnica
'; str+='
'; str+='
'; str+='
'; str+='
'; str+=''; str+='
'; str+='
Štart cesty
'; str+='
Koniec cesty
'; str+='
'; str+='
'; str+='
'; str+='
'; str+=''; nmdiv.innerHTML=str; nmdiv.style.zIndex='999'; smdiv.style.top=((-1)*nmdiv.offsetHeight)+'px'; smdiv.style.left='-11px'; nmdiv=null; smdiv=null; } el.style.left=pcor.px+'px'; el.style.top=pcor.py+'px'; el.onmousedown=function(e) { e=new Event(e); e.stop(); e=null; } el=null; }, rightMenu:function() { if(this.isref==true) return; this.refmapmoved=false; document.resetTool(); var cor=this.ShCoord(); var x=(cor.minX+(this.px2len(this.click.x))); var y=(cor.maxY-(this.px2len(this.click.y))); var coor=$('mappa').getCoordinates(); var rcor=$('refmapdesk').getCoordinates(); var pcor=this.coordToPos(x,y); ptid='RCMENU_'+this.id; var el=$(ptid); if(!el) { el=new Element('div'); el.id=ptid; el.className='pointdiv'; el.injectInside(this.id); el.style.zIndex='999'; smdiv=new Element('div'); smdiv.className='labeldiv'; smdiv.injectInside(el); var nmdiv=new Element('div'); nmdiv.innerHTML=''; nmdiv.className='lbl'; nmdiv.style.width='20px'; nmdiv.injectInside(smdiv); var w=nmdiv.offsetWidth; nmdiv=null; nmdiv=new Element('div'); var o=Math.round(w/2-6); nmdiv.innerHTML=''; nmdiv.style.height='5px'; nmdiv.injectInside(smdiv); var w=nmdiv.offsetWidth; nmdiv=null; smdiv.style.top=((-1)*smdiv.offsetHeight)+'px'; smdiv.style.left='-11px'; nmdiv=new Element('div'); nmdiv.style.position='absolute'; var str=''; str+=''; str+=''; str+='
Označiť miesto
'; str+=''; if(this.scale<13) { str+='
Štart cesty
'; str+=''; str+='
Koniec cesty
'; str+=''; } str+='
Zobraziť GPS
'; str+=''; str+='
Vytlačiť mapu
'; str+=''; str+='
Oznámiť chybu
'; nmdiv.innerHTML=str; nmdiv.className='menulbl'; nmdiv.injectInside(smdiv); nmdiv.style.left='26px'; nmdiv.style.top='0px'; str=null; /* str=new Element('div'); str.id='rmads'; str.injectInside(nmdiv); dpAds('5','rmads'); */ nmdiv=null; smdiv=null; } el.style.left=pcor.px+'px'; el.style.top=pcor.py+'px'; el.onmousedown=function(e) { e=new Event(e); e.stop(); e=null; } el=null; var movl=0; var movt=0; if((this.aclick.x+170)>(coor.left+coor.width)) { movl=150; } if(this.aclick.x(coor.top+coor.height)) { movt=-150; } if(((this.aclick.x+170)>rcor.left) && (this.aclick.y=xmin && x<=xmax && y>=ymin && y<=ymax) { if(!this.LPOINTSD[ptid]) { tmppoints[ptid]=this.drawPoint(this.LPOINTS[ptid]); } else { tmppoints[ptid]=this.LPOINTSD[ptid]; } tmppoints[ptid].sredraw(); } else { this.removePoint(ptid); } } this.LPOINTSD=tmppoints; tmppoints=null; return; }, refholder:function() { var ptid='REFHOLDER_'+this.id; var el=$(ptid); if(!el) { el=new Element('div'); el.id=ptid; el.className='placeholder'; el.injectInside(this.id); } el.style.width='90px'; el.style.height='70px'; el.style.left='0px'; el.style.top='0px'; el=null; delete el; //this.refholderSize(); this.refholderMove(); }, refholderMove:function() { var ptid='REFHOLDER_'+this.id; var el=$(ptid); if(el) { var cor=$(this.refmap).ShCoord(); var cor2=this.ShCoord(); var px=Math.abs(this.minX-cor.centerX); var py=Math.abs(this.maxY-cor.centerY); px=Math.round(this.len2px(px)); py=Math.round(this.len2px(py)); el.style.left=(Math.round(px-(el.offsetWidth/2)))+'px'; el.style.top=(Math.round(py-(el.offsetHeight/2)))+'px'; cor=null; } el=null; }, refholderSize:function() { //var ptid='REFHOLDER_'+this.id; //var el=$(ptid); //if(el!=false) //{ //el.style.width='90px'; //el.style.height='70px'; //el.style.width=Math.round(this.len2px($(this.refmap).px2len($(this.refmap).viewportW)))+'px'; //el.style.height=Math.round(this.len2px($(this.refmap).px2len($(this.refmap).viewportH)))+'px'; //} //el=null; } }); _pointdiv=({ il:null, ini:function(po,maplay) { this.timer=null; this.po=po; if(!po.paid) this.paid=0; else this.paid=po.paid; this.maplay=maplay; this.il=new Element('img'); this.il.src=LAYERICONS['l'+this.po.layer].icon; this.il.injectInside(this); this.il.style.cssText='position:absolute;left:'+LAYERICONS['l'+this.po.layer].xo+'px;top:'+LAYERICONS['l'+this.po.layer].yo+'px;width:'+LAYERICONS['l'+this.po.layer].w+'px;height:'+LAYERICONS['l'+this.po.layer].h+'px;cursor:pointer'; this.il.title=this.po.name; this.il.alt=this.po.name; }, onmousedown:function(e) { e=new Event(e); e.stop(); e.stopPropagation(); e=null; }, onmouseup:function(e) { e=new Event(e); e.stop(); e.stopPropagation(); e=null; }, sredraw:function() { var cS=$('mappa_in').coordS; if(this.po.coord.cS!=cS) this.po.coord=ConvKlasTrans.doFoo(this.po.coord,cS); var pcor=$(this.maplay).coordToPos(this.po.coord.x,this.po.coord.y); this.style.zIndex=(30+this.paid); var pG={minX:(pcor.px-10),maxX:(pcor.px+10),minY:(pcor.py-10),maxY:(pcor.py+10),num:1}; var i; var PPG=4; if(pGroups.length<1) { pGroups[0]=pG; } else { var isInG=false; for(i=0;i=pGl.minX)&&(pG.minX<=pGl.maxX)) || ((pG.maxX>=pGl.minX)&&(pG.maxX<=pGl.maxX))) && (((pG.minY>=pGl.minY)&&(pG.minY<=pGl.maxY)) || ((pG.maxY>=pGl.minY)&&(pG.maxY<=pGl.maxY)))) { isInG=true; var m=MOD(pGl.num,PPG); pcor.px=pGl.minX+10+20*(m.d); pcor.py=pGl.minY+10+(20*m.c); var pxG={minX:pGl.minX,maxX:(pGl.minX+20*(m.d+1)),minY:pGl.minY,maxY:pGl.minY+20*(m.c+1),num:(pGl.num+1)}; pGroups[i]=pxG; pxG=null; break; } } if(isInG==false) { pGroups[pGroups.length]=pG; } } this.style.left=pcor.px+'px'; this.style.top=pcor.py+'px'; }, onmouseover:function() { if(!window.ie) this.onmouseenter(); }, onmouseout:function() { if(!window.ie) this.onmouseleave(); }, onmouseenter:function() { this.hilit(); }, onmouseleave:function() { this.dehilit(); }, hilit:function() { this.style.zIndex='999'; }, dehilit:function() { this.style.zIndex=(30+this.paid); }, onclick:function(e) { e=new Event(e); e.stop(); e.stopPropagation(); e=null; //$(this.maplay).drawBubble(this.po.coord, this.po.html, LAYERMAP['l'+this.po.layer].editable,((this.po.typ==3 && this.po.paid==1)?true:false), null, this.po.pid); } }); _bublediv=({ el:null, editable:false, showgps:false, sGPS:false, ptid:null, pidel:null, ini:function(coord,content,mapdiv,editable,showgps,pidel,pid) { if(pid) this.ptid=pid; if(pidel) this.pidel=pidel; if(editable) this.editable=editable; if(showgps) this.showgps=showgps; this.coord=coord; this.maplay=mapdiv; if(this.bg) { this.bg.empty(); this.bg.remove(); } if(this.st) { this.st.empty(); this.st.remove(); } if(this.inn) { this.inn.removeEvents(); this.inn.empty(); this.inn.remove(); } if(this.cls) { this.cls.removeEvents(); this.cls.empty(); this.cls.remove(); } this.bg=new Element('div'); this.bg.className='vizitka_bg'; this.bg.injectInside(this); this.st=new Element('div'); this.st.className='vizitka_stonka'; this.st.injectInside(this); this.inn=new Element('div'); this.inn.addEvent('mousedown',this.mouseD.bind(this)); this.inn.className='vizitka_in'; var editable=true; this.inn.setHTML('
'+content+'
'+(this.editable==true?'Upraviť polohu':'')+(this.editable==true && this.showgps==true?' | ':'')+(this.showgps==true?'GPS Súradnica':'')+'
').injectInside(this); this.cls=new Element('div'); this.cls.setHTML('Zatvoriť'); this.cls.className='v_cls'; this.cls.injectInside(this.inn); this.cls.addEvent('click',this.close.bind(this)); this.redraw(); this.size(); if($('bubgps')) $('bubgps').addEvent('click',this.ShowGPS.bind(this)); this.wrapMap(); }, wrapMap:function() { var posB = this.inn.getCoordinates(); var posR = $('refmapdesk').getCoordinates(); var posS = $('nuswitchdesk').getCoordinates(); var posM = $('mapmaindesk').getCoordinates(); var posN = $('mapnavigatedesk').getCoordinates(); posB.left=posB.left-posM.left; posR.left=posR.left-posM.left; posS.left=posS.left-posM.left; posN.left=posN.left-posM.left; posB.top=posB.top-posM.top; posR.top=posR.top-posM.top; posS.top=posS.top-posM.top; posN.top=posN.top-posM.top; var movtoX=0; var movtoY=0; var cnM=20; var prIN=false; if((posB.left+posB.width)>=posM.width)//je mimo sprava { movtoX=(posB.left+posB.width+cnM)-posM.width; } if(posB.left<=0)//je mimo zlava { movtoX=posB.left-cnM; } if( (posB.left<=posS.left+posS.width) && posB.top<=(posS.top+posS.height))//zasahuje do prepinacov { movtoX=-1*((posS.left+posS.width+cnM)-posB.left); } if(((posB.left+posB.width)>=posR.left && posB.top<=(posR.top+posR.height)))//zasahuije do prehladovky { movtoX=movtoX=(posB.left+posB.width+cnM)-posR.left; prIN=true; } if( ((posB.left+posB.width)>=posN.left && posB.top<=(posN.top+posN.height)) && prIN==false )//zasahuje do ruzice { movtoX=movtoX=(posN.left+posN.width+cnM)-posN.left; } if(posB.top<=0)//je mimo zhora { movtoY=(-1*posB.top+cnM); } if(movtoX!=0 || movtoY!=0) { var cor=$('mappa_in').ShCoord(); var lenX=$('mappa_in').px2len(movtoX); var lenY=$('mappa_in').px2len(movtoY); var cS=$('mappa_in').coordS; $('mappa_in').moveTo({"x":(cor.centerX+lenX),"y":(cor.centerY+lenY),"cS":cS}); } }, redraw:function() { var cS=$(this.maplay).coordS; if(this.coord.cS!=cS) this.coord=ConvKlasTrans.doFoo(this.coord,cS); var pcor=$(this.maplay).coordToPos(this.coord.x,this.coord.y); this.style.cssText='position:absolute;left:'+pcor.px+'px;top:'+pcor.py+'px;z-index:999'; pcor=null; cS=null; }, size:function() { var maxH=200; var minH=100; var tH=0; var bH=0; var cH; if($E('div.v_t',this.inn)) tH=$E('div.v_t',this.inn).offsetHeight; if($E('div.v_bott',this.inn)) bH=$E('div.v_bott',this.inn).offsetHeight; if($E('div.v_c_t',this.inn)) { cH=$E('div.v_c_t',this.inn).offsetHeight; $E('div.v_c_t',this.inn).style.height='auto'; if((tH+cH+bH)>maxH) { cH=(maxH-tH); $E('div.v_c_t',this.inn).style.height=cH+'px'; } if((tH+cH+bH)'; this.GPS.injectInside($E('div.v_c_t',this.inn)); this.sGPS=true; this.wrapMap(); this.size(); } else { this.GPS.empty(); this.GPS.remove(); this.GPS=null; this.sGPS=false; } }, mouseD:function(e) { e=new Event(e); e.stopPropagation(); e.stop(); e=null; } }); _spointdiv=({ il:null, lbl:null, ini:function(po,maplay,frm) { this.timer=null; this.po=po; this.po.html=this.po.html.replace('{RP}','Naplánovať cestu'); if(!po.paid) this.paid=0; else this.paid=po.paid; this.maplay=maplay; this.frm=frm; this.il=new Element('img'); if(this.po.paid==1) this.il.src='http://mapy.atlas.sk/design/layers/green_filled.gif'; else this.il.src='http://mapy.atlas.sk/design/layers/orange_filled.gif'; this.il.injectInside(this); this.il.style.cssText='position:absolute;left:-12px;top:-26px;width:24px;height:26px;cursor:pointer;z-index:1'; this.il.title=this.po.name; this.il.alt=this.po.name; this.lbl=new Element('div'); this.lbl.style.cssText='position:absolute;width:24px;line-height:20px;color:#fff;font-weight:bold;left:-12px;text-align:center;font-size:11px;font-family:verdana;top:-26px;z-index:2;cursor:pointer'; this.lbl.innerHTML=this.po.nmb; this.lbl.injectInside(this); this.lbl.title=this.po.name; this.lbl.alt=this.po.name; }, onmousedown:function(e) { e=new Event(e); e.stop(); e.stopPropagation(); e=null; }, onmouseup:function(e) { e=new Event(e); e.stop(); e.stopPropagation(); e=null; }, sredraw:function() { var cS=$(this.maplay).coordS; if(this.po.coord.cS!=cS) this.po.coord=ConvKlasTrans.doFoo(this.po.coord,cS); var pcor=$(this.maplay).coordToPos(this.po.coord.x,this.po.coord.y); this.style.zIndex=(40+this.paid); this.style.left=pcor.px+'px'; this.style.top=pcor.py+'px'; }, onmouseover:function() { if(!window.ie) this.onmouseenter(); }, onmouseout:function() { if(!window.ie) this.onmouseleave(); }, onmouseenter:function() { this.hilit(); if($(this.frm).results[this.po.pid]) $(this.frm).results[this.po.pid].hilit(); }, onmouseleave:function() { this.dehilit(); if($(this.frm).results[this.po.pid]) $(this.frm).results[this.po.pid].dehilit(); }, hilit:function() { this.style.zIndex='999'; if(this.po.paid==1) this.il.src='http://mapy.atlas.sk/design/layers/green_unfilled.gif'; else this.il.src='http://mapy.atlas.sk/design/layers/orange_unfilled.gif'; this.il.style.cssText='position:absolute;left:-12px;top:-26px;width:24px;height:26px;cursor:pointer;z-index:1'; this.lbl.style.cssText='position:absolute;width:24px;line-height:20px;color:#ff6000;font-weight:bold;left:-12px;text-align:center;font-size:11px;font-family:verdana;top:-26px;z-index:2;cursor:pointer'; }, dehilit:function() { this.style.zIndex=(40+this.paid); if(this.po.paid==1) this.il.src='http://mapy.atlas.sk/design/layers/green_filled.gif'; else this.il.src='http://mapy.atlas.sk/design/layers/orange_filled.gif'; this.il.style.cssText='position:absolute;left:-12px;top:-26px;width:24px;height:26px;cursor:pointer;z-index:1'; this.lbl.style.cssText='position:absolute;width:24px;line-height:20px;color:#fff;font-weight:bold;left:-12px;text-align:center;font-size:11px;font-family:verdana;top:-26px;z-index:2;cursor:pointer'; }, onclick:function(e) { return; } }); _search=({ clicked:null, results:{}, POINTSM:[], POINTSD:{}, POINTS:{}, pager:null, init:function() { this.oname='search'; }, dosearch:function() { closSrWin(); this.removePoints(); $('srchpgr').style.display='none'; if(this.x.value=='' || this.y.value=='') { var cor=$('mappa_in').ShCoord(); var cx=cor.centerX; var cy=cor.centerY; cor=null; if($('mappa_in').coordS!=1) { var coord=ConvKlasTrans.doFoo({x:cx,y:cy,cS:$('mappa_in').coordS},1); cx=coord.x; cy=coord.y; coord=null; } this.x.value=cx; this.y.value=cy; } var poststr=this.toQueryString(); document.ajax("mapsearch/index.php",poststr,'$(\''+this.id+'\').writeSearch'); }, removePoints:function() { if(this.POINTSM.length>0) { for(i=0;i0) { $('srout').style.display='block'; for(i=0;i1) { $('srout').style.display='block'; $('norespt').style.display='none'; $('respt').style.display='block'; for(i=0;i'+this.po.desc+''):(''+this.po.name+'
'+this.po.desc))+''; }, onmouseenter:function() { if(this.clicked==false) this.hilit(); if($(this.frm).POINTSD[this.po.pid]) $('sfrm3').POINTSD[this.po.pid].hilit(); }, onmouseleave:function() { if(this.clicked==false) this.dehilit(); if($(this.frm).POINTSD[this.po.pid]) $('sfrm3').POINTSD[this.po.pid].dehilit(); }, hilit:function() { this.style.cssText="background-color:#e7eff5;cursor:pointer;"; }, dehilit:function() { if(this.clicked==false) { if(this.po.typ==7) this.style.cssText="background-color:#fefcf2;cursor:pointer;"; else this.style.cssText="background-color:#fff;cursor:pointer;"; } }, onmouseover:function() { if(!window.ie) this.onmouseenter(); }, onmouseout:function() { if(!window.ie) this.onmouseleave(); }, onclick:function() { closSrWin(); var zoomL=4; $(this.maplay).refmapmoved=false; if(this.po.typ==1 || this.po.typ==3 || this.po.typ==7) zoomL=1; else if(this.po.typ==2) zoomL=4; else if(this.po.typ==4) zoomL=12; setTimeout('$(\'sfrm3\').reset();',200); setTimeout('$(\''+this.maplay+'\').zoomTo('+zoomL+',{x:'+this.po.coord.x+',y:'+this.po.coord.y+',cS:'+this.po.coord.cS+'});',300); setTimeout('$(\''+this.maplay+'\').drawEpoint({x:'+this.po.coord.x+',y:'+this.po.coord.y+',cS:'+this.po.coord.cS+'});',400); }, declick:function() { this.clicked=false; this.dehilit(); $(this.frm).clicked=null; }, oBuble:function() { return; } }) _spointdiv=({ il:null, lbl:null, ini:function(po,maplay,frm) { this.timer=null; this.po=po; this.po.html=this.po.html.replace('{RP}','Naplánovať cestu'); if(!po.paid) this.paid=0; else this.paid=po.paid; this.maplay=maplay; this.frm=frm; this.il=new Element('img'); if(this.po.paid==1) this.il.src='http://mapy.atlas.sk/design/layers/green_filled.gif'; else this.il.src='http://mapy.atlas.sk/design/layers/orange_filled.gif'; this.il.injectInside(this); this.il.style.cssText='position:absolute;left:-12px;top:-26px;width:24px;height:26px;cursor:pointer;z-index:1'; this.il.title=this.po.name; this.il.alt=this.po.name; this.lbl=new Element('div'); this.lbl.style.cssText='position:absolute;width:24px;line-height:20px;color:#fff;font-weight:bold;left:-12px;text-align:center;font-size:11px;font-family:verdana;top:-26px;z-index:2;cursor:pointer'; this.lbl.innerHTML=this.po.nmb; this.lbl.injectInside(this); this.lbl.title=this.po.name; this.lbl.alt=this.po.name; }, onmousedown:function(e) { e=new Event(e); e.stop(); e.stopPropagation(); e=null; }, onmouseup:function(e) { e=new Event(e); e.stop(); e.stopPropagation(); e=null; }, sredraw:function() { var cS=$(this.maplay).coordS; if(this.po.coord.cS!=cS) this.po.coord=ConvKlasTrans.doFoo(this.po.coord,cS); var pcor=$(this.maplay).coordToPos(this.po.coord.x,this.po.coord.y); this.style.zIndex=(40+this.paid); this.style.left=pcor.px+'px'; this.style.top=pcor.py+'px'; }, onmouseover:function() { if(!window.ie) this.onmouseenter(); }, onmouseout:function() { if(!window.ie) this.onmouseleave(); }, onmouseenter:function() { this.hilit(); if($(this.frm).results[this.po.pid]) $(this.frm).results[this.po.pid].hilit(); }, onmouseleave:function() { this.dehilit(); if($(this.frm).results[this.po.pid]) $(this.frm).results[this.po.pid].dehilit(); }, hilit:function() { this.style.zIndex='999'; if(this.po.paid==1) this.il.src='http://mapy.atlas.sk/design/layers/green_unfilled.gif'; else this.il.src='http://mapy.atlas.sk/design/layers/orange_unfilled.gif'; this.il.style.cssText='position:absolute;left:-12px;top:-26px;width:24px;height:26px;cursor:pointer;z-index:1'; this.lbl.style.cssText='position:absolute;width:24px;line-height:20px;color:#ff6000;font-weight:bold;left:-12px;text-align:center;font-size:11px;font-family:verdana;top:-26px;z-index:2;cursor:pointer'; }, dehilit:function() { this.style.zIndex=(40+this.paid); if(this.po.paid==1) this.il.src='http://mapy.atlas.sk/design/layers/green_filled.gif'; else this.il.src='http://mapy.atlas.sk/design/layers/orange_filled.gif'; this.il.style.cssText='position:absolute;left:-12px;top:-26px;width:24px;height:26px;cursor:pointer;z-index:1'; this.lbl.style.cssText='position:absolute;width:24px;line-height:20px;color:#fff;font-weight:bold;left:-12px;text-align:center;font-size:11px;font-family:verdana;top:-26px;z-index:2;cursor:pointer'; }, onclick:function(e) { return; } }); _pageel=({ ini:function(frm,pg,typ) { this.page=pg; this.formid=frm; }, onclick:function() { $(this.formid).page.value=this.page; $(this.formid).dosearch(); } }); _editpoint=({ ini:function(coord) { this.style.zIndex='998'; this.changed=false; this.coord=coord; this.id='edpoint'; this.icn=new Element('img'); this.icn.src='http://mapy.atlas.sk/design/layers/ikony/edit.gif'; this.icn.style.cssText='position:absolute;left:-7px;top:-19px;width:15px;height:19px;cursor:pointer'; this.icn.injectInside(this); this.cross=new Element('img'); this.cross.src='http://mapy.atlas.sk/design/place_cross.gif'; this.cross.style.cssText='width:12px;height:12px;position:absolute;left:-6px;top:-6px;display:none'; this.cross.injectInside(this); this.sredraw(); }, sredraw:function() { if(this.coord.cS!=$('mappa_in').coordS) this.coord=ConvKlasTrans.doFoo(this.coord,$('mappa_in').coordS); var pcor=$('mappa_in').coordToPos(this.coord.x,this.coord.y); this.style.left=pcor.px+'px'; this.style.top=pcor.py+'px'; this.style.zIndex='998'; this.updateInp(); }, onmouseover:function(e) { e=new Event(e); e.stop(); e=null; }, onmousedown:function(e) { e=new Event(e); e.stop(); this.start=[]; this.start.x=this.offsetLeft; this.start.y=this.offsetTop; document.mov=this.id; document.click=[]; document.click.x=e.client.x; document.click.y=e.client.y; e=null; }, updateInp:function() { var ptc=this.coord; if(ptc.cS!=1) { ptc=ConvKlasTrans.doFoo(ptc,1); } if(parentform && parent.$(parentform).posx) { parent.$(parentform).posx.value=ptc.x; parent.$(parentform).posy.value=ptc.y; } else if(parent.$('PosXInp')) { parent.$('PosXInp').value=ptc.x; parent.$('PosYInp').value=ptc.y; } ptc=null; return; }, onmouseup:function(e) { e=new Event(e); e.stop(); this.start=null; document.mov=null; document.click=null; document.dobreak=false; this.cross.style.display='none'; this.icn.style.top='-19px'; x=$('mappa_in').minX+$('mappa_in').px2len(this.offsetLeft); y=$('mappa_in').maxY-$('mappa_in').px2len(this.offsetTop); this.coord.x=x; this.coord.y=y; this.coord.cS=$('mappa_in').coordS; e=null; this.updateInp(); return; }, drag:function(e) { this.changed=true; var x=e.client.x-document.click.x; var y=e.client.y-document.click.y; this.cross.style.display='block'; this.icn.style.top='-30px'; this.style.left=Math.round(this.start.x+x)+'px'; this.style.top=Math.round(this.start.y+y+12)+'px'; x=$('mappa_in').minX+$('mappa_in').px2len(this.offsetLeft); y=$('mappa_in').maxY-$('mappa_in').px2len(this.offsetTop); this.coord.x=x; this.coord.y=y; this.coord.cS=$('mappa_in').coordS; } });