--- step-3/index.html 2023-07-02 13:20:09.119154723 +0000 +++ step-4/index.html 2023-07-02 13:20:09.119154723 +0000 @@ -1,6 +1,6 @@ <html> <head> - <title>Step 3: adding map controls</title> + <title>Step 4: unfolding the overview map by default</title> <script src="../OpenLayers.js"></script> <script src="../OpenStreetMap.js"></script> <script> @@ -12,17 +12,20 @@ projLonLat = new OpenLayers.Projection("EPSG:4326"); // WGS 1984 projMercator = new OpenLayers.Projection("EPSG:900913"); // Spherical Mercator + overviewMap = new OpenLayers.Control.OverviewMap(); + map = new OpenLayers.Map("demoMap", { controls: [ new OpenLayers.Control.Navigation(), // direct panning via mouse drag new OpenLayers.Control.Attribution(), // attribution text + new OpenLayers.Control.MousePosition(), // where am i? new OpenLayers.Control.PanZoomBar(), // larger navigation control - new OpenLayers.Control.MousePosition({'displayProjection': projMercator}) // mouse position - new OpenLayers.Control.OverviewMap() // overview map + overviewMap // overview map ] } ); map.addLayer(new OpenLayers.Layer.OSM.Mapnik()); map.setCenter(new OpenLayers.LonLat(lon, lat).transform(projLonLat,projMercator), zoom); + overviewMap.maximizeControl(); } </script> </head>