Merge pull request #7793 from tschaub/default-names

More renaming of default exports
This commit is contained in:
Tim Schaub
2018-02-09 06:54:07 -07:00
committed by GitHub
12 changed files with 72 additions and 69 deletions
+12 -11
View File
@@ -2,7 +2,7 @@
* @module ol/Image * @module ol/Image
*/ */
import {inherits} from './index.js'; import {inherits} from './index.js';
import _ol_ImageBase_ from './ImageBase.js'; import ImageBase from './ImageBase.js';
import ImageState from './ImageState.js'; import ImageState from './ImageState.js';
import {listenOnce, unlistenByKey} from './events.js'; import {listenOnce, unlistenByKey} from './events.js';
import EventType from './events/EventType.js'; import EventType from './events/EventType.js';
@@ -18,9 +18,9 @@ import {getHeight} from './extent.js';
* @param {?string} crossOrigin Cross origin. * @param {?string} crossOrigin Cross origin.
* @param {ol.ImageLoadFunctionType} imageLoadFunction Image load function. * @param {ol.ImageLoadFunctionType} imageLoadFunction Image load function.
*/ */
const _ol_Image_ = function(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) { const ImageWrapper = function(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) {
_ol_ImageBase_.call(this, extent, resolution, pixelRatio, ImageState.IDLE); ImageBase.call(this, extent, resolution, pixelRatio, ImageState.IDLE);
/** /**
* @private * @private
@@ -57,14 +57,14 @@ const _ol_Image_ = function(extent, resolution, pixelRatio, src, crossOrigin, im
}; };
inherits(_ol_Image_, _ol_ImageBase_); inherits(ImageWrapper, ImageBase);
/** /**
* @inheritDoc * @inheritDoc
* @api * @api
*/ */
_ol_Image_.prototype.getImage = function() { ImageWrapper.prototype.getImage = function() {
return this.image_; return this.image_;
}; };
@@ -74,7 +74,7 @@ _ol_Image_.prototype.getImage = function() {
* *
* @private * @private
*/ */
_ol_Image_.prototype.handleImageError_ = function() { ImageWrapper.prototype.handleImageError_ = function() {
this.state = ImageState.ERROR; this.state = ImageState.ERROR;
this.unlistenImage_(); this.unlistenImage_();
this.changed(); this.changed();
@@ -86,7 +86,7 @@ _ol_Image_.prototype.handleImageError_ = function() {
* *
* @private * @private
*/ */
_ol_Image_.prototype.handleImageLoad_ = function() { ImageWrapper.prototype.handleImageLoad_ = function() {
if (this.resolution === undefined) { if (this.resolution === undefined) {
this.resolution = getHeight(this.extent) / this.image_.height; this.resolution = getHeight(this.extent) / this.image_.height;
} }
@@ -103,7 +103,7 @@ _ol_Image_.prototype.handleImageLoad_ = function() {
* @override * @override
* @api * @api
*/ */
_ol_Image_.prototype.load = function() { ImageWrapper.prototype.load = function() {
if (this.state == ImageState.IDLE || this.state == ImageState.ERROR) { if (this.state == ImageState.IDLE || this.state == ImageState.ERROR) {
this.state = ImageState.LOADING; this.state = ImageState.LOADING;
this.changed(); this.changed();
@@ -121,7 +121,7 @@ _ol_Image_.prototype.load = function() {
/** /**
* @param {HTMLCanvasElement|Image|HTMLVideoElement} image Image. * @param {HTMLCanvasElement|Image|HTMLVideoElement} image Image.
*/ */
_ol_Image_.prototype.setImage = function(image) { ImageWrapper.prototype.setImage = function(image) {
this.image_ = image; this.image_ = image;
}; };
@@ -131,8 +131,9 @@ _ol_Image_.prototype.setImage = function(image) {
* *
* @private * @private
*/ */
_ol_Image_.prototype.unlistenImage_ = function() { ImageWrapper.prototype.unlistenImage_ = function() {
this.imageListenerKeys_.forEach(unlistenByKey); this.imageListenerKeys_.forEach(unlistenByKey);
this.imageListenerKeys_ = null; this.imageListenerKeys_ = null;
}; };
export default _ol_Image_;
export default ImageWrapper;
+11 -10
View File
@@ -14,7 +14,7 @@ import EventType from './events/EventType.js';
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* @param {ol.ImageState} state State. * @param {ol.ImageState} state State.
*/ */
const _ol_ImageBase_ = function(extent, resolution, pixelRatio, state) { const ImageBase = function(extent, resolution, pixelRatio, state) {
EventTarget.call(this); EventTarget.call(this);
@@ -44,13 +44,13 @@ const _ol_ImageBase_ = function(extent, resolution, pixelRatio, state) {
}; };
inherits(_ol_ImageBase_, EventTarget); inherits(ImageBase, EventTarget);
/** /**
* @protected * @protected
*/ */
_ol_ImageBase_.prototype.changed = function() { ImageBase.prototype.changed = function() {
this.dispatchEvent(EventType.CHANGE); this.dispatchEvent(EventType.CHANGE);
}; };
@@ -58,7 +58,7 @@ _ol_ImageBase_.prototype.changed = function() {
/** /**
* @return {ol.Extent} Extent. * @return {ol.Extent} Extent.
*/ */
_ol_ImageBase_.prototype.getExtent = function() { ImageBase.prototype.getExtent = function() {
return this.extent; return this.extent;
}; };
@@ -67,13 +67,13 @@ _ol_ImageBase_.prototype.getExtent = function() {
* @abstract * @abstract
* @return {HTMLCanvasElement|Image|HTMLVideoElement} Image. * @return {HTMLCanvasElement|Image|HTMLVideoElement} Image.
*/ */
_ol_ImageBase_.prototype.getImage = function() {}; ImageBase.prototype.getImage = function() {};
/** /**
* @return {number} PixelRatio. * @return {number} PixelRatio.
*/ */
_ol_ImageBase_.prototype.getPixelRatio = function() { ImageBase.prototype.getPixelRatio = function() {
return this.pixelRatio_; return this.pixelRatio_;
}; };
@@ -81,7 +81,7 @@ _ol_ImageBase_.prototype.getPixelRatio = function() {
/** /**
* @return {number} Resolution. * @return {number} Resolution.
*/ */
_ol_ImageBase_.prototype.getResolution = function() { ImageBase.prototype.getResolution = function() {
return /** @type {number} */ (this.resolution); return /** @type {number} */ (this.resolution);
}; };
@@ -89,7 +89,7 @@ _ol_ImageBase_.prototype.getResolution = function() {
/** /**
* @return {ol.ImageState} State. * @return {ol.ImageState} State.
*/ */
_ol_ImageBase_.prototype.getState = function() { ImageBase.prototype.getState = function() {
return this.state; return this.state;
}; };
@@ -98,5 +98,6 @@ _ol_ImageBase_.prototype.getState = function() {
* Load not yet loaded URI. * Load not yet loaded URI.
* @abstract * @abstract
*/ */
_ol_ImageBase_.prototype.load = function() {}; ImageBase.prototype.load = function() {};
export default _ol_ImageBase_;
export default ImageBase;
+3 -3
View File
@@ -2,7 +2,7 @@
* @module ol/ImageCanvas * @module ol/ImageCanvas
*/ */
import {inherits} from './index.js'; import {inherits} from './index.js';
import _ol_ImageBase_ from './ImageBase.js'; import ImageBase from './ImageBase.js';
import ImageState from './ImageState.js'; import ImageState from './ImageState.js';
/** /**
@@ -26,7 +26,7 @@ const ImageCanvas = function(extent, resolution, pixelRatio, canvas, opt_loader)
const state = opt_loader !== undefined ? ImageState.IDLE : ImageState.LOADED; const state = opt_loader !== undefined ? ImageState.IDLE : ImageState.LOADED;
_ol_ImageBase_.call(this, extent, resolution, pixelRatio, state); ImageBase.call(this, extent, resolution, pixelRatio, state);
/** /**
* @private * @private
@@ -42,7 +42,7 @@ const ImageCanvas = function(extent, resolution, pixelRatio, canvas, opt_loader)
}; };
inherits(ImageCanvas, _ol_ImageBase_); inherits(ImageCanvas, ImageBase);
/** /**
+5 -4
View File
@@ -15,7 +15,7 @@ import GML3 from '../format/GML3.js';
* @extends {ol.format.GMLBase} * @extends {ol.format.GMLBase}
* @api * @api
*/ */
const _ol_format_GML_ = GML3; const GML = GML3;
/** /**
@@ -27,7 +27,7 @@ const _ol_format_GML_ = GML3;
* @return {string} Result. * @return {string} Result.
* @api * @api
*/ */
_ol_format_GML_.prototype.writeFeatures; GML.prototype.writeFeatures;
/** /**
@@ -39,5 +39,6 @@ _ol_format_GML_.prototype.writeFeatures;
* @return {Node} Node. * @return {Node} Node.
* @api * @api
*/ */
_ol_format_GML_.prototype.writeFeaturesNode; GML.prototype.writeFeaturesNode;
export default _ol_format_GML_;
export default GML;
+4 -4
View File
@@ -3,7 +3,7 @@
*/ */
import {ERROR_THRESHOLD} from './common.js'; import {ERROR_THRESHOLD} from './common.js';
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_ImageBase_ from '../ImageBase.js'; import ImageBase from '../ImageBase.js';
import ImageState from '../ImageState.js'; import ImageState from '../ImageState.js';
import {listen, unlistenByKey} from '../events.js'; import {listen, unlistenByKey} from '../events.js';
import EventType from '../events/EventType.js'; import EventType from '../events/EventType.js';
@@ -106,10 +106,10 @@ const ReprojImage = function(sourceProj, targetProj,
state = ImageState.IDLE; state = ImageState.IDLE;
} }
_ol_ImageBase_.call(this, targetExtent, targetResolution, this.sourcePixelRatio_, state); ImageBase.call(this, targetExtent, targetResolution, this.sourcePixelRatio_, state);
}; };
inherits(ReprojImage, _ol_ImageBase_); inherits(ReprojImage, ImageBase);
/** /**
@@ -119,7 +119,7 @@ ReprojImage.prototype.disposeInternal = function() {
if (this.state == ImageState.LOADING) { if (this.state == ImageState.LOADING) {
this.unlistenSource_(); this.unlistenSource_();
} }
_ol_ImageBase_.prototype.disposeInternal.call(this); ImageBase.prototype.disposeInternal.call(this);
}; };
+2 -2
View File
@@ -2,7 +2,7 @@
* @module ol/source/ImageArcGISRest * @module ol/source/ImageArcGISRest
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Image_ from '../Image.js'; import ImageWrapper from '../Image.js';
import {assert} from '../asserts.js'; import {assert} from '../asserts.js';
import {listen} from '../events.js'; import {listen} from '../events.js';
import EventType from '../events/EventType.js'; import EventType from '../events/EventType.js';
@@ -168,7 +168,7 @@ ImageArcGISRest.prototype.getImageInternal = function(extent, resolution, pixelR
const url = this.getRequestUrl_(extent, this.imageSize_, pixelRatio, const url = this.getRequestUrl_(extent, this.imageSize_, pixelRatio,
projection, params); projection, params);
this.image_ = new _ol_Image_(extent, resolution, pixelRatio, this.image_ = new ImageWrapper(extent, resolution, pixelRatio,
url, this.crossOrigin_, this.imageLoadFunction_); url, this.crossOrigin_, this.imageLoadFunction_);
this.renderedRevision_ = this.getRevision(); this.renderedRevision_ = this.getRevision();
+2 -2
View File
@@ -2,7 +2,7 @@
* @module ol/source/ImageMapGuide * @module ol/source/ImageMapGuide
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Image_ from '../Image.js'; import ImageWrapper from '../Image.js';
import {listen} from '../events.js'; import {listen} from '../events.js';
import EventType from '../events/EventType.js'; import EventType from '../events/EventType.js';
import {containsExtent, getCenter, getHeight, getWidth, scaleFromCenter} from '../extent.js'; import {containsExtent, getCenter, getHeight, getWidth, scaleFromCenter} from '../extent.js';
@@ -141,7 +141,7 @@ ImageMapGuide.prototype.getImageInternal = function(extent, resolution, pixelRat
if (this.url_ !== undefined) { if (this.url_ !== undefined) {
const imageUrl = this.getUrl(this.url_, this.params_, extent, size, const imageUrl = this.getUrl(this.url_, this.params_, extent, size,
projection); projection);
image = new _ol_Image_(extent, resolution, pixelRatio, image = new ImageWrapper(extent, resolution, pixelRatio,
imageUrl, this.crossOrigin_, imageUrl, this.crossOrigin_,
this.imageLoadFunction_); this.imageLoadFunction_);
listen(image, EventType.CHANGE, listen(image, EventType.CHANGE,
+2 -2
View File
@@ -2,7 +2,7 @@
* @module ol/source/ImageStatic * @module ol/source/ImageStatic
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Image_ from '../Image.js'; import ImageWrapper from '../Image.js';
import ImageState from '../ImageState.js'; import ImageState from '../ImageState.js';
import {createCanvasContext2D} from '../dom.js'; import {createCanvasContext2D} from '../dom.js';
import {listen} from '../events.js'; import {listen} from '../events.js';
@@ -39,7 +39,7 @@ const Static = function(options) {
* @private * @private
* @type {ol.Image} * @type {ol.Image}
*/ */
this.image_ = new _ol_Image_(imageExtent, undefined, 1, options.url, crossOrigin, imageLoadFunction); this.image_ = new ImageWrapper(imageExtent, undefined, 1, options.url, crossOrigin, imageLoadFunction);
/** /**
* @private * @private
+2 -2
View File
@@ -4,7 +4,7 @@
import {DEFAULT_WMS_VERSION} from './common.js'; import {DEFAULT_WMS_VERSION} from './common.js';
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Image_ from '../Image.js'; import ImageWrapper from '../Image.js';
import {assert} from '../asserts.js'; import {assert} from '../asserts.js';
import {listen} from '../events.js'; import {listen} from '../events.js';
import EventType from '../events/EventType.js'; import EventType from '../events/EventType.js';
@@ -231,7 +231,7 @@ ImageWMS.prototype.getImageInternal = function(extent, resolution, pixelRatio, p
const url = this.getRequestUrl_(requestExtent, this.imageSize_, pixelRatio, const url = this.getRequestUrl_(requestExtent, this.imageSize_, pixelRatio,
projection, params); projection, params);
this.image_ = new _ol_Image_(requestExtent, resolution, pixelRatio, this.image_ = new ImageWrapper(requestExtent, resolution, pixelRatio,
url, this.crossOrigin_, this.imageLoadFunction_); url, this.crossOrigin_, this.imageLoadFunction_);
this.renderedRevision_ = this.getRevision(); this.renderedRevision_ = this.getRevision();
+25 -25
View File
@@ -1,5 +1,5 @@
import Feature from '../../../../src/ol/Feature.js'; import Feature from '../../../../src/ol/Feature.js';
import _ol_format_GML_ from '../../../../src/ol/format/GML.js'; import GML from '../../../../src/ol/format/GML.js';
import GML2 from '../../../../src/ol/format/GML2.js'; import GML2 from '../../../../src/ol/format/GML2.js';
import LineString from '../../../../src/ol/geom/LineString.js'; import LineString from '../../../../src/ol/geom/LineString.js';
import LinearRing from '../../../../src/ol/geom/LinearRing.js'; import LinearRing from '../../../../src/ol/geom/LinearRing.js';
@@ -337,11 +337,11 @@ describe('ol.format.GML3', function() {
let format, formatWGS84, formatNoSrs; let format, formatWGS84, formatNoSrs;
beforeEach(function() { beforeEach(function() {
format = new _ol_format_GML_({srsName: 'CRS:84'}); format = new GML({srsName: 'CRS:84'});
formatWGS84 = new _ol_format_GML_({ formatWGS84 = new GML({
srsName: 'urn:x-ogc:def:crs:EPSG:4326' srsName: 'urn:x-ogc:def:crs:EPSG:4326'
}); });
formatNoSrs = new _ol_format_GML_(); formatNoSrs = new GML();
}); });
describe('#readGeometry', function() { describe('#readGeometry', function() {
@@ -545,7 +545,7 @@ describe('ol.format.GML3', function() {
const g = readGeometry(format, text); const g = readGeometry(format, text);
expect(g.getCoordinates()[0][0][0][0]).to.equal(-77.0081); expect(g.getCoordinates()[0][0][0][0]).to.equal(-77.0081);
expect(g.getCoordinates()[0][0][0][1]).to.equal(38.9661); expect(g.getCoordinates()[0][0][0][1]).to.equal(38.9661);
format = new _ol_format_GML_({ format = new GML({
srsName: 'urn:x-ogc:def:crs:EPSG:4326', srsName: 'urn:x-ogc:def:crs:EPSG:4326',
surface: false}); surface: false});
const serialized = format.writeGeometryNode(g); const serialized = format.writeGeometryNode(g);
@@ -657,7 +657,7 @@ describe('ol.format.GML3', function() {
expect(g.getCoordinates()).to.eql([[[1, 2, 0], [3, 2, 0], [3, 4, 0], expect(g.getCoordinates()).to.eql([[[1, 2, 0], [3, 2, 0], [3, 4, 0],
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
[[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]]); [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]]);
format = new _ol_format_GML_({srsName: 'CRS:84', surface: true}); format = new GML({srsName: 'CRS:84', surface: true});
const serialized = format.writeGeometryNode(g); const serialized = format.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(parse(text)); expect(serialized.firstElementChild).to.xmleql(parse(text));
}); });
@@ -679,7 +679,7 @@ describe('ol.format.GML3', function() {
const g = readGeometry(format, text); const g = readGeometry(format, text);
expect(g).to.be.an(LineString); expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]); expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]);
format = new _ol_format_GML_({srsName: 'CRS:84', curve: true}); format = new GML({srsName: 'CRS:84', curve: true});
const serialized = format.writeGeometryNode(g); const serialized = format.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(parse(text)); expect(serialized.firstElementChild).to.xmleql(parse(text));
}); });
@@ -774,7 +774,7 @@ describe('ol.format.GML3', function() {
expect(g).to.be.an(MultiLineString); expect(g).to.be.an(MultiLineString);
expect(g.getCoordinates()).to.eql( expect(g.getCoordinates()).to.eql(
[[[1, 2, 0], [2, 3, 0]], [[3, 4, 0], [4, 5, 0]]]); [[[1, 2, 0], [2, 3, 0]], [[3, 4, 0], [4, 5, 0]]]);
format = new _ol_format_GML_({srsName: 'CRS:84', multiCurve: false}); format = new GML({srsName: 'CRS:84', multiCurve: false});
const serialized = format.writeGeometryNode(g); const serialized = format.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(parse(text)); expect(serialized.firstElementChild).to.xmleql(parse(text));
}); });
@@ -850,7 +850,7 @@ describe('ol.format.GML3', function() {
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
[[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]],
[[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]); [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]);
format = new _ol_format_GML_({srsName: 'CRS:84', multiSurface: false}); format = new GML({srsName: 'CRS:84', multiSurface: false});
const serialized = format.writeGeometryNode(g); const serialized = format.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(parse(text)); expect(serialized.firstElementChild).to.xmleql(parse(text));
}); });
@@ -950,7 +950,7 @@ describe('ol.format.GML3', function() {
expect(g).to.be.an(MultiLineString); expect(g).to.be.an(MultiLineString);
expect(g.getCoordinates()).to.eql( expect(g.getCoordinates()).to.eql(
[[[1, 2, 0], [2, 3, 0]], [[3, 4, 0], [4, 5, 0]]]); [[[1, 2, 0], [2, 3, 0]], [[3, 4, 0], [4, 5, 0]]]);
format = new _ol_format_GML_({srsName: 'CRS:84', curve: true}); format = new GML({srsName: 'CRS:84', curve: true});
const serialized = format.writeGeometryNode(g); const serialized = format.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(parse(text)); expect(serialized.firstElementChild).to.xmleql(parse(text));
}); });
@@ -1109,7 +1109,7 @@ describe('ol.format.GML3', function() {
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]], [1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
[[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]], [[3, 4, 0], [3, 6, 0], [5, 6, 0], [3, 4, 0]]],
[[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]); [[[1, 2, 0], [3, 2, 0], [3, 4, 0], [1, 2, 0]]]]);
format = new _ol_format_GML_({srsName: 'CRS:84', surface: true}); format = new GML({srsName: 'CRS:84', surface: true});
const serialized = format.writeGeometryNode(g); const serialized = format.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(parse(text)); expect(serialized.firstElementChild).to.xmleql(parse(text));
}); });
@@ -1141,7 +1141,7 @@ describe('ol.format.GML3', function() {
'featureNS': 'http://www.openplans.org/topp', 'featureNS': 'http://www.openplans.org/topp',
'featureType': 'gnis_pop' 'featureType': 'gnis_pop'
}; };
const features = new _ol_format_GML_(config).readFeatures(text); const features = new GML(config).readFeatures(text);
const feature = features[0]; const feature = features[0];
expect(feature.get('empty')).to.be(undefined); expect(feature.get('empty')).to.be(undefined);
}); });
@@ -1172,7 +1172,7 @@ describe('ol.format.GML3', function() {
'featureNS': 'http://www.openplans.org/topp', 'featureNS': 'http://www.openplans.org/topp',
'featureType': 'gnis_pop' 'featureType': 'gnis_pop'
}; };
features = new _ol_format_GML_(config).readFeatures(text); features = new GML(config).readFeatures(text);
} catch (e) { } catch (e) {
done(e); done(e);
} }
@@ -1193,7 +1193,7 @@ describe('ol.format.GML3', function() {
before(function(done) { before(function(done) {
afterLoadText('spec/ol/format/gml/topp-states-wfs.xml', function(xml) { afterLoadText('spec/ol/format/gml/topp-states-wfs.xml', function(xml) {
try { try {
gmlFormat = new _ol_format_GML_(); gmlFormat = new GML();
features = gmlFormat.readFeatures(xml); features = gmlFormat.readFeatures(xml);
} catch (e) { } catch (e) {
done(e); done(e);
@@ -1258,7 +1258,7 @@ describe('ol.format.GML3', function() {
'schemaLocation': schemaLoc 'schemaLocation': schemaLoc
}; };
text = xml; text = xml;
gmlFormat = new _ol_format_GML_(config); gmlFormat = new GML(config);
features = gmlFormat.readFeatures(xml); features = gmlFormat.readFeatures(xml);
} catch (e) { } catch (e) {
done(e); done(e);
@@ -1292,7 +1292,7 @@ describe('ol.format.GML3', function() {
'featureNS': 'http://www.openplans.org/topp', 'featureNS': 'http://www.openplans.org/topp',
'featureType': 'states' 'featureType': 'states'
}; };
features = new _ol_format_GML_(config).readFeatures(xml); features = new GML(config).readFeatures(xml);
} catch (e) { } catch (e) {
done(e); done(e);
} }
@@ -1323,7 +1323,7 @@ describe('ol.format.GML3', function() {
'featureNS': 'http://opengeo.org/#medford', 'featureNS': 'http://opengeo.org/#medford',
'featureType': 'zoning' 'featureType': 'zoning'
}; };
features = new _ol_format_GML_(config).readFeatures(xml); features = new GML(config).readFeatures(xml);
} catch (e) { } catch (e) {
done(e); done(e);
} }
@@ -1349,7 +1349,7 @@ describe('ol.format.GML3', function() {
'featureNS': 'http://opengeo.org/#medford', 'featureNS': 'http://opengeo.org/#medford',
'featureType': 'zoning' 'featureType': 'zoning'
}; };
features = new _ol_format_GML_(config).readFeatures(xml); features = new GML(config).readFeatures(xml);
} catch (e) { } catch (e) {
done(e); done(e);
} }
@@ -1370,7 +1370,7 @@ describe('ol.format.GML3', function() {
before(function(done) { before(function(done) {
afterLoadText('spec/ol/format/gml/only-boundedby.xml', function(xml) { afterLoadText('spec/ol/format/gml/only-boundedby.xml', function(xml) {
try { try {
features = new _ol_format_GML_().readFeatures(xml); features = new GML().readFeatures(xml);
} catch (e) { } catch (e) {
done(e); done(e);
} }
@@ -1391,7 +1391,7 @@ describe('ol.format.GML3', function() {
before(function(done) { before(function(done) {
afterLoadText('spec/ol/format/gml/ogr.xml', function(xml) { afterLoadText('spec/ol/format/gml/ogr.xml', function(xml) {
try { try {
features = new _ol_format_GML_().readFeatures(xml); features = new GML().readFeatures(xml);
} catch (e) { } catch (e) {
done(e); done(e);
} }
@@ -1411,7 +1411,7 @@ describe('ol.format.GML3', function() {
before(function(done) { before(function(done) {
afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function(xml) { afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function(xml) {
try { try {
features = new _ol_format_GML_({ features = new GML({
featureNS: 'http://localhost:8080/official', featureNS: 'http://localhost:8080/official',
featureType: ['planet_osm_polygon', 'planet_osm_line'] featureType: ['planet_osm_polygon', 'planet_osm_line']
}).readFeatures(xml); }).readFeatures(xml);
@@ -1434,7 +1434,7 @@ describe('ol.format.GML3', function() {
before(function(done) { before(function(done) {
afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function(xml) { afterLoadText('spec/ol/format/gml/multiple-typenames.xml', function(xml) {
try { try {
features = new _ol_format_GML_().readFeatures(xml); features = new GML().readFeatures(xml);
} catch (e) { } catch (e) {
done(e); done(e);
} }
@@ -1455,7 +1455,7 @@ describe('ol.format.GML3', function() {
const url = 'spec/ol/format/gml/multiple-typenames-ns.xml'; const url = 'spec/ol/format/gml/multiple-typenames-ns.xml';
afterLoadText(url, function(xml) { afterLoadText(url, function(xml) {
try { try {
features = new _ol_format_GML_({ features = new GML({
featureNS: { featureNS: {
'topp': 'http://www.openplans.org/topp', 'topp': 'http://www.openplans.org/topp',
'sf': 'http://www.openplans.org/spearfish' 'sf': 'http://www.openplans.org/spearfish'
@@ -1482,7 +1482,7 @@ describe('ol.format.GML3', function() {
const url = 'spec/ol/format/gml/multiple-typenames-ns.xml'; const url = 'spec/ol/format/gml/multiple-typenames-ns.xml';
afterLoadText(url, function(xml) { afterLoadText(url, function(xml) {
try { try {
features = new _ol_format_GML_().readFeatures(xml); features = new GML().readFeatures(xml);
} catch (e) { } catch (e) {
done(e); done(e);
} }
@@ -1507,7 +1507,7 @@ describe('ol.format.GML3', function() {
'featureNS': 'http://www.opengeospatial.net/cite', 'featureNS': 'http://www.opengeospatial.net/cite',
'featureType': 'geoserver_layer' 'featureType': 'geoserver_layer'
}; };
features = new _ol_format_GML_(config).readFeatures(xml); features = new GML(config).readFeatures(xml);
} catch (e) { } catch (e) {
done(e); done(e);
} }
+2 -2
View File
@@ -1,4 +1,4 @@
import _ol_Image_ from '../../../../src/ol/Image.js'; import ImageWrapper from '../../../../src/ol/Image.js';
import Map from '../../../../src/ol/Map.js'; import Map from '../../../../src/ol/Map.js';
import View from '../../../../src/ol/View.js'; import View from '../../../../src/ol/View.js';
import Layer from '../../../../src/ol/layer/Layer.js'; import Layer from '../../../../src/ol/layer/Layer.js';
@@ -28,7 +28,7 @@ describe('ol.renderer.Layer', function() {
const src = ''; const src = '';
const crossOrigin = ''; const crossOrigin = '';
imageLoadFunction = sinon.spy(); imageLoadFunction = sinon.spy();
image = new _ol_Image_(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction); image = new ImageWrapper(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction);
}); });
describe('load IDLE image', function() { describe('load IDLE image', function() {
+2 -2
View File
@@ -1,4 +1,4 @@
import _ol_Image_ from '../../../../src/ol/Image.js'; import ImageWrapper from '../../../../src/ol/Image.js';
import {listen} from '../../../../src/ol/events.js'; import {listen} from '../../../../src/ol/events.js';
import {get as getProjection} from '../../../../src/ol/proj.js'; import {get as getProjection} from '../../../../src/ol/proj.js';
import ReprojImage from '../../../../src/ol/reproj/Image.js'; import ReprojImage from '../../../../src/ol/reproj/Image.js';
@@ -10,7 +10,7 @@ describe('ol.reproj.Image', function() {
getProjection('EPSG:3857'), getProjection('EPSG:4326'), getProjection('EPSG:3857'), getProjection('EPSG:4326'),
[-180, -85, 180, 85], 10, pixelRatio, [-180, -85, 180, 85], 10, pixelRatio,
function(extent, resolution, pixelRatio) { function(extent, resolution, pixelRatio) {
return new _ol_Image_(extent, resolution, pixelRatio, return new ImageWrapper(extent, resolution, pixelRatio,
'data:image/gif;base64,' + 'data:image/gif;base64,' +
'R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=', null, 'R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=', null,
function(image, src) { function(image, src) {