*/ 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"); var layerTah = new OpenLayers.Layer.OSM.Osmarender("Tiles@Home"); map.addLayers([layerMapnik,layerTah]); var planet00 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet S45-90)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-0.txt"} ); planet00.setVisibility(false); var planet01 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet S00-45,W)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-1.txt"} ); planet01.setVisibility(false); var planet02 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet S00-45,E)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-2.txt"} ); planet02.setVisibility(false); var planet03 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet N00-45,W090-180)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-3.txt"} ); planet03.setVisibility(false); var planet04 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet N00-45,W000-090)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-4.txt"} ); planet04.setVisibility(false); var planet05 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet N00-45,E000-090)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-5.txt"} ); planet05.setVisibility(false); var planet06 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet N00-45,E090-180)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-6.txt"} ); planet06.setVisibility(false); var planet07 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet N45-90,W090-180)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-7.txt"} ); planet07.setVisibility(false); var planet08 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet N45-90,W000-090)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-8.txt"} ); planet08.setVisibility(false); var planet09 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet N45-90,E000-045)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-9.txt"} ); planet09.setVisibility(false); var planet10 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.3 (Planet N45-90,E045-180)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet-10.txt"} ); planet10.setVisibility(false); var planet = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.4 (Planet.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet.txt"} ); // var planet = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.4 (Planet-Test)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet.php"} ); planet.setVisibility(false); var planet_1 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet E000-E019)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet1.txt"} ); planet_1.setVisibility(false); var planet_2 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet E020-E039)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet2.txt"} ); planet_2.setVisibility(false); var planet_3 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet E040-E059)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet3.txt"} ); planet_3.setVisibility(false); var planet_4 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet E060-E079)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet4.txt"} ); planet_4.setVisibility(false); var planet_5 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet E080-E099)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet5.txt"} ); planet_5.setVisibility(false); var planet_6 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet E100-E119)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet6.txt"} ); planet_6.setVisibility(false); var planet_7 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet E120-E139)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet7.txt"} ); planet_7.setVisibility(false); var planet_8 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet E140-E179)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet8.txt"} ); planet_8.setVisibility(false); var planet_11 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet W000-E039)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet11.txt"} ); planet_11.setVisibility(false); var planet_13 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet W040-W059)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet13.txt"} ); planet_13.setVisibility(false); var planet_14 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet W060-W079)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet14.txt"} ); planet_14.setVisibility(false); var planet_15 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet W080-W099)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet15.txt"} ); planet_15.setVisibility(false); var planet_16 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet W100-W119)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet16.txt"} ); planet_16.setVisibility(false); var planet_17 = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.5 (Planet W120-W179)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./planet17.txt"} ); planet_17.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.4 (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.4 (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 haiti = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.4 (Haiti.osm)", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./haiti.txt"} ); haiti.setVisibility(false); var chile = new OpenLayers.Layer.Text( "NaviPOWM_V0.2.4 (Chile.osm])", { projection: new OpenLayers.Projection("EPSG:4326"),location:"./chile.txt"} ); chile.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); var colors = ["black", "blue", "green", "red"]; var style = new OpenLayers.Style({ pointRadius: "${radius}", fillColor: "red", fillOpacity: 0.8, strokeColor: "#ff5555", strokeWidth: 2, strokeOpacity: 0.8 }, { context: { radius: function(feature) { return Math.min(feature.attributes.count, 7) + 3; }, } }); var pois = new OpenLayers.Layer.Vector("POI", { projection: new OpenLayers.Projection("EPSG:4326"), strategies: [ new OpenLayers.Strategy.BBOX(), new OpenLayers.Strategy.Cluster() ], protocol: new OpenLayers.Protocol.HTTP({ url: "planet.php", //Note that it is probably worth adding a Math.random() on the end of the URL to stop caching. format: new OpenLayers.Format.Text({ extractStyles: true, extractAttributes: true }), }), styleMap: new OpenLayers.StyleMap({ "default": style, "select": { fillColor: "#8aeeef", strokeColor: "#32a8a9" } }) }); pois.setVisibility(false); // map.addLayers([germany,germany2,europe]); // map.addLayers([planet,planet00,planet01,planet02,planet03,planet04,planet05,planet06,planet07,planet08,planet09,planet10]); map.addLayers([planet_1,planet_2,planet_3,planet_4,planet_5,planet_6,planet_7,planet_8,planet_11,planet_13,planet_14,planet_15,planet_16,planet_17]); // map.addLayers([europe,germanyplus,africa,antarctica,asiaw,asiae,australia,samerica,namerica,other,haiti,chile]); // map.addLayers([europe,germanyplus,germany,africa,antarctica,asiaw,asiae,australia,samerica,namerica,other]); // map.addLayers([srtm25, srtm10]); map.addLayer(pois); 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); map.addControl(new OpenLayers.Control.ScaleLine({geodesic:true})); } // -->