Changeset 8303 in genesis for nodes/nodemap.html
- Timestamp:
- Aug 10, 2010, 6:21:48 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/nodemap.html
r8292 r8303 16 16 <script> 17 17 var map, rulerControl; 18 var mapnik, wms; 18 19 var projection_wgs = new OpenLayers.Projection("EPSG:4326"); // WGS 1984 19 20 var projection_smp = new OpenLayers.Projection("EPSG:900913"); // Spherical Mercator Projection 20 21 22 var current_opacity = 0.5; 23 var max_opacity = 0.9; 24 var min_opacity = 0.1; 25 26 27 function setOpacity(new_opacity) { 28 current_opacity = new_opacity; 29 mapnik.setOpacity(new_opacity); 30 wms.setOpacity(new_opacity); 31 } 32 33 function changeOpacity(by_opacity) { 34 var new_opacity = current_opacity + by_opacity; 35 new_opacity = Math.min(max_opacity, Math.max(min_opacity, new_opacity)); 36 setOpacity(new_opacity); 37 } 38 21 39 function init() { 22 40 map = new OpenLayers.Map("basicMap"); 23 41 24 42 var world_bound = new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34); 25 var mapnik = new OpenLayers.Layer.OSM("OpenStreepMap"); 43 // Development focus maps 44 mapnik = new OpenLayers.Layer.OSM("OpenStreetMap"); 45 wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", 46 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} ); 47 48 // Added extra's 26 49 var google_sat = new OpenLayers.Layer.Google("Google Satellite" , 27 50 { type: G_SATELLITE_MAP, 28 51 sphericalMercator: true, 29 52 maxExtent: world_bound, 30 wrapDateLine: false}); 53 wrapDateLine: false, 54 }); 31 55 var google_normal = new OpenLayers.Layer.Google("Google Normal" , 32 56 { type: G_NORMAL_MAP, 33 57 sphericalMercator: true, 34 58 maxExtent: world_bound, 35 wrapDateLine: false}); 36 37 var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", 38 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} ); 39 40 map.addLayers([mapnik, google_sat, wms, google_normal]); 41 //map.setCenter(new OpenLayers.LonLat(4.40,52.186), 9); 42 59 wrapDateLine: false 60 }); 61 62 63 map.addLayers([mapnik, wms, google_sat, google_normal]); 64 setOpacity(0.5); 43 65 defaultFocus(); 44 66 … … 256 278 <li>holding down shift, whilst dragging the mouse to do box zooming</li> 257 279 <li>Keyboard Navigation is enabled</li> 280 <li>Contrast of background: <a title="decrease opacity" href="javascript: changeOpacity(-0.1);">Decrease</a> or <a title="increase opacity" href="javascript: changeOpacity(0.1);">Increase</a></li> 281 282 258 283 </ul> 259 284 </div>
Note:
See TracChangeset
for help on using the changeset viewer.