Web Content Display Web Content Display
Widget installation instructions
Web Content Display Web Content Display
Geoss Search WidgetGeoss Search Widget is a plugin that allows you to explore Earth Observation data on your website. The widget is still in development phase, but it is already able to:
|
Getting started Geoss Search Widget package come along with sample website which is a practical example of plugin implementation.
|
UsageFunction Geoss.initSearchBarCallback() can be used to perform an action just after the widget is load. Function Geoss.actionBeforeRequest() is called before each request sent to DAB (on new search, page change, opening drill-down, opening metainfo). Function Geoss.successCallback(dataXml) is called on successful response, designed to interact with UI on your site. This function has access to XML with DAB response, e.g.: function successResponse(dataXml) { updatePagination(dataXml); progressBar.hide(); // other instructions here ... } Geoss.successCallback = successResponse; Function Geoss.failureCallback(error) is designed to interact with UI on your site in case of an error, e.g.: function failureResponse(error) { if (error == "ajax") { alert("AJAX request failed."); } else if (error == "xhr") { alert("Wrong response code."); } else if (error == "noresults") { alert("No results to show."); } progressBar.hide(); clearPagination(); // other instructions here ... } Geoss.failureCallback = failureResponse; Function Geoss.metadataCallback() is called after metadata window shows up. Function Geoss.downloadBoxCallback() is triggered when download windows appears. Function Geoss.synchronizeLayerList() is called after opening layer window of given resource. It is designed to synchronize checkboxes of this window with active layers container. Function Geoss.addLayerCallback(layer, element) is triggered after selecting layer from layer window of given resource. This is a place to load layer on your map. The 'element' is a reference to clicked checkbox. Function initSearchBar() initializes Geoss Search Widget. Function addBBoxInteraction(map) adds LMB, RMB and hover actions to bounding boxes on previously initialized map. Function initLayerBox() appends custom layer-popup to previously defined Geoss.layersContainer. Function Geoss.search(params) automatically fills search form and sends request to Discovery and Access Broker (DAB). Argument 'params' is an object with search form parameters listed below: - query - searching term, - fullAndOpenDataset - data only from Geoss Data Core; values: true, false, - viewid - id of predefined view catalogs, - sources - id of predefined source catalog, - dateFrom - start time of data collection (e.g. 2017-06-28), - dateTo - end time of data collection (e.g. 2017-06-29), - datePeriod - predefined time periods (values: last-week, last-month, last-year), - aoiRelation - relation of area of interest (bbox_contains, bbox_overlaps or bbox_disjoint), - aoiOption* - way of providing AOI (values: Coordinates, Geolocation, ContinentAndCountry), - aoiBoundingBox - box defining area of interest (format: W,S,E,N; e.g. -178.217,18.925,-68,71.351), - aoiGeolocation - name of AOI (just a label; used only if aoiOption is set to Geolocation). All parameters are defined as strings. * - aoiOption = Coordinates with provided aoiBoundingBox is most convinient option for use in this simple API. In fact, Geolocation and ContinentAndCountry come down to usage of coordinates as well. Example: var params = new Object(); params.query = "Water"; params.sources = "geodabgbifid" params.aoiOption = "Coordinates"; params.aoiBoundingBox = "-100,-60,0,20"; params.aoiRelation = "bbox_contains"; params.datePeriod = "last-year"; Geoss.search(params); |
Additional info / Recent changes
|