var SdnLocal;function AddGpsTracksMapTypes(map,PoisUrl,Sdn,t1,m1,MapStartTyp){if(MapStartTyp=='Winterkarte'){MapStartTyp='HKF-Winter'}SdnLocal=Sdn|'0';var copyCollection=new GCopyrightCollection('www.GPS-Tracks.com PK');copyCollection.addCopyright(new GCopyright(1,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),15,'1:25k Geodaten©swisstopo(5704002162)'));copyCollection.addCopyright(new GCopyright(2,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),14,'1:50k Geodaten©swisstopo(5704002162)'));copyCollection.addCopyright(new GCopyright(3,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),13,'1:100k Geodaten©swisstopo(5704002162)'));copyCollection.addCopyright(new GCopyright(4,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),12,'1:200k Geodaten©swisstopo(5704002162)'));copyCollection.addCopyright(new GCopyright(5,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),11,'1:500k Geodaten©swisstopo(5704002162)'));var tilelayers=[new GTileLayer(copyCollection,11,15)];tilelayers[0].getTileUrl=MapFactory;SwissGrid=new SwissGridProjection(19,PoisUrl,Sdn,map);var MapSizePix=map.getSize();var KachelRatio=Math.sqrt((MapSizePix.width*MapSizePix.height)/1000000);if(KachelRatio<1){KachelRatio=1}var TileSize=Math.ceil(KachelRatio*SwissGrid.KachelBreite[0]);SwissGrid.SetKachelRatio('Swiss',TileSize/SwissGrid.KachelBreite[0]);var SwissGridMap=new GMapType(tilelayers,SwissGrid,"Swiss-Map",{errorMessage:t1[0],textColor:"black",alt:t1[1],tileSize:TileSize});var copyCollectionD=new GCopyrightCollection('www.GPS-Tracks.com ATKIS');copyCollectionD.addCopyright(new GCopyright(6,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),15,'®DTK25-V ©Vermessung der Länder & BKG 2006'));copyCollectionD.addCopyright(new GCopyright(7,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),14,'®DTK50-V ©Vermessung der Länder & BKG 2006'));copyCollectionD.addCopyright(new GCopyright(8,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),13,'®DTK100-V ©Vermessung der Länder & BKG 2006'));copyCollectionD.addCopyright(new GCopyright(9,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),12,'®DTK200-V ©Vermessung der Länder & BKG 2006'));var KachelRatio=Math.sqrt((MapSizePix.width*MapSizePix.height)/1000000);if(KachelRatio<1){KachelRatio=1}var tilelayersD=[new GTileLayer(copyCollectionD,12,15)];tilelayersD[0].getTileUrl=MapFactory;var TileSize=Math.ceil(KachelRatio*SwissGrid.KachelBreite[5]);SwissGrid.SetKachelRatio('Utm',TileSize/SwissGrid.KachelBreite[5]);var DGridMap=new GMapType(tilelayersD,SwissGrid,"Deutschland-Map Utm",{errorMessage:t1[2],textColor:"black",alt:t1[3],tileSize:TileSize});var copyCollectionSG=new GCopyrightCollection('www.GPS-Tracks.com SG');copyCollectionSG.addCopyright(new GCopyright(10,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),16,'1:10k Vermessungsamt St.Gallen'));var tilelayersSG=[new GTileLayer(copyCollectionSG,16,16)];tilelayersSG[0].getTileUrl=MapFactory;var SGGridMap=new GMapType(tilelayersSG,SwissGrid,"SG-Map",{errorMessage:t1[11],textColor:"black",alt:t1[12],tileSize:SwissGrid.KachelBreite[9]});var copyCollectionUSA=new GCopyrightCollection('www.GPS-Tracks.com Topo maps by USGS');copyCollectionUSA.addCopyright(new GCopyright(11,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),16,'via terraserver-usa.com'));var tilelayersUSA=[new GTileLayer(copyCollectionUSA,5,17)];tilelayersUSA[0].getTileUrl=MapFactoryUsa;var TileSize=400;var UsaGridMap=new GMapType(tilelayersUSA,G_SATELLITE_MAP.getProjection(),"Topo-USA",{errorMessage:t1[13],textColor:"black",alt:t1[14],tileSize:TileSize});var copyCollectionCA=new GCopyrightCollection('www.GPS-Tracks.com Canada');copyCollectionCA.addCopyright(new GCopyright(12,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),16,'Maps by NRCan.gc.ca'));var tilelayersCA=[new GTileLayer(copyCollectionCA,6,18)];tilelayersCA[0].getTileUrl=MapFactoryUsa;var TileSize=600;var CaGridMap=new GMapType(tilelayersCA,G_SATELLITE_MAP.getProjection(),"Topo-CA",{errorMessage:t1[15],textColor:"black",alt:t1[16],tileSize:TileSize});var copyCollectionZG=new GCopyrightCollection('www.GPS-Tracks.com ZG');copyCollectionZG.addCopyright(new GCopyright(13,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),16,'1:5k Orthofoto 07 © Grundbuch- und Vermessungsamt des Kt. Zug'));copyCollectionZG.addCopyright(new GCopyright(14,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),15,'1:10k Orthofoto 07 © Grundbuch- und Vermessungsamt des Kt. Zug'));copyCollectionZG.addCopyright(new GCopyright(15,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),14,'1:20k Orthofoto 07 © Grundbuch- und Vermessungsamt des Kt. Zug'));var tilelayersZG=[new GTileLayer(copyCollectionZG,14,16)];tilelayersZG[0].getTileUrl=MapFactory;var ZGGridMap=new GMapType(tilelayersZG,SwissGrid,"ZG-Map",{errorMessage:t1[17],textColor:"black",alt:t1[17],tileSize:SwissGrid.KachelBreite[12]});var copyCollectionAT=new GCopyrightCollection('www.GPS-Tracks.com AT_Kompass');copyCollectionAT.addCopyright(new GCopyright(16,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),14,'1:50k ©KOMPASS-Karten GmbH - Rum/Innsbruck(AT)'));var tilelayersAT=[new GTileLayer(copyCollectionAT,14,14)];tilelayersAT[0].getTileUrl=MapFactory;var ATGridMap=new GMapType(tilelayersAT,SwissGrid,"KOMPASS Austria-Map",{errorMessage:t1[20],textColor:"black",alt:t1[19],tileSize:SwissGrid.KachelBreite[15]});var copyCollectionWinter=new GCopyrightCollection('www.GPS-Tracks.com HKF-Winter');copyCollectionWinter.addCopyright(new GCopyright(17,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),16,'1:12.5 ©Hallwag & swisstopo(DV053917.1)'));copyCollectionWinter.addCopyright(new GCopyright(18,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),15,'1:25 ©Hallwag & swisstopo(DV053917.1)'));copyCollectionWinter.addCopyright(new GCopyright(19,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),14,'1:50 ©Hallwag & swisstopo(DV053917.1)'));copyCollectionWinter.addCopyright(new GCopyright(20,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),13,'1:100 ©Hallwag & swisstopo(DV053917.1)'));copyCollectionWinter.addCopyright(new GCopyright(21,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),12,'1:200 ©Hallwag & swisstopo(DV053917.1)'));copyCollectionWinter.addCopyright(new GCopyright(22,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),11,'1:500 ©Hallwag & swisstopo(DV053917.1)'));var tilelayersWinter=[new GTileLayer(copyCollectionWinter,11,16)];tilelayersWinter[0].getTileUrl=MapFactory;var TileSize=200;var WinterGridMap=new GMapType(tilelayersWinter,SwissGrid,"HKF-Winter",{errorMessage:t1[23],textColor:"black",alt:t1[22],tileSize:TileSize});var KartenMapType=new GMapType(tilelayers,new GMercatorProjection(19),t1[4]);var KartenMapTypes=new GHierarchicalMapTypeControl();KartenMapTypes.clearRelationships();map.addMapType(KartenMapType);if(m1[2]==1){map.addMapType(G_PHYSICAL_MAP);KartenMapTypes.addRelationship(KartenMapType,G_PHYSICAL_MAP,t1[7],false)}if(m1[0]==1){map.addMapType(SwissGridMap);KartenMapTypes.addRelationship(KartenMapType,SwissGridMap,t1[8],false)}if(m1[8]==1){map.addMapType(WinterGridMap);KartenMapTypes.addRelationship(KartenMapType,WinterGridMap,t1[24],false)}if(m1[3]==1){map.addMapType(SGGridMap);KartenMapTypes.addRelationship(KartenMapType,SGGridMap,t1[10],false)}if(m1[6]==1){map.addMapType(ZGGridMap);KartenMapTypes.addRelationship(KartenMapType,ZGGridMap,t1[17],false)}if(m1[1]==1){map.addMapType(DGridMap);KartenMapTypes.addRelationship(KartenMapType,DGridMap,t1[9],false)}if(m1[7]==1){map.addMapType(ATGridMap);KartenMapTypes.addRelationship(KartenMapType,ATGridMap,t1[21],false)}if(m1[4]==1){map.addMapType(UsaGridMap);KartenMapTypes.addRelationship(KartenMapType,UsaGridMap,"Topo USA",false)}if(m1[5]==1){map.addMapType(CaGridMap);KartenMapTypes.addRelationship(KartenMapType,CaGridMap,"Topo Canada",false)}KartenMapTypes.addRelationship(KartenMapType,G_SATELLITE_MAP,t1[5],false);KartenMapTypes.addRelationship(KartenMapType,G_NORMAL_MAP,t1[6],false);KartenMapTypes.addRelationship(KartenMapType,G_HYBRID_MAP,"Hybrid",false);map.addControl(KartenMapTypes);GEvent.addListener(map,'maptypechanged',function(){if(map.getCurrentMapType().getName().indexOf("KOMPASS")>-1){SwissGrid.KompassLogo.show()}else{SwissGrid.KompassLogo.hide()}if(MiniMapControl!=null){try{MiniMapControl.setMapType(G_NORMAL_MAP)}catch(e){var Fehler='Fehler bei Minimap'}}});switch(MapStartTyp){case'G_SATELLITE_MAP':return G_SATELLITE_MAP;break;case'G_NORMAL_MAP':return G_NORMAL_MAP;break;case'G_HYBRID_MAP':return G_HYBRID_MAP;break;case'G_PHYSICAL_MAP':return G_PHYSICAL_MAP;break;case'SG-Map':return SGGridMap;break;case'ZG-Map':return ZGGridMap;break;case'Swiss-Map':return SwissGridMap;break;case'Deutschland-Map Utm':return DGridMap;break;case'KOMPASS Austria-Map':return ATGridMap;break;case'HKF-Winter':return WinterGridMap;break;default:return G_SATELLITE_MAP}};function MapFactory(a,b){var proj=map.getCurrentMapType().getProjection();var MapPointer=proj.GetMapPointer(map,b);var Datei='';var DateiFormat='';var KachelTrenner='-';switch(proj.MapId[MapPointer]){case 1:Datei='Maps/KA025/';KachelTrenner='/';DateiFormat='.png';break;case 2:Datei='Maps/KA050/';KachelTrenner='/';DateiFormat='.png';break;case 3:Datei="Maps/K0100/ST0100-";DateiFormat=".png";break;case 4:Datei='Maps/K0200/ST0200-';DateiFormat='.png';break;case 5:Datei='Maps/K0500/';KachelTrenner='/';DateiFormat='.png';break;case 6:Datei='Mapd/KA025/';KachelTrenner='/';DateiFormat='.png';break;case 7:Datei='Mapd/KA050/';KachelTrenner='/';DateiFormat='.png';break;case 8:Datei='Mapd/K0100/DE0100-';DateiFormat='.png';break;case 9:Datei='Mapd/K0200/DE0200-';DateiFormat='.png';break;case 10:Datei='Maps/K0010/SG0010-';DateiFormat='.png';break;case 13:Datei='Maps/Kunden/KZug/ZU0005-';DateiFormat='.png';break;case 14:Datei='Maps/Kunden/KZug/ZU0010-';DateiFormat='.png';break;case 15:Datei='Maps/Kunden/KZug/ZU0020-';DateiFormat='.png';break;case 16:Datei='Mapd/AT050/';KachelTrenner='/';DateiFormat='.png';break;case 17:Datei='Mapw/HA012/';KachelTrenner='/';DateiFormat='.png';break;case 18:Datei='Mapw/HA025/';KachelTrenner='/';DateiFormat='.png';break;case 19:Datei='Mapw/HA050/';KachelTrenner='/';DateiFormat=".png";break;case 20:Datei='Mapw/K0100/HW0100-';DateiFormat='.png';break;case 21:Datei='Mapw/K0200/HW0200-';DateiFormat='.png';break;case 22:Datei='Mapw/K0500/HW0500-';DateiFormat='.png';break}if(proj.MapId[MapPointer]==17){return GetUrlPrafix(proj.Sdn)+Datei+a.x+KachelTrenner+a.y+DateiFormat}else{return GetUrlPrafix(proj.Sdn)+Datei+StrRight("000"+a.x,3)+KachelTrenner+StrRight("000"+a.y,3)+DateiFormat}};function MapFactoryWinter(tile,zoom){return GetUrlPrafix(SdnLocal)+'Mapw/'+zoom+'/'+tile.x+'/'+tile.y+'.png'}function MapFactoryUsa(tile,zoom){var tileSize=map.getCurrentMapType().getTileSize();var MapName=map.getCurrentMapType().getName();var southWestPixel=new GPoint(tile.x*tileSize,(tile.y+1)*tileSize);var northEastPixel=new GPoint((tile.x+1)*tileSize,tile.y*tileSize);var southWestCoords=G_SATELLITE_MAP.getProjection().fromPixelToLatLng(southWestPixel,zoom);var northEastCoords=G_SATELLITE_MAP.getProjection().fromPixelToLatLng(northEastPixel,zoom);var bbox=southWestCoords.lng()+','+southWestCoords.lat()+','+northEastCoords.lng()+','+northEastCoords.lat();switch(MapName){case'Topo-USA':Url='http://terraservice.net/ogcmap6.ashx?version=1.1.1&request=GetMap&styles=&srs=EPSG:4326&format=image/jpeg&bgcolor=0xCCCCCC&exceptions=INIMAGE&layers=DRG';break;case'Topo-CA':Url='http://wms.cits.rncan.gc.ca/cgi-bin/cubeserv.cgi?version=1.1.3&request=GetMap&format=image/png&bgcolor=0xFFFFFF&exceptions=application/vnd.ogc.se_inimage&srs=EPSG:4326&layers=PUB_50K:CARTES_MATRICIELLES/RASTER_MAPS';break}return Url+'&bbox='+bbox+'&width='+tileSize+'&height='+tileSize}function SwissGridProjection(a,PoisUrl,Sdn,map){this.MapId=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];this.CalcSys=['Swiss','Swiss','Swiss','Swiss','Swiss','Utm','Utm','Utm','Utm','SG','USA','CA','ZG','ZG','ZG','Austria','HKF','HKF','HKF','HKF','HKF','HKF'];this.Layer=[15,14,13,12,11,15,14,13,12,16,12,12,16,15,14,14,16,15,14,13,12,11];this.KachelBreite=[200,200,200,200,200,400,400,400,400,500,400,400,250,250,250,200,200,200,200,200,200,200];this.PixelBreiteMeter=[2.5,5,10,20,50,2.499,4.998,9.996,24.99,0.5,1,1,0.5,1,2,5,1.25,2.5,5,10,20,50];this.UtmShiftX=[480000,480000,480000,463000,480000,220033,220033,220033,220033,698750,1,1,672000,672000,672000,520000,480000,480000,480000,480000,480000,479925];this.UtmShiftY=[302000,302000,302000,318000,302000,6127988,6127988,6127988,6127988,272000,1,1,234000,234000,234000,5460000,302000,302000,302000,302000,302000,254425];this.KachelRatio=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];this.PoisUrl=PoisUrl;this.Sdn=Sdn|'0';this.KompassLogo=new GScreenOverlay('Bilder/KOMPASS-Logo.png',new GScreenPoint(67,2,'pixel','pixel'),new GScreenPoint(0,0),new GScreenSize(150,38,'pixels','pixels'));map.addOverlay(this.KompassLogo);this.KompassLogo.hide();var b=this;var Z=Math.PI;b.kn=[];b.ln=[];b.hn=[];b.jn=[];var c=400;for(var d=0;d<a;d++){var e=c/2;b.kn.push(c/360);b.ln.push(c/(2*Z));b.hn.push(new GPoint(e,e));b.jn.push(c);c*=2}};SwissGridProjection.prototype=new GProjection();SwissGridProjection.prototype.GetMapPointer=function(map,Zoom){var MapName=map.getCurrentMapType().getName();for(var MapIndex=0;MapIndex<this.MapId.length;MapIndex++){if(this.Layer[MapIndex]==Zoom&&MapName.indexOf(this.CalcSys[MapIndex])>-1){return MapIndex}}return-1};SwissGridProjection.prototype.SetKachelRatio=function(MapName,KachelRatio){for(var MapIndex=0;MapIndex<this.MapId.length;MapIndex++){if(MapName.indexOf(this.CalcSys[MapIndex])>-1){this.KachelRatio[MapIndex]=KachelRatio}}};SwissGridProjection.prototype.fromLatLngToPixel=function(LatLngPoint,zoom){var MapPointer=this.GetMapPointer(map,zoom);if(MapPointer==-1){var proj=G_SATELLITE_MAP.getProjection();var Pix=proj.fromLatLngToPixel(LatLngPoint,zoom);return Pix}switch(this.CalcSys[MapPointer]){case"Swiss":var Utm=GFC1(LatLngPoint);break;case"SG":var Utm=GFC1(LatLngPoint);break;case"ZG":var Utm=GFC1(LatLngPoint);break;case"HKF":var Utm=GFC1(LatLngPoint);break;case"Utm":var Utm=GFC4(LatLngPoint);break;case"Austria":var Utm=GFC4(LatLngPoint);break;default:var proj=G_SATELLITE_MAP.getProjection();var Pix=proj.fromLatLngToPixel(LatLngPoint,zoom);return Pix}return GFC5(Utm,this.PixelBreiteMeter[MapPointer],this.UtmShiftX[MapPointer],this.UtmShiftY[MapPointer],this.KachelRatio[MapPointer])};SwissGridProjection.prototype.fromPixelToLatLng=function(point,zoom,nofix){var MapPointer=this.GetMapPointer(map,zoom);if(MapPointer==-1){var proj=G_SATELLITE_MAP.getProjection();var LatLng=proj.fromPixelToLatLng(point,zoom,nofix);return LatLng}var UtmKorrX=0;var UtmKorrY=0;var MstKorrFaktor=1;if(this.CalcSys[MapPointer]=="Utm"){var UtmTemp=GFC6(point,this.PixelBreiteMeter[MapPointer],this.UtmShiftX[MapPointer],this.UtmShiftY[MapPointer],this.KachelRatio[MapPointer],0,0);var LlTemp=GFC3(UtmTemp,32,nofix);if(MapPointer==5){MstKorrFaktor=1}if(MapPointer==6){MstKorrFaktor=0.5}if(MapPointer==7){MstKorrFaktor=0.25}if(MapPointer==8){MstKorrFaktor=0.125}if(LlTemp.x>10){UtmKorrY=Math.floor((LlTemp.x-10)*6*MstKorrFaktor);UtmKorrX=Math.floor(1*MstKorrFaktor)}if(LlTemp.x>13){UtmKorrY=Math.floor((LlTemp.x-10)*9*MstKorrFaktor);UtmKorrX=Math.floor(2*MstKorrFaktor)}}if(this.CalcSys[MapPointer]=="Austria"&&MapPointer==15){var UtmTemp=GFC6(point,this.PixelBreiteMeter[MapPointer],this.UtmShiftX[MapPointer],this.UtmShiftY[MapPointer],this.KachelRatio[MapPointer],0,0);var LlTemp=GFC3(UtmTemp,32,nofix);if(LlTemp.x>11){UtmKorrY=Math.floor((LlTemp.x-11)*5);UtmKorrX=1}if(LlTemp.x>16){UtmKorrY=Math.floor((LlTemp.x-13)*9);UtmKorrX=3}}var Utm=GFC6(point,this.PixelBreiteMeter[MapPointer],this.UtmShiftX[MapPointer],this.UtmShiftY[MapPointer],this.KachelRatio[MapPointer],UtmKorrX,UtmKorrY);switch(this.CalcSys[MapPointer]){case"Swiss":var Ll=GFC2(Utm,nofix);break;case"SG":var Ll=GFC2(Utm,nofix);break;case"ZG":var Ll=GFC2(Utm,nofix);break;case"HKF":var Ll=GFC2(Utm,nofix);break;case"Utm":var Ll=GFC3(Utm,32,nofix);break;case"Austria":var Ll=GFC3(Utm,32,nofix);break;default:var proj=G_SATELLITE_MAP.getProjection();var LatLng=proj.fromPixelToLatLng(point,zoom,nofix);return LatLng}return Ll};SwissGridProjection.prototype.tileCheckRange=function(a,b,c){var d=this.jn[b];if(a.y<0||a.y*c>=d){return false}if(a.x<0||a.x*c>=d){var e=Math.floor(d/c);a.x=a.x%e;if(a.x<0){a.x+=e}}return true};SwissGridProjection.prototype.getWrapWidth=function(a){return this.jn[a]};function GFC1(LatLngPoint){var Swiss=new GPoint(0,0);var xsBreite;var xsBreiteGrad;var xsBreiteMinuten;var xsBreiteSekunden;var xsLaenge;var xsLaengeGrad;var xsLaengeMinuten;var xsLaengeSekunden;xsLaengeGrad=Math.floor(LatLngPoint.lng());xsLaengeMinuten=Math.floor((LatLngPoint.lng()-xsLaengeGrad)*60);xsLaengeSekunden=(((LatLngPoint.lng()-xsLaengeGrad)*60)-xsLaengeMinuten)*60;xsLaenge=3600*xsLaengeGrad+60*xsLaengeMinuten+xsLaengeSekunden;xsLaenge=(xsLaenge-26782.5)/10000;xsBreiteGrad=Math.floor(LatLngPoint.lat());xsBreiteMinuten=Math.floor((LatLngPoint.lat()-xsBreiteGrad)*60);xsBreiteSekunden=(((LatLngPoint.lat()-xsBreiteGrad)*60)-xsBreiteMinuten)*60;xsBreite=3600*xsBreiteGrad+60*xsBreiteMinuten+xsBreiteSekunden;xsBreite=(xsBreite-169028.66)/10000;Swiss.x=Math.floor(600072.37+211455.93*xsLaenge-10938.51*xsLaenge*xsBreite-0.36*xsLaenge*xsBreite*xsBreite-44.54*xsLaenge*xsLaenge*xsLaenge);Swiss.y=Math.floor(200147.07+308807.95*xsBreite+3745.25*xsLaenge*xsLaenge+76.63*xsBreite*xsBreite-194.56*xsLaenge*xsLaenge*xsBreite+119.79*xsBreite*xsBreite*xsBreite);return Swiss};function GFC2(point,nofix){var Lat,Lng;var yStrich;var xStrich;yStrich=(point.x-600000)/1000000;xStrich=(point.y-200000)/1000000;Lng=2.6779094+4.728982*yStrich+0.791484*yStrich*xStrich+0.1306*yStrich*xStrich*xStrich-0.0436*yStrich*yStrich*yStrich;Lat=16.9023892+3.238272*xStrich-0.270978*yStrich*yStrich-0.002528*xStrich*xStrich-0.0447*yStrich*yStrich*xStrich-0.0140*xStrich*xStrich*xStrich;return new GLatLng(parseFloat(Lat*100/36),parseFloat(Lng*100/36),nofix)};function GFC3(UTMPoint,UTMCalcZone,nofix){var LlY;var LlX;var LongTemp;var LatRad;var LongRad;var ZoneNumber;var N1;var T1;var C1;var R1;var D;var A;var M;var mu;var phi1Rad;var phi1;var aa=6378137;var k0=0.9996;var deg2rad=Math.PI/180;var rad2deg=180/Math.PI;var eccSquared=0.00669438;var e1=(1-Math.sqrt(1-eccSquared))/(1+Math.sqrt(1-eccSquared));var eccPrimeSquared=(eccSquared)/(1-eccSquared);var LongOrigin=(UTMCalcZone-1)*6-180+3;if(UTMCalcZone==undefined){UTMCalcZone=32}var LongOriginRad=(UTMCalcZone-1)*6-180+3;M=UTMPoint.y/k0;UTMPoint.x=UTMPoint.x-500000;mu=M/(aa*(1-eccSquared/4-3*eccSquared*eccSquared/64-5*eccSquared*eccSquared*eccSquared/256));phi1Rad=mu+(3*e1/2-27*e1*e1*e1/32)*Math.sin(2*mu)+(21*e1*e1/16-55*e1*e1*e1*e1/32)*Math.sin(4*mu)+(151*e1*e1*e1/96)*Math.sin(6*mu);phi1=phi1Rad*rad2deg;N1=aa/Math.sqrt(1-eccSquared*Math.sin(phi1Rad)*Math.sin(phi1Rad));T1=Math.tan(phi1Rad)*Math.tan(phi1Rad);C1=eccPrimeSquared*Math.cos(phi1Rad)*Math.cos(phi1Rad);R1=aa*(1-eccSquared)/((1-eccSquared*Math.sin(phi1Rad)*Math.sin(phi1Rad))^1.5);D=UTMPoint.x/(N1*k0);LlY=phi1Rad-(N1*Math.tan(phi1Rad)/R1)*(D*D/2-(5+3*T1+10*C1-4*C1*C1-9*eccPrimeSquared)*D*D*D*D/24+(61+90*T1+298*C1+45*T1*T1-252*eccPrimeSquared-3*C1*C1)*D*D*D*D*D*D/720);LlY=LlY*rad2deg;LlX=(D-(1+2*T1+C1)*D*D*D/6+(5-2*C1+28*T1-3*C1*C1+8*eccPrimeSquared+24*T1*T1)*D*D*D*D*D/120)/Math.cos(phi1Rad);LlX=LongOrigin+LlX*rad2deg;return new GLatLng(LlY,LlX,nofix)};function GFC4(Ll){var UtmX;var UtmY;var Lat=parseFloat(Ll.lat());var Long=parseFloat(Ll.lng());var LongOrigin;var eccPrimeSquared;var N;var T;var C;var A;var M;var a=6378137;var eccSquared=0.00669438;var k0=0.9996;var deg2rad=Math.PI/180;var LongTemp=(Long+180)-parseInt((Long+180)/360)*360-180;var LatRad=Lat*deg2rad;var LongRad=LongTemp*deg2rad;var LongOriginRad;var ZoneNumber;ZoneNumber=parseInt((LongTemp+180)/6)+1;if(Lat>=56.0&&Lat<64.0&&LongTemp>=3.0&&LongTemp<12.0){ZoneNumber=32}if(Lat>=72.0&&Lat<84.0){if(LongTemp>=0.0&&LongTemp<9.0)ZoneNumber=31;else if(LongTemp>=9.0&&LongTemp<21.0)ZoneNumber=33;else if(LongTemp>=21.0&&LongTemp<33.0)ZoneNumber=35;else if(LongTemp>=33.0&&LongTemp<42.0)ZoneNumber=37}ZoneNumber=32;LongOrigin=(ZoneNumber-1)*6-180+3;LongOriginRad=LongOrigin*deg2rad;eccPrimeSquared=(eccSquared)/(1-eccSquared);N=a/Math.sqrt(1-eccSquared*Math.sin(LatRad)*Math.sin(LatRad));T=Math.tan(LatRad)*Math.tan(LatRad);C=eccPrimeSquared*Math.cos(LatRad)*Math.cos(LatRad);A=Math.cos(LatRad)*(LongRad-LongOriginRad);M=a*((1-eccSquared/4-3*eccSquared*eccSquared/64-5*eccSquared*eccSquared*eccSquared/256)*LatRad-(3*eccSquared/8+3*eccSquared*eccSquared/32+45*eccSquared*eccSquared*eccSquared/1024)*Math.sin(2*LatRad)+(15*eccSquared*eccSquared/256+45*eccSquared*eccSquared*eccSquared/1024)*Math.sin(4*LatRad)-(35*eccSquared*eccSquared*eccSquared/3072)*Math.sin(6*LatRad));UtmX=Math.round(k0*N*(A+(1-T+C)*A*A*A/6+(5-18*T+T*T+72*C-58*eccPrimeSquared)*A*A*A*A*A/120)+500000.0);UtmY=Math.round(k0*(M+N*Math.tan(LatRad)*(A*A/2+(5-T+9*C+4*C*C)*A*A*A*A/24+(61-58*T+T*T+600*C-330*eccPrimeSquared)*A*A*A*A*A*A/720)));if(Lat<0){UtmY+=10000000.0}return new GPoint(UtmX,UtmY)};function GFC5(point,PixelBreiteMeter,UtmShiftX,UtmShiftY,KachelRatio){var Pix=new GPoint(0,0);var KachelDarstellungsFaktor=1.0*KachelRatio;Pix.x=parseInt(Math.round((point.x-UtmShiftX)/PixelBreiteMeter)*KachelDarstellungsFaktor);Pix.y=parseInt(Math.round((point.y-UtmShiftY)/(-1*PixelBreiteMeter))*KachelDarstellungsFaktor);return Pix};function GFC6(point,PixelBreiteMeter,UtmShiftX,UtmShiftY,KachelRatio,UtmKorrX,UtmKorrY){var Utm=new GPoint(0,0);var KachelDarstellungsFaktor=1.0*KachelRatio;point.y=point.y-UtmKorrY;point.x=point.x-UtmKorrX;Utm.x=UtmShiftX+Math.round(point.x/KachelDarstellungsFaktor*PixelBreiteMeter);Utm.y=UtmShiftY+Math.round(point.y/KachelDarstellungsFaktor*(-1*PixelBreiteMeter));return Utm};
