*/ function init(){ map = new OpenLayers.Map('map', { maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), numZoomLevels: 19, maxResolution: 156543.0399, units: 'm', projection: new OpenLayers.Projection("EPSG:900913"), displayProjection: new OpenLayers.Projection("EPSG:4326") }); var layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik (updated weekly)"); var layerTah = new OpenLayers.Layer.OSM.Osmarender("Tiles@Home"); map.addLayers([layerMapnik,layerTah]); var planet01 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet W180-90)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet_W180_90.txt"} ); planet01.setVisibility(false); var planet02 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet W90-00)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet_W90_00.txt"} ); planet02.setVisibility(false); var planet03 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet E00-90)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet_E00_90.txt"} ); planet03.setVisibility(false); var planet04 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet E90-180)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet_E90_180.txt"} ); planet04.setVisibility(false); var planet05 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet N00-40)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet_N00_40.txt"} ); planet05.setVisibility(false); var planet06 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet S00-40)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet_S00_40.txt"} ); planet06.setVisibility(false); var planet07 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet S40-90)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet_S40_90.txt"} ); planet07.setVisibility(false); var germany = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Germany.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./germany.txt"} ); germany.setVisibility(false); var germanyplus = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (GermanyPlus [Europe.osm])", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./germanyplus.txt"} ); // var germany = new OpenLayers.Layer.Text( "NaviPOWM_V0.1.3 (Germany.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./germany.txt"} ); // var germany2 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2 (Germany.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./germany2.txt"} ); var europe = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Europe.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./europe.txt"} ); europe.setVisibility(false); var africa = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Africa.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./africa.txt"} ); africa.setVisibility(false); var antarctica = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Antarctica.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./antarctica.txt"} ); antarctica.setVisibility(false); var asiaw = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Asia.osm)-West", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./asiaw.txt"} ); asiaw.setVisibility(false); var asiae = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Asia.osm)-East", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./asiae.txt"} ); asiae.setVisibility(false); var australia = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Australia-Oceania.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./australia.txt"} ); australia.setVisibility(false); var samerica = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (South-America.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./south-america.txt"} ); samerica.setVisibility(false); var namerica = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (North-America.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./north-america.txt"} ); namerica.setVisibility(false); var other = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Other Countries XAPI)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./other.txt"} ); other.setVisibility(false); var srtm25 = new OpenLayers.Layer.Text( "Höhenlinien 25m (SRTM.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./srtm25.txt"} ); srtm25.setVisibility(false); var srtm10 = new OpenLayers.Layer.Text( "Höhenlinien 10m (SRTM.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./srtm10.txt"} ); srtm10.setVisibility(false); // germany.setVisibility(false); var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']); layer_style.fillOpacity = 0.2; layer_style.graphicOpacity = 1; /* * Green style */ var style_green = { strokeColor: "#00FF00", strokeOpacity: 0.7, strokeWidth: 2, pointRadius: 6, pointerEvents: "visiblePainted" }; var style_blue = { strokeColor: "#0000FF", strokeOpacity: 0.7, strokeWidth: 2, pointRadius: 6, pointerEvents: "visiblePainted" }; var style_red = { strokeColor: "#FF0000", strokeOpacity: 0.7, strokeWidth: 3, pointRadius: 6, pointerEvents: "visiblePainted" }; var vectorLayer = new OpenLayers.Layer.Vector("Tile Raster", {style: layer_style}); var lonLat; var newPoint; var pointList; var lineFeature; // create a line feature from a list of points var la_min=-85; //Breite var la_max=85; var lo_min=-180; //Länge var lo_max=180; var ZoomScale=1; //if (map.getZoom()<5) ZoomScale=5; for(var p=lo_min; p<=lo_max; p+=ZoomScale) { lonLat = new OpenLayers.LonLat(p, la_min).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")); newPoint = new OpenLayers.Geometry.Point(lonLat.lon,lonLat.lat); pointList = []; pointList.push(newPoint); lonLat = new OpenLayers.LonLat(p, la_max).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")); newPoint = new OpenLayers.Geometry.Point(lonLat.lon,lonLat.lat); pointList.push(newPoint); var akt_style=style_green; if (p % 10 == 0) akt_style=style_blue; if (p % 60 == 0) akt_style=style_red; lineFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(pointList),null,akt_style); vectorLayer.addFeatures([lineFeature]); } for(p=la_min; p<=la_max; ++p) { lonLat = new OpenLayers.LonLat(lo_min, p).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")); newPoint = new OpenLayers.Geometry.Point(lonLat.lon,lonLat.lat); pointList = []; pointList.push(newPoint); lonLat = new OpenLayers.LonLat(lo_max, p).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")); newPoint = new OpenLayers.Geometry.Point(lonLat.lon,lonLat.lat); pointList.push(newPoint); var akt_style1=style_green; if (p % 10 == 0) akt_style1=style_blue; if (p == 0) akt_style1=style_red; lineFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(pointList),null,akt_style1); vectorLayer.addFeatures([lineFeature]); } // vectorLayer.setVisibility(false); // vectorLayer.addFeatures([lineFeature]); vectorLayer.setVisibility(false); map.addLayer(vectorLayer); var grid = new OpenLayers.Control.Graticule({ numPoints: 2, labelled: true, visible: true, layerName: "Raster", intervals: [ 45, 30, 20, 10, 5, 2, 1], labelFormat: 'd', lineSymbolizer: {strokeColor: "#00BB00", strokeWidth: 5, strokeOpacity: 0.4} }); // grid.setName("Raster"); map.addControl(grid); // map.addLayers([germany,germany2,europe]); map.addLayers([europe,germanyplus,germany,africa,antarctica,asiaw,asiae,australia,samerica,namerica,other]); map.addLayers([srtm25, srtm10]); // map.addLayers([planet01,planet02,planet03,planet04,planet05,planet06,planet07]); var ls = new OpenLayers.Control.LayerSwitcher(); //ls.maximizeControl(); // map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(ls); ls.maximizeControl(); map.addControl(new OpenLayers.Control.MousePosition()); //this.permalink = new OpenLayers.Control.Permalink('permalink'); //map.addControl(this.permalink); map.setCenter(new OpenLayers.LonLat(10.00,51.00).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")), 6); } // -->