Rename _ol_source_TileJSON_ to TileJSON

This commit is contained in:
Tim Schaub
2018-01-08 15:51:17 -07:00
parent d940b5d458
commit 57febf2712
14 changed files with 43 additions and 43 deletions

View File

@@ -9,7 +9,7 @@ import {defaults as defaultInteractions} from '../src/ol/interaction.js';
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
import TileLayer from '../src/ol/layer/Tile.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
@@ -148,7 +148,7 @@ var map = new Map({
interactions: defaultInteractions().extend([new app.Drag()]),
layers: [
new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure'
})
}),

View File

@@ -5,7 +5,7 @@ import Point from '../src/ol/geom/Point.js';
import TileLayer from '../src/ol/layer/Tile.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import {fromLonLat} from '../src/ol/proj.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
@@ -57,7 +57,7 @@ var vectorLayer = new VectorLayer({
});
var rasterLayer = new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
crossOrigin: ''
})

View File

@@ -5,7 +5,7 @@ import View from '../src/ol/View.js';
import Point from '../src/ol/geom/Point.js';
import TileLayer from '../src/ol/layer/Tile.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
import _ol_style_Style_ from '../src/ol/style/Style.js';
@@ -38,7 +38,7 @@ var vectorLayer = new VectorLayer({
});
var rasterLayer = new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
crossOrigin: ''
})

View File

@@ -2,7 +2,7 @@ import Map from '../src/ol/Map.js';
import View from '../src/ol/View.js';
import TileLayer from '../src/ol/layer/Tile.js';
import {transformExtent} from '../src/ol/proj.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
function transform(extent) {
return transformExtent(extent, 'EPSG:4326', 'EPSG:3857');
@@ -16,7 +16,7 @@ var extents = {
};
var base = new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-light.json?secure',
crossOrigin: 'anonymous'
})
@@ -24,7 +24,7 @@ var base = new TileLayer({
var overlay = new TileLayer({
extent: extents.India,
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-black.json?secure',
crossOrigin: 'anonymous'
})

View File

@@ -4,7 +4,7 @@ import _ol_layer_Group_ from '../src/ol/layer/Group.js';
import TileLayer from '../src/ol/layer/Tile.js';
import {fromLonLat} from '../src/ol/proj.js';
import OSM from '../src/ol/source/OSM.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
var map = new Map({
layers: [
@@ -13,13 +13,13 @@ var map = new Map({
}), new _ol_layer_Group_({
layers: [
new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.20110804-hoa-foodinsecurity-3month.json?secure',
crossOrigin: 'anonymous'
})
}),
new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-borders-light.json?secure',
crossOrigin: 'anonymous'
})

View File

@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
import {defaults as defaultControls} from '../src/ol/control.js';
import TileLayer from '../src/ol/layer/Tile.js';
import OSM from '../src/ol/source/OSM.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
/**
@@ -17,7 +17,7 @@ var map = new Map({
maxResolution: 2000
}),
new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
crossOrigin: 'anonymous'
}),

View File

@@ -4,7 +4,7 @@ import View from '../src/ol/View.js';
import _ol_coordinate_ from '../src/ol/coordinate.js';
import TileLayer from '../src/ol/layer/Tile.js';
import {toLonLat} from '../src/ol/proj.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
/**
@@ -44,7 +44,7 @@ closer.onclick = function() {
var map = new Map({
layers: [
new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
crossOrigin: 'anonymous'
})

View File

@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
import TileLayer from '../src/ol/layer/Tile.js';
import {fromLonLat} from '../src/ol/proj.js';
import OSM from '../src/ol/source/OSM.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
var map = new Map({
@@ -12,7 +12,7 @@ var map = new Map({
source: new OSM()
}),
new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.va-quake-aug.json?secure',
crossOrigin: 'anonymous'
})

View File

@@ -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_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
/**
@@ -77,7 +77,7 @@ Progress.prototype.hide = function() {
var progress = new Progress(document.getElementById('progress'));
var source = new _ol_source_TileJSON_({
var source = new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-bright.json?secure',
crossOrigin: 'anonymous'
});

View File

@@ -1,13 +1,13 @@
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_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
var map = new Map({
layers: [
new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
crossOrigin: 'anonymous'
})

View File

@@ -2,13 +2,13 @@ import Map from '../src/ol/Map.js';
import _ol_Overlay_ from '../src/ol/Overlay.js';
import View from '../src/ol/View.js';
import TileLayer from '../src/ol/layer/Tile.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
import _ol_source_TileUTFGrid_ from '../src/ol/source/TileUTFGrid.js';
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
var mapLayer = new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v4/mapbox.geography-class.json?secure&access_token=' + key
})
});

View File

@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
import TopoJSON from '../src/ol/format/TopoJSON.js';
import TileLayer from '../src/ol/layer/Tile.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import _ol_source_TileJSON_ from '../src/ol/source/TileJSON.js';
import TileJSON from '../src/ol/source/TileJSON.js';
import VectorSource from '../src/ol/source/Vector.js';
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
import _ol_style_Stroke_ from '../src/ol/style/Stroke.js';
@@ -11,7 +11,7 @@ import _ol_style_Style_ from '../src/ol/style/Style.js';
var raster = new TileLayer({
source: new _ol_source_TileJSON_({
source: new TileJSON({
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-dark.json?secure'
})
});

View File

@@ -26,7 +26,7 @@ import _ol_tilegrid_ from '../tilegrid.js';
* @param {olx.source.TileJSONOptions} options TileJSON options.
* @api
*/
var _ol_source_TileJSON_ = function(options) {
var TileJSON = function(options) {
/**
* @type {TileJSON}
@@ -65,14 +65,14 @@ var _ol_source_TileJSON_ = function(options) {
};
inherits(_ol_source_TileJSON_, TileImage);
inherits(TileJSON, TileImage);
/**
* @private
* @param {Event} event The load event.
*/
_ol_source_TileJSON_.prototype.onXHRLoad_ = function(event) {
TileJSON.prototype.onXHRLoad_ = function(event) {
var client = /** @type {XMLHttpRequest} */ (event.target);
// status will be 0 for file:// urls
if (!client.status || client.status >= 200 && client.status < 300) {
@@ -94,7 +94,7 @@ _ol_source_TileJSON_.prototype.onXHRLoad_ = function(event) {
* @private
* @param {Event} event The error event.
*/
_ol_source_TileJSON_.prototype.onXHRError_ = function(event) {
TileJSON.prototype.onXHRError_ = function(event) {
this.handleTileJSONError();
};
@@ -103,7 +103,7 @@ _ol_source_TileJSON_.prototype.onXHRError_ = function(event) {
* @return {TileJSON} The tilejson object.
* @api
*/
_ol_source_TileJSON_.prototype.getTileJSON = function() {
TileJSON.prototype.getTileJSON = function() {
return this.tileJSON_;
};
@@ -112,7 +112,7 @@ _ol_source_TileJSON_.prototype.getTileJSON = function() {
* @protected
* @param {TileJSON} tileJSON Tile JSON.
*/
_ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) {
TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {
var epsg4326Projection = getProjection('EPSG:4326');
@@ -156,7 +156,7 @@ _ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) {
/**
* @protected
*/
_ol_source_TileJSON_.prototype.handleTileJSONError = function() {
TileJSON.prototype.handleTileJSONError = function() {
this.setState(SourceState.ERROR);
};
export default _ol_source_TileJSON_;
export default TileJSON;

View File

@@ -1,5 +1,5 @@
import Source from '../../../../src/ol/source/Source.js';
import _ol_source_TileJSON_ from '../../../../src/ol/source/TileJSON.js';
import TileJSON from '../../../../src/ol/source/TileJSON.js';
import Observable from '../../../../src/ol/Observable.js';
@@ -8,18 +8,18 @@ describe('ol.source.TileJSON', function() {
describe('constructor', function() {
it('returns a tileJSON source', function() {
var source = new _ol_source_TileJSON_({
var source = new TileJSON({
url: 'spec/ol/data/tilejson.json'
});
expect(source).to.be.a(Source);
expect(source).to.be.a(_ol_source_TileJSON_);
expect(source).to.be.a(TileJSON);
});
});
describe('#getTileJSON', function() {
it('parses the tilejson file', function() {
var source = new _ol_source_TileJSON_({
var source = new TileJSON({
url: 'spec/ol/data/tilejson.json'
});
source.on('change', function() {
@@ -63,7 +63,7 @@ describe('ol.source.TileJSON', function() {
version: '1.0.0',
webpage: 'https://a.tiles.mapbox.com/v3/mapbox.geography-class/page.html'
};
var source = new _ol_source_TileJSON_({
var source = new TileJSON({
tileJSON: tileJSON
});
expect(source.getState()).to.be('ready');
@@ -74,7 +74,7 @@ describe('ol.source.TileJSON', function() {
describe('#getState', function() {
it('returns error on HTTP 404', function() {
var source = new _ol_source_TileJSON_({
var source = new TileJSON({
url: 'invalid.jsonp'
});
source.on('change', function() {
@@ -84,7 +84,7 @@ describe('ol.source.TileJSON', function() {
});
it('returns error on CORS issues', function() {
var source = new _ol_source_TileJSON_({
var source = new TileJSON({
url: 'http://example.com'
});
source.on('change', function() {
@@ -94,7 +94,7 @@ describe('ol.source.TileJSON', function() {
});
it('returns error on JSON parsing issues', function() {
var source = new _ol_source_TileJSON_({
var source = new TileJSON({
url: '/'
});
source.on('change', function() {
@@ -110,7 +110,7 @@ describe('ol.source.TileJSON', function() {
var source, tileGrid;
beforeEach(function(done) {
source = new _ol_source_TileJSON_({
source = new TileJSON({
url: 'spec/ol/data/tilejson.json'
});
var key = source.on('change', function() {