How to use the terriajs-cesium/Source/ThirdParty/knockout.default.track function in terriajs-cesium

To help you get started, we’ve selected a few terriajs-cesium examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TerriaJS / terriajs / lib / Models / TimeSeriesStack.js View on Github external
var TimeSeriesStack = function(clock) {
  this.clock = clock;

  this._layerStack = [];

  knockout.track(this, ["_layerStack"]);

  /**
   * The highest time-series layer, or undefined if there are no time series layers.
   */
  knockout.defineProperty(this, "topLayer", {
    get: function() {
      if (this._layerStack.length) {
        return this._layerStack[this._layerStack.length - 1];
      }
      return undefined;
    }
  });

  knockout.getObservable(this, "topLayer").subscribe(function(topLayer) {
    if (defined(topLayer)) {
      // If there's a top layer, make the clock track it.
github TerriaJS / terriajs / lib / Models / ArcGisMapServerCatalogItem.js View on Github external
/**
   * Gets or sets the URL to use for requesting tokens.
   * @type {String}
   */
  this.tokenUrl = undefined;

  /**
   * Gets or sets the additional parameters to pass to the WMS server when requesting images.
   * All parameter names must be entered in lowercase in order to be consistent with references in TerrisJS code.
   * If this property is undefined, {@link WebMapServiceCatalogItem.defaultParameters} is used.
   * @type {Object}
   */
  this.parameters = {};

  knockout.track(this, [
    "layers",
    "maximumScale",
    "_legendUrl",
    "_generatedLegendUrl",
    "maximumScaleBeforeMessage",
    "showTilesAfterMessage",
    "allowFeaturePicking",
    "tokenUrl",
    "parameters"
  ]);

  // metadataUrl and legendUrl are derived from url if not explicitly specified.
  overrideProperty(this, "metadataUrl", {
    get: function() {
      if (defined(this._metadataUrl)) {
        return this._metadataUrl;
github TerriaJS / terriajs / lib / Models / WebProcessingServiceCatalogItem.js View on Github external
/**
   * Gets or sets the URL of the WPS completed response.  This property is ignored if
   * {@link WebProcessingServiceCatalogItem#wpsResponse} is defined.  This property is observable.
   * @type {String}
   */
  this.wpsResponseUrl = undefined;

  /**
   * Gets or sets the completed WPS response, as either XML or the result of passing the
   * XML through {@link xml2json}.
   * @type {Object|Document}
   */
  this.wpsResponse = undefined;

  knockout.track(this, ["wpsResponseUrl", "wpsResponse"]);
}
github TerriaJS / terriajs / lib / Models / Catalog.js View on Github external
this._terria = terria;
  this._shareKeyIndex = {};

  this._group = new CatalogGroup(terria);
  this._group.name = "Root Group";
  this._group.preserveOrder = true;

  /**
   * Gets or sets a flag indicating whether the catalog is currently loading.
   * @type {Boolean}
   */
  this.isLoading = false;

  this._chartableItems = [];

  knockout.track(this, ["isLoading", "_chartableItems"]);

  knockout.defineProperty(this, "userAddedDataGroup", {
    get: this.upsertCatalogGroup.bind(
      this,
      CatalogGroup,
      USER_ADDED_CATEGORY_NAME,
      "The group for data that was added by the user via the Add Data panel."
    )
  });

  knockout.defineProperty(this, "chartDataGroup", {
    get: this.upsertCatalogGroup.bind(
      this,
      CatalogGroup,
      CHART_DATA_CATEGORY_NAME,
      "A group for chart data."
github TerriaJS / terriajs / lib / Models / WebFeatureServiceCatalogGroup.js View on Github external
* Gets or sets a description of the custodian of the data sources in this group.
   * This property is an HTML string that must be sanitized before display to the user.
   * This property is observable.
   * @type {String}
   */
  this.dataCustodian = undefined;

  /**
   * Gets or sets a hash of names of blacklisted data layers.  A layer that appears in this hash
   * will not be shown to the user.  In this hash, the keys should be the Title of the layers to blacklist,
   * and the values should be "true".  This property is observable.
   * @type {Object}
   */
  this.blacklist = undefined;

  knockout.track(this, ["url", "dataCustodian", "blacklist"]);
};
github TerriaJS / terriajs / lib / ReactViewModels / HelpViewState.js View on Github external
*/
  this.currentSequence = undefined;

  /**
   * Whether to cancel help mode.
   * @type {Boolean}
   */
  this.cancel = false;

  /**
   * Whether to go to next screen in help mode.
   * @type {Boolean}
   */
  this.advance = false;

  knockout.track(this, ["currentScreen", "currentSequence"]);
};
github TerriaJS / terriajs / lib / Models / AbsIttCatalogGroup.js View on Github external
/**
   * Gets or sets a hash of names of whitelisted datasets.  A dataset that doesn't appears in this hash
   * will not be shown to the user.  In this hash, the keys should be the name of the dataset to blacklist,
   * and the values should be "true".  This property is observable.
   * @type {Object}
   */
  this.whitelist = undefined;

  /**
   * Gets or sets a hash of properties that will be set on each child item.
   * For example, { 'treat404AsError': false }
   */
  this.itemProperties = undefined;

  knockout.track(this, [
    "url",
    "filter",
    "dataCustodian",
    "blacklist",
    "whitelist",
    "itemProperties"
  ]);
};
github TerriaJS / terriajs / lib / Models / WebProcessingServiceCatalogFunction.js View on Github external
this.url = undefined;

  /**
   * Gets or sets the identifier of this WPS process.  This property is observable.
   * @type {String}
   */
  this.identifier = undefined;

  /**
   * Gets or sets whether to use key value pairs (KVP) embedded in Execute URL, or whether to make a POST request
   * with XML data.
   * @type {Boolean}
   */
  this.executeWithHttpGet = undefined;

  knockout.track(this, [
    "_parameters",
    "url",
    "identifier",
    "inputs",
    "executeWithHttpGet"
  ]);
}
github TerriaJS / terriajs / lib / Models / CswCatalogGroup.js View on Github external
this.includeWps = false;

  /**
   * Gets or sets a regular expression that, when it matches the protocol attribute of a URI element of a record, indicates that the resource is a WPS resource.
   * @type {RegExp}
   */
  this.wpsResourceFormat = /\bwps\b/i;

  /**
   * Gets or sets a hash of properties that will be set on the item created from the CKAN resource.
   * For example, { "treat404AsError": false }
   * @type {Object}
   */
  this.itemProperties = undefined;

  knockout.track(this, [
    "url",
    "getRecordsParameters",
    "includeWms",
    "includeKml",
    "includeCsv",
    "includeEsriMapServer",
    "includeGeoJson",
    "includeWps",
    "itemProperties"
  ]);
};
github TerriaJS / terriajs / lib / ReactViewModels / HelpScreen.js View on Github external
*/
  this.width = defaultValue(options.width, 300);

  /**
   * Top position of the caret in pixels
   * @type {Number}
   */
  this.caretTop = defaultValue(options.caretTop, -5);

  /**
   * Left position of the caret in pixels
   * @type {Number}
   */
  this.caretLeft = defaultValue(options.caretLeft, -5);

  knockout.track(this, ["message"]);
}