~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to gis/dhis-gis-geostat/mfbase/openlayers/examples/setextent.html

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
<title>Setting a visual Extent</title>
 
4
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
 
5
    <link rel="stylesheet" href="style.css" type="text/css" />
 
6
<script src="../lib/OpenLayers.js"></script>
 
7
</head>
 
8
<body>
 
9
<h1 id="title">Setting a Visual Extent</h1>
 
10
<p id='shortdesc'>
 
11
  Use a boxes layer to visually display the area of interest indicated by a user.
 
12
</p>
 
13
<p>
 
14
  Because the ability to set the map to a given extent is limited by the 
 
15
  current resolutions available, zoomToExtent will not always set the map to 
 
16
  exactly the right extent. In order to visually annotate the actual extent, 
 
17
  this example, will use the Boxes layer to visually describe the desired
 
18
  extent as well as setting the map extent.
 
19
</p>
 
20
  <div style="width:100%; height:75%" id="map"></div>
 
21
  <script defer="defer" type="text/javascript">
 
22
    var map = new OpenLayers.Map('map');
 
23
    var bounds = new OpenLayers.Bounds(-45,-45, 0, 45); 
 
24
    var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
 
25
        "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
 
26
    map.addLayer(wms);
 
27
    map.zoomToExtent(bounds);
 
28
    var boxes = new OpenLayers.Layer.Boxes("boxes");
 
29
    var box = new OpenLayers.Marker.Box(bounds);
 
30
    boxes.addMarker(box);
 
31
    map.addLayer(boxes);
 
32
  </script>
 
33
</body>
 
34
</html>