Project

General

Profile

WMJSService » History » Version 12

« Previous - Version 12/17 (diff) - Next » - Current version
Maarten Plieger, 02/09/2017 03:25 PM


API/WMJSService

Example: Do GetCapabilities on a WMS Service URL

    $( document ).ready(function() {
      var serviceURL = 'http://geoservices.knmi.nl/cgi-bin/RADNL_OPER_R___25PCPRR_L3.cgi?';

      var service = WMJSgetServiceFromStore(serviceURL);

      var failed = function(msg){
        alert(msg);
      };

      var success = function(capabilitiesDoc){
        console.log("GetCapabilities obtained");
        console.log(capabilitiesDoc);
      };

      service.getCapabilities(success,failed);
    });

Configuration

  • Use the global method WMJSgetServiceFromStore(serviceUrl) to create or get a service object for an URL.

Properties

  • service
  • title
  • getcapabilitiesDoc

Methods

  • getCapabilities(successCallback, failedCallback,forceReload) - Does getcapabilities for this service. Uses callback functions to indicate whether success or failure has happened.
  • getNodes(successCallback, failedCallback,forceReload) - Returns all layernames in a hierarchical way, the returned objects are nested by using the children property. A node has the following properties: name, text, leaf and children. The returned object can directly be used in an ExtJS4 tree component.
  • getLayerNames(successCallback, failedCallback) - Returns an array with all layernames.