Changeset 8309 for mauRepo


Ignore:
Timestamp:
10/05/12 15:16:52 (8 years ago)
Author:
jhorton
Message:

added extents box

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/MolesManager/static/templates/cedaBrowse.html

    r8308 r8309  
    8989          ); 
    9090 
    91           map.addLayers([wms]); 
     91          var w = parseFloat(" {{ geographic_extentW }} "); 
     92          var s = parseFloat(" {{ geographic_extentS }} "); 
     93          var e = parseFloat(" {{ geographic_extentE }} "); 
     94          var n = parseFloat(" {{ geographic_extentN }} "); 
     95          // if we have no extents or if they are bad create a global box 
     96          if (isNaN(w) || isNaN(s) || isNaN(e) || isNaN(n)) { 
     97            w = -180.0; 
     98            s = -90.0; 
     99            e = 180.0; 
     100            n = 90.0; 
     101          } 
     102          var box_extents = [ w, s, e, n ]; 
     103 
     104          var boxes  = new OpenLayers.Layer.Vector( "Boxes" ); 
     105          bounds = OpenLayers.Bounds.fromArray(box_extents); 
     106          box = new OpenLayers.Feature.Vector(bounds.toGeometry()); 
     107          boxes.addFeatures(box); 
     108 
     109          map.addLayers([wms, boxes]); 
     110          map.addControl(new OpenLayers.Control.LayerSwitcher()); 
     111          var sf = new OpenLayers.Control.SelectFeature(boxes); 
     112          map.addControl(sf); 
    92113          map.zoomToMaxExtent(); 
    93114        } 
Note: See TracChangeset for help on using the changeset viewer.