Using single argument for callback and string for projection
This makes the asynchronous and synchronous versions of readFeatures work with the same data structures, and leaves projection handling outside the parsers.
This commit is contained in:
@@ -8,19 +8,6 @@ goog.provide('ol.parser.StringFeatureParser');
|
||||
goog.require('ol.Feature');
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{projection: ol.Projection}}
|
||||
*/
|
||||
ol.parser.ReadFeaturesMetadata;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{features: Array.<ol.Feature>,
|
||||
* metadata: ol.parser.ReadFeaturesMetadata}}
|
||||
*/
|
||||
ol.parser.ReadFeaturesResult;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @interface
|
||||
@@ -78,9 +65,8 @@ ol.parser.AsyncStringFeatureParser = function() {};
|
||||
|
||||
/**
|
||||
* @param {string} data String data.
|
||||
* @param {function(Array.<ol.Feature>, ol.parser.ReadFeaturesMetadata)}
|
||||
* callback Callback which is called
|
||||
* after parsing.
|
||||
* @param {function(ol.parser.ReadFeaturesResult)} callback Callback which is
|
||||
* called after parsing.
|
||||
* @param {ol.parser.ReadFeaturesOptions=} opt_options Feature reading options.
|
||||
*/
|
||||
ol.parser.AsyncStringFeatureParser.prototype.readFeaturesFromStringAsync =
|
||||
@@ -96,9 +82,8 @@ ol.parser.AsyncObjectFeatureParser = function() {};
|
||||
|
||||
/**
|
||||
* @param {Object} obj Object representing features.
|
||||
* @param {function(Array.<ol.Feature>, ol.parser.ReadFeaturesMetadata)}
|
||||
* callback Callback which is called
|
||||
* after parsing.
|
||||
* @param {function(ol.parser.ReadFeaturesResult)} callback Callback which is
|
||||
* called after parsing.
|
||||
* @param {ol.parser.ReadFeaturesOptions=} opt_options Feature reading options.
|
||||
*/
|
||||
ol.parser.AsyncObjectFeatureParser.prototype.readFeaturesFromObjectAsync =
|
||||
@@ -111,7 +96,20 @@ ol.parser.AsyncObjectFeatureParser.prototype.readFeaturesFromObjectAsync =
|
||||
ol.parser.ReadFeaturesCallback;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{projection: ol.ProjectionLike}}
|
||||
*/
|
||||
ol.parser.ReadFeaturesMetadata;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{callback: ol.parser.ReadFeaturesCallback}}
|
||||
*/
|
||||
ol.parser.ReadFeaturesOptions;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{features: Array.<ol.Feature>,
|
||||
* metadata: ol.parser.ReadFeaturesMetadata}}
|
||||
*/
|
||||
ol.parser.ReadFeaturesResult;
|
||||
|
||||
Reference in New Issue
Block a user