Shorter module paths for default exports

This commit is contained in:
ahocevar
2018-04-25 17:23:56 +02:00
parent 6cb115d6a4
commit 440d1ad3e1
233 changed files with 2136 additions and 2042 deletions
+18 -16
View File
@@ -74,7 +74,7 @@ export const GMLNS = 'http://www.opengis.net/gml';
* @abstract
* @param {module:ol/format/GMLBase~Options=} opt_options
* Optional configuration object.
* @extends {module:ol/format/XMLFeature~XMLFeature}
* @extends {module:ol/format/XMLFeature}
*/
const GMLBase = function(opt_options) {
const options = /** @type {module:ol/format/GMLBase~Options} */ (opt_options ? opt_options : {});
@@ -135,7 +135,7 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {Array.<module:ol/Feature~Feature> | undefined} Features.
* @return {Array.<module:ol/Feature> | undefined} Features.
*/
GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
const localName = node.localName;
@@ -224,16 +224,18 @@ GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {module:ol/geom/Geometry~Geometry|undefined} Geometry.
* @return {module:ol/geom/Geometry|undefined} Geometry.
*/
GMLBase.prototype.readGeometryElement = function(node, objectStack) {
const context = /** @type {Object} */ (objectStack[0]);
context['srsName'] = node.firstElementChild.getAttribute('srsName');
context['srsDimension'] = node.firstElementChild.getAttribute('srsDimension');
/** @type {module:ol/geom/Geometry~Geometry} */
/** @type {module:ol/geom/Geometry} */
const geometry = pushParseAndPop(null, this.GEOMETRY_PARSERS_, node, objectStack, this);
if (geometry) {
return /** @type {module:ol/geom/Geometry~Geometry} */ (transformWithOptions(geometry, false, context));
return (
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(geometry, false, context))
);
} else {
return undefined;
}
@@ -243,7 +245,7 @@ GMLBase.prototype.readGeometryElement = function(node, objectStack) {
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {module:ol/Feature~Feature} Feature.
* @return {module:ol/Feature} Feature.
*/
GMLBase.prototype.readFeatureElement = function(node, objectStack) {
let n;
@@ -285,7 +287,7 @@ GMLBase.prototype.readFeatureElement = function(node, objectStack) {
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {module:ol/geom/Point~Point|undefined} Point.
* @return {module:ol/geom/Point|undefined} Point.
*/
GMLBase.prototype.readPoint = function(node, objectStack) {
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
@@ -300,7 +302,7 @@ GMLBase.prototype.readPoint = function(node, objectStack) {
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {module:ol/geom/MultiPoint~MultiPoint|undefined} MultiPoint.
* @return {module:ol/geom/MultiPoint|undefined} MultiPoint.
*/
GMLBase.prototype.readMultiPoint = function(node, objectStack) {
/** @type {Array.<Array.<number>>} */
@@ -317,10 +319,10 @@ GMLBase.prototype.readMultiPoint = function(node, objectStack) {
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {module:ol/geom/MultiLineString~MultiLineString|undefined} MultiLineString.
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
*/
GMLBase.prototype.readMultiLineString = function(node, objectStack) {
/** @type {Array.<module:ol/geom/LineString~LineString>} */
/** @type {Array.<module:ol/geom/LineString>} */
const lineStrings = pushParseAndPop([],
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
if (lineStrings) {
@@ -336,10 +338,10 @@ GMLBase.prototype.readMultiLineString = function(node, objectStack) {
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {module:ol/geom/MultiPolygon~MultiPolygon|undefined} MultiPolygon.
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
*/
GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
/** @type {Array.<module:ol/geom/Polygon~Polygon>} */
/** @type {Array.<module:ol/geom/Polygon>} */
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
if (polygons) {
const multiPolygon = new MultiPolygon(null);
@@ -384,7 +386,7 @@ GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {module:ol/geom/LineString~LineString|undefined} LineString.
* @return {module:ol/geom/LineString|undefined} LineString.
*/
GMLBase.prototype.readLineString = function(node, objectStack) {
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
@@ -419,7 +421,7 @@ GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {module:ol/geom/LinearRing~LinearRing|undefined} LinearRing.
* @return {module:ol/geom/LinearRing|undefined} LinearRing.
*/
GMLBase.prototype.readLinearRing = function(node, objectStack) {
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
@@ -436,7 +438,7 @@ GMLBase.prototype.readLinearRing = function(node, objectStack) {
/**
* @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack.
* @return {module:ol/geom/Polygon~Polygon|undefined} Polygon.
* @return {module:ol/geom/Polygon|undefined} Polygon.
*/
GMLBase.prototype.readPolygon = function(node, objectStack) {
/** @type {Array.<Array.<number>>} */
@@ -573,7 +575,7 @@ GMLBase.prototype.readGeometryFromNode = function(node, opt_options) {
* @function
* @param {Document|Node|Object|string} source Source.
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
* @return {Array.<module:ol/Feature~Feature>} Features.
* @return {Array.<module:ol/Feature>} Features.
* @api
*/
GMLBase.prototype.readFeatures;