Merge pull request #5368 from probins/wfs
Move WFS typedefs to typedefs.js
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
#### Move of typedefs out of code and into separate file
|
||||
|
||||
This change should not affect the great majority of application developers, but it's possible there are edge cases when compiling application code together with the library which cause compiler errors or warnings. In this case, please raise a GitHub issue. `goog.require`s for typedefs should not be necessary.
|
||||
Users compiling their code with the library should note that the following API `@typedef`s have been renamed; your code may need changing if you use these:
|
||||
* `ol.format.WFS.FeatureCollectionMetadata` to `ol.WFSFeatureCollectionMetadata`
|
||||
* `ol.format.WFS.TransactionResponse` to `ol.WFSTransactionResponse`
|
||||
|
||||
#### Removal of `opaque` option for `ol.source.VectorTile`
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ ol.format.WFS.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
* Read transaction response of the source.
|
||||
*
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {ol.format.WFS.TransactionResponse|undefined} Transaction response.
|
||||
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
||||
* @api stable
|
||||
*/
|
||||
ol.format.WFS.prototype.readTransactionResponse = function(source) {
|
||||
@@ -153,7 +153,7 @@ ol.format.WFS.prototype.readTransactionResponse = function(source) {
|
||||
* Read feature collection metadata of the source.
|
||||
*
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {ol.format.WFS.FeatureCollectionMetadata|undefined}
|
||||
* @return {ol.WFSFeatureCollectionMetadata|undefined}
|
||||
* FeatureCollection metadata.
|
||||
* @api stable
|
||||
*/
|
||||
@@ -176,7 +176,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadata = function(source) {
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @return {ol.format.WFS.FeatureCollectionMetadata|undefined}
|
||||
* @return {ol.WFSFeatureCollectionMetadata|undefined}
|
||||
* FeatureCollection metadata.
|
||||
*/
|
||||
ol.format.WFS.prototype.readFeatureCollectionMetadataFromDocument = function(doc) {
|
||||
@@ -206,7 +206,7 @@ ol.format.WFS.FEATURE_COLLECTION_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {ol.format.WFS.FeatureCollectionMetadata|undefined}
|
||||
* @return {ol.WFSFeatureCollectionMetadata|undefined}
|
||||
* FeatureCollection metadata.
|
||||
*/
|
||||
ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
|
||||
@@ -219,7 +219,7 @@ ol.format.WFS.prototype.readFeatureCollectionMetadataFromNode = function(node) {
|
||||
node.getAttribute('numberOfFeatures'));
|
||||
result['numberOfFeatures'] = value;
|
||||
return ol.xml.pushParseAndPop(
|
||||
/** @type {ol.format.WFS.FeatureCollectionMetadata} */ (result),
|
||||
/** @type {ol.WFSFeatureCollectionMetadata} */ (result),
|
||||
ol.format.WFS.FEATURE_COLLECTION_PARSERS_, node, [], this.gmlFormat_);
|
||||
};
|
||||
|
||||
@@ -318,7 +318,7 @@ ol.format.WFS.TRANSACTION_RESPONSE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @return {ol.format.WFS.TransactionResponse|undefined} Transaction response.
|
||||
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
||||
*/
|
||||
ol.format.WFS.prototype.readTransactionResponseFromDocument = function(doc) {
|
||||
goog.asserts.assert(doc.nodeType == goog.dom.NodeType.DOCUMENT,
|
||||
@@ -334,7 +334,7 @@ ol.format.WFS.prototype.readTransactionResponseFromDocument = function(doc) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {ol.format.WFS.TransactionResponse|undefined} Transaction response.
|
||||
* @return {ol.WFSTransactionResponse|undefined} Transaction response.
|
||||
*/
|
||||
ol.format.WFS.prototype.readTransactionResponseFromNode = function(node) {
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
@@ -342,7 +342,7 @@ ol.format.WFS.prototype.readTransactionResponseFromNode = function(node) {
|
||||
goog.asserts.assert(node.localName == 'TransactionResponse',
|
||||
'localName should be TransactionResponse');
|
||||
return ol.xml.pushParseAndPop(
|
||||
/** @type {ol.format.WFS.TransactionResponse} */({}),
|
||||
/** @type {ol.WFSTransactionResponse} */({}),
|
||||
ol.format.WFS.TRANSACTION_RESPONSE_PARSERS_, node, []);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* typedefs for the WFS sub-sub-namespace
|
||||
* See typedefs.js for more details
|
||||
*/
|
||||
goog.provide('ol.format.WFS.FeatureCollectionMetadata');
|
||||
goog.provide('ol.format.WFS.TransactionResponse');
|
||||
|
||||
|
||||
/**
|
||||
* Number of features; bounds/extent.
|
||||
* @typedef {{numberOfFeatures: number,
|
||||
* bounds: ol.Extent}}
|
||||
* @api stable
|
||||
*/
|
||||
ol.format.WFS.FeatureCollectionMetadata;
|
||||
|
||||
|
||||
/**
|
||||
* Total deleted; total inserted; total updated; array of insert ids.
|
||||
* @typedef {{totalDeleted: number,
|
||||
* totalInserted: number,
|
||||
* totalUpdated: number,
|
||||
* insertIds: Array.<string>}}
|
||||
* @api stable
|
||||
*/
|
||||
ol.format.WFS.TransactionResponse;
|
||||
@@ -4,15 +4,12 @@
|
||||
* These look like vars (or var properties), but in fact are simply identifiers
|
||||
* for the Closure compiler. Originally they were included in the appropriate
|
||||
* namespace file, but with the move away from Closure namespaces and towards
|
||||
* self-contained standard modules are now all in this file, with two exceptions.
|
||||
* self-contained standard modules are now all in this file.
|
||||
* Unlike the other type definitions - enums and constructor functions - they
|
||||
* are not code and so are not imported or exported. They are only referred to
|
||||
* in type-defining comments used by the Closure compiler, and so should not
|
||||
* appear in module code.
|
||||
*
|
||||
* The 2 exceptions are the WFS typedefs which are in a sub-sub-namespace and
|
||||
* are API. These have been put in their own separate file.
|
||||
*
|
||||
* When the code is converted to ES6 modules, the namespace structure will
|
||||
* disappear, and these typedefs will have to be renamed accordingly, but the
|
||||
* namespace structure is maintained for the present for backwards compatibility.
|
||||
@@ -477,6 +474,26 @@ ol.WebglBufferCacheEntry;
|
||||
ol.WebglTextureCacheEntry;
|
||||
|
||||
|
||||
/**
|
||||
* Number of features; bounds/extent.
|
||||
* @typedef {{numberOfFeatures: number,
|
||||
* bounds: ol.Extent}}
|
||||
* @api stable
|
||||
*/
|
||||
ol.WFSFeatureCollectionMetadata;
|
||||
|
||||
|
||||
/**
|
||||
* Total deleted; total inserted; total updated; array of insert ids.
|
||||
* @typedef {{totalDeleted: number,
|
||||
* totalInserted: number,
|
||||
* totalUpdated: number,
|
||||
* insertIds: Array.<string>}}
|
||||
* @api stable
|
||||
*/
|
||||
ol.WFSTransactionResponse;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{type: number, value: (number|string|undefined), position: number}}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user