| | 1 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| | 2 | <head> |
|---|
| | 3 | <title>OpenLayers Navigation Control</title> |
|---|
| | 4 | <link rel="stylesheet" href="../theme/default/style.css" type="text/css" /> |
|---|
| | 5 | <style type="text/css"> |
|---|
| | 6 | #map { |
|---|
| | 7 | width: 512px; |
|---|
| | 8 | height: 512px; |
|---|
| | 9 | border: 1px solid black; |
|---|
| | 10 | } |
|---|
| | 11 | </style> |
|---|
| | 12 | <script src="../lib/OpenLayers.js"></script> |
|---|
| | 13 | <script type="text/javascript"> |
|---|
| | 14 | var map, layer; |
|---|
| | 15 | function init(){ |
|---|
| | 16 | map = new OpenLayers.Map( 'map', { controls: [] }); |
|---|
| | 17 | layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", |
|---|
| | 18 | "http://labs.metacarta.com/wms/vmap0", |
|---|
| | 19 | {layers: 'basic'} ); |
|---|
| | 20 | map.addLayer(layer); |
|---|
| | 21 | nav = new OpenLayers.Control.Navigation({'zoomWheelEnabled': false}); |
|---|
| | 22 | map.addControl(nav); |
|---|
| | 23 | map.zoomToMaxExtent(); |
|---|
| | 24 | } |
|---|
| | 25 | </script> |
|---|
| | 26 | </head> |
|---|
| | 27 | <body onload="init()"> |
|---|
| | 28 | <h1 id="title">Navigation Control</h1> |
|---|
| | 29 | |
|---|
| | 30 | <div id="tags"></div> |
|---|
| | 31 | |
|---|
| | 32 | <div id="shortdesc">Demonstrate Navigation Control features</div> |
|---|
| | 33 | |
|---|
| | 34 | <div id="map"></div> |
|---|
| | 35 | <a href="#" onclick="nav.enableZoomWheel();return false">Turn on Wheel Zoom</a> | <a href="#" onclick="nav.disableZoomWheel(); return false;">Turn off Wheel Zoom</a> |
|---|
| | 36 | <div id="docs"> |
|---|
| | 37 | This example demonstrates a couple features of the Navigation control. The Navigation control controls most map dragging, movement, zooming, etc. In this case, we have a demonstration of how to create a navigation control with no zoom wheel action, which can then be enabled or disabled by the user. |
|---|
| | 38 | </div> |
|---|
| | 39 | </body> |
|---|
| | 40 | </html> |