diff --git a/src/ol/featureloader.js b/src/ol/featureloader.js index 714c8d056c..a456b67692 100644 --- a/src/ol/featureloader.js +++ b/src/ol/featureloader.js @@ -2,7 +2,7 @@ * @module ol/featureloader */ import {nullFunction} from './index.js'; -import _ol_format_FormatType_ from './format/FormatType.js'; +import FormatType from './format/FormatType.js'; import _ol_xml_ from './xml.js'; @@ -30,7 +30,7 @@ export function loadFeaturesXhr(url, format, success, failure) { xhr.open('GET', typeof url === 'function' ? url(extent, resolution, projection) : url, true); - if (format.getType() == _ol_format_FormatType_.ARRAY_BUFFER) { + if (format.getType() == FormatType.ARRAY_BUFFER) { xhr.responseType = 'arraybuffer'; } /** @@ -43,15 +43,14 @@ export function loadFeaturesXhr(url, format, success, failure) { var type = format.getType(); /** @type {Document|Node|Object|string|undefined} */ var source; - if (type == _ol_format_FormatType_.JSON || - type == _ol_format_FormatType_.TEXT) { + if (type == FormatType.JSON || type == FormatType.TEXT) { source = xhr.responseText; - } else if (type == _ol_format_FormatType_.XML) { + } else if (type == FormatType.XML) { source = xhr.responseXML; if (!source) { source = _ol_xml_.parse(xhr.responseText); } - } else if (type == _ol_format_FormatType_.ARRAY_BUFFER) { + } else if (type == FormatType.ARRAY_BUFFER) { source = /** @type {ArrayBuffer} */ (xhr.response); } if (source) { diff --git a/src/ol/format/JSONFeature.js b/src/ol/format/JSONFeature.js index 802c59d83c..e427239ddf 100644 --- a/src/ol/format/JSONFeature.js +++ b/src/ol/format/JSONFeature.js @@ -3,7 +3,7 @@ */ import {inherits} from '../index.js'; import FeatureFormat from '../format/Feature.js'; -import _ol_format_FormatType_ from '../format/FormatType.js'; +import FormatType from '../format/FormatType.js'; /** * @classdesc @@ -43,7 +43,7 @@ JSONFeature.prototype.getObject_ = function(source) { * @inheritDoc */ JSONFeature.prototype.getType = function() { - return _ol_format_FormatType_.JSON; + return FormatType.JSON; }; diff --git a/src/ol/format/MVT.js b/src/ol/format/MVT.js index 162ca43094..ed99490866 100644 --- a/src/ol/format/MVT.js +++ b/src/ol/format/MVT.js @@ -7,7 +7,7 @@ import {inherits} from '../index.js'; import {assert} from '../asserts.js'; import PBF from 'pbf'; import FeatureFormat from '../format/Feature.js'; -import _ol_format_FormatType_ from '../format/FormatType.js'; +import FormatType from '../format/FormatType.js'; import GeometryLayout from '../geom/GeometryLayout.js'; import GeometryType from '../geom/GeometryType.js'; import LineString from '../geom/LineString.js'; @@ -345,7 +345,7 @@ MVT.prototype.getLastExtent = function() { * @inheritDoc */ MVT.prototype.getType = function() { - return _ol_format_FormatType_.ARRAY_BUFFER; + return FormatType.ARRAY_BUFFER; }; diff --git a/src/ol/format/TextFeature.js b/src/ol/format/TextFeature.js index 31543cfa02..abba66610a 100644 --- a/src/ol/format/TextFeature.js +++ b/src/ol/format/TextFeature.js @@ -3,7 +3,7 @@ */ import {inherits} from '../index.js'; import FeatureFormat from '../format/Feature.js'; -import _ol_format_FormatType_ from '../format/FormatType.js'; +import FormatType from '../format/FormatType.js'; /** * @classdesc @@ -40,7 +40,7 @@ TextFeature.prototype.getText_ = function(source) { * @inheritDoc */ TextFeature.prototype.getType = function() { - return _ol_format_FormatType_.TEXT; + return FormatType.TEXT; }; diff --git a/src/ol/format/XMLFeature.js b/src/ol/format/XMLFeature.js index c6faf92b21..cc89bd044e 100644 --- a/src/ol/format/XMLFeature.js +++ b/src/ol/format/XMLFeature.js @@ -4,7 +4,7 @@ import {inherits} from '../index.js'; import _ol_array_ from '../array.js'; import FeatureFormat from '../format/Feature.js'; -import _ol_format_FormatType_ from '../format/FormatType.js'; +import FormatType from '../format/FormatType.js'; import _ol_xml_ from '../xml.js'; /** @@ -35,7 +35,7 @@ inherits(XMLFeature, FeatureFormat); * @inheritDoc */ XMLFeature.prototype.getType = function() { - return _ol_format_FormatType_.XML; + return FormatType.XML; };