Named export for ol/asserts

This commit is contained in:
Frederic Junod
2017-12-17 18:10:59 +01:00
parent 7202573f82
commit 9349ba5403
33 changed files with 89 additions and 92 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
*/
import {inherits} from '../index.js';
import _ol_Feature_ from '../Feature.js';
import _ol_asserts_ from '../asserts.js';
import {assert} from '../asserts.js';
import {containsExtent} from '../extent.js';
import FeatureFormat from '../format/Feature.js';
import JSONFeature from '../format/JSONFeature.js';
@@ -277,7 +277,7 @@ EsriJSON.writePointGeometry_ = function(geometry, opt_options) {
y: coordinates[1]
});
} else {
_ol_asserts_.assert(false, 34); // Invalid geometry layout
assert(false, 34); // Invalid geometry layout
}
return /** @type {EsriJSONGeometry} */ (esriJSON);
};
+2 -2
View File
@@ -5,7 +5,7 @@
// see https://github.com/openlayers/openlayers/issues/2078
import {inherits} from '../index.js';
import _ol_asserts_ from '../asserts.js';
import {assert} from '../asserts.js';
import _ol_Feature_ from '../Feature.js';
import FeatureFormat from '../format/Feature.js';
import JSONFeature from '../format/JSONFeature.js';
@@ -469,7 +469,7 @@ GeoJSON.prototype.readProjectionFromObject = function(object) {
if (crs.type == 'name') {
projection = getProjection(crs.properties.name);
} else {
_ol_asserts_.assert(false, 36); // Unknown SRS type
assert(false, 36); // Unknown SRS type
}
} else {
projection = this.defaultDataProjection;
+5 -5
View File
@@ -4,7 +4,7 @@
import {inherits} from '../index.js';
import _ol_Feature_ from '../Feature.js';
import _ol_array_ from '../array.js';
import _ol_asserts_ from '../asserts.js';
import {assert} from '../asserts.js';
import _ol_color_ from '../color.js';
import FeatureFormat from '../format/Feature.js';
import XMLFeature from '../format/XMLFeature.js';
@@ -945,7 +945,7 @@ KML.readMultiGeometry_ = function(node, objectStack) {
} else if (type == GeometryType.GEOMETRY_COLLECTION) {
multiGeometry = new GeometryCollection(geometries);
} else {
_ol_asserts_.assert(false, 37); // Unknown geometry type found
assert(false, 37); // Unknown geometry type found
}
} else {
multiGeometry = new GeometryCollection(geometries);
@@ -1171,7 +1171,7 @@ KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
} else if (typeof styleMapValue === 'string') {
placemarkObject['styleUrl'] = styleMapValue;
} else {
_ol_asserts_.assert(false, 38); // `styleMapValue` has an unknown type
assert(false, 38); // `styleMapValue` has an unknown type
}
};
@@ -2124,7 +2124,7 @@ KML.writeCoordinatesTextNode_ = function(node, coordinates, objectStack) {
layout == GeometryLayout.XYZM) {
dimension = 3;
} else {
_ol_asserts_.assert(false, 34); // Invalid geometry layout
assert(false, 34); // Invalid geometry layout
}
var d, i;
@@ -2382,7 +2382,7 @@ KML.writeMultiGeometry_ = function(node, geometry, objectStack) {
(/** @type {ol.geom.MultiPolygon} */ (geometry)).getPolygons();
factory = KML.POLYGON_NODE_FACTORY_;
} else {
_ol_asserts_.assert(false, 39); // Unknown geometry type
assert(false, 39); // Unknown geometry type
}
_ol_xml_.pushSerializeAndPop(context,
KML.MULTI_GEOMETRY_SERIALIZERS_, factory,
+2 -2
View File
@@ -4,7 +4,7 @@
//FIXME Implement projection handling
import {inherits} from '../index.js';
import _ol_asserts_ from '../asserts.js';
import {assert} from '../asserts.js';
import PBF from 'pbf';
import FeatureFormat from '../format/Feature.js';
import _ol_format_FormatType_ from '../format/FormatType.js';
@@ -225,7 +225,7 @@ MVT.readRawGeometry_ = function(pbf, feature, flatCoordinates, ends) {
}
} else {
_ol_asserts_.assert(false, 59); // Invalid command found in the PBF
assert(false, 59); // Invalid command found in the PBF
}
}
+2 -2
View File
@@ -2,7 +2,7 @@
* @module ol/format/Polyline
*/
import {inherits} from '../index.js';
import _ol_asserts_ from '../asserts.js';
import {assert} from '../asserts.js';
import _ol_Feature_ from '../Feature.js';
import FeatureFormat from '../format/Feature.js';
import TextFeature from '../format/TextFeature.js';
@@ -359,7 +359,7 @@ Polyline.prototype.writeFeatureText = function(feature, opt_options) {
if (geometry) {
return this.writeGeometryText(geometry, opt_options);
} else {
_ol_asserts_.assert(false, 40); // Expected `feature` to have a geometry
assert(false, 40); // Expected `feature` to have a geometry
return '';
}
};
+5 -5
View File
@@ -2,7 +2,7 @@
* @module ol/format/WFS
*/
import {inherits} from '../index.js';
import _ol_asserts_ from '../asserts.js';
import {assert} from '../asserts.js';
import GML2 from '../format/GML2.js';
import GML3 from '../format/GML3.js';
import GMLBase from '../format/GMLBase.js';
@@ -450,7 +450,7 @@ WFS.getTypeName_ = function(featurePrefix, featureType) {
*/
WFS.writeDelete_ = function(node, feature, objectStack) {
var context = objectStack[objectStack.length - 1];
_ol_asserts_.assert(feature.getId() !== undefined, 26); // Features must have an id set
assert(feature.getId() !== undefined, 26); // Features must have an id set
var featureType = context['featureType'];
var featurePrefix = context['featurePrefix'];
var featureNS = context['featureNS'];
@@ -473,7 +473,7 @@ WFS.writeDelete_ = function(node, feature, objectStack) {
*/
WFS.writeUpdate_ = function(node, feature, objectStack) {
var context = objectStack[objectStack.length - 1];
_ol_asserts_.assert(feature.getId() !== undefined, 27); // Features must have an id set
assert(feature.getId() !== undefined, 27); // Features must have an id set
var featureType = context['featureType'];
var featurePrefix = context['featurePrefix'];
var featureNS = context['featureNS'];
@@ -958,7 +958,7 @@ WFS.prototype.writeGetFeature = function(options) {
}
filter = options.filter;
if (options.bbox) {
_ol_asserts_.assert(options.geometryName,
assert(options.geometryName,
12); // `options.geometryName` must also be provided when `options.bbox` is set
var bbox = _ol_format_filter_.bbox(
/** @type {string} */ (options.geometryName), options.bbox, options.srsName);
@@ -982,7 +982,7 @@ WFS.prototype.writeGetFeature = function(options) {
'filter': filter,
'propertyNames': options.propertyNames ? options.propertyNames : []
};
_ol_asserts_.assert(Array.isArray(options.featureTypes),
assert(Array.isArray(options.featureTypes),
11); // `options.featureTypes` should be an Array
WFS.writeGetFeature_(node, /** @type {!Array.<string>} */ (options.featureTypes), [context]);
return node;
+2 -2
View File
@@ -2,7 +2,7 @@
* @module ol/format/filter/LogicalNary
*/
import {inherits} from '../../index.js';
import _ol_asserts_ from '../../asserts.js';
import {assert} from '../../asserts.js';
import Filter from '../filter/Filter.js';
/**
@@ -25,7 +25,7 @@ var LogicalNary = function(tagName, conditions) {
* @type {Array.<ol.format.filter.Filter>}
*/
this.conditions = Array.prototype.slice.call(arguments, 1);
_ol_asserts_.assert(this.conditions.length >= 2, 57); // At least 2 conditions are required.
assert(this.conditions.length >= 2, 57); // At least 2 conditions are required.
};
inherits(LogicalNary, Filter);