<commit_before><%--
 Created by IntelliJ IDEA.
 User: sbortman
 Date: Sep 14, 2009
 Time: 9:24:47 AM
 To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
 <title>OMAR - Raster Search</title>
 <meta name="layout" content="main3"/>

 <style type="text/css">
 #map {
   border: 1px solid black;
   width: 100%;
   height: 100%;
 }

 #controls {
   padding-left: 2em;
   margin-left: 0;
   width: 12em;
 }

 #controls li {
   padding-top: 0.5em;
   list-style: none;
 }

 #panel {
   right: 0px;
   height: 30px;
   width: 200px;
 }

 #panel div {
   float: left;
   margin: 5px;
 }
 </style>

 <openlayers:loadMapToolBar/>
 <openlayers:loadTheme theme="default"/>
 <openlayers:loadJavascript/>
 <resource:include components="dateChooser"/>

 <g:javascript src="coordinateConversion.js"/>

 <g:javascript>
   var aoiLayer;
   var polygonControl;
   var map;
   var dataLayer;


   function changeMapSize()
   {
     var mapTitle = $("mapTitle");
     var mapDiv = $("map");

     mapDiv.style.width = mapTitle.offsetWidth + "px";
     mapDiv.style.height = Math.round( mapTitle.offsetWidth / 2) + "px";

     map.updateSize();
   }

   function setupDataLayer()
   {
     dataLayer = new OpenLayers.Layer.WMS(
       "${dataWMS.title}",
       "${dataWMS.url}",
       { layers: "${dataWMS.layers}", styles:"${dataWMS.styles}", format: "${dataWMS.format}", IMAGEFILTER: "true=true", transparent: true },
        {isBaseLayer:false,buffer:0,visibility:false,transitionEffect: "resize"}
     );
     map.addLayer(dataLayer);
   }

   function setupBaseLayer()
   {
     var baseLayer = new OpenLayers.Layer.WMS(
       "${baseWMS.title}",
       "${baseWMS.url}",
       {layers: '${baseWMS.layers}', format: "${baseWMS.format}" },
        {isBaseLayer:true, buffer:0,transitionEffect: "resize"}
     );
     map.addLayer(baseLayer);
     map.setBaseLayer(baseLayer);
   }

   function setupAoiLayer()
   {

     aoiLayer = new OpenLayers.Layer.Vector("Area of Interest");
     aoiLayer.events.register("featureadded", aoiLayer, setAOI );

     var polyOptions = {sides: 4, irregular: true} ;

     polygonControl = new OpenLayers.Control.DrawFeature( aoiLayer, OpenLayers.Handler.RegularPolygon,
        {handlerOptions: polyOptions});

     map.addLayer(aoiLayer);
     map.addControl(polygonControl);

     var aoiMinLon = "${queryParams?.aoiMinLon ?: ''}";
     var aoiMinLat = "${queryParams?.aoiMinLat ?: ''}";
     var aoiMaxLon = "${queryParams?.aoiMaxLon ?: ''}";
     var aoiMaxLat = "${queryParams?.aoiMaxLat ?: ''}";

     if ( aoiMinLon && aoiMinLat && aoiMaxLon && aoiMaxLat )
     {
       var bounds = new OpenLayers.Bounds( aoiMinLon, aoiMinLat, aoiMaxLon, aoiMaxLat );
       var feature = new OpenLayers.Feature.Vector(bounds.toGeometry());

       aoiLayer.addFeatures(feature, {silent: true});
     }
   }

   function setupMapWidget()
   {
      map = new OpenLayers.Map("map", { controls: [], format: 'DMS'});
      map.addControl(new OpenLayers.Control.LayerSwitcher());
      //map.addControl(new OpenLayers.Control.PanZoom());
      //map.addControl(new OpenLayers.Control.NavToolbar());
      map.addControl(new OpenLayers.Control.Scale());
      //map.addControl(new OpenLayers.Control.Permalink("permalink"));
      map.addControl(new OpenLayers.Control.ScaleLine());
      map.addControl(new OpenLayers.Control.Attribution());
      map.events.register("moveend", map, setCenterText);
      map.events.register("zoomend", map, setView );

      map.addControl(new OpenLayers.Control.MousePosition({
          formatOutput: function(lonLat)
          {
              var dmsOutput = document.getElementById('dmsCoordinates');
              dmsOutput.innerHTML = "<b>DMS:</b> " + ddToDms(lonLat.lat, "latitude") + " " + ddToDms(lonLat.lon, "longitude");

              var latHem;
              if(lonLat.lat < 0)
              {
                  latHem = " S";
              }
              else
              {
                  latHem = " N";
              }

              var lonHem;
              if(lonLat.lon < 0)
              {
                  lonHem = " W";
              }
              else
              {
                  lonHem = " E";
              }

              var ddOutput = document.getElementById('ddCoordinates');
              ddOutput.innerHTML = "<b>DD:</b> " + lonLat.lat + "" + latHem + " " + lonLat.lon + "" + lonHem;
          }
      }));

   }

   function setupMapView()<commit_msg>Took the hemisphere notation off the Decimal Degree output for the mouse position on the open layers map. ~dlucas<commit_after><%--
 Created by IntelliJ IDEA.
 User: sbortman
 Date: Sep 14, 2009
 Time: 9:24:47 AM
 To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
 <title>OMAR - Raster Search</title>
 <meta name="layout" content="main3"/>

 <style type="text/css">
 #map {
   border: 1px solid black;
   width: 100%;
   height: 100%;
 }

 #controls {
   padding-left: 2em;
   margin-left: 0;
   width: 12em;
 }

 #controls li {
   padding-top: 0.5em;
   list-style: none;
 }

 #panel {
   right: 0px;
   height: 30px;
   width: 200px;
 }

 #panel div {
   float: left;
   margin: 5px;
 }
 </style>

 <openlayers:loadMapToolBar/>
 <openlayers:loadTheme theme="default"/>
 <openlayers:loadJavascript/>
 <resource:include components="dateChooser"/>

 <g:javascript src="coordinateConversion.js"/>

 <g:javascript>
   var aoiLayer;
   var polygonControl;
   var map;
   var dataLayer;


   function changeMapSize()
   {
     var mapTitle = $("mapTitle");
     var mapDiv = $("map");

     mapDiv.style.width = mapTitle.offsetWidth + "px";
     mapDiv.style.height = Math.round( mapTitle.offsetWidth / 2) + "px";

     map.updateSize();
   }

   function setupDataLayer()
   {
     dataLayer = new OpenLayers.Layer.WMS(
       "${dataWMS.title}",
       "${dataWMS.url}",
       { layers: "${dataWMS.layers}", styles:"${dataWMS.styles}", format: "${dataWMS.format}", IMAGEFILTER: "true=true", transparent: true },
        {isBaseLayer:false,buffer:0,visibility:false,transitionEffect: "resize"}
     );
     map.addLayer(dataLayer);
   }

   function setupBaseLayer()
   {
     var baseLayer = new OpenLayers.Layer.WMS(
       "${baseWMS.title}",
       "${baseWMS.url}",
       {layers: '${baseWMS.layers}', format: "${baseWMS.format}" },
        {isBaseLayer:true, buffer:0,transitionEffect: "resize"}
     );
     map.addLayer(baseLayer);
     map.setBaseLayer(baseLayer);
   }

   function setupAoiLayer()
   {

     aoiLayer = new OpenLayers.Layer.Vector("Area of Interest");
     aoiLayer.events.register("featureadded", aoiLayer, setAOI );

     var polyOptions = {sides: 4, irregular: true} ;

     polygonControl = new OpenLayers.Control.DrawFeature( aoiLayer, OpenLayers.Handler.RegularPolygon,
        {handlerOptions: polyOptions});

     map.addLayer(aoiLayer);
     map.addControl(polygonControl);

     var aoiMinLon = "${queryParams?.aoiMinLon ?: ''}";
     var aoiMinLat = "${queryParams?.aoiMinLat ?: ''}";
     var aoiMaxLon = "${queryParams?.aoiMaxLon ?: ''}";
     var aoiMaxLat = "${queryParams?.aoiMaxLat ?: ''}";

     if ( aoiMinLon && aoiMinLat && aoiMaxLon && aoiMaxLat )
     {
       var bounds = new OpenLayers.Bounds( aoiMinLon, aoiMinLat, aoiMaxLon, aoiMaxLat );
       var feature = new OpenLayers.Feature.Vector(bounds.toGeometry());

       aoiLayer.addFeatures(feature, {silent: true});
     }
   }

   function setupMapWidget()
   {
      map = new OpenLayers.Map("map", { controls: [], format: 'DMS'});
      map.addControl(new OpenLayers.Control.LayerSwitcher());
      //map.addControl(new OpenLayers.Control.PanZoom());
      //map.addControl(new OpenLayers.Control.NavToolbar());
      map.addControl(new OpenLayers.Control.Scale());
      //map.addControl(new OpenLayers.Control.Permalink("permalink"));
      map.addControl(new OpenLayers.Control.ScaleLine());
      map.addControl(new OpenLayers.Control.Attribution());
      map.events.register("moveend", map, setCenterText);
      map.events.register("zoomend", map, setView );

      map.addControl(new OpenLayers.Control.MousePosition({
          formatOutput: function(lonLat)
          {
              var dmsOutput = document.getElementById('dmsCoordinates');
              dmsOutput.innerHTML = "<b>DMS:</b> " + ddToDms(lonLat.lat, "latitude") + " " + ddToDms(lonLat.lon, "longitude");

              var latHem;
              if(lonLat.lat < 0)
              {
                  latHem = " S";
              }
              else
              {
                  latHem = " N";
              }

              var lonHem;
              if(lonLat.lon < 0)
              {
                  lonHem = " W";
              }
              else
              {
                  lonHem = " E";
              }

              var ddOutput = document.getElementById('ddCoordinates');
              ddOutput.innerHTML = "<b>DD:</b> " + lonLat.lat + " " + lonLat.lon;
          }
      }));

   }

   function setupMapView()
{'fraction_non_alphanumeric': 0.14780701754385964, 'fraction_numerical': 0.008552631578947369, 'mean_word_length': 2.5243431221020094, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6432813', 'n_tokens_mistral': 3102, 'n_tokens_neox': 2916, 'n_words': 551}