function CustomMap(d,a,b,c){this.USGS_TOPO_TILES=this.createCustomLayer("USGS Topo","Topo maps by USGS via terraserver-usa.com","Topo maps unavailable",5,17,400,"http://terraservice.net/ogcmap6.ashx?version=1.1.1&request=GetMap&styles=&srs=EPSG:4326&format=image/jpeg&bgcolor=0xCCCCCC&exceptions=INIMAGE&layers=DRG");this.USGS_AERIAL_TILES=this.createCustomLayer("USGS Aerial","Imagery by USGS via terraserver-usa.com","USGS aerial imagery unavailable",7,18,400,"http://terraservice.net/ogcmap6.ashx?version=1.1.1&request=GetMap&styles=&srs=EPSG:4326&format=image/jpeg&bgcolor=0xCCCCCC&exceptions=INIMAGE&layers=DOQ");this.placeholder=d;this.url=a;this.centerLat=b;this.centerLong=c;this.zoom=13;this.mapType=G_HYBRID_MAP}CustomMap.prototype.create=function(){this.map=new GMap2(this.placeholder);var a=new GGeoXml(this.url);this.map.setCenter(new GLatLng(this.centerLat,this.centerLong),this.zoom,G_PHYSICAL_MAP);this.map.enableScrollWheelZoom();this.map.addMapType(G_PHYSICAL_MAP);this.map.addMapType(G_SATELLITE_3D_MAP);this.addCustomLayers();this.map.addControl(new GMenuMapTypeControl());this.map.addControl(new GLargeMapControl());this.map.setMapType(this.mapType);this.map.addOverlay(a)};CustomMap.prototype.addCustomLayers=function(){this.map.addMapType(this.USGS_TOPO_TILES);this.map.addMapType(this.USGS_AERIAL_TILES)};CustomMap.prototype.createCustomLayer=function(b,g,e,d,h,i,f){var c=new GTileLayer(new GCopyrightCollection(g),d,h);c.baseUrl=f;c.tileSize=i;c.getTileUrl=GetTileUrl;c.getCopyright=function(){return{prefix:"",copyrightTexts:[g]}};var a=[c];return new GMapType(a,G_SATELLITE_MAP.getProjection(),b,{errorMessage:e,tileSize:i})};function GetTileUrl(e,d){var g=new GPoint(e.x*this.tileSize,(e.y+1)*this.tileSize);var a=new GPoint((e.x+1)*this.tileSize,e.y*this.tileSize);var c=G_SATELLITE_MAP.getProjection().fromPixelToLatLng(g,d);var b=G_SATELLITE_MAP.getProjection().fromPixelToLatLng(a,d);var f=c.lng()+","+c.lat()+","+b.lng()+","+b.lat();return this.baseUrl+"&bbox="+f+"&width="+this.tileSize+"&height="+this.tileSize};