Example #1
0
 * @param {Boolean} [options.defaultValue] The default value. If not specified, the first possible value is the default.
 */
var StringParameter = function(options) {
    FunctionParameter.call(this, options);

    this.value = options.defaultValue;
};

inherit(FunctionParameter, StringParameter);

defineProperties(StringParameter.prototype, {
    /**
     * Gets the type of this parameter.
     * @memberof StringParameter.prototype
     * @type {String}
     */
    type: {
        get: function() {
            return 'string';
        }
    }

    /**
     * Gets or sets the value of this parameter.
     * @memberof StringParameter.prototype
     * @member {String} value
     */
});

module.exports = StringParameter;
Example #2
0
defineProperties(FunctionParameter.prototype, {
    /**
     * Gets the type of this parameter.
     * @memberof FunctionParameter.prototype
     * @type {String}
     */
    type: {
        get: function() {
            throw new DeveloperError('FunctionParameter.type must be overridden in derived classes.');
        }
    },

    /**
     * Gets the Terria instance associated with this parameter.
     * @memberof FunctionParameter.prototype
     * @type {Terria}
     */
    terria: {
        get: function() {
            return this._terria;
        }
    },

    /**
     * Gets the function to which this is a parameter.
     * @memberof FunctionParameter.prototype
     * @type {CatalogFunction}
     */
    catalogFunction: {
        get: function() {
            return this._catalogFunction;
        }
    },

    /**
     * Gets the ID of the parameter.
     * @memberof FunctionParameter.prototype
     * @type {String}
     */
    id: {
        get: function() {
            return this._id;
        }
    },

    /**
     * Gets the formatters that are available to format the parameter's value.
     * @memberof FunctionParameter.prototype
     */
    availableFormatters: {
        get: function() {
            if (this.constructor && this.constructor.AvailableFormatters) {
                return this.constructor.AvailableFormatters;
            } else {
                return {
                    default: this.formatValueAsString.bind(this)
                };
            }
        }
    }
});
Example #3
0
};

inherit(ImageryLayerCatalogItem, BingMapsCatalogItem);

defineProperties(BingMapsCatalogItem.prototype, {
    /**
     * Gets the type of data item represented by this instance.
     * @memberOf BingMapsCatalogItem.prototype
     * @type {String}
     */
    type : {
        get : function() {
            return 'bing-maps';
        }
    },

    /**
     * Gets a human-readable name for this type of data source, 'Bing Maps'.
     * @memberOf BingMapsCatalogItem.prototype
     * @type {String}
     */
    typeName : {
        get : function() {
            return 'Bing Maps';
        }
    }
});

BingMapsCatalogItem.prototype._createImageryProvider = function() {
    var result = new BingMapsImageryProvider({
        url: '//dev.virtualearth.net',
Example #4
0
    /**
     * Gets or sets a value indicating whether this concept is visible. Defaults to true.
     * @type {Boolean}
     */
    this.isVisible = true;

    knockout.track(this, ['name', 'isSelectable', 'isVisible']);
};

defineProperties(Concept.prototype, {
    /**
     * Gets a value indicating whether this item has child items.
     * If your subclass can return true, it must also define isOpen & items properties, and a toggleOpen function.
     * @type {Boolean}
     */
    hasChildren : {
        get : function() {
            return false;
        }
    }
});

/**
 * Toggles the {@link Concept#isOpen} property.  If this item's list of children is open,
 * calling this method will close it.  If the list is closed, calling this method will open it.
 */
Concept.prototype.toggleOpen = function() {
    this.isOpen = !this.isOpen;
};

/**
Example #5
0
     * @type {Boolean}
     */
    this.isOpen = true;

    knockout.track(this, ['name', 'value', 'items', 'isOpen']);
};

defineProperties(MetadataItem.prototype, {
    /**
     * Gets a value indicating whether this item has child items.
     * @type {Boolean}
     */
    hasChildren : {
        get : function() {
            return this.items.length > 0;
        }
    },

    valueIsArray : {
        get : function() {
            return this.value instanceof Array;
        }
    }
});

/**
 * Toggles the {@link MetadataItem#isOpen} property.  If this item's list of children is open,
 * calling this method will close it.  If the list is closed, calling this method will open it.
 */
MetadataItem.prototype.toggleOpen = function() {
    this.isOpen = !this.isOpen;
Example #6
0
var GoogleUrlShortener = function(options) {
  if (!defined(options) || !defined(options.terria)) {
    throw new DeveloperError("options.terria is required.");
  }

  this.terria = options.terria;
  this.url = defaultValue(
    options.url,
    "https://www.googleapis.com/urlshortener/v1/url"
  );
};

defineProperties(GoogleUrlShortener.prototype, {
  isUsable: {
    get: function() {
      var key = this.terria.configParameters.googleUrlShortenerKey;
      return defined(key) && key !== null;
    }
  }
});

GoogleUrlShortener.prototype.shorten = function(url) {
  if (!this.isUsable) {
    throw new DeveloperError(
      "GoogleUrlShortener is not usable because Terria.configPrameters.googleUrlShortenerKey is not defined."
    );
  }

  return loadWithXhr({
    url:
      this.url + "?key=" + this.terria.configParameters.googleUrlShortenerKey,
    method: "POST",
Example #7
0
defineProperties(CatalogItem.prototype, {
    /**
     * Gets a value indicating whether this data item, when enabled, can be reordered with respect to other data items.
     * Data items that cannot be reordered are typically displayed above reorderable data items.
     * @memberOf CatalogItem.prototype
     * @type {Boolean}
     */
    supportsReordering : {
        get : function() {
            return false;
        }
    },

    /**
     * Gets a value indicating whether the visibility of this data item can be toggled.
     * @memberOf CatalogItem.prototype
     * @type {Boolean}
     */
    supportsToggleShown : {
        get : function() {
            return true;
        }
    },

    /**
     * Gets a value indicating whether the opacity of this data item can be changed.
     * @memberOf CatalogItem.prototype
     * @type {Boolean}
     */
    supportsOpacity : {
        get : function() {
            return false;
        }
    },

    /**
     * Gets a value indicating whether this data item has a legend.
     * @memberOf CatalogItem.prototype
     * @type {Boolean}
     */
    hasLegend: {
        get: function() {
            return defined(this.legendUrl);
        }
    },

    /**
     * Gets the metadata associated with this data item and the server that provided it, if applicable.
     * @memberOf CatalogItem.prototype
     * @type {Metadata}
     */
    metadata : {
        get : function() {
            return CatalogItem.defaultMetadata;
        }
    },

    /**
     * Gets the set of functions used to update individual properties in {@link CatalogMember#updateFromJson}.
     * When a property name in the returned object literal matches the name of a property on this instance, the value
     * will be called as a function and passed a reference to this instance, a reference to the source JSON object
     * literal, and the name of the property.
     * @memberOf CatalogItem.prototype
     * @type {Object}
     */
    updaters : {
        get : function() {
            return CatalogItem.defaultUpdaters;
        }
    },

    /**
     * Gets the set of functions used to serialize individual properties in {@link CatalogMember#serializeToJson}.
     * When a property name on the model matches the name of a property in the serializers object lieral,
     * the value will be called as a function and passed a reference to the model, a reference to the destination
     * JSON object literal, and the name of the property.
     * @memberOf CatalogItem.prototype
     * @type {Object}
     */
    serializers : {
        get : function() {
            return CatalogItem.defaultSerializers;
        }
    },

    /**
     * Gets the set of names of the properties to be serialized for this object for a share link.
     * @memberOf CatalogItem.prototype
     * @type {String[]}
     */
    propertiesForSharing : {
        get : function() {
            return CatalogItem.defaultPropertiesForSharing;
        }
    }
});
defineProperties(WebProcessingServiceCatalogFunction.prototype, {
    /**
     * Gets the type of data item represented by this instance.
     * @memberOf WebProcessingServiceCatalogFunction.prototype
     * @type {String}
     */
    type : {
        get : function() {
            return 'wps';
        }
    },

    /**
     * Gets a human-readable name for this type of data source, 'Web Processing Service (WPS)'.
     * @memberOf WebProcessingServiceCatalogFunction.prototype
     * @type {String}
     */
    typeName : {
        get : function() {
            return 'Web Processing Service (WPS)';
        }
    },

    /**
     * Gets the parameters used to {@link CatalogFunction#invoke} to this process.
     * @memberOf WebProcessingServiceCatalogFunction
     * @type {CatalogFunctionParameters[]}
     */
    parameters : {
        get : function() {
            return this._parameters;
        }
    },
});
 */
var SelectAPolygonParameter = function(options) {
  FunctionParameter.call(this, options);
};

inherit(FunctionParameter, SelectAPolygonParameter);

defineProperties(SelectAPolygonParameter.prototype, {
  /**
   * Gets the type of this parameter.
   * @memberof SelectAPolygonParameter.prototype
   * @type {String}
   */
  type: {
    get: function() {
      return "polygon";
    }
  }

  /**
   * Gets or sets the value of this parameter.
   * @memberof SelectAPolygonParameter.prototype
   * @member {Number[][][]} value
   */
});

/**
 * @param {String} value Value to use to format.
 * @return {String} Stringified JSON that can be used to pass parameter value in URL.
 */
SelectAPolygonParameter.formatValueForUrl = function(value, parameter) {
  if (!defined(value) || value === "") {
defineProperties(WebProcessingServiceCatalogItem.prototype, {
    /**
     * Gets the type of data member represented by this instance.
     * @memberOf WebProcessingServiceCatalogItem.prototype
     * @type {String}
     */
    type : {
        get : function() {
            return 'wps-result';
        }
    },

    /**
     * Gets a human-readable name for this type of data source, 'Web Processing Service Result'.
     * @memberOf WebProcessingServiceCatalogItem.prototype
     * @type {String}
     */
    typeName : {
        get : function() {
            return 'Web Processing Service Result';
        }
    },

    /**
     * Gets the data source associated with this catalog item.
     * @memberOf WebProcessingServiceCatalogItem.prototype
     * @type {DataSource}
     */
    dataSource : {
        get : function() {
            return defined(this._geoJsonItem) ? this._geoJsonItem.dataSource : undefined;
        }
    }
});
Example #11
0
defineProperties(CatalogGroup.prototype, {
    /**
     * Gets the type of data member represented by this instance.
     * @memberOf CatalogGroup.prototype
     * @type {String}
     */
    type: {
        get: function() {
            return 'group';
        }
    },

    /**
     * Gets a human-readable name for this type of data source, such as 'Web Map Service (WMS)'.
     * @memberOf CatalogGroup.prototype
     * @type {String}
     */
    typeName: {
        get: function() {
            return 'Group';
        }
    },

    /**
     * Gets a value that tells the UI whether this is a group.
     * Groups, when clicked, expand to show their constituent items.
     * @memberOf CatalogGroup.prototype
     * @type {Boolean}
     */
    isGroup: {
        get: function() {
            return true;
        }
    },

    /**
     * Gets the set of functions used to update individual properties in {@link CatalogMember#updateFromJson}.
     * When a property name in the returned object literal matches the name of a property on this instance, the value
     * will be called as a function and passed a reference to this instance, a reference to the source JSON object
     * literal, and the name of the property.
     * @memberOf CatalogGroup.prototype
     * @type {Object}
     */
    updaters: {
        get: function() {
            return CatalogGroup.defaultUpdaters;
        }
    },

    /**
     * Gets the set of functions used to serialize individual properties in {@link CatalogMember#serializeToJson}.
     * When a property name on the model matches the name of a property in the serializers object lieral,
     * the value will be called as a function and passed a reference to the model, a reference to the destination
     * JSON object literal, and the name of the property.
     * @memberOf CatalogGroup.prototype
     * @type {Object}
     */
    serializers: {
        get: function() {
            return CatalogGroup.defaultSerializers;
        }
    },

    /**
     * Gets the set of names of the properties to be serialized for this object for a share link.
     * @memberOf CatalogGroup.prototype
     * @type {String[]}
     */
    propertiesForSharing: {
        get: function() {
            return CatalogGroup.defaultPropertiesForSharing;
        }
    }
});
Example #12
0
defineProperties(GeoJsonCatalogItem.prototype, {
    /**
     * Gets the type of data member represented by this instance.
     * @memberOf GeoJsonCatalogItem.prototype
     * @type {String}
     */
    type : {
        get : function() {
            return 'geojson';
        }
    },

    /**
     * Gets a human-readable name for this type of data source, 'GeoJSON'.
     * @memberOf GeoJsonCatalogItem.prototype
     * @type {String}
     */
    typeName : {
        get : function() {
            return 'GeoJSON';
        }
    },

    /**
     * Gets the metadata associated with this data source and the server that provided it, if applicable.
     * @memberOf GeoJsonCatalogItem.prototype
     * @type {Metadata}
     */
    metadata : {
        get : function() {
            // TODO: maybe return the FeatureCollection's properties?
            var result = new Metadata();
            result.isLoading = false;
            result.dataSourceErrorMessage = 'This data source does not have any details available.';
            result.serviceErrorMessage = 'This service does not have any details available.';
            return result;
        }
    },
    /**
     * Gets the data source associated with this catalog item.
     * @memberOf GeoJsonCatalogItem.prototype
     * @type {DataSource}
     */
    dataSource : {
        get : function() {
            return this._dataSource;
        }
    }
});
Example #13
0
defineProperties(KmlCatalogItem.prototype, {
  /**
   * Gets the type of data member represented by this instance.
   * @memberOf KmlCatalogItem.prototype
   * @type {String}
   */
  type: {
    get: function() {
      return "kml";
    }
  },

  /**
   * Gets a human-readable name for this type of data source, 'KML'.
   * @memberOf KmlCatalogItem.prototype
   * @type {String}
   */
  typeName: {
    get: function() {
      return "KML or KMZ";
    }
  },

  /**
   * Gets the metadata associated with this data source and the server that provided it, if applicable.
   * @memberOf KmlCatalogItem.prototype
   * @type {Metadata}
   */
  metadata: {
    get: function() {
      var result = new Metadata();
      result.isLoading = false;
      result.dataSourceErrorMessage =
        "This data source does not have any details available.";
      result.serviceErrorMessage =
        "This service does not have any details available.";
      return result;
    }
  },
  /**
   * Gets the data source associated with this catalog item.
   * @memberOf KmlCatalogItem.prototype
   * @type {DataSource}
   */
  dataSource: {
    get: function() {
      return this._dataSource;
    }
  }
});
Example #14
0
var ShareDataService = function(options) {
    if (!defined(options) || !defined(options.terria)) {
        throw new DeveloperError('options.terria is required.');
    }

    this.terria = options.terria;
    this.url = defaultValue(options.url, '/share');

    this._isUsable = undefined;
};

defineProperties(ShareDataService.prototype, {
    isUsable: {
        get: function() {
            return this._isUsable;
        }
    }
});

/**
 * Initialise the service, passing through server config options.
 * @param  {Object} serverConfig Options retrieved from ServerConfig.config.
 */
ShareDataService.prototype.init = function(serverConfig) {
    if (typeof serverConfig === 'object' && typeof serverConfig.newShareUrlPrefix === 'string') {
        this._isUsable = true;
    } else {
        this._isUsable = false;
    }
};
defineProperties(RegionTypeParameter.prototype, {
    /**
     * Gets the type of this parameter.
     * @memberof RegionTypeParameter.prototype
     * @type {String}
     */
    type: {
        get: function() {
            return 'regionType';
        }
    },

    /**
     * Gets or sets the value of this parameter.
     * @memberof RegionTypeParameter.prototype
     * @member {RegionProvider} value
     */

    /**
     * Gets the default region provider if the user has not specified one.  If region-mapped data
     * is loaded on the map, this property returns the {@link RegionProvider} of the topmost
     * region-mapped catalog item.  Otherwise, it returns the first region provider.  If the
     * parameter has not yet been loaded, this property returns undefined.
     * @memberof RegionTypeParameter.prototype
     * @type {RegionProvider}
     */
    defaultValue: {
        get: function() {
            if (defined(this._defaultValue)) {
                return this._defaultValue;
            }

            const nowViewingItems = this.terria.nowViewing.items;
            if (nowViewingItems.length > 0) {
                for (let i = 0; i < nowViewingItems.length; ++i) {
                    const item = nowViewingItems[i];
                    if (defined(item.regionMapping) && defined(item.regionMapping.regionDetails) && item.regionMapping.regionDetails.length > 0) {
                        return item.regionMapping.regionDetails[0].regionProvider;
                    }
                }
            }
            if (defined(this._regionProviderList) && this._regionProviderList.length > 0) {
                return this._regionProviderList[0];
            }

            // No defaults available; have we requested the region providers yet?
            this.load();
            return undefined;
        }
    }
});
Example #16
0
defineProperties(CsvCatalogItem.prototype, {
    /**
     * Gets the type of data member represented by this instance.
     * @memberOf CsvCatalogItem.prototype
     * @type {String}
     */
    type: {
        get: function() {
            return 'csv';
        }
    },

    /**
     * Gets a human-readable name for this type of data source, 'CSV'.
     * @memberOf CsvCatalogItem.prototype
     * @type {String}
     */
    typeName: {
        get: function() {
            return 'Comma-Separated Values (CSV)';
        }
    },

    /**
     * Gets the metadata associated with this data source and the server that provided it, if applicable.
     * @memberOf CsvCatalogItem.prototype
     * @type {Metadata}
     */
    metadata: { //TODO: return metadata if tableDataSource defined
        get: function() {
            var result = new Metadata();
            result.isLoading = false;
            result.dataSourceErrorMessage = 'This data source does not have any details available.';
            result.serviceErrorMessage = 'This service does not have any details available.';
            return result;
        }
    },

    /**
     * Gets a value indicating whether this data source, when enabled, can be reordered with respect to other data sources.
     * Data sources that cannot be reordered are typically displayed above reorderable data sources.
     * @memberOf CsvCatalogItem.prototype
     * @type {Boolean}
     */
    supportsReordering: {
        get: function() {
            return defined(this._regionMapping) && defined(this._regionMapping.regionDetails) && !this.keepOnTop;
        }
    },

    /**
     * Gets a value indicating whether the opacity of this data source can be changed.
     * @memberOf ImageryLayerCatalogItem.prototype
     * @type {Boolean}
     */
    supportsOpacity: {
        get: function() {
            return (defined(this._regionMapping) && defined(this._regionMapping.regionDetails));
        }
    },

    /**
     * Gets the table structure associated with this catalog item.
     * @memberOf CsvCatalogItem.prototype
     * @type {TableStructure}
     */
    tableStructure: {
        get: function() {
            return this._tableStructure;
        }
    },

    /**
     * Gets the data source associated with this catalog item.
     * @memberOf CsvCatalogItem.prototype
     * @type {DataSource}
     */
    dataSource: {
        get: function() {
            return this._dataSource;
        }
    },

    /**
     * Gets the region mapping associated with this catalog item.
     * @memberOf CsvCatalogItem.prototype
     * @type {RegionMapping}
     */
    regionMapping: {
        get: function() {
            return this._regionMapping;
        }
    },

    /**
     * Gets the Cesium or Leaflet imagery layer object associated with this data source.
     * Used in region mapping only.
     * This property is undefined if the data source is not enabled.
     * @memberOf CsvCatalogItem.prototype
     * @type {Object}
     */
    imageryLayer: {
        get: function() {
            return this._regionMapping && this._regionMapping.imageryLayer;
        }
    },

    /**
     * Gets the set of names of the properties to be serialized for this object when {@link CatalogMember#serializeToJson} is called
     * for a share link.
     * @memberOf ImageryLayerCatalogItem.prototype
     * @type {String[]}
     */
    propertiesForSharing: {
        get: function() {
            return CsvCatalogItem.defaultPropertiesForSharing;
        }
    },

    /**
     * Gets the set of functions used to update individual properties in {@link CatalogMember#updateFromJson}.
     * When a property name in the returned object literal matches the name of a property on this instance, the value
     * will be called as a function and passed a reference to this instance, a reference to the source JSON object
     * literal, and the name of the property.
     * @memberOf CsvCatalogItem.prototype
     * @type {Object}
     */
    updaters: {
        get: function() {
            return CsvCatalogItem.defaultUpdaters;
        }
    },

    /**
     * Gets the set of functions used to serialize individual properties in {@link CatalogMember#serializeToJson}.
     * When a property name on the model matches the name of a property in the serializers object lieral,
     * the value will be called as a function and passed a reference to the model, a reference to the destination
     * JSON object literal, and the name of the property.
     * @memberOf CsvCatalogItem.prototype
     * @type {Object}
     */
    serializers: {
        get: function() {
            return CsvCatalogItem.defaultSerializers;
        }
    },

    intervals: {
        get: function() {
            return this.tableStructure.activeTimeColumn.availabilities.reduce(function(intervals, availability) {
                for (var i = 0; i < availability.length; i++) {
                    intervals.addInterval(availability.get(i));
                }
                return intervals;
            }, new TimeIntervalCollection());
        }
    }
});
defineProperties(TerrainCatalogItem.prototype, {
    /**
     * Gets the terrain provider object associated with this data source.
     * This property is undefined if the data source is not enabled.
     * @memberOf TerrainCatalogItem.prototype
     * @type {Object}
     */
    terrainProvider : {
        get : function() {
            return this._terrainProvider;
        }
    },

    /**
     * Gets a value indicating whether this data source, when enabled, can be reordered with respect to other data sources.
     * Data sources that cannot be reordered are typically displayed above reorderable data sources.
     * @memberOf TerrainCatalogItem.prototype
     * @type {Boolean}
     */
    supportsReordering : {
        get : function() {
            return false;
        }
    },

    /**
     * Gets a value indicating whether the opacity of this data source can be changed.
     * @memberOf TerrainCatalogItem.prototype
     * @type {Boolean}
     */
    supportsOpacity : {
        get : function() {
            return false;
        }
    },

    /**
     * Gets the set of names of the properties to be serialized for this object when {@link CatalogMember#serializeToJson} is called
     * and the `serializeForSharing` flag is set in the options.
     * @memberOf CesiumTerrainCatalogItem.prototype
     * @type {String[]}
     */
    propertiesForSharing : {
        get : function() {
            return TerrainCatalogItem.defaultPropertiesForSharing;
        }
    }
});
};

inherit(CatalogItem, ResultPendingCatalogItem);

defineProperties(ResultPendingCatalogItem.prototype, {
  /**
   * Gets the type of data member represented by this instance.
   * @memberOf ResultPendingCatalogItem.prototype
   * @type {String}
   */
  type: {
    get: function() {
      return "result-pending";
    }
  },

  /**
   * Gets a human-readable name for this type of data source, 'CSV'.
   * @memberOf ResultPendingCatalogItem.prototype
   * @type {String}
   */
  typeName: {
    get: function() {
      return "Result Pending";
    }
  }
});

ResultPendingCatalogItem.prototype._load = function() {
  return this.loadPromise;
};
Example #19
0
defineProperties(NowViewing.prototype, {
    /**
      * Gets the Terria instance.
     * @memberOf NowViewing.prototype
     * @type  {Terria}
     */
    terria : {
        get : function() {
            return this._terria;
        }
    },

    /**
     * Gets a value indicating whether the "Now Viewing" pane has one or more items.
     * @memberOf NowViewing.prototype
     * @type {Boolean}
     */
    hasItems : {
        get : function() {
            return this.items.length > 0;
        }
    },

    /**
     * Gets a value indicating whether the "Now Viewing" pane has at list own data
     * source that is currently shown.
     * @memberOf NowViewing.prototype
     * @type {Boolean}
     */
    hasShownItems : {
        get : function() {
            for (var i = 0; i < this.items.length; ++i) {
                if (this.items[i].isShown) {
                    return true;
                }
            }
            return false;
        }
    },
    
    hasChildren : {
        get : function() {
            return this.items.length > 0;
        }
    },

});
Example #20
0
defineProperties(OgrCatalogItem.prototype, {
    /**
     * Gets the type of data member represented by this instance.
     * @memberOf OgrCatalogItem.prototype
     * @type {String}
     */
    type : {
        get : function() {
            return 'ogr';
        }
    },

    /**
     * Gets a human-readable name for this type of data source.
     * @memberOf OgrCatalogItem.prototype
     * @type {String}
     */
    typeName : {
        get : function() {
            return 'Unknown / Converted to GeoJSON';
        }
    },

    /**
     * Gets the metadata associated with this data source and the server that provided it, if applicable.
     * @memberOf OgrCatalogItem.prototype
     * @type {Metadata}
     */
    metadata : {
        get : function() {
            var result = new Metadata();
            result.isLoading = false;
            result.dataSourceErrorMessage = 'This data source does not have any details available.';
            result.serviceErrorMessage = 'This service does not have any details available.';
            return result;
        }
    },
    /**
     * Gets the data source associated with this catalog item.
     * @memberOf OgrCatalogItem.prototype
     * @type {DataSource}
     */
    dataSource : {
        get : function() {
            return defined(this._geoJsonItem) ? this._geoJsonItem.dataSource : undefined;
        }
    }
});
defineProperties(Cesium3DTilesCatalogItem.prototype, {
    /**
     * Gets the type of data item represented by this instance.
     * @memberOf CesiumTerrainCatalogItem.prototype
     * @type {String}
     */
    type : {
        get : function() {
            return '3d-tiles';
        }
    },

    /**
     * Gets a human-readable name for this type of data source, 'Cesium 3D Tiles'.
     * @memberOf CesiumTerrainCatalogItem.prototype
     * @type {String}
     */
    typeName : {
        get : function() {
            return 'Cesium 3D Tiles';
        }
    },

    /**
     * Gets a value indicating whether this data source, when enabled, can be reordered with respect to other data sources.
     * Data sources that cannot be reordered are typically displayed above reorderable data sources.
     * @memberOf Cesium3DTilesCatalogItem.prototype
     * @type {Boolean}
     */
    supportsReordering : {
        get : function() {
            return false;
        }
    },

    /**
     * Gets a value indicating whether the opacity of this data source can be changed.
     * @memberOf Cesium3DTilesCatalogItem.prototype
     * @type {Boolean}
     */
    supportsOpacity : {
        get : function() {
            return false;
        }
    },

    /**
     * Returns true if we can zoom to this item. Depends on observable properties, and so updates once loaded.
     * @memberOf Cesium3DTilesCatalogItem.prototype
     * @type {Boolean}
     */
    canZoomTo : {
        get : function() {
            return true;
        }
    }
});
Example #22
0
defineProperties(TableDataSource.prototype, {
    /**
     * Gets a human-readable name for this instance.
     * @memberof TableDataSource.prototype
     * @type {String}
     */
    name : {
        get : function() {
            return this._name;
        }
    },
    /**
     * Gets the clock settings defined by the loaded data.  If
     * only static data exists, this value is undefined.
     * @memberof TableDataSource.prototype
     * @type {DataSourceClock}
     */
   clock : {
        get : function() {
            if (defined(this._tableStructure)) {
                return this._tableStructure.clock;
            }
        }
    },
    /**
     * Gets the collection of {@link Entity} instances.
     * @memberof TableDataSource.prototype
     * @type {EntityCollection}
     */
   entities : {
        get : function() {
            return this._entityCollection;
        }
    },
    /**
     * Gets a value indicating if the data source is currently loading data.
     * @memberof TableDataSource.prototype
     * @type {Boolean}
     */
   isLoading : {
        get : function() {
            return this.loadingData;
        }
    },
    /**
     * Gets a CesiumEvent that will be raised when the underlying data changes.
     * @memberof TableDataSource.prototype
     * @type {CesiumEvent}
     */
   changedEvent : {
        get : function() {
            return this._changed;
        }
    },
    /**
     * Gets a CesiumEvent that will be raised if an error is encountered during processing.
     * @memberof TableDataSource.prototype
     * @type {CesiumEvent}
     */
   errorEvent : {
        get : function() {
            return this._error;
        }
    },
    /**
     * Gets a CesiumEvent that will be raised when the data source either starts or stops loading.
     * @memberof TableDataSource.prototype
     * @type {CesiumEvent}
     */
    loadingEvent : {
        get : function() {
            return this._loading;
        }
    },

    /**
     * Gets the TableStructure object holding all the data.
     * @memberof TableDataSource.prototype
     * @type {TableStructure}
     */
    tableStructure : {
        get : function() {
            return this._tableStructure;
        }
    },

    /**
     * Gets a Rectangle covering the extent of the data, based on lat & lon columns. (It could be based on regions too eventually.)
     * @type {Rectangle}
     */
    extent: {
        get: function() {
            return this._extent;
        }
    },

    /**
     * Gets a URL for the legend for this data.
     * @type {String}
     */
    legendUrl: {
        get: function() {
            return this._legendUrl;
        }
    },

    /**
     * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
     *
     * @memberof CustomDataSource.prototype
     * @type {EntityCluster}
     */
    clustering : {
        get : function() {
            return this._entityCluster;
        },
        set : function(value) {
            //>>includeStart('debug', pragmas.debug);
            if (!defined(value)) {
                throw new DeveloperError('value must be defined.');
            }
            //>>includeEnd('debug');
            this._entityCluster = value;
        }
    }
});
defineProperties(SpatialDetailingCatalogFunction.prototype, {
    /**
     * Gets the type of data member represented by this instance.
     * @memberOf SpatialDetailingCatalogFunction.prototype
     * @type {String}
     */
    type : {
        get : function() {
            return 'spatial-detailing-function';
        }
    },

    /**
     * Gets a human-readable name for this type of data source, 'Spatial Detailing'.
     * @memberOf SpatialDetailingCatalogFunction.prototype
     * @type {String}
     */
    typeName : {
        get : function() {
            return 'Spatial Detailing';
        }
    },

    /**
     * Gets the parameters used to {@link CatalogProcess#invoke} to this function.
     * @memberOf SpatialDetailingCatalogFunction
     * @type {CatalogProcessParameters[]}
     */
    parameters : {
        get : function() {
            return this._parameters;
        }
    }
});
Example #24
0
}

inherit(UrlTemplateCatalogItem, CartoMapCatalogItem);

defineProperties(CartoMapCatalogItem.prototype, {
  /**
   * Gets the type of data item represented by this instance.
   * @memberOf CartoMapCatalogItem.prototype
   * @type {String}
   */
  type: {
    get: function() {
      return "carto";
    }
  },

  /**
   * Gets a human-readable name for this type of data source, 'URL Template Map Server'.
   * @memberOf CartoMapCatalogItem.prototype
   * @type {String}
   */
  typeName: {
    get: function() {
      return "Carto Map";
    }
  }
});

CartoMapCatalogItem.prototype._load = function() {
  if (defined(this.tileUrl)) {
    return;
Example #25
0
defineProperties(AbsIttCatalogItem.prototype, {
  /**
   * Gets the type of data member represented by this instance.
   * @memberOf AbsIttCatalogItem.prototype
   * @type {String}
   */
  type: {
    get: function() {
      return "abs-itt";
    }
  },

  /**
   * Gets a human-readable name for this type of data source, 'GPX'.
   * @memberOf AbsIttCatalogItem.prototype
   * @type {String}
   */
  typeName: {
    get: function() {
      return "ABS.Stat";
    }
  },

  /**
   * Gets the set of names of the properties to be serialized for this object for a share link.
   * @memberOf ImageryLayerCatalogItem.prototype
   * @type {String[]}
   */
  propertiesForSharing: {
    get: function() {
      return AbsIttCatalogItem.defaultPropertiesForSharing;
    }
  },

  /**
   * Gets the set of functions used to serialize individual properties in {@link CatalogMember#serializeToJson}.
   * When a property name on the model matches the name of a property in the serializers object literal,
   * the value will be called as a function and passed a reference to the model, a reference to the destination
   * JSON object literal, and the name of the property.
   * @memberOf AbsIttCatalogItem.prototype
   * @type {Object}
   */
  serializers: {
    get: function() {
      return AbsIttCatalogItem.defaultSerializers;
    }
  }
});
Example #26
0
defineProperties(RegionMapping.prototype, {
   /**
     * Gets the clock settings defined by the loaded data.  If
     * only static data exists, this value is undefined.
     * @memberof RegionMapping.prototype
     * @type {DataSourceClock}
     */
   clock: {
        get: function() {
            var timeColumn = this._tableStructure.activeTimeColumn;
            if (defined(timeColumn)) {
                return timeColumn.clock;
            }
        }
    },
    /**
     * Gets a CesiumEvent that will be raised when the underlying data changes.
     * @memberof RegionMapping.prototype
     * @type {CesiumEvent}
     */
   changedEvent: {
        get: function() {
            return this._changed;
        }
    },

    /**
     * Gets or sets a value indicating if the data source is currently loading data.
     * Whenever loadingData is changed to false, also trigger a redraw.
     * @memberof RegionMapping.prototype
     * @type {Boolean}
     */
   isLoading: {
        get: function() {
            return this._loadingData;
        },
        set: function(value) {
            this._loadingData = value;
            if (!value) {
                changedActiveItems(this);
            }
        }
    },

    /**
     * Gets the TableStructure object holding all the data.
     * @memberof RegionMapping.prototype
     * @type {TableStructure}
     */
    tableStructure: {
        get : function() {
            return this._tableStructure;
        }
    },

    /**
     * Gets the TableStyle object showing how to style the data.
     * @memberof RegionMapping.prototype
     * @type {TableStyle}
     */
    tableStyle: {
        get: function() {
            return this._tableStyle;
        }
    },

    /**
     * Gets a Rectangle covering the extent of the data, based on lat & lon columns. (It could be based on regions too eventually.)
     * @type {Rectangle}
     */
    extent: {
        get: function() {
            return this._extent;
        }
    },

    /**
     * Gets a URL for the legend for this data.
     * @type {String}
     */
    legendUrl: {
        get: function() {
            return this._legendUrl;
        }
    },

    /**
     * Once loaded, gets the region details (an array of "regionDetail" objects, with regionProvider, column and disambigColumn properties).
     * By checking if defined, can be used as the region-mapping equivalent to "hasLatitudeAndLongitude".
     * @type {Object[]}
     */
    regionDetails: {
        get: function() {
            return this._regionDetails;
        }
    },

    /**
     * Gets the Cesium or Leaflet imagery layer object associated with this data source.
     * Used in region mapping only.
     * This property is undefined if the data source is not enabled.
     * @memberOf RegionMapping.prototype
     * @type {Object}
     */
    imageryLayer: {
        get: function() {
            return this._imageryLayer;
        }
    }

});
defineProperties(WebFeatureServiceCatalogGroup.prototype, {
  /**
   * Gets the type of data member represented by this instance.
   * @memberOf WebFeatureServiceCatalogGroup.prototype
   * @type {String}
   */
  type: {
    get: function() {
      return "wfs-getCapabilities";
    }
  },

  /**
   * Gets a human-readable name for this type of data source, such as 'Web Feature Service (WFS)'.
   * @memberOf WebFeatureServiceCatalogGroup.prototype
   * @type {String}
   */
  typeName: {
    get: function() {
      return "Web Feature Service (WFS) Server";
    }
  },

  /**
   * Gets the set of functions used to serialize individual properties in {@link CatalogMember#serializeToJson}.
   * When a property name on the model matches the name of a property in the serializers object literal,
   * the value will be called as a function and passed a reference to the model, a reference to the destination
   * JSON object literal, and the name of the property.
   * @memberOf WebFeatureServiceCatalogGroup.prototype
   * @type {Object}
   */
  serializers: {
    get: function() {
      return WebFeatureServiceCatalogGroup.defaultSerializers;
    }
  }
});
Example #28
0
 * @param {Boolean} [options.defaultValue] The default value.
 */
var PointParameter = function(options) {
    FunctionParameter.call(this, options);

    this.defaultValue = options.defaultValue;
};

inherit(FunctionParameter, PointParameter);

defineProperties(PointParameter.prototype, {
    /**
     * Gets the type of this parameter.
     * @memberof DateTimeParameter.prototype
     * @type {String}
     */
    type: {
        get: function() {
            return 'point';
        }
    },
});

PointParameter.prototype.formatValueAsString = function(value) {
    if (!defined(value)) {
        return '-';
    }

    return Math.abs(CesiumMath.toDegrees(value.latitude)) + '°' + (value.latitude < 0 ? 'S ' : 'N ') +
           Math.abs(CesiumMath.toDegrees(value.longitude)) + '°' + (value.longitude < 0 ? 'W' : 'E');
};
defineProperties(ArcGisMapServerCatalogItem.prototype, {
    /**
     * Gets the type of data item represented by this instance.
     * @memberOf ArcGisMapServerCatalogItem.prototype
     * @type {String}
     */
    type : {
        get : function() {
            return 'esri-mapServer';
        }
    },

    /**
     * Gets a human-readable name for this type of data source, 'Esri ArcGIS MapServer'.
     * @memberOf ArcGisMapServerCatalogItem.prototype
     * @type {String}
     */
    typeName : {
        get : function() {
            return 'Esri ArcGIS MapServer';
        }
    },

    /**
     * Gets the metadata associated with this data source and the server that provided it, if applicable.
     * @memberOf ArcGisMapServerCatalogItem.prototype
     * @type {Metadata}
     */
    metadata : {
        get : function() {
            if (!defined(this._metadata)) {
                this._metadata = requestMetadata(this);
            }
            return this._metadata;
        }
    }
});
defineProperties(TerriaJsonCatalogFunction.prototype, {
    /**
     * Gets the type of data item represented by this instance.
     * @memberOf TerriaJSONCatalogFunction.prototype
     * @type {String}
     */
    type : {
        get : function() {
            return 'terria-json';
        }
    },

    /**
     * Gets a human-readable name for this type of data source, 'Terria JSON Catalog Function'.
     * @memberOf TerriaJSONCatalogFunction.prototype
     * @type {String}
     */
    typeName : {
        get : function() {
            return 'Terria JSON Catalog Function';
        }
    },

    /**
     * Gets the set of functions used to update individual properties in {@link CatalogMember#updateFromJson}.
     * When a property name in the returned object literal matches the name of a property on this instance, the value
     * will be called as a function and passed a reference to this instance, a reference to the source JSON object
     * literal, and the name of the property.
     * @memberOf WebMapServiceCatalogItem.prototype
     * @type {Object}
     */
    updaters : {
        get : function() {
            return TerriaJsonCatalogFunction.defaultUpdaters;
        }
    },

    /**
     * Gets the set of functions used to serialize individual properties in {@link CatalogMember#serializeToJson}.
     * When a property name on the model matches the name of a property in the serializers object literal,
     * the value will be called as a function and passed a reference to the model, a reference to the destination
     * JSON object literal, and the name of the property.
     * @memberOf WebMapServiceCatalogItem.prototype
     * @type {Object}
     */
    serializers : {
        get : function() {
            return TerriaJsonCatalogFunction.defaultSerializers;
        }
    },

    /**
     * Gets the set of names of the properties to be serialized for this object when {@link CatalogMember#serializeToJson} is called
     * for a share link.
     * @memberOf WebMapServiceCatalogItem.prototype
     * @type {String[]}
     */
    propertiesForSharing : {
        get : function() {
            return TerriaJsonCatalogFunction.defaultPropertiesForSharing;
        }
    },

    /**
     * Gets the parameters used to {@link CatalogFunction#invoke} to this process.
     * @memberOf CatalogFunction
     * @type {CatalogFunctionParameters[]}
     */
    parameters : {
        get : function() {
            return this.inputs;
        }
    },
});