%@ page import="grails.converters.JSON; org.ossim.omar.BaseQuery; org.ossim.omar.VideoDataSetQuery; org.ossim.omar.VideoDataSetSearchTag" contentType="text/html;charset=UTF-8" %>
OMAR : Video Search
Map Center:
-
-
-
-
-
-
-
-
-
-
-
Map Center:
-
-
-
-
-
-
-
-
-
-
-
Map Center:
-
-
-
-
-
-
-
-
-
Map Measurement Tool:
- Measurement Units:
- Not certified for targeting.
function validateMaxResults()
{
var maxResultsRegExp = /^([1-9][0-9]?[0-9]?)$/
if (!$("max").value.match(maxResultsRegExp))
{
alert("Invalid input for max results.\nAcceptable Inputs: 1 - 100");
$("max").value = "10";
}
}
var mapWidget = null;
var oElement = null;
var oElement1 = null;
var oElement2 = null;
var oElement3 = null;
var tabView = null;
var criteriaTabView = null;
var videoDataSetSearchCriteriaIndex=${session.videoDataSetSearchCriteriaTab?:0};
var videoDataSetSearchSpatialIndex=${session.videoDataSetSearchSpatialTab?:0};
var omarSearchParams = new OmarSearchParams();
function syncAoiRadius(synchTo)
{
value = $(synchTo).value;
$("aoiRadius1").value = value;
$("aoiRadius2").value = value;
$("aoiRadius3").value = value;
}
function search()
{
var url = "${createLink(action: 'search', controller: 'videoDataSet')}";
mapWidget.setupSearch();
omarSearchParams.setProperties(document);
omarSearchParams.initTime();
omarSearchParams.time = "";
if($( "bboxSearchButton" ).checked)
{
omarSearchParams.searchMethod = "${BaseQuery.BBOX_SEARCH}"
}
else
{
omarSearchParams.searchMethod = "${BaseQuery.RADIUS_SEARCH}"
}
document.searchForm.action = url + "?" + omarSearchParams.toUrlParams();
//alert(document.searchForm.action );
document.searchForm.submit();
}
function generateKml()
{
var url = "${createLink(action: 'kmlnetworklink', controller: 'videoDataSet')}";
mapWidget.setupSearch();
omarSearchParams.setProperties(document);
omarSearchParams.initTime();
omarSearchParams.setTimeFromDate({day:$("startDate_day").value,
month:$("startDate_month").value,
year:$("startDate_year").value,
hour:$("startDate_hour").value,
minute:$("startDate_minute").value,
sec:""
},
{day:$("endDate_day").value,
month:$("endDate_month").value,
year:$("endDate_year").value,
hour:$("endDate_hour").value,
minute:$("endDate_minute").value,
sec:""
});
document.searchForm.action = url + "?" + omarSearchParams.toUrlParams();
document.searchForm.submit();
}
function init()
{
var oMenu = new YAHOO.widget.MenuBar("searchMenu", {
autosubmenudisplay: true,
hidedelay: 750,
lazyload: true,
zIndex:9999});
oMenu.render();
var spatialSearchFlag = document.getElementById("spatialSearchFlag");
if(spatialSearchFlag)
{
spatialSearchFlag.checked = ${queryParams?.spatialSearchFlag};
spatialSearchFlag.value = "${queryParams?.spatialSearchFlag}";
}
spatialTabView = new YAHOO.widget.TabView('spatialTab');
criteriaTabView = new YAHOO.widget.TabView('criteriaTab');
var criteriaTab0 = criteriaTabView.getTab(0);
var criteriaTab1 = criteriaTabView.getTab(1);
criteriaTab0.addListener('click', handleClickCriteriaTab0);
criteriaTab1.addListener('click', handleClickCriteriaTab1);
criteriaTabView.selectTab(videoDataSetSearchCriteriaIndex);
var spatialTab0 = spatialTabView.getTab(0);
var spatialTab1 = spatialTabView.getTab(1);
var spatialTab2 = spatialTabView.getTab(2);
spatialTab0.addListener('click', handleClickSpatialTab0);
spatialTab1.addListener('click', handleClickSpatialTab1);
spatialTab2.addListener('click', handleClickSpatialTab2);
spatialTabView.selectTab(videoDataSetSearchSpatialIndex);
mapWidget = new MapWidget();
mapWidget.setupMapWidget();
setupBaseLayers();
mapWidget.setupDataLayer("${dataWMS.name}", "${dataWMS.url}", "${dataWMS.params.layers}", "${dataWMS.options.styles}", "${dataWMS.params.format}");
mapWidget.changeMapSize();
mapWidget.setupAoiLayer();
mapWidget.setupToolBar();
mapWidget.setupMapView("${queryParams?.viewMinLon ?: -180}", "${queryParams?.viewMinLat ?: -90}", "${queryParams?.viewMaxLon ?: 180}", "${queryParams?.viewMaxLat ?: 90}");
var minLon = ${queryParams?.aoiMinLon ?: 'null'};
var minLat = ${queryParams?.aoiMinLat ?: 'null'};
var maxLon = ${queryParams?.aoiMaxLon ?: 'null'};
var maxLat = ${queryParams?.aoiMaxLat ?: 'null'};
if ( minLon && minLat && maxLon && maxLat)
{
mapWidget.initAOI(minLon, minLat, maxLon, maxLat);
}
if("${queryParams.searchMethod}" == "BBOX")
{
mapWidget.toggleBboxCheckBox()
}
else if("${queryParams.searchMethod}" == "RADIUS")
{
mapWidget.togglePointRadiusCheckBox()
}
else
{
mapWidget.toggleBboxCheckBox()
}
updateOmarFilters();
oElement = document.getElementById("startDate_hour");
oElement1 = document.getElementById("startDate_minute");
oElement2 = document.getElementById("endDate_hour");
oElement3 = document.getElementById("endDate_minute");
YAHOO.util.Event.addListener(oElement, "change", updateOmarFilters);
YAHOO.util.Event.addListener(oElement1, "change", updateOmarFilters);
YAHOO.util.Event.addListener(oElement2, "change", updateOmarFilters);
YAHOO.util.Event.addListener(oElement3, "change", updateOmarFilters);
ddTab.title = "Please enter the search parameters in Decimal Degrees (DD) format";
dmsTab.title = "Please enter the search parameters in Degrees Minutes Seconds (DMS) format. DMS is formatted as ddmmss.ssssN|S or dd mm ss.sss N|S for latitude and longitude can have up to 3 digits for the degree indicator and can be formatted as dddmmss.ssssN|S or ddd mm ss.sss N|S";
mgrsTab.title = "Please enter the search parameters in Military Grid Reference System (MGRS) format. MGRS formatted input is of the form [grid zone designator][100,000-meter square identifier][easting][northing].";
metadataCriteriaTab.title = "Please select from the list of meta data you would like to search";
cqlCriteriaTab.title = "Please enter the Common Query Language (CQL) statements";
}
function handleClickSpatialTab0(e) {
updateCurrentSpatialTab(0);
}
function handleClickSpatialTab1(e) {
updateCurrentSpatialTab(1);
}
function handleClickSpatialTab2(e) {
updateCurrentSpatialTab(2);
}
function handleClickCriteriaTab0(e) {
updateCurrentCriteriaTab(0);
}
function handleClickCriteriaTab1(e) {
updateCurrentCriteriaTab(1);
}
function updateCurrentSpatialTab(tabIndex)
{
var link = "${createLink(action: 'updateSession', controller: 'session')}";
if(tabIndex != videoDataSetSearchCriteriaIndex)
{
videoDataSetSearchSpatialIndex = tabIndex;
new OpenLayers.Ajax.Request(link+"?"+"videoDataSetSearchSpatialTab="+videoDataSetSearchSpatialIndex, {method: 'post',
onCreate: function(transport) {
}
});
}
}
function updateCurrentCriteriaTab(tabIndex)
{
var link = "${createLink(action: 'updateSession', controller: 'session')}";
if(tabIndex != videoDataSetSearchCriteriaIndex)
{
videoDataSetSearchCriteriaIndex = tabIndex;
new OpenLayers.Ajax.Request(link+"?"+"videoDataSetSearchCriteriaTab="+videoDataSetSearchCriteriaIndex, {method: 'post',
onCreate: function(transport) {
}
});
}
}
function measureUnitChanged(unit)
{
if(unit == 'kilometers')
{
pathMeasurement.innerHTML = mapWidget.getPathUnit()[0];
}
else if(unit == 'meters')
{
pathMeasurement.innerHTML = mapWidget.getPathUnit()[1];
}
else if(unit == 'feet')
{
pathMeasurement.innerHTML = mapWidget.getPathUnit()[2];
}
else if(unit == 'miles')
{
pathMeasurement.innerHTML = mapWidget.getPathUnit()[3];
}
else if(unit == 'yards')
{
pathMeasurement.innerHTML = mapWidget.getPathUnit()[4];
}
}
function updateOmarFilters()
{
if(!mapWidget) return;
var numberOfNames = parseInt("${queryParams?.searchTagNames.size()}");
var numberOfValues = parseInt(${queryParams?.searchTagValues.size()});
var ogcFilterInput = document.getElementById('filter');
var additionalParams = new Array();
if(ogcFilterInput)
{
additionalParams['filter']=ogcFilterInput.value;
}
mapWidget.updateOmarFilters(
$("startDate_day").value, $("startDate_month").value, $("startDate_year").value, $("startDate_hour").value, $("startDate_minute").value,
$("endDate_day").value, $("endDate_month").value, $("endDate_year").value, $("endDate_hour").value, $("endDate_minute").value,
numberOfNames, numberOfValues, additionalParams
);
}
function setupBaseLayers()
{
if(!mapWidget) return;
var baseLayer = null;
var baseWMS=${baseWMS as JSON};
for ( layer in baseWMS ) {
baseLayer = new OpenLayers.Layer.WMS(baseWMS[layer].name, baseWMS[layer].url,
baseWMS[layer].params, baseWMS[layer].options);
if(baseWMS[layer].options.isBaseLayer)
{
mapWidget.setupBaseLayers(baseLayer);
}
else
{
mapWidget.getMap().addLayer(baseLayer);
}
}
}