Rename _ol_source_TileJSON_ to TileJSON
This commit is contained in:
@@ -9,7 +9,7 @@ import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
|||||||
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
|
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import VectorLayer from '../src/ol/layer/Vector.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 VectorSource from '../src/ol/source/Vector.js';
|
||||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||||
import _ol_style_Icon_ from '../src/ol/style/Icon.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()]),
|
interactions: defaultInteractions().extend([new app.Drag()]),
|
||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure'
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure'
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Point from '../src/ol/geom/Point.js';
|
|||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||||
import {fromLonLat} from '../src/ol/proj.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 VectorSource from '../src/ol/source/Vector.js';
|
||||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||||
@@ -57,7 +57,7 @@ var vectorLayer = new VectorLayer({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var rasterLayer = new TileLayer({
|
var rasterLayer = new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
||||||
crossOrigin: ''
|
crossOrigin: ''
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import View from '../src/ol/View.js';
|
|||||||
import Point from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import VectorLayer from '../src/ol/layer/Vector.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 VectorSource from '../src/ol/source/Vector.js';
|
||||||
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
import _ol_style_Icon_ from '../src/ol/style/Icon.js';
|
||||||
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
import _ol_style_Style_ from '../src/ol/style/Style.js';
|
||||||
@@ -38,7 +38,7 @@ var vectorLayer = new VectorLayer({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var rasterLayer = new TileLayer({
|
var rasterLayer = new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
||||||
crossOrigin: ''
|
crossOrigin: ''
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Map from '../src/ol/Map.js';
|
|||||||
import View from '../src/ol/View.js';
|
import View from '../src/ol/View.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import {transformExtent} from '../src/ol/proj.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) {
|
function transform(extent) {
|
||||||
return transformExtent(extent, 'EPSG:4326', 'EPSG:3857');
|
return transformExtent(extent, 'EPSG:4326', 'EPSG:3857');
|
||||||
@@ -16,7 +16,7 @@ var extents = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var base = new TileLayer({
|
var base = new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-light.json?secure',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-light.json?secure',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
@@ -24,7 +24,7 @@ var base = new TileLayer({
|
|||||||
|
|
||||||
var overlay = new TileLayer({
|
var overlay = new TileLayer({
|
||||||
extent: extents.India,
|
extent: extents.India,
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-black.json?secure',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-black.json?secure',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import _ol_layer_Group_ from '../src/ol/layer/Group.js';
|
|||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import {fromLonLat} from '../src/ol/proj.js';
|
import {fromLonLat} from '../src/ol/proj.js';
|
||||||
import OSM from '../src/ol/source/OSM.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({
|
var map = new Map({
|
||||||
layers: [
|
layers: [
|
||||||
@@ -13,13 +13,13 @@ var map = new Map({
|
|||||||
}), new _ol_layer_Group_({
|
}), new _ol_layer_Group_({
|
||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.20110804-hoa-foodinsecurity-3month.json?secure',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.20110804-hoa-foodinsecurity-3month.json?secure',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-borders-light.json?secure',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-borders-light.json?secure',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
|
|||||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import OSM from '../src/ol/source/OSM.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
|
maxResolution: 2000
|
||||||
}),
|
}),
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import View from '../src/ol/View.js';
|
|||||||
import _ol_coordinate_ from '../src/ol/coordinate.js';
|
import _ol_coordinate_ from '../src/ol/coordinate.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import {toLonLat} from '../src/ol/proj.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({
|
var map = new Map({
|
||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
|
|||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import {fromLonLat} from '../src/ol/proj.js';
|
import {fromLonLat} from '../src/ol/proj.js';
|
||||||
import OSM from '../src/ol/source/OSM.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({
|
var map = new Map({
|
||||||
@@ -12,7 +12,7 @@ var map = new Map({
|
|||||||
source: new OSM()
|
source: new OSM()
|
||||||
}),
|
}),
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.va-quake-aug.json?secure',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.va-quake-aug.json?secure',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
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 TileLayer from '../src/ol/layer/Tile.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 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',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-bright.json?secure',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
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 TileLayer from '../src/ol/layer/Tile.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({
|
var map = new Map({
|
||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import Map from '../src/ol/Map.js';
|
|||||||
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
import _ol_Overlay_ from '../src/ol/Overlay.js';
|
||||||
import View from '../src/ol/View.js';
|
import View from '../src/ol/View.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.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';
|
import _ol_source_TileUTFGrid_ from '../src/ol/source/TileUTFGrid.js';
|
||||||
|
|
||||||
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
var key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
||||||
|
|
||||||
var mapLayer = new TileLayer({
|
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
|
url: 'https://api.tiles.mapbox.com/v4/mapbox.geography-class.json?secure&access_token=' + key
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
|
|||||||
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
import TopoJSON from '../src/ol/format/TopoJSON.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import VectorLayer from '../src/ol/layer/Vector.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 VectorSource from '../src/ol/source/Vector.js';
|
||||||
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
import _ol_style_Fill_ from '../src/ol/style/Fill.js';
|
||||||
import _ol_style_Stroke_ from '../src/ol/style/Stroke.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({
|
var raster = new TileLayer({
|
||||||
source: new _ol_source_TileJSON_({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-dark.json?secure'
|
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-dark.json?secure'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import _ol_tilegrid_ from '../tilegrid.js';
|
|||||||
* @param {olx.source.TileJSONOptions} options TileJSON options.
|
* @param {olx.source.TileJSONOptions} options TileJSON options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_source_TileJSON_ = function(options) {
|
var TileJSON = function(options) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {TileJSON}
|
* @type {TileJSON}
|
||||||
@@ -65,14 +65,14 @@ var _ol_source_TileJSON_ = function(options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_source_TileJSON_, TileImage);
|
inherits(TileJSON, TileImage);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {Event} event The load event.
|
* @param {Event} event The load event.
|
||||||
*/
|
*/
|
||||||
_ol_source_TileJSON_.prototype.onXHRLoad_ = function(event) {
|
TileJSON.prototype.onXHRLoad_ = function(event) {
|
||||||
var client = /** @type {XMLHttpRequest} */ (event.target);
|
var client = /** @type {XMLHttpRequest} */ (event.target);
|
||||||
// status will be 0 for file:// urls
|
// status will be 0 for file:// urls
|
||||||
if (!client.status || client.status >= 200 && client.status < 300) {
|
if (!client.status || client.status >= 200 && client.status < 300) {
|
||||||
@@ -94,7 +94,7 @@ _ol_source_TileJSON_.prototype.onXHRLoad_ = function(event) {
|
|||||||
* @private
|
* @private
|
||||||
* @param {Event} event The error event.
|
* @param {Event} event The error event.
|
||||||
*/
|
*/
|
||||||
_ol_source_TileJSON_.prototype.onXHRError_ = function(event) {
|
TileJSON.prototype.onXHRError_ = function(event) {
|
||||||
this.handleTileJSONError();
|
this.handleTileJSONError();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ _ol_source_TileJSON_.prototype.onXHRError_ = function(event) {
|
|||||||
* @return {TileJSON} The tilejson object.
|
* @return {TileJSON} The tilejson object.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_source_TileJSON_.prototype.getTileJSON = function() {
|
TileJSON.prototype.getTileJSON = function() {
|
||||||
return this.tileJSON_;
|
return this.tileJSON_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ _ol_source_TileJSON_.prototype.getTileJSON = function() {
|
|||||||
* @protected
|
* @protected
|
||||||
* @param {TileJSON} tileJSON Tile JSON.
|
* @param {TileJSON} tileJSON Tile JSON.
|
||||||
*/
|
*/
|
||||||
_ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) {
|
TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {
|
||||||
|
|
||||||
var epsg4326Projection = getProjection('EPSG:4326');
|
var epsg4326Projection = getProjection('EPSG:4326');
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ _ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) {
|
|||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
_ol_source_TileJSON_.prototype.handleTileJSONError = function() {
|
TileJSON.prototype.handleTileJSONError = function() {
|
||||||
this.setState(SourceState.ERROR);
|
this.setState(SourceState.ERROR);
|
||||||
};
|
};
|
||||||
export default _ol_source_TileJSON_;
|
export default TileJSON;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 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 TileJSON from '../../../../src/ol/source/TileJSON.js';
|
||||||
import Observable from '../../../../src/ol/Observable.js';
|
import Observable from '../../../../src/ol/Observable.js';
|
||||||
|
|
||||||
|
|
||||||
@@ -8,18 +8,18 @@ describe('ol.source.TileJSON', function() {
|
|||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
|
|
||||||
it('returns a tileJSON source', function() {
|
it('returns a tileJSON source', function() {
|
||||||
var source = new _ol_source_TileJSON_({
|
var source = new TileJSON({
|
||||||
url: 'spec/ol/data/tilejson.json'
|
url: 'spec/ol/data/tilejson.json'
|
||||||
});
|
});
|
||||||
expect(source).to.be.a(Source);
|
expect(source).to.be.a(Source);
|
||||||
expect(source).to.be.a(_ol_source_TileJSON_);
|
expect(source).to.be.a(TileJSON);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#getTileJSON', function() {
|
describe('#getTileJSON', function() {
|
||||||
|
|
||||||
it('parses the tilejson file', function() {
|
it('parses the tilejson file', function() {
|
||||||
var source = new _ol_source_TileJSON_({
|
var source = new TileJSON({
|
||||||
url: 'spec/ol/data/tilejson.json'
|
url: 'spec/ol/data/tilejson.json'
|
||||||
});
|
});
|
||||||
source.on('change', function() {
|
source.on('change', function() {
|
||||||
@@ -63,7 +63,7 @@ describe('ol.source.TileJSON', function() {
|
|||||||
version: '1.0.0',
|
version: '1.0.0',
|
||||||
webpage: 'https://a.tiles.mapbox.com/v3/mapbox.geography-class/page.html'
|
webpage: 'https://a.tiles.mapbox.com/v3/mapbox.geography-class/page.html'
|
||||||
};
|
};
|
||||||
var source = new _ol_source_TileJSON_({
|
var source = new TileJSON({
|
||||||
tileJSON: tileJSON
|
tileJSON: tileJSON
|
||||||
});
|
});
|
||||||
expect(source.getState()).to.be('ready');
|
expect(source.getState()).to.be('ready');
|
||||||
@@ -74,7 +74,7 @@ describe('ol.source.TileJSON', function() {
|
|||||||
describe('#getState', function() {
|
describe('#getState', function() {
|
||||||
|
|
||||||
it('returns error on HTTP 404', function() {
|
it('returns error on HTTP 404', function() {
|
||||||
var source = new _ol_source_TileJSON_({
|
var source = new TileJSON({
|
||||||
url: 'invalid.jsonp'
|
url: 'invalid.jsonp'
|
||||||
});
|
});
|
||||||
source.on('change', function() {
|
source.on('change', function() {
|
||||||
@@ -84,7 +84,7 @@ describe('ol.source.TileJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns error on CORS issues', function() {
|
it('returns error on CORS issues', function() {
|
||||||
var source = new _ol_source_TileJSON_({
|
var source = new TileJSON({
|
||||||
url: 'http://example.com'
|
url: 'http://example.com'
|
||||||
});
|
});
|
||||||
source.on('change', function() {
|
source.on('change', function() {
|
||||||
@@ -94,7 +94,7 @@ describe('ol.source.TileJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns error on JSON parsing issues', function() {
|
it('returns error on JSON parsing issues', function() {
|
||||||
var source = new _ol_source_TileJSON_({
|
var source = new TileJSON({
|
||||||
url: '/'
|
url: '/'
|
||||||
});
|
});
|
||||||
source.on('change', function() {
|
source.on('change', function() {
|
||||||
@@ -110,7 +110,7 @@ describe('ol.source.TileJSON', function() {
|
|||||||
var source, tileGrid;
|
var source, tileGrid;
|
||||||
|
|
||||||
beforeEach(function(done) {
|
beforeEach(function(done) {
|
||||||
source = new _ol_source_TileJSON_({
|
source = new TileJSON({
|
||||||
url: 'spec/ol/data/tilejson.json'
|
url: 'spec/ol/data/tilejson.json'
|
||||||
});
|
});
|
||||||
var key = source.on('change', function() {
|
var key = source.on('change', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user