From d0728a5e65dcef80f3ac71075a9731ddd56b3606 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 19 Dec 2017 08:33:14 +0100 Subject: [PATCH 1/6] Rename _ol_source_State_ to SourceState --- src/ol/layer/Group.js | 4 ++-- src/ol/layer/Layer.js | 4 ++-- src/ol/renderer/Layer.js | 4 ++-- src/ol/renderer/canvas/Map.js | 4 ++-- src/ol/renderer/webgl/Map.js | 4 ++-- src/ol/source/BingMaps.js | 8 ++++---- src/ol/source/CartoDB.js | 12 ++++++------ src/ol/source/Raster.js | 4 ++-- src/ol/source/Source.js | 4 ++-- src/ol/source/TileJSON.js | 8 ++++---- src/ol/source/TileUTFGrid.js | 10 +++++----- src/ol/source/Vector.js | 4 ++-- 12 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/ol/layer/Group.js b/src/ol/layer/Group.js index 112bbed2ce..ae07cd6370 100644 --- a/src/ol/layer/Group.js +++ b/src/ol/layer/Group.js @@ -12,7 +12,7 @@ import EventType from '../events/EventType.js'; import {getIntersection} from '../extent.js'; import _ol_layer_Base_ from '../layer/Base.js'; import _ol_obj_ from '../obj.js'; -import _ol_source_State_ from '../source/State.js'; +import SourceState from '../source/State.js'; /** @@ -232,7 +232,7 @@ _ol_layer_Group_.prototype.getLayerStatesArray = function(opt_states) { * @inheritDoc */ _ol_layer_Group_.prototype.getSourceState = function() { - return _ol_source_State_.READY; + return SourceState.READY; }; export default _ol_layer_Group_; diff --git a/src/ol/layer/Layer.js b/src/ol/layer/Layer.js index 12c8cb9f53..72b65b803d 100644 --- a/src/ol/layer/Layer.js +++ b/src/ol/layer/Layer.js @@ -9,7 +9,7 @@ import _ol_layer_Base_ from '../layer/Base.js'; import _ol_layer_Property_ from '../layer/Property.js'; import _ol_obj_ from '../obj.js'; import RenderEventType from '../render/EventType.js'; -import _ol_source_State_ from '../source/State.js'; +import SourceState from '../source/State.js'; /** * @classdesc @@ -124,7 +124,7 @@ _ol_layer_Layer_.prototype.getSource = function() { */ _ol_layer_Layer_.prototype.getSourceState = function() { var source = this.getSource(); - return !source ? _ol_source_State_.UNDEFINED : source.getState(); + return !source ? SourceState.UNDEFINED : source.getState(); }; diff --git a/src/ol/renderer/Layer.js b/src/ol/renderer/Layer.js index fde1389c4c..89e4010222 100644 --- a/src/ol/renderer/Layer.js +++ b/src/ol/renderer/Layer.js @@ -8,7 +8,7 @@ import _ol_TileState_ from '../TileState.js'; import _ol_events_ from '../events.js'; import EventType from '../events/EventType.js'; import {FALSE} from '../functions.js'; -import _ol_source_State_ from '../source/State.js'; +import SourceState from '../source/State.js'; /** * @constructor @@ -130,7 +130,7 @@ _ol_renderer_Layer_.prototype.loadImage = function(image) { */ _ol_renderer_Layer_.prototype.renderIfReadyAndVisible = function() { var layer = this.getLayer(); - if (layer.getVisible() && layer.getSourceState() == _ol_source_State_.READY) { + if (layer.getVisible() && layer.getSourceState() == SourceState.READY) { this.changed(); } }; diff --git a/src/ol/renderer/canvas/Map.js b/src/ol/renderer/canvas/Map.js index 549e1542c5..6e9dd38802 100644 --- a/src/ol/renderer/canvas/Map.js +++ b/src/ol/renderer/canvas/Map.js @@ -15,7 +15,7 @@ import _ol_render_canvas_ from '../../render/canvas.js'; import _ol_render_canvas_Immediate_ from '../../render/canvas/Immediate.js'; import _ol_renderer_Map_ from '../Map.js'; import RendererType from '../Type.js'; -import _ol_source_State_ from '../../source/State.js'; +import SourceState from '../../source/State.js'; /** * @constructor @@ -180,7 +180,7 @@ _ol_renderer_canvas_Map_.prototype.renderFrame = function(frameState) { layer = layerState.layer; layerRenderer = /** @type {ol.renderer.canvas.Layer} */ (this.getLayerRenderer(layer)); if (!_ol_layer_Layer_.visibleAtResolution(layerState, viewResolution) || - layerState.sourceState != _ol_source_State_.READY) { + layerState.sourceState != SourceState.READY) { continue; } if (layerRenderer.prepareFrame(frameState, layerState)) { diff --git a/src/ol/renderer/webgl/Map.js b/src/ol/renderer/webgl/Map.js index aac017c819..1f8dd8a4af 100644 --- a/src/ol/renderer/webgl/Map.js +++ b/src/ol/renderer/webgl/Map.js @@ -14,7 +14,7 @@ import RenderEventType from '../../render/EventType.js'; import _ol_render_webgl_Immediate_ from '../../render/webgl/Immediate.js'; import _ol_renderer_Map_ from '../Map.js'; import RendererType from '../Type.js'; -import _ol_source_State_ from '../../source/State.js'; +import SourceState from '../../source/State.js'; import LRUCache from '../../structs/LRUCache.js'; import PriorityQueue from '../../structs/PriorityQueue.js'; import _ol_webgl_ from '../../webgl.js'; @@ -450,7 +450,7 @@ _ol_renderer_webgl_Map_.prototype.renderFrame = function(frameState) { for (i = 0, ii = layerStatesArray.length; i < ii; ++i) { layerState = layerStatesArray[i]; if (_ol_layer_Layer_.visibleAtResolution(layerState, viewResolution) && - layerState.sourceState == _ol_source_State_.READY) { + layerState.sourceState == SourceState.READY) { layerRenderer = /** @type {ol.renderer.webgl.Layer} */ (this.getLayerRenderer(layerState.layer)); if (layerRenderer.prepareFrame(frameState, layerState, context)) { layerStatesToDraw.push(layerState); diff --git a/src/ol/source/BingMaps.js b/src/ol/source/BingMaps.js index d2f921274b..7582db5cf1 100644 --- a/src/ol/source/BingMaps.js +++ b/src/ol/source/BingMaps.js @@ -6,7 +6,7 @@ import {createFromTileUrlFunctions} from '../tileurlfunction.js'; import {applyTransform, intersects} from '../extent.js'; import _ol_net_ from '../net.js'; import {get as getProjection, getTransformFromProjections} from '../proj.js'; -import _ol_source_State_ from '../source/State.js'; +import SourceState from '../source/State.js'; import _ol_source_TileImage_ from '../source/TileImage.js'; import _ol_tilecoord_ from '../tilecoord.js'; import _ol_tilegrid_ from '../tilegrid.js'; @@ -34,7 +34,7 @@ var _ol_source_BingMaps_ = function(options) { opaque: true, projection: getProjection('EPSG:3857'), reprojectionErrorThreshold: options.reprojectionErrorThreshold, - state: _ol_source_State_.LOADING, + state: SourceState.LOADING, tileLoadFunction: options.tileLoadFunction, tilePixelRatio: this.hidpi_ ? 2 : 1, wrapX: options.wrapX !== undefined ? options.wrapX : true, @@ -121,7 +121,7 @@ _ol_source_BingMaps_.prototype.handleImageryMetadataResponse = function(response response.authenticationResultCode != 'ValidCredentials' || response.resourceSets.length != 1 || response.resourceSets[0].resources.length != 1) { - this.setState(_ol_source_State_.ERROR); + this.setState(SourceState.ERROR); return; } @@ -204,6 +204,6 @@ _ol_source_BingMaps_.prototype.handleImageryMetadataResponse = function(response }); } - this.setState(_ol_source_State_.READY); + this.setState(SourceState.READY); }; export default _ol_source_BingMaps_; diff --git a/src/ol/source/CartoDB.js b/src/ol/source/CartoDB.js index 9a88a0fbc1..57c24d60ce 100644 --- a/src/ol/source/CartoDB.js +++ b/src/ol/source/CartoDB.js @@ -3,7 +3,7 @@ */ import {inherits} from '../index.js'; import _ol_obj_ from '../obj.js'; -import _ol_source_State_ from '../source/State.js'; +import SourceState from '../source/State.js'; import _ol_source_XYZ_ from '../source/XYZ.js'; /** @@ -48,7 +48,7 @@ var _ol_source_CartoDB_ = function(options) { maxZoom: options.maxZoom !== undefined ? options.maxZoom : 18, minZoom: options.minZoom, projection: options.projection, - state: _ol_source_State_.LOADING, + state: SourceState.LOADING, wrapX: options.wrapX }); this.initializeMap_(); @@ -132,14 +132,14 @@ _ol_source_CartoDB_.prototype.handleInitResponse_ = function(paramHash, event) { try { response = /** @type {CartoDBLayerInfo} */(JSON.parse(client.responseText)); } catch (err) { - this.setState(_ol_source_State_.ERROR); + this.setState(SourceState.ERROR); return; } this.applyTemplate_(response); this.templateCache_[paramHash] = response; - this.setState(_ol_source_State_.READY); + this.setState(SourceState.READY); } else { - this.setState(_ol_source_State_.ERROR); + this.setState(SourceState.ERROR); } }; @@ -149,7 +149,7 @@ _ol_source_CartoDB_.prototype.handleInitResponse_ = function(paramHash, event) { * @param {Event} event Event. */ _ol_source_CartoDB_.prototype.handleInitError_ = function(event) { - this.setState(_ol_source_State_.ERROR); + this.setState(SourceState.ERROR); }; diff --git a/src/ol/source/Raster.js b/src/ol/source/Raster.js index 7efc4be015..63b3841848 100644 --- a/src/ol/source/Raster.js +++ b/src/ol/source/Raster.js @@ -17,7 +17,7 @@ import _ol_renderer_canvas_ImageLayer_ from '../renderer/canvas/ImageLayer.js'; import _ol_renderer_canvas_TileLayer_ from '../renderer/canvas/TileLayer.js'; import _ol_source_Image_ from '../source/Image.js'; import _ol_source_RasterOperationType_ from '../source/RasterOperationType.js'; -import _ol_source_State_ from '../source/State.js'; +import SourceState from '../source/State.js'; import _ol_source_Tile_ from '../source/Tile.js'; import _ol_transform_ from '../transform.js'; @@ -201,7 +201,7 @@ _ol_source_Raster_.prototype.allSourcesReady_ = function() { var source; for (var i = 0, ii = this.renderers_.length; i < ii; ++i) { source = this.renderers_[i].getLayer().getSource(); - if (source.getState() !== _ol_source_State_.READY) { + if (source.getState() !== SourceState.READY) { ready = false; break; } diff --git a/src/ol/source/Source.js b/src/ol/source/Source.js index 9db8b45901..70cbbebcf3 100644 --- a/src/ol/source/Source.js +++ b/src/ol/source/Source.js @@ -4,7 +4,7 @@ import {inherits, nullFunction} from '../index.js'; import _ol_Object_ from '../Object.js'; import {get as getProjection} from '../proj.js'; -import _ol_source_State_ from '../source/State.js'; +import SourceState from '../source/State.js'; /** @@ -42,7 +42,7 @@ var _ol_source_Source_ = function(options) { * @type {ol.source.State} */ this.state_ = options.state !== undefined ? - options.state : _ol_source_State_.READY; + options.state : SourceState.READY; /** * @private diff --git a/src/ol/source/TileJSON.js b/src/ol/source/TileJSON.js index b135952a59..17cf4fc0f6 100644 --- a/src/ol/source/TileJSON.js +++ b/src/ol/source/TileJSON.js @@ -13,7 +13,7 @@ import {assert} from '../asserts.js'; import {applyTransform, intersects} from '../extent.js'; import _ol_net_ from '../net.js'; import {get as getProjection, getTransformFromProjections} from '../proj.js'; -import _ol_source_State_ from '../source/State.js'; +import SourceState from '../source/State.js'; import _ol_source_TileImage_ from '../source/TileImage.js'; import _ol_tilegrid_ from '../tilegrid.js'; @@ -40,7 +40,7 @@ var _ol_source_TileJSON_ = function(options) { crossOrigin: options.crossOrigin, projection: getProjection('EPSG:3857'), reprojectionErrorThreshold: options.reprojectionErrorThreshold, - state: _ol_source_State_.LOADING, + state: SourceState.LOADING, tileLoadFunction: options.tileLoadFunction, wrapX: options.wrapX !== undefined ? options.wrapX : true, transition: options.transition @@ -148,7 +148,7 @@ _ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) { } this.tileJSON_ = tileJSON; - this.setState(_ol_source_State_.READY); + this.setState(SourceState.READY); }; @@ -157,6 +157,6 @@ _ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) { * @protected */ _ol_source_TileJSON_.prototype.handleTileJSONError = function() { - this.setState(_ol_source_State_.ERROR); + this.setState(SourceState.ERROR); }; export default _ol_source_TileJSON_; diff --git a/src/ol/source/TileUTFGrid.js b/src/ol/source/TileUTFGrid.js index 6a20f53155..0c385b5242 100644 --- a/src/ol/source/TileUTFGrid.js +++ b/src/ol/source/TileUTFGrid.js @@ -11,7 +11,7 @@ import EventType from '../events/EventType.js'; import {applyTransform, intersects} from '../extent.js'; import _ol_net_ from '../net.js'; import {get as getProjection, getTransformFromProjections} from '../proj.js'; -import _ol_source_State_ from '../source/State.js'; +import SourceState from '../source/State.js'; import _ol_source_Tile_ from '../source/Tile.js'; import _ol_tilecoord_ from '../tilecoord.js'; import _ol_tilegrid_ from '../tilegrid.js'; @@ -28,7 +28,7 @@ import _ol_tilegrid_ from '../tilegrid.js'; var _ol_source_TileUTFGrid_ = function(options) { _ol_source_Tile_.call(this, { projection: getProjection('EPSG:3857'), - state: _ol_source_State_.LOADING + state: SourceState.LOADING }); /** @@ -155,7 +155,7 @@ _ol_source_TileUTFGrid_.prototype.forDataAtCoordinateAndResolution = function( * @protected */ _ol_source_TileUTFGrid_.prototype.handleTileJSONError = function() { - this.setState(_ol_source_State_.ERROR); + this.setState(SourceState.ERROR); }; @@ -189,7 +189,7 @@ _ol_source_TileUTFGrid_.prototype.handleTileJSONResponse = function(tileJSON) { var grids = tileJSON.grids; if (!grids) { - this.setState(_ol_source_State_.ERROR); + this.setState(SourceState.ERROR); return; } @@ -207,7 +207,7 @@ _ol_source_TileUTFGrid_.prototype.handleTileJSONResponse = function(tileJSON) { }); } - this.setState(_ol_source_State_.READY); + this.setState(SourceState.READY); }; diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index 849670b350..d4dd04cdea 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -17,7 +17,7 @@ import {TRUE} from '../functions.js'; import _ol_loadingstrategy_ from '../loadingstrategy.js'; import _ol_obj_ from '../obj.js'; import _ol_source_Source_ from '../source/Source.js'; -import _ol_source_State_ from '../source/State.js'; +import SourceState from '../source/State.js'; import _ol_source_VectorEventType_ from '../source/VectorEventType.js'; import RBush from '../structs/RBush.js'; @@ -40,7 +40,7 @@ var _ol_source_Vector_ = function(opt_options) { _ol_source_Source_.call(this, { attributions: options.attributions, projection: undefined, - state: _ol_source_State_.READY, + state: SourceState.READY, wrapX: options.wrapX !== undefined ? options.wrapX : true }); From 2ae553702b913bb4572131842eacc34f902dda9c Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 19 Dec 2017 08:37:33 +0100 Subject: [PATCH 2/6] Rename _ol_source_RasterOperationType_ to RasterOperationType --- src/ol/source/Raster.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/source/Raster.js b/src/ol/source/Raster.js index 63b3841848..490edaef3d 100644 --- a/src/ol/source/Raster.js +++ b/src/ol/source/Raster.js @@ -16,7 +16,7 @@ import _ol_obj_ from '../obj.js'; import _ol_renderer_canvas_ImageLayer_ from '../renderer/canvas/ImageLayer.js'; import _ol_renderer_canvas_TileLayer_ from '../renderer/canvas/TileLayer.js'; import _ol_source_Image_ from '../source/Image.js'; -import _ol_source_RasterOperationType_ from '../source/RasterOperationType.js'; +import RasterOperationType from '../source/RasterOperationType.js'; import SourceState from '../source/State.js'; import _ol_source_Tile_ from '../source/Tile.js'; import _ol_transform_ from '../transform.js'; @@ -46,7 +46,7 @@ var _ol_source_Raster_ = function(options) { * @type {ol.source.RasterOperationType} */ this.operationType_ = options.operationType !== undefined ? - options.operationType : _ol_source_RasterOperationType_.PIXEL; + options.operationType : RasterOperationType.PIXEL; /** * @private @@ -149,7 +149,7 @@ inherits(_ol_source_Raster_, _ol_source_Image_); _ol_source_Raster_.prototype.setOperation = function(operation, opt_lib) { this.worker_ = new Processor({ operation: operation, - imageOps: this.operationType_ === _ol_source_RasterOperationType_.IMAGE, + imageOps: this.operationType_ === RasterOperationType.IMAGE, queue: 1, lib: opt_lib, threads: this.threads_ From 87cc4b9c9f23ba584390d1177228e3896437f915 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 19 Dec 2017 08:39:06 +0100 Subject: [PATCH 3/6] Rename _ol_source_WMSServerType_ to WMSServerType --- src/ol/source/ImageWMS.js | 10 +++++----- src/ol/source/TileWMS.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ol/source/ImageWMS.js b/src/ol/source/ImageWMS.js index 685f8d941e..f510358031 100644 --- a/src/ol/source/ImageWMS.js +++ b/src/ol/source/ImageWMS.js @@ -13,7 +13,7 @@ import _ol_obj_ from '../obj.js'; import {get as getProjection, transform} from '../proj.js'; import _ol_reproj_ from '../reproj.js'; import _ol_source_Image_ from '../source/Image.js'; -import _ol_source_WMSServerType_ from '../source/WMSServerType.js'; +import WMSServerType from '../source/WMSServerType.js'; import _ol_string_ from '../string.js'; import _ol_uri_ from '../uri.js'; @@ -275,7 +275,7 @@ _ol_source_ImageWMS_.prototype.getRequestUrl_ = function(extent, size, pixelRati if (pixelRatio != 1) { switch (this.serverType_) { - case _ol_source_WMSServerType_.GEOSERVER: + case WMSServerType.GEOSERVER: var dpi = (90 * pixelRatio + 0.5) | 0; if ('FORMAT_OPTIONS' in params) { params['FORMAT_OPTIONS'] += ';dpi:' + dpi; @@ -283,11 +283,11 @@ _ol_source_ImageWMS_.prototype.getRequestUrl_ = function(extent, size, pixelRati params['FORMAT_OPTIONS'] = 'dpi:' + dpi; } break; - case _ol_source_WMSServerType_.MAPSERVER: + case WMSServerType.MAPSERVER: params['MAP_RESOLUTION'] = 90 * pixelRatio; break; - case _ol_source_WMSServerType_.CARMENTA_SERVER: - case _ol_source_WMSServerType_.QGIS: + case WMSServerType.CARMENTA_SERVER: + case WMSServerType.QGIS: params['DPI'] = 90 * pixelRatio; break; default: diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index 4c1dc5bc47..801fd87d13 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -12,7 +12,7 @@ import {get as getProjection, transform, transformExtent} from '../proj.js'; import _ol_reproj_ from '../reproj.js'; import _ol_size_ from '../size.js'; import _ol_source_TileImage_ from '../source/TileImage.js'; -import _ol_source_WMSServerType_ from '../source/WMSServerType.js'; +import WMSServerType from '../source/WMSServerType.js'; import _ol_tilecoord_ from '../tilecoord.js'; import _ol_string_ from '../string.js'; import _ol_uri_ from '../uri.js'; @@ -209,7 +209,7 @@ _ol_source_TileWMS_.prototype.getRequestUrl_ = function(tileCoord, tileSize, til if (pixelRatio != 1) { switch (this.serverType_) { - case _ol_source_WMSServerType_.GEOSERVER: + case WMSServerType.GEOSERVER: var dpi = (90 * pixelRatio + 0.5) | 0; if ('FORMAT_OPTIONS' in params) { params['FORMAT_OPTIONS'] += ';dpi:' + dpi; @@ -217,11 +217,11 @@ _ol_source_TileWMS_.prototype.getRequestUrl_ = function(tileCoord, tileSize, til params['FORMAT_OPTIONS'] = 'dpi:' + dpi; } break; - case _ol_source_WMSServerType_.MAPSERVER: + case WMSServerType.MAPSERVER: params['MAP_RESOLUTION'] = 90 * pixelRatio; break; - case _ol_source_WMSServerType_.CARMENTA_SERVER: - case _ol_source_WMSServerType_.QGIS: + case WMSServerType.CARMENTA_SERVER: + case WMSServerType.QGIS: params['DPI'] = 90 * pixelRatio; break; default: From a7d1e6fdf7f55d6496250d17fa7c8511efa034f6 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 19 Dec 2017 08:40:16 +0100 Subject: [PATCH 4/6] Rename _ol_source_TileEventType_ to TileEventType --- src/ol/source/UrlTile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/source/UrlTile.js b/src/ol/source/UrlTile.js index 6da1b582ad..7c2bbedc81 100644 --- a/src/ol/source/UrlTile.js +++ b/src/ol/source/UrlTile.js @@ -5,7 +5,7 @@ import {getUid, inherits} from '../index.js'; import _ol_TileState_ from '../TileState.js'; import {expandUrl, createFromTemplates, nullTileUrlFunction} from '../tileurlfunction.js'; import _ol_source_Tile_ from '../source/Tile.js'; -import _ol_source_TileEventType_ from '../source/TileEventType.js'; +import TileEventType from '../source/TileEventType.js'; import _ol_tilecoord_ from '../tilecoord.js'; /** @@ -122,12 +122,12 @@ _ol_source_UrlTile_.prototype.handleTileChange = function(event) { var type; if (tileState == _ol_TileState_.LOADING) { this.tileLoadingKeys_[uid] = true; - type = _ol_source_TileEventType_.TILELOADSTART; + type = TileEventType.TILELOADSTART; } else if (uid in this.tileLoadingKeys_) { delete this.tileLoadingKeys_[uid]; - type = tileState == _ol_TileState_.ERROR ? _ol_source_TileEventType_.TILELOADERROR : + type = tileState == _ol_TileState_.ERROR ? TileEventType.TILELOADERROR : (tileState == _ol_TileState_.LOADED || tileState == _ol_TileState_.ABORT) ? - _ol_source_TileEventType_.TILELOADEND : undefined; + TileEventType.TILELOADEND : undefined; } if (type != undefined) { this.dispatchEvent(new _ol_source_Tile_.Event(type, tile)); From 1e307c16acfae446344df515174401ca9a3c8675 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 19 Dec 2017 08:42:32 +0100 Subject: [PATCH 5/6] Rename _ol_source_VectorEventType_ to VectorEventType --- src/ol/interaction/Modify.js | 6 +++--- src/ol/interaction/Snap.js | 6 +++--- src/ol/source/Vector.js | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/ol/interaction/Modify.js b/src/ol/interaction/Modify.js index e9d33737e5..397ff20af6 100644 --- a/src/ol/interaction/Modify.js +++ b/src/ol/interaction/Modify.js @@ -20,7 +20,7 @@ import _ol_interaction_ModifyEventType_ from '../interaction/ModifyEventType.js' import _ol_interaction_Pointer_ from '../interaction/Pointer.js'; import _ol_layer_Vector_ from '../layer/Vector.js'; import _ol_source_Vector_ from '../source/Vector.js'; -import _ol_source_VectorEventType_ from '../source/VectorEventType.js'; +import VectorEventType from '../source/VectorEventType.js'; import RBush from '../structs/RBush.js'; import _ol_style_Style_ from '../style/Style.js'; @@ -196,9 +196,9 @@ var _ol_interaction_Modify_ = function(options) { if (options.source) { this.source_ = options.source; features = new _ol_Collection_(this.source_.getFeatures()); - _ol_events_.listen(this.source_, _ol_source_VectorEventType_.ADDFEATURE, + _ol_events_.listen(this.source_, VectorEventType.ADDFEATURE, this.handleSourceAdd_, this); - _ol_events_.listen(this.source_, _ol_source_VectorEventType_.REMOVEFEATURE, + _ol_events_.listen(this.source_, VectorEventType.REMOVEFEATURE, this.handleSourceRemove_, this); } else { features = options.features; diff --git a/src/ol/interaction/Snap.js b/src/ol/interaction/Snap.js index eec5ca78a5..cf5845699e 100644 --- a/src/ol/interaction/Snap.js +++ b/src/ol/interaction/Snap.js @@ -14,7 +14,7 @@ import Polygon from '../geom/Polygon.js'; import _ol_interaction_Pointer_ from '../interaction/Pointer.js'; import _ol_obj_ from '../obj.js'; import _ol_source_Vector_ from '../source/Vector.js'; -import _ol_source_VectorEventType_ from '../source/VectorEventType.js'; +import VectorEventType from '../source/VectorEventType.js'; import RBush from '../structs/RBush.js'; /** @@ -316,9 +316,9 @@ _ol_interaction_Snap_.prototype.setMap = function(map) { ); } else if (this.source_) { keys.push( - _ol_events_.listen(this.source_, _ol_source_VectorEventType_.ADDFEATURE, + _ol_events_.listen(this.source_, VectorEventType.ADDFEATURE, this.handleFeatureAdd_, this), - _ol_events_.listen(this.source_, _ol_source_VectorEventType_.REMOVEFEATURE, + _ol_events_.listen(this.source_, VectorEventType.REMOVEFEATURE, this.handleFeatureRemove_, this) ); } diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index d4dd04cdea..306416d4f0 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -18,7 +18,7 @@ import _ol_loadingstrategy_ from '../loadingstrategy.js'; import _ol_obj_ from '../obj.js'; import _ol_source_Source_ from '../source/Source.js'; import SourceState from '../source/State.js'; -import _ol_source_VectorEventType_ from '../source/VectorEventType.js'; +import VectorEventType from '../source/VectorEventType.js'; import RBush from '../structs/RBush.js'; /** @@ -192,7 +192,7 @@ _ol_source_Vector_.prototype.addFeatureInternal = function(feature) { } this.dispatchEvent( - new _ol_source_Vector_.Event(_ol_source_VectorEventType_.ADDFEATURE, feature)); + new _ol_source_Vector_.Event(VectorEventType.ADDFEATURE, feature)); }; @@ -287,7 +287,7 @@ _ol_source_Vector_.prototype.addFeaturesInternal = function(features) { for (i = 0, length = newFeatures.length; i < length; i++) { this.dispatchEvent(new _ol_source_Vector_.Event( - _ol_source_VectorEventType_.ADDFEATURE, newFeatures[i])); + VectorEventType.ADDFEATURE, newFeatures[i])); } }; @@ -298,7 +298,7 @@ _ol_source_Vector_.prototype.addFeaturesInternal = function(features) { */ _ol_source_Vector_.prototype.bindFeaturesCollection_ = function(collection) { var modifyingCollection = false; - _ol_events_.listen(this, _ol_source_VectorEventType_.ADDFEATURE, + _ol_events_.listen(this, VectorEventType.ADDFEATURE, function(evt) { if (!modifyingCollection) { modifyingCollection = true; @@ -306,7 +306,7 @@ _ol_source_Vector_.prototype.bindFeaturesCollection_ = function(collection) { modifyingCollection = false; } }); - _ol_events_.listen(this, _ol_source_VectorEventType_.REMOVEFEATURE, + _ol_events_.listen(this, VectorEventType.REMOVEFEATURE, function(evt) { if (!modifyingCollection) { modifyingCollection = true; @@ -368,7 +368,7 @@ _ol_source_Vector_.prototype.clear = function(opt_fast) { this.loadedExtentsRtree_.clear(); this.nullGeometryFeatures_ = {}; - var clearEvent = new _ol_source_Vector_.Event(_ol_source_VectorEventType_.CLEAR); + var clearEvent = new _ol_source_Vector_.Event(VectorEventType.CLEAR); this.dispatchEvent(clearEvent); this.changed(); }; @@ -719,7 +719,7 @@ _ol_source_Vector_.prototype.handleFeatureChange_ = function(event) { } this.changed(); this.dispatchEvent(new _ol_source_Vector_.Event( - _ol_source_VectorEventType_.CHANGEFEATURE, feature)); + VectorEventType.CHANGEFEATURE, feature)); }; @@ -817,7 +817,7 @@ _ol_source_Vector_.prototype.removeFeatureInternal = function(feature) { delete this.undefIdIndex_[featureKey]; } this.dispatchEvent(new _ol_source_Vector_.Event( - _ol_source_VectorEventType_.REMOVEFEATURE, feature)); + VectorEventType.REMOVEFEATURE, feature)); }; From aa45598ae15d783b82ae697b57669f96a9ec6858 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Tue, 19 Dec 2017 08:51:50 +0100 Subject: [PATCH 6/6] Rename _ol_source_Source_ to Source --- src/ol/source/Image.js | 6 ++--- src/ol/source/Source.js | 26 +++++++++--------- src/ol/source/Tile.js | 6 ++--- src/ol/source/Vector.js | 6 ++--- test/spec/ol/layer/group.test.js | 22 +++++++-------- test/spec/ol/layer/layer.test.js | 40 ++++++++++++++-------------- test/spec/ol/source/cluster.test.js | 4 +-- test/spec/ol/source/raster.test.js | 4 +-- test/spec/ol/source/source.test.js | 20 +++++++------- test/spec/ol/source/tile.test.js | 4 +-- test/spec/ol/source/tilejson.test.js | 4 +-- 11 files changed, 71 insertions(+), 71 deletions(-) diff --git a/src/ol/source/Image.js b/src/ol/source/Image.js index 7a2e76f934..c34d4bf925 100644 --- a/src/ol/source/Image.js +++ b/src/ol/source/Image.js @@ -9,7 +9,7 @@ import Event from '../events/Event.js'; import {equals} from '../extent.js'; import {equivalent} from '../proj.js'; import _ol_reproj_Image_ from '../reproj/Image.js'; -import _ol_source_Source_ from '../source/Source.js'; +import Source from '../source/Source.js'; /** * @classdesc @@ -24,7 +24,7 @@ import _ol_source_Source_ from '../source/Source.js'; * @api */ var _ol_source_Image_ = function(options) { - _ol_source_Source_.call(this, { + Source.call(this, { attributions: options.attributions, extent: options.extent, projection: options.projection, @@ -53,7 +53,7 @@ var _ol_source_Image_ = function(options) { this.reprojectedRevision_ = 0; }; -inherits(_ol_source_Image_, _ol_source_Source_); +inherits(_ol_source_Image_, Source); /** diff --git a/src/ol/source/Source.js b/src/ol/source/Source.js index 70cbbebcf3..58c30401dc 100644 --- a/src/ol/source/Source.js +++ b/src/ol/source/Source.js @@ -21,7 +21,7 @@ import SourceState from '../source/State.js'; * @param {ol.SourceSourceOptions} options Source options. * @api */ -var _ol_source_Source_ = function(options) { +var Source = function(options) { _ol_Object_.call(this); @@ -52,14 +52,14 @@ var _ol_source_Source_ = function(options) { }; -inherits(_ol_source_Source_, _ol_Object_); +inherits(Source, _ol_Object_); /** * Turns the attributions option into an attributions function. * @param {ol.AttributionLike|undefined} attributionLike The attribution option. * @return {?ol.Attribution} An attribution function (or null). */ -_ol_source_Source_.prototype.adaptAttributions_ = function(attributionLike) { +Source.prototype.adaptAttributions_ = function(attributionLike) { if (!attributionLike) { return null; } @@ -89,14 +89,14 @@ _ol_source_Source_.prototype.adaptAttributions_ = function(attributionLike) { * @return {T|undefined} Callback result. * @template T */ -_ol_source_Source_.prototype.forEachFeatureAtCoordinate = nullFunction; +Source.prototype.forEachFeatureAtCoordinate = nullFunction; /** * Get the attribution function for the source. * @return {?ol.Attribution} Attribution function. */ -_ol_source_Source_.prototype.getAttributions = function() { +Source.prototype.getAttributions = function() { return this.attributions_; }; @@ -106,7 +106,7 @@ _ol_source_Source_.prototype.getAttributions = function() { * @return {ol.proj.Projection} Projection. * @api */ -_ol_source_Source_.prototype.getProjection = function() { +Source.prototype.getProjection = function() { return this.projection_; }; @@ -115,7 +115,7 @@ _ol_source_Source_.prototype.getProjection = function() { * @abstract * @return {Array.|undefined} Resolutions. */ -_ol_source_Source_.prototype.getResolutions = function() {}; +Source.prototype.getResolutions = function() {}; /** @@ -123,7 +123,7 @@ _ol_source_Source_.prototype.getResolutions = function() {}; * @return {ol.source.State} State. * @api */ -_ol_source_Source_.prototype.getState = function() { +Source.prototype.getState = function() { return this.state_; }; @@ -131,7 +131,7 @@ _ol_source_Source_.prototype.getState = function() { /** * @return {boolean|undefined} Wrap X. */ -_ol_source_Source_.prototype.getWrapX = function() { +Source.prototype.getWrapX = function() { return this.wrapX_; }; @@ -140,7 +140,7 @@ _ol_source_Source_.prototype.getWrapX = function() { * Refreshes the source and finally dispatches a 'change' event. * @api */ -_ol_source_Source_.prototype.refresh = function() { +Source.prototype.refresh = function() { this.changed(); }; @@ -152,7 +152,7 @@ _ol_source_Source_.prototype.refresh = function() { * or `undefined`. * @api */ -_ol_source_Source_.prototype.setAttributions = function(attributions) { +Source.prototype.setAttributions = function(attributions) { this.attributions_ = this.adaptAttributions_(attributions); this.changed(); }; @@ -163,8 +163,8 @@ _ol_source_Source_.prototype.setAttributions = function(attributions) { * @param {ol.source.State} state State. * @protected */ -_ol_source_Source_.prototype.setState = function(state) { +Source.prototype.setState = function(state) { this.state_ = state; this.changed(); }; -export default _ol_source_Source_; +export default Source; diff --git a/src/ol/source/Tile.js b/src/ol/source/Tile.js index b5a9138fb9..afc44f8674 100644 --- a/src/ol/source/Tile.js +++ b/src/ol/source/Tile.js @@ -7,7 +7,7 @@ import _ol_TileState_ from '../TileState.js'; import Event from '../events/Event.js'; import {equivalent} from '../proj.js'; import _ol_size_ from '../size.js'; -import _ol_source_Source_ from '../source/Source.js'; +import Source from '../source/Source.js'; import _ol_tilecoord_ from '../tilecoord.js'; import _ol_tilegrid_ from '../tilegrid.js'; @@ -25,7 +25,7 @@ import _ol_tilegrid_ from '../tilegrid.js'; */ var _ol_source_Tile_ = function(options) { - _ol_source_Source_.call(this, { + Source.call(this, { attributions: options.attributions, extent: options.extent, projection: options.projection, @@ -78,7 +78,7 @@ var _ol_source_Tile_ = function(options) { }; -inherits(_ol_source_Tile_, _ol_source_Source_); +inherits(_ol_source_Tile_, Source); /** diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index 306416d4f0..11eb1bddb9 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -16,7 +16,7 @@ import {xhr} from '../featureloader.js'; import {TRUE} from '../functions.js'; import _ol_loadingstrategy_ from '../loadingstrategy.js'; import _ol_obj_ from '../obj.js'; -import _ol_source_Source_ from '../source/Source.js'; +import Source from '../source/Source.js'; import SourceState from '../source/State.js'; import VectorEventType from '../source/VectorEventType.js'; import RBush from '../structs/RBush.js'; @@ -37,7 +37,7 @@ var _ol_source_Vector_ = function(opt_options) { var options = opt_options || {}; - _ol_source_Source_.call(this, { + Source.call(this, { attributions: options.attributions, projection: undefined, state: SourceState.READY, @@ -149,7 +149,7 @@ var _ol_source_Vector_ = function(opt_options) { }; -inherits(_ol_source_Vector_, _ol_source_Source_); +inherits(_ol_source_Vector_, Source); /** diff --git a/test/spec/ol/layer/group.test.js b/test/spec/ol/layer/group.test.js index d759e11ec7..266827b055 100644 --- a/test/spec/ol/layer/group.test.js +++ b/test/spec/ol/layer/group.test.js @@ -6,7 +6,7 @@ import _ol_layer_Group_ from '../../../../src/ol/layer/Group.js'; import _ol_layer_Layer_ from '../../../../src/ol/layer/Layer.js'; import _ol_obj_ from '../../../../src/ol/obj.js'; import _ol_renderer_Map_ from '../../../../src/ol/renderer/Map.js'; -import _ol_source_Source_ from '../../../../src/ol/source/Source.js'; +import Source from '../../../../src/ol/source/Source.js'; describe('ol.layer.Group', function() { @@ -61,7 +61,7 @@ describe('ol.layer.Group', function() { var layer, group, listener; beforeEach(function() { layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: 'EPSG:4326' }) }); @@ -100,7 +100,7 @@ describe('ol.layer.Group', function() { var layer, group, listener; beforeEach(function() { layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: 'EPSG:4326' }) }); @@ -138,7 +138,7 @@ describe('ol.layer.Group', function() { it('accepts options', function() { var layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: 'EPSG:4326' }) }); @@ -176,7 +176,7 @@ describe('ol.layer.Group', function() { it('accepts an extent option', function() { var layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: 'EPSG:4326' }) }); @@ -311,7 +311,7 @@ describe('ol.layer.Group', function() { it('sets layers property', function() { var layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: 'EPSG:4326' }) }); @@ -342,12 +342,12 @@ describe('ol.layer.Group', function() { }); var layer1 = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: 'EPSG:4326' }) }); var layer2 = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: 'EPSG:4326' }), opacity: 0.5, @@ -356,7 +356,7 @@ describe('ol.layer.Group', function() { minResolution: 0.25 }); var layer3 = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: 'EPSG:4326' }), extent: [-5, -2, 5, 2] @@ -461,14 +461,14 @@ describe('ol.layer.Group', function() { it('orders layer with higher Z-index on top', function() { var layer10 = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: 'EPSG:4326' }) }); layer10.setZIndex(10); var layerM1 = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: 'EPSG:4326' }) }); diff --git a/test/spec/ol/layer/layer.test.js b/test/spec/ol/layer/layer.test.js index 3884d773c9..6b1af6b305 100644 --- a/test/spec/ol/layer/layer.test.js +++ b/test/spec/ol/layer/layer.test.js @@ -3,7 +3,7 @@ import _ol_Map_ from '../../../../src/ol/Map.js'; import _ol_layer_Layer_ from '../../../../src/ol/layer/Layer.js'; import {get as getProjection} from '../../../../src/ol/proj.js'; import _ol_render_Event_ from '../../../../src/ol/render/Event.js'; -import _ol_source_Source_ from '../../../../src/ol/source/Source.js'; +import Source from '../../../../src/ol/source/Source.js'; describe('ol.layer.Layer', function() { @@ -14,7 +14,7 @@ describe('ol.layer.Layer', function() { beforeEach(function() { layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: getProjection('EPSG:4326') }) }); @@ -64,7 +64,7 @@ describe('ol.layer.Layer', function() { it('accepts options', function() { var layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: getProjection('EPSG:4326') }), opacity: 0.5, @@ -102,7 +102,7 @@ describe('ol.layer.Layer', function() { beforeEach(function() { layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: getProjection('EPSG:4326') }) }); @@ -152,7 +152,7 @@ describe('ol.layer.Layer', function() { beforeEach(function() { layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: getProjection('EPSG:4326') }) }); @@ -216,7 +216,7 @@ describe('ol.layer.Layer', function() { describe('#getSource', function() { it('gets the layer source', function() { - var source = new _ol_source_Source_({projection: getProjection('EPSG:4326')}); + var source = new Source({projection: getProjection('EPSG:4326')}); var layer = new _ol_layer_Layer_({source: source}); expect(layer.getSource()).to.be(source); }); @@ -228,21 +228,21 @@ describe('ol.layer.Layer', function() { it('sets the layer source', function() { var layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({projection: projection}) + source: new Source({projection: projection}) }); - var source = new _ol_source_Source_({projection: projection}); + var source = new Source({projection: projection}); layer.set('source', source); expect(layer.getSource()).to.be(source); }); it('calls changed', function() { var layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({projection: projection}) + source: new Source({projection: projection}) }); sinon.spy(layer, 'changed'); - var source = new _ol_source_Source_({projection: projection}); + var source = new Source({projection: projection}); layer.set('source', source); expect(layer.changed.calledOnce).to.be(true); }); @@ -250,13 +250,13 @@ describe('ol.layer.Layer', function() { it('sets up event listeners', function() { sinon.spy(_ol_layer_Layer_.prototype, 'handleSourceChange_'); - var first = new _ol_source_Source_({projection: projection}); + var first = new Source({projection: projection}); var layer = new _ol_layer_Layer_({source: first}); first.setState('ready'); expect(layer.handleSourceChange_.calledOnce).to.be(true); - var second = new _ol_source_Source_({projection: projection}); + var second = new Source({projection: projection}); layer.set('source', second); expect(layer.handleSourceChange_.calledOnce).to.be(true); @@ -274,21 +274,21 @@ describe('ol.layer.Layer', function() { it('sets the layer source', function() { var layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({projection: projection}) + source: new Source({projection: projection}) }); - var source = new _ol_source_Source_({projection: projection}); + var source = new Source({projection: projection}); layer.setSource(source); expect(layer.getSource()).to.be(source); }); it('calls changed', function() { var layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({projection: projection}) + source: new Source({projection: projection}) }); sinon.spy(layer, 'changed'); - var source = new _ol_source_Source_({projection: projection}); + var source = new Source({projection: projection}); layer.setSource(source); expect(layer.changed.calledOnce).to.be(true); }); @@ -296,13 +296,13 @@ describe('ol.layer.Layer', function() { it('sets up event listeners', function() { sinon.spy(_ol_layer_Layer_.prototype, 'handleSourceChange_'); - var first = new _ol_source_Source_({projection: projection}); + var first = new Source({projection: projection}); var layer = new _ol_layer_Layer_({source: first}); first.setState('ready'); expect(layer.handleSourceChange_.calledOnce).to.be(true); - var second = new _ol_source_Source_({projection: projection}); + var second = new Source({projection: projection}); layer.setSource(second); expect(layer.handleSourceChange_.calledOnce).to.be(true); @@ -322,7 +322,7 @@ describe('ol.layer.Layer', function() { beforeEach(function() { layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: getProjection('EPSG:4326') }) }); @@ -352,7 +352,7 @@ describe('ol.layer.Layer', function() { var layer; beforeEach(function() { layer = new _ol_layer_Layer_({ - source: new _ol_source_Source_({ + source: new Source({ projection: getProjection('EPSG:4326') }) }); diff --git a/test/spec/ol/source/cluster.test.js b/test/spec/ol/source/cluster.test.js index 3779597d54..0034b10990 100644 --- a/test/spec/ol/source/cluster.test.js +++ b/test/spec/ol/source/cluster.test.js @@ -4,7 +4,7 @@ import Point from '../../../../src/ol/geom/Point.js'; import Polygon from '../../../../src/ol/geom/Polygon.js'; import {get as getProjection} from '../../../../src/ol/proj.js'; import _ol_source_Cluster_ from '../../../../src/ol/source/Cluster.js'; -import _ol_source_Source_ from '../../../../src/ol/source/Source.js'; +import Source from '../../../../src/ol/source/Source.js'; import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js'; describe('ol.source.Cluster', function() { @@ -15,7 +15,7 @@ describe('ol.source.Cluster', function() { projection: getProjection('EPSG:4326'), source: new _ol_source_Vector_() }); - expect(source).to.be.a(_ol_source_Source_); + expect(source).to.be.a(Source); expect(source).to.be.a(_ol_source_Cluster_); expect(source.getDistance()).to.be(20); }); diff --git a/test/spec/ol/source/raster.test.js b/test/spec/ol/source/raster.test.js index e4a67f79d1..e2206490fb 100644 --- a/test/spec/ol/source/raster.test.js +++ b/test/spec/ol/source/raster.test.js @@ -5,7 +5,7 @@ import _ol_layer_Image_ from '../../../../src/ol/layer/Image.js'; import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js'; import _ol_source_ImageStatic_ from '../../../../src/ol/source/ImageStatic.js'; import _ol_source_Raster_ from '../../../../src/ol/source/Raster.js'; -import _ol_source_Source_ from '../../../../src/ol/source/Source.js'; +import Source from '../../../../src/ol/source/Source.js'; import _ol_source_Tile_ from '../../../../src/ol/source/Tile.js'; import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js'; @@ -94,7 +94,7 @@ where('Uint8ClampedArray').describe('ol.source.Raster', function() { threads: 0, sources: [new _ol_source_Tile_({})] }); - expect(source).to.be.a(_ol_source_Source_); + expect(source).to.be.a(Source); expect(source).to.be.a(_ol_source_Raster_); }); diff --git a/test/spec/ol/source/source.test.js b/test/spec/ol/source/source.test.js index 59004d3a9e..e76b6e0c24 100644 --- a/test/spec/ol/source/source.test.js +++ b/test/spec/ol/source/source.test.js @@ -1,27 +1,27 @@ import {get as getProjection} from '../../../../src/ol/proj.js'; -import _ol_source_Source_ from '../../../../src/ol/source/Source.js'; +import Source from '../../../../src/ol/source/Source.js'; describe('ol.source.Source', function() { describe('constructor', function() { it('returns a source', function() { - var source = new _ol_source_Source_({ + var source = new Source({ projection: getProjection('EPSG:4326') }); - expect(source).to.be.a(_ol_source_Source_); + expect(source).to.be.a(Source); }); }); describe('config option `attributions`', function() { it('accepts undefined', function() { - var source = new _ol_source_Source_({}); + var source = new Source({}); var attributions = source.getAttributions(); expect(attributions).to.be(null); }); it('accepts a single string', function() { - var source = new _ol_source_Source_({ + var source = new Source({ attributions: 'Humpty' }); var attributions = source.getAttributions(); @@ -31,7 +31,7 @@ describe('ol.source.Source', function() { }); it('accepts an array of strings', function() { - var source = new _ol_source_Source_({ + var source = new Source({ attributions: ['Humpty', 'Dumpty'] }); var attributions = source.getAttributions(); @@ -41,7 +41,7 @@ describe('ol.source.Source', function() { }); it('accepts a function that returns a string', function() { - var source = new _ol_source_Source_({ + var source = new Source({ attributions: function() { return 'Humpty'; } @@ -53,7 +53,7 @@ describe('ol.source.Source', function() { }); it('accepts a function that returns an array of strings', function() { - var source = new _ol_source_Source_({ + var source = new Source({ attributions: function() { return ['Humpty', 'Dumpty']; } @@ -67,7 +67,7 @@ describe('ol.source.Source', function() { describe('#refresh()', function() { it('dispatches the change event', function() { - var source = new _ol_source_Source_({ + var source = new Source({ projection: getProjection('EPSG:4326') }); var changedSpy = sinon.spy(); @@ -81,7 +81,7 @@ describe('ol.source.Source', function() { var source = null; beforeEach(function() { - source = new _ol_source_Source_({ + source = new Source({ attributions: 'before' }); }); diff --git a/test/spec/ol/source/tile.test.js b/test/spec/ol/source/tile.test.js index 1bdb607e5d..7b850bc1d4 100644 --- a/test/spec/ol/source/tile.test.js +++ b/test/spec/ol/source/tile.test.js @@ -3,7 +3,7 @@ import _ol_Tile_ from '../../../../src/ol/Tile.js'; import TileRange from '../../../../src/ol/TileRange.js'; import {get as getProjection} from '../../../../src/ol/proj.js'; import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js'; -import _ol_source_Source_ from '../../../../src/ol/source/Source.js'; +import Source from '../../../../src/ol/source/Source.js'; import _ol_source_Tile_ from '../../../../src/ol/source/Tile.js'; import _ol_tilecoord_ from '../../../../src/ol/tilecoord.js'; import _ol_tilegrid_TileGrid_ from '../../../../src/ol/tilegrid/TileGrid.js'; @@ -59,7 +59,7 @@ describe('ol.source.Tile', function() { var source = new _ol_source_Tile_({ projection: getProjection('EPSG:4326') }); - expect(source).to.be.a(_ol_source_Source_); + expect(source).to.be.a(Source); expect(source).to.be.a(_ol_source_Tile_); }); it('sets a custom cache size', function() { diff --git a/test/spec/ol/source/tilejson.test.js b/test/spec/ol/source/tilejson.test.js index 879f7628b2..b259d14402 100644 --- a/test/spec/ol/source/tilejson.test.js +++ b/test/spec/ol/source/tilejson.test.js @@ -1,4 +1,4 @@ -import _ol_source_Source_ from '../../../../src/ol/source/Source.js'; +import Source from '../../../../src/ol/source/Source.js'; import _ol_source_TileJSON_ from '../../../../src/ol/source/TileJSON.js'; import _ol_Observable_ from '../../../../src/ol/Observable.js'; @@ -11,7 +11,7 @@ describe('ol.source.TileJSON', function() { var source = new _ol_source_TileJSON_({ url: 'spec/ol/data/tilejson.json' }); - expect(source).to.be.a(_ol_source_Source_); + expect(source).to.be.a(Source); expect(source).to.be.a(_ol_source_TileJSON_); }); });