%--
Created by IntelliJ IDEA.
User: sbortman
Date: Jun 9, 2008
Time: 1:34:39 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
" type="text/css"/>
">
OpenLayers.ProxyHost="/omar-2.0/thumbnail/proxy?url=";
var aoiLayer
var polygonControl
var map
function goto()
{
var centerLon = document.getElementById("centerLon").value
var centerLat = document.getElementById("centerLat").value
var zoom = map.getZoom()
var center = new OpenLayers.LonLat( centerLon, centerLat )
map.setCenter( center, zoom )
}
function clearAOI( e )
{
aoiLayer.destroyFeatures()
document.getElementById("aoiMinLon").value = ""
document.getElementById("aoiMaxLat").value = ""
document.getElementById("aoiMaxLon").value = ""
document.getElementById("aoiMinLat").value = ""
}
function setAOI( e )
{
var geom = e.feature.geometry
var bounds = geom.getBounds()
var feature = new OpenLayers.Feature.Vector(geom)
document.getElementById("aoiMinLon").value = bounds.left
document.getElementById("aoiMaxLat").value = bounds.top
document.getElementById("aoiMaxLon").value = bounds.right
document.getElementById("aoiMinLat").value = bounds.bottom
aoiLayer.destroyFeatures()
aoiLayer.addFeatures(feature, {silent: true})
}
function setView( e )
{
var bounds = map.getExtent()
document.getElementById("viewMinLon").value = bounds.left
document.getElementById("viewMaxLat").value = bounds.top
document.getElementById("viewMaxLon").value = bounds.right
document.getElementById("viewMinLat").value = bounds.bottom
}
function setCenterText( e )
{
var center = map.getCenter()
document.getElementById("centerLon").value = center.lon
document.getElementById("centerLat").value = center.lat
}
function init()
{
map = new OpenLayers.Map("map", { controls: [] });
var dataLayer = new OpenLayers.Layer.WMS(
"${dataWMS.title}",
"${dataWMS.url}",
{ layers: "${dataWMS.layers}", format: 'image/png', transparent: true } ,
{'isBaseLayer': false}
);
var baseLayer = new OpenLayers.Layer.WMS(
"${baseWMS.title}",
"${baseWMS.url}",
{layers: '${baseWMS.layers}', format: 'image/png' }
);
aoiLayer = new OpenLayers.Layer.Vector("Area of Interest");
aoiLayer.events.register("featureadded", aoiLayer, function( e ) { setAOI(e) });
var polyOptions = {sides: 4, irregular: true}
polygonControl = new OpenLayers.Control.DrawFeature( aoiLayer, OpenLayers.Handler.RegularPolygon,
{handlerOptions: polyOptions});
map.addLayer(dataLayer);
map.addLayer(baseLayer);
map.addLayer(aoiLayer);
map.setBaseLayer(baseLayer)
map.addControl(new OpenLayers.Control.LayerSwitcher())
map.addControl(new OpenLayers.Control.PanZoom())
map.addControl(new OpenLayers.Control.NavToolbar())
map.addControl(new OpenLayers.Control.MousePosition());
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.addControl(polygonControl);
var left = ${rasterEntryQuery?.viewMinLon}
var bottom = ${rasterEntryQuery?.viewMinLat}
var right = ${rasterEntryQuery?.viewMaxLon}
var top = ${rasterEntryQuery?.viewMaxLat}
var left = -180
var bottom = -90
var right = 180
var top = 90
var bounds = new OpenLayers.Bounds(left, bottom, right, top);
var zoom = map.getZoomForExtent(bounds, true);
map.events.register("moveend", map, function( e ) { setCenterText(e) });
map.events.register("zoomend", map, function( e ) { setView(e) });
map.setCenter(bounds.getCenterLonLat(), zoom);
var bounds = new OpenLayers.Bounds(${rasterEntryQuery.aoiMinLon}, ${rasterEntryQuery.aoiMinLat}, ${rasterEntryQuery.aoiMaxLon}, ${rasterEntryQuery.aoiMaxLat});
var feature = new OpenLayers.Feature.Vector(bounds.toGeometry())
aoiLayer.addFeatures(feature, {silent: true})
}
Search for Imagery