Loading...
 
ESA > Join & Share > WebMapViewer > WebMapViewerJavascript
Print

WebMapViewerJavascript

WebMapViewer Javascript API

Introduction

This page describes a set of Javascript functions that the SSE Portal uses to communicate with the WebMapViewer.
These functions can also be used by SSE Service Providers from within the XSL stylesheets of their service:

List of functions

selectOnMap


Function: selectOnMap(ids)
Purpose: To (de)select a (set of) GML object(s) on the map.
Parameters: ids is a semicolon separated list of GML object identifiers
Notes: Each time you call this function the complete set of selected features must be passed. Passing an empty list clears the selection.

updateFeatures


Function: updateFeatures(aoiFeaturesURLs, aoiFeaturesStrings, srFeaturesURLs, srFeaturesStrings, wfsFeaturesURLs, clearAOIs, clearSRs, clearWFSsaoiFeaturesURLs)
Purpose: instruct the WebMapViewer to display AOI GML, Service Result GML or shape files and/or WFS derived features. Information is provided as either http/FTP URLs to files, GML strings and/or WFS URLs. For information on the supported GML application schema and file types, please refer to the SSE ICD.
Parameters:
*aoiFeaturesURL String: URL to a valid AOI GML file
*aoiFeaturesString String: a valid AOI GML String
*srFeaturesURL String: URL to a valid Service Result GML file
*srFeaturesString String: a valid Service Result GML String
*wfsFeaturesURL String: a pipe-separated string consisting of the WFS base URL, the FeatureType and a Query statement
*clearAOI: boolean value to indicate whether all existing AOI should be removed (Boolean meaning "1" or "0")
*clearSR: boolean value to indicate whether all existing Service Results should be removed (Boolean meaning "1" or "0")
*clearWFS: boolean value to indicate whether all existing WFS FeatureTypes should be removed (Boolean meaning "1" or "0")

Notes: the boolean values clearAOIs, clearSRs,clearWFSs indicate whether or not the previously existing objects within the map must be erased. This allows for instance to keep the AOI features but to remove the previous defined Service Result features.

addLayer

Function: addLayer(baseURL, serviceType,layerTypeName, parameters)
Purpose: this function allows adding an OGC service "map layer" to the WebMapViewer
Parameters:

  • baseURL is the online resource string of the OGC service
  • serviceType is one of “WMSâ€?, “WFSâ€?, “WCSâ€? or “SOSâ€?
  • layerTypeName is the name of the WMS/WFS/WCS/SOS Layer/FeatureType/Coverage/ObservationOffering
  • parameters is an array of (Vendor-Specific) parameters that are used to identify the layer.

updateWMC

Function: updateWMC(viewWMCFileURL,viewWMCString,clearWMC)
Purpose: this function allows adding or replacing the Web Map Context of the Viewer with a new WebMapContext.
Parameters:

  • viewWMCFileURL is a URL to a file containing a Web Map Context.
  • viewWMCString is a Web Map Context string.
  • clearWMC determines whether the existing Web Map Context will be replaced.

updateWMSURL

Function: updateWMSURL(GetMapURL)
Purpose: this function allows adding a set of WMS layers to the WebMapViewer by passing a complete GetMap URL. The layer will be shown on top of the map but will not be incorporated in the layer manager. All KVP parameters that you specify in the GetMap request will be passed to the WMS Service with the exception of the Width, Height and BBOX which will be set to the width, height and spatial extent of the WebMapViewer. The BBOX of the original GetMapURL will serve as limiting zoom extent.
Parameters:

  • GetMapURL is a complete GetMapURL


How to use these functions


Depending on whether you call this function from within the resultFame or from within the main page of the portal, you can access these functions like done in the following examples

window.parent.frameViewer.updateFeatures(,aoiFeatures,,,,"0","0","0");

or

frameViewer.updateFeatures(,aoiFeatures,,,,"0","0","0");









Contributors to this page:
WebMapViewerSupport .

Page last modified on Thursday 12 of June 2014 17:11:12 CEST by .