From 8c0a06b56a997391e4ce4e33e2386877cf6bfdd8 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 8 Jan 2018 13:56:25 -0700 Subject: [PATCH] Rename _ol_source_XYZ_ to XYZ --- examples/here-maps.js | 4 ++-- examples/reprojection.js | 6 +++--- examples/reusable-source.js | 4 ++-- examples/sea-level.js | 6 +++--- examples/shaded-relief.js | 4 ++-- examples/tile-transitions.js | 6 +++--- examples/vector-esri-edit.js | 4 ++-- examples/vector-esri.js | 4 ++-- examples/xyz-esri-4326-512.js | 4 ++-- examples/xyz-esri.js | 4 ++-- examples/xyz-retina.js | 4 ++-- examples/xyz.js | 4 ++-- src/ol/source/CartoDB.js | 6 +++--- src/ol/source/OSM.js | 6 +++--- src/ol/source/Stamen.js | 6 +++--- src/ol/source/XYZ.js | 6 +++--- test/rendering/ol/layer/clip.test.js | 4 ++-- test/rendering/ol/layer/tile.test.js | 14 ++++++------- test/rendering/ol/reproj/tile.test.js | 12 +++++------ test/rendering/ol/source/raster.test.js | 4 ++-- test/spec/ol/map.test.js | 10 +++++----- .../spec/ol/renderer/canvas/tilelayer.test.js | 4 ++-- test/spec/ol/renderer/layer.test.js | 4 ++-- test/spec/ol/source/cartodb.test.js | 4 ++-- test/spec/ol/source/raster.test.js | 4 ++-- test/spec/ol/source/xyz.test.js | 20 +++++++++---------- 26 files changed, 79 insertions(+), 79 deletions(-) diff --git a/examples/here-maps.js b/examples/here-maps.js index 52257d7a07..2e6406beb1 100644 --- a/examples/here-maps.js +++ b/examples/here-maps.js @@ -1,7 +1,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import TileLayer from '../src/ol/layer/Tile.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; var appId = 'kDm0Jq1K4Ak7Bwtn8uvk'; var appCode = 'xnmvc4dKZrDfGlvQHXSvwQ'; @@ -59,7 +59,7 @@ for (i = 0, ii = hereLayers.length; i < ii; ++i) { layers.push(new TileLayer({ visible: false, preload: Infinity, - source: new _ol_source_XYZ_({ + source: new XYZ({ url: createUrl(urlTpl, layerDesc), attributions: 'Map Tiles © ' + new Date().getFullYear() + ' ' + 'HERE' diff --git a/examples/reprojection.js b/examples/reprojection.js index 8541f8e852..dbdf2ee571 100644 --- a/examples/reprojection.js +++ b/examples/reprojection.js @@ -9,7 +9,7 @@ import _ol_source_OSM_ from '../src/ol/source/OSM.js'; import TileImage from '../src/ol/source/TileImage.js'; import _ol_source_TileWMS_ from '../src/ol/source/TileWMS.js'; import _ol_source_WMTS_ from '../src/ol/source/WMTS.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; import TileGrid from '../src/ol/tilegrid/TileGrid.js'; import proj4 from 'proj4'; @@ -59,7 +59,7 @@ proj54009.setExtent([-18e6, -9e6, 18e6, 9e6]); var layers = {}; layers['bng'] = new TileLayer({ - source: new _ol_source_XYZ_({ + source: new XYZ({ projection: 'EPSG:27700', url: 'https://tileserver.maptiler.com/miniscale/{z}/{x}/{y}.png', crossOrigin: '', @@ -117,7 +117,7 @@ fetch(url).then(function(response) { }); layers['grandcanyon'] = new TileLayer({ - source: new _ol_source_XYZ_({ + source: new XYZ({ url: 'https://tileserver.maptiler.com/grandcanyon@2x/{z}/{x}/{y}.png', crossOrigin: '', tilePixelRatio: 2, diff --git a/examples/reusable-source.js b/examples/reusable-source.js index 6a4bc42112..45a1cc9a01 100644 --- a/examples/reusable-source.js +++ b/examples/reusable-source.js @@ -1,7 +1,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import TileLayer from '../src/ol/layer/Tile.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; var urls = [ 'https://{a-c}.tiles.mapbox.com/v3/mapbox.blue-marble-topo-jan/{z}/{x}/{y}.png', @@ -10,7 +10,7 @@ var urls = [ 'https://{a-c}.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul/{z}/{x}/{y}.png' ]; -var source = new _ol_source_XYZ_(); +var source = new XYZ(); var map = new Map({ target: 'map', diff --git a/examples/sea-level.js b/examples/sea-level.js index 75cc88b938..ac73fcab99 100644 --- a/examples/sea-level.js +++ b/examples/sea-level.js @@ -5,7 +5,7 @@ import ImageLayer from '../src/ol/layer/Image.js'; import TileLayer from '../src/ol/layer/Tile.js'; import {fromLonLat} from '../src/ol/proj.js'; import RasterSource from '../src/ol/source/Raster.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; function flood(pixels, data) { var pixel = pixels[0]; @@ -24,7 +24,7 @@ function flood(pixels, data) { } var key = 'pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg'; -var elevation = new _ol_source_XYZ_({ +var elevation = new XYZ({ url: 'https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=' + key, crossOrigin: 'anonymous', transition: 0 @@ -39,7 +39,7 @@ var map = new Map({ target: 'map', layers: [ new TileLayer({ - source: new _ol_source_XYZ_({ + source: new XYZ({ url: 'https://api.mapbox.com/styles/v1/tschaub/ciutc102t00c62js5fqd47kqw/tiles/256/{z}/{x}/{y}?access_token=' + key }) }), diff --git a/examples/shaded-relief.js b/examples/shaded-relief.js index 3b908ee59a..4c6bb97f87 100644 --- a/examples/shaded-relief.js +++ b/examples/shaded-relief.js @@ -5,7 +5,7 @@ import ImageLayer from '../src/ol/layer/Image.js'; import TileLayer from '../src/ol/layer/Tile.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; import RasterSource from '../src/ol/source/Raster.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; /** @@ -102,7 +102,7 @@ function shade(inputs, data) { return {data: shadeData, width: width, height: height}; } -var elevation = new _ol_source_XYZ_({ +var elevation = new XYZ({ url: 'https://{a-d}.tiles.mapbox.com/v3/aj.sf-dem/{z}/{x}/{y}.png', crossOrigin: 'anonymous', transition: 0 diff --git a/examples/tile-transitions.js b/examples/tile-transitions.js index be74646943..5715978741 100644 --- a/examples/tile-transitions.js +++ b/examples/tile-transitions.js @@ -1,16 +1,16 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import TileLayer from '../src/ol/layer/Tile.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; var url = 'https://{a-c}.tiles.mapbox.com/v3/mapbox.world-bright/{z}/{x}/{y}.png'; var withTransition = new TileLayer({ - source: new _ol_source_XYZ_({url: url}) + source: new XYZ({url: url}) }); var withoutTransition = new TileLayer({ - source: new _ol_source_XYZ_({url: url, transition: 0}), + source: new XYZ({url: url, transition: 0}), visible: false }); diff --git a/examples/vector-esri-edit.js b/examples/vector-esri-edit.js index 6498d26b8e..f0e15a643d 100644 --- a/examples/vector-esri-edit.js +++ b/examples/vector-esri-edit.js @@ -10,7 +10,7 @@ import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js'; import {fromLonLat} from '../src/ol/proj.js'; import VectorSource from '../src/ol/source/Vector.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; import _ol_tilegrid_ from '../src/ol/tilegrid.js'; @@ -54,7 +54,7 @@ var vector = new VectorLayer({ }); var raster = new TileLayer({ - source: new _ol_source_XYZ_({ + source: new XYZ({ attributions: 'Tiles © ArcGIS', url: 'https://server.arcgisonline.com/ArcGIS/rest/services/' + diff --git a/examples/vector-esri.js b/examples/vector-esri.js index 4fe5305d33..c281795d51 100644 --- a/examples/vector-esri.js +++ b/examples/vector-esri.js @@ -6,7 +6,7 @@ import VectorLayer from '../src/ol/layer/Vector.js'; import _ol_loadingstrategy_ from '../src/ol/loadingstrategy.js'; import {fromLonLat} from '../src/ol/proj.js'; import VectorSource from '../src/ol/source/Vector.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; import _ol_style_Fill_ from '../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../src/ol/style/Style.js'; @@ -96,7 +96,7 @@ var vector = new VectorLayer({ }); var raster = new TileLayer({ - source: new _ol_source_XYZ_({ + source: new XYZ({ attributions: 'Tiles © ArcGIS', url: 'https://server.arcgisonline.com/ArcGIS/rest/services/' + diff --git a/examples/xyz-esri-4326-512.js b/examples/xyz-esri-4326-512.js index 1faef89d35..47d329173c 100644 --- a/examples/xyz-esri-4326-512.js +++ b/examples/xyz-esri-4326-512.js @@ -1,7 +1,7 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import TileLayer from '../src/ol/layer/Tile.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; // The tile size supported by the ArcGIS tile service. var tileSize = 512; @@ -13,7 +13,7 @@ var map = new Map({ target: 'map', layers: [ new TileLayer({ - source: new _ol_source_XYZ_({ + source: new XYZ({ attributions: 'Copyright:© 2013 ESRI, i-cubed, GeoEye', maxZoom: 16, projection: 'EPSG:4326', diff --git a/examples/xyz-esri.js b/examples/xyz-esri.js index 45e4d96032..653ef9b102 100644 --- a/examples/xyz-esri.js +++ b/examples/xyz-esri.js @@ -2,14 +2,14 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import TileLayer from '../src/ol/layer/Tile.js'; import {fromLonLat} from '../src/ol/proj.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; var map = new Map({ target: 'map', layers: [ new TileLayer({ - source: new _ol_source_XYZ_({ + source: new XYZ({ attributions: 'Tiles © ArcGIS', url: 'https://server.arcgisonline.com/ArcGIS/rest/services/' + diff --git a/examples/xyz-retina.js b/examples/xyz-retina.js index c93476b325..5537932ec7 100644 --- a/examples/xyz-retina.js +++ b/examples/xyz-retina.js @@ -3,7 +3,7 @@ import View from '../src/ol/View.js'; import TileLayer from '../src/ol/layer/Tile.js'; import {transform, transformExtent} from '../src/ol/proj.js'; import _ol_source_OSM_ from '../src/ol/source/OSM.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; var mapMinZoom = 1; var mapMaxZoom = 15; @@ -17,7 +17,7 @@ var map = new Map({ }), new TileLayer({ extent: transformExtent(mapExtent, 'EPSG:4326', 'EPSG:3857'), - source: new _ol_source_XYZ_({ + source: new XYZ({ attributions: 'Tiles © USGS, rendered with ' + 'MapTiler', url: 'https://tileserver.maptiler.com/grandcanyon@2x/{z}/{x}/{y}.png', diff --git a/examples/xyz.js b/examples/xyz.js index f61e474aad..2f06344a5a 100644 --- a/examples/xyz.js +++ b/examples/xyz.js @@ -1,14 +1,14 @@ import Map from '../src/ol/Map.js'; import View from '../src/ol/View.js'; import TileLayer from '../src/ol/layer/Tile.js'; -import _ol_source_XYZ_ from '../src/ol/source/XYZ.js'; +import XYZ from '../src/ol/source/XYZ.js'; var map = new Map({ target: 'map', layers: [ new TileLayer({ - source: new _ol_source_XYZ_({ + source: new XYZ({ url: 'https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' + '?apikey=0e6fc415256d4fbb9b5166a718591d71' }) diff --git a/src/ol/source/CartoDB.js b/src/ol/source/CartoDB.js index f8872a0e1c..46c1b8aa02 100644 --- a/src/ol/source/CartoDB.js +++ b/src/ol/source/CartoDB.js @@ -4,7 +4,7 @@ import {inherits} from '../index.js'; import _ol_obj_ from '../obj.js'; import SourceState from '../source/State.js'; -import _ol_source_XYZ_ from '../source/XYZ.js'; +import XYZ from '../source/XYZ.js'; /** * @classdesc @@ -41,7 +41,7 @@ var CartoDB = function(options) { */ this.templateCache_ = {}; - _ol_source_XYZ_.call(this, { + XYZ.call(this, { attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, @@ -54,7 +54,7 @@ var CartoDB = function(options) { this.initializeMap_(); }; -inherits(CartoDB, _ol_source_XYZ_); +inherits(CartoDB, XYZ); /** diff --git a/src/ol/source/OSM.js b/src/ol/source/OSM.js index 7654012be5..1f5c766726 100644 --- a/src/ol/source/OSM.js +++ b/src/ol/source/OSM.js @@ -2,7 +2,7 @@ * @module ol/source/OSM */ import {inherits} from '../index.js'; -import _ol_source_XYZ_ from '../source/XYZ.js'; +import XYZ from '../source/XYZ.js'; /** * @classdesc @@ -30,7 +30,7 @@ var _ol_source_OSM_ = function(opt_options) { var url = options.url !== undefined ? options.url : 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'; - _ol_source_XYZ_.call(this, { + XYZ.call(this, { attributions: attributions, cacheSize: options.cacheSize, crossOrigin: crossOrigin, @@ -44,7 +44,7 @@ var _ol_source_OSM_ = function(opt_options) { }; -inherits(_ol_source_OSM_, _ol_source_XYZ_); +inherits(_ol_source_OSM_, XYZ); /** diff --git a/src/ol/source/Stamen.js b/src/ol/source/Stamen.js index 1244ae20d4..8b72d7dc30 100644 --- a/src/ol/source/Stamen.js +++ b/src/ol/source/Stamen.js @@ -3,7 +3,7 @@ */ import {inherits} from '../index.js'; import _ol_source_OSM_ from '../source/OSM.js'; -import _ol_source_XYZ_ from '../source/XYZ.js'; +import XYZ from '../source/XYZ.js'; /** * @classdesc @@ -25,7 +25,7 @@ var _ol_source_Stamen_ = function(options) { 'https://stamen-tiles-{a-d}.a.ssl.fastly.net/' + options.layer + '/{z}/{x}/{y}.' + layerConfig.extension; - _ol_source_XYZ_.call(this, { + XYZ.call(this, { attributions: _ol_source_Stamen_.ATTRIBUTIONS, cacheSize: options.cacheSize, crossOrigin: 'anonymous', @@ -39,7 +39,7 @@ var _ol_source_Stamen_ = function(options) { }); }; -inherits(_ol_source_Stamen_, _ol_source_XYZ_); +inherits(_ol_source_Stamen_, XYZ); /** diff --git a/src/ol/source/XYZ.js b/src/ol/source/XYZ.js index 0961c2ac2e..98a41fb560 100644 --- a/src/ol/source/XYZ.js +++ b/src/ol/source/XYZ.js @@ -27,7 +27,7 @@ import _ol_tilegrid_ from '../tilegrid.js'; * @param {olx.source.XYZOptions=} opt_options XYZ options. * @api */ -var _ol_source_XYZ_ = function(opt_options) { +var XYZ = function(opt_options) { var options = opt_options || {}; var projection = options.projection !== undefined ? options.projection : 'EPSG:3857'; @@ -59,5 +59,5 @@ var _ol_source_XYZ_ = function(opt_options) { }; -inherits(_ol_source_XYZ_, TileImage); -export default _ol_source_XYZ_; +inherits(XYZ, TileImage); +export default XYZ; diff --git a/test/rendering/ol/layer/clip.test.js b/test/rendering/ol/layer/clip.test.js index 18ae355727..c620fdcb5f 100644 --- a/test/rendering/ol/layer/clip.test.js +++ b/test/rendering/ol/layer/clip.test.js @@ -2,7 +2,7 @@ import Map from '../../../../src/ol/Map.js'; import View from '../../../../src/ol/View.js'; import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js'; import TileLayer from '../../../../src/ol/layer/Tile.js'; -import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js'; +import XYZ from '../../../../src/ol/source/XYZ.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; import _ol_style_Style_ from '../../../../src/ol/style/Style.js'; @@ -55,7 +55,7 @@ describe('layer clipping', function() { it('clips to all parts of the MultiPolygon', function(done) { - var source = new _ol_source_XYZ_({ + var source = new XYZ({ url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png', transition: 0 }); diff --git a/test/rendering/ol/layer/tile.test.js b/test/rendering/ol/layer/tile.test.js index 19ffff2ac3..36ad343f77 100644 --- a/test/rendering/ol/layer/tile.test.js +++ b/test/rendering/ol/layer/tile.test.js @@ -6,7 +6,7 @@ import TileLayer from '../../../../src/ol/layer/Tile.js'; import _ol_obj_ from '../../../../src/ol/obj.js'; import {transform} from '../../../../src/ol/proj.js'; import TileImage from '../../../../src/ol/source/TileImage.js'; -import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js'; +import XYZ from '../../../../src/ol/source/XYZ.js'; import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js'; import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js'; import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js'; @@ -73,7 +73,7 @@ describe('ol.rendering.layer.Tile', function() { describe('with tile transition', function() { it('renders correctly after the transition', function(done) { createMap('canvas'); - var source = new _ol_source_XYZ_({ + var source = new XYZ({ url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png' }); waitForTiles([source], {}, function() { @@ -89,7 +89,7 @@ describe('ol.rendering.layer.Tile', function() { var source; beforeEach(function() { - source = new _ol_source_XYZ_({ + source = new XYZ({ url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png', transition: 0 }); @@ -117,11 +117,11 @@ describe('ol.rendering.layer.Tile', function() { var source1, source2; beforeEach(function() { - source1 = new _ol_source_XYZ_({ + source1 = new XYZ({ url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png', transition: 0 }); - source2 = new _ol_source_XYZ_({ + source2 = new XYZ({ url: 'rendering/ol/data/tiles/stamen-labels/{z}/{x}/{y}.png', transition: 0 }); @@ -191,7 +191,7 @@ describe('ol.rendering.layer.Tile', function() { var source; beforeEach(function() { - source = new _ol_source_XYZ_({ + source = new XYZ({ url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png', transition: 0 }); @@ -272,7 +272,7 @@ describe('ol.rendering.layer.Tile', function() { var source, onAddLayer; beforeEach(function() { - source = new _ol_source_XYZ_({ + source = new XYZ({ url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png', transition: 0 }); diff --git a/test/rendering/ol/reproj/tile.test.js b/test/rendering/ol/reproj/tile.test.js index 410df98ea5..4b27de01b0 100644 --- a/test/rendering/ol/reproj/tile.test.js +++ b/test/rendering/ol/reproj/tile.test.js @@ -2,7 +2,7 @@ import TileState from '../../../../src/ol/TileState.js'; import _ol_events_ from '../../../../src/ol/events.js'; import {get as getProjection} from '../../../../src/ol/proj.js'; import _ol_reproj_Tile_ from '../../../../src/ol/reproj/Tile.js'; -import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js'; +import XYZ from '../../../../src/ol/source/XYZ.js'; import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js'; import {register} from '../../../../src/ol/proj/proj4.js'; @@ -38,7 +38,7 @@ describe('ol.rendering.reproj.Tile', function() { describe('single tile reprojections from EPSG:3857', function() { beforeEach(function() { - source = new _ol_source_XYZ_({ + source = new XYZ({ projection: 'EPSG:3857', url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png' }); @@ -83,7 +83,7 @@ describe('ol.rendering.reproj.Tile', function() { describe('stitching several tiles from EPSG:3857', function() { beforeEach(function() { - source = new _ol_source_XYZ_({ + source = new XYZ({ projection: 'EPSG:3857', url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png' }); @@ -111,7 +111,7 @@ describe('ol.rendering.reproj.Tile', function() { describe('tile projection from EPSG:4326', function() { beforeEach(function() { - source = new _ol_source_XYZ_({ + source = new XYZ({ projection: 'EPSG:4326', maxZoom: 0, url: 'rendering/ol/data/tiles/4326/{z}/{x}/{y}.png' @@ -132,7 +132,7 @@ describe('ol.rendering.reproj.Tile', function() { describe('non-square source tiles', function() { beforeEach(function() { - source = new _ol_source_XYZ_({ + source = new XYZ({ projection: 'EPSG:3857', url: 'rendering/ol/data/tiles/osm-512x256/{z}/{x}/{y}.png', tileSize: [512, 256] @@ -153,7 +153,7 @@ describe('ol.rendering.reproj.Tile', function() { describe('dateline wrapping', function() { beforeEach(function() { - source = new _ol_source_XYZ_({ + source = new XYZ({ projection: 'EPSG:4326', maxZoom: 0, url: 'rendering/ol/data/tiles/4326/{z}/{x}/{y}.png' diff --git a/test/rendering/ol/source/raster.test.js b/test/rendering/ol/source/raster.test.js index 6283f21534..5ffe7671f2 100644 --- a/test/rendering/ol/source/raster.test.js +++ b/test/rendering/ol/source/raster.test.js @@ -2,7 +2,7 @@ import Map from '../../../../src/ol/Map.js'; import View from '../../../../src/ol/View.js'; import ImageLayer from '../../../../src/ol/layer/Image.js'; import RasterSource from '../../../../src/ol/source/Raster.js'; -import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js'; +import XYZ from '../../../../src/ol/source/XYZ.js'; where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() { @@ -50,7 +50,7 @@ where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() { it('renders the result of an operation', function(done) { createMap('canvas', 1); - var source = new _ol_source_XYZ_({ + var source = new XYZ({ url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png', transition: 0 }); diff --git a/test/spec/ol/map.test.js b/test/spec/ol/map.test.js index 2debf0da91..07b8342cf1 100644 --- a/test/spec/ol/map.test.js +++ b/test/spec/ol/map.test.js @@ -14,7 +14,7 @@ import TileLayer from '../../../src/ol/layer/Tile.js'; import VectorLayer from '../../../src/ol/layer/Vector.js'; import _ol_renderer_canvas_IntermediateCanvas_ from '../../../src/ol/renderer/canvas/IntermediateCanvas.js'; import VectorSource from '../../../src/ol/source/Vector.js'; -import _ol_source_XYZ_ from '../../../src/ol/source/XYZ.js'; +import XYZ from '../../../src/ol/source/XYZ.js'; describe('ol.Map', function() { @@ -125,7 +125,7 @@ describe('ol.Map', function() { view: view, layers: [ new TileLayer({ - source: new _ol_source_XYZ_({ + source: new XYZ({ url: '#{x}/{y}/{z}' }) }) @@ -279,13 +279,13 @@ describe('ol.Map', function() { }), layers: [ new TileLayer({ - source: new _ol_source_XYZ_() + source: new XYZ() }), new TileLayer({ - source: new _ol_source_XYZ_() + source: new XYZ() }), new TileLayer({ - source: new _ol_source_XYZ_() + source: new XYZ() }) ] }); diff --git a/test/spec/ol/renderer/canvas/tilelayer.test.js b/test/spec/ol/renderer/canvas/tilelayer.test.js index 48d36689ab..1c652a9c52 100644 --- a/test/spec/ol/renderer/canvas/tilelayer.test.js +++ b/test/spec/ol/renderer/canvas/tilelayer.test.js @@ -5,7 +5,7 @@ import {get as getProjection} from '../../../../../src/ol/proj.js'; import _ol_renderer_Map_ from '../../../../../src/ol/renderer/Map.js'; import CanvasTileLayerRenderer from '../../../../../src/ol/renderer/canvas/TileLayer.js'; import _ol_source_TileWMS_ from '../../../../../src/ol/source/TileWMS.js'; -import _ol_source_XYZ_ from '../../../../../src/ol/source/XYZ.js'; +import XYZ from '../../../../../src/ol/source/XYZ.js'; import _ol_transform_ from '../../../../../src/ol/transform.js'; @@ -71,7 +71,7 @@ describe('ol.renderer.canvas.TileLayer', function() { it('uses correct draw scale when rotating (HiDPI)', function() { var layer = new TileLayer({ - source: new _ol_source_XYZ_({ + source: new XYZ({ tileSize: 1 }) }); diff --git a/test/spec/ol/renderer/layer.test.js b/test/spec/ol/renderer/layer.test.js index 81d12fa9c0..bc1883a325 100644 --- a/test/spec/ol/renderer/layer.test.js +++ b/test/spec/ol/renderer/layer.test.js @@ -4,7 +4,7 @@ import View from '../../../../src/ol/View.js'; import _ol_layer_Layer_ from '../../../../src/ol/layer/Layer.js'; import TileLayer from '../../../../src/ol/layer/Tile.js'; import _ol_renderer_Layer_ from '../../../../src/ol/renderer/Layer.js'; -import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js'; +import XYZ from '../../../../src/ol/source/XYZ.js'; import _ol_tilecoord_ from '../../../../src/ol/tilecoord.js'; @@ -103,7 +103,7 @@ describe('ol.renderer.Layer', function() { zoom: 0 }); - source = new _ol_source_XYZ_({ + source = new XYZ({ url: '#{x}/{y}/{z}' }); diff --git a/test/spec/ol/source/cartodb.test.js b/test/spec/ol/source/cartodb.test.js index ea25dc2986..6b8ec2555a 100644 --- a/test/spec/ol/source/cartodb.test.js +++ b/test/spec/ol/source/cartodb.test.js @@ -1,5 +1,5 @@ import CartoDB from '../../../../src/ol/source/CartoDB.js'; -import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js'; +import XYZ from '../../../../src/ol/source/XYZ.js'; describe('ol.source.CartoDB', function() { @@ -9,7 +9,7 @@ describe('ol.source.CartoDB', function() { account: 'documentation', config: {} }); - expect(source).to.be.a(_ol_source_XYZ_); + expect(source).to.be.a(XYZ); expect(source).to.be.a(CartoDB); }); }); diff --git a/test/spec/ol/source/raster.test.js b/test/spec/ol/source/raster.test.js index 278eeaa56c..362cdbbbc7 100644 --- a/test/spec/ol/source/raster.test.js +++ b/test/spec/ol/source/raster.test.js @@ -7,7 +7,7 @@ import _ol_source_ImageStatic_ from '../../../../src/ol/source/ImageStatic.js'; import RasterSource from '../../../../src/ol/source/Raster.js'; import Source from '../../../../src/ol/source/Source.js'; import TileSource from '../../../../src/ol/source/Tile.js'; -import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js'; +import XYZ from '../../../../src/ol/source/XYZ.js'; var red = 'data:image/gif;base64,R0lGODlhAQABAPAAAP8AAP///yH5BAAAAAAALAAAAAA' + 'BAAEAAAICRAEAOw=='; @@ -311,7 +311,7 @@ where('Uint8ClampedArray').describe('ol.source.Raster', function() { it('is initiated on the underlying source', function(done) { - var source = new _ol_source_XYZ_({ + var source = new XYZ({ url: 'spec/ol/data/osm-{z}-{x}-{y}.png' }); diff --git a/test/spec/ol/source/xyz.test.js b/test/spec/ol/source/xyz.test.js index d77f26cfa0..23baaf9cf2 100644 --- a/test/spec/ol/source/xyz.test.js +++ b/test/spec/ol/source/xyz.test.js @@ -1,7 +1,7 @@ import TileSource from '../../../../src/ol/source/Tile.js'; import TileImage from '../../../../src/ol/source/TileImage.js'; import _ol_source_UrlTile_ from '../../../../src/ol/source/UrlTile.js'; -import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js'; +import XYZ from '../../../../src/ol/source/XYZ.js'; import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js'; @@ -10,8 +10,8 @@ describe('ol.source.XYZ', function() { describe('constructor', function() { it('can be constructed without options', function() { - var source = new _ol_source_XYZ_(); - expect(source).to.be.an(_ol_source_XYZ_); + var source = new XYZ(); + expect(source).to.be.an(XYZ); expect(source).to.be.an(TileImage); expect(source).to.be.an(_ol_source_UrlTile_); expect(source).to.be.an(TileSource); @@ -19,21 +19,21 @@ describe('ol.source.XYZ', function() { it('can be constructed with a custom tile grid', function() { var tileGrid = _ol_tilegrid_.createXYZ(); - var tileSource = new _ol_source_XYZ_({ + var tileSource = new XYZ({ tileGrid: tileGrid }); expect(tileSource.getTileGrid()).to.be(tileGrid); }); it('can be constructed with a custom tile size', function() { - var tileSource = new _ol_source_XYZ_({ + var tileSource = new XYZ({ tileSize: 512 }); expect(tileSource.getTileGrid().getTileSize(0)).to.be(512); }); it('can be constructed with a custom min zoom', function() { - var tileSource = new _ol_source_XYZ_({ + var tileSource = new XYZ({ minZoom: 2 }); expect(tileSource.getTileGrid().getMinZoom()).to.be(2); @@ -46,7 +46,7 @@ describe('ol.source.XYZ', function() { var xyzTileSource, tileGrid; beforeEach(function() { - xyzTileSource = new _ol_source_XYZ_({ + xyzTileSource = new XYZ({ maxZoom: 6, url: '{z}/{x}/{y}' }); @@ -149,7 +149,7 @@ describe('ol.source.XYZ', function() { describe('using a "url" option', function() { beforeEach(function() { sourceOptions.url = url; - source = new _ol_source_XYZ_(sourceOptions); + source = new XYZ(sourceOptions); }); it('returns the XYZ URL', function() { @@ -162,7 +162,7 @@ describe('ol.source.XYZ', function() { describe('using a "urls" option', function() { beforeEach(function() { sourceOptions.urls = ['some_xyz_url1', 'some_xyz_url2']; - source = new _ol_source_XYZ_(sourceOptions); + source = new XYZ(sourceOptions); }); it('returns the XYZ URLs', function() { @@ -177,7 +177,7 @@ describe('ol.source.XYZ', function() { sourceOptions.tileUrlFunction = function() { return 'some_xyz_url'; }; - source = new _ol_source_XYZ_(sourceOptions); + source = new XYZ(sourceOptions); }); it('returns null', function() {