How to use the terriajs/lib/Models/CatalogItem.defaultUpdaters function in terriajs

To help you get started, we’ve selected a few terriajs 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 / MagdaCatalogItem.js View on Github external
* @memberOf MagdaCatalogItem.prototype
   * @type {Object}
   */
  serializers: {
    get: function() {
      return MagdaCatalogItem.defaultSerializers;
    }
  }
});

/**
 * Gets or sets the set of default updater functions to use in {@link CatalogMember#updateFromJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#updaters} property.
 * @type {Object}
 */
MagdaCatalogItem.defaultUpdaters = clone(CatalogItem.defaultUpdaters);

MagdaCatalogItem.defaultUpdaters.wmsDistributionFormat = createRegexDeserializer(
  "wmsDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.wfsDistributionFormat = createRegexDeserializer(
  "wfsDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.kmlDistributionFormat = createRegexDeserializer(
  "kmlDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.csvDistributionFormat = createRegexDeserializer(
  "csvDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.esriMapServerDistributionFormat = createRegexDeserializer(
  "esriMapServerDistributionFormat"
);
github magda-io / magda / magda-preview-map / lib / Models / MagdaCatalogItem.js View on Github external
* @memberOf MagdaCatalogItem.prototype
     * @type {Object}
     */
    serializers: {
        get: function() {
            return MagdaCatalogItem.defaultSerializers;
        }
    }
});

/**
 * Gets or sets the set of default updater functions to use in {@link CatalogMember#updateFromJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#updaters} property.
 * @type {Object}
 */
MagdaCatalogItem.defaultUpdaters = clone(CatalogItem.defaultUpdaters);

MagdaCatalogItem.defaultUpdaters.wmsDistributionFormat = createRegexDeserializer(
    "wmsDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.wfsDistributionFormat = createRegexDeserializer(
    "wfsDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.kmlDistributionFormat = createRegexDeserializer(
    "kmlDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.csvDistributionFormat = createRegexDeserializer(
    "csvDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.esriMapServerDistributionFormat = createRegexDeserializer(
    "esriMapServerDistributionFormat"
);