Rename ol/source/TileUTFGrid to ol/source/UTFGrid
This commit is contained in:
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
### Next release
|
### Next release
|
||||||
|
|
||||||
|
#### Renamed `ol/source/TileUTFGrid` to `ol/source/UTFGrid`
|
||||||
|
|
||||||
|
The module name is now `ol/source/UTFGrid` (`ol.source.UTFGrid` in the full build).
|
||||||
|
|
||||||
#### Renaming of the `defaultDataProjection` in the options and property of the `ol/format/Feature` class and its subclasses
|
#### Renaming of the `defaultDataProjection` in the options and property of the `ol/format/Feature` class and its subclasses
|
||||||
|
|
||||||
The `defaultDataProjection` option is now named `dataProjection`. The protected property available on the class is also renamed.
|
The `defaultDataProjection` option is now named `dataProjection`. The protected property available on the class is also renamed.
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: example.html
|
||||||
title: Tiled UTFGrid
|
title: UTFGrid
|
||||||
shortdesc: This example shows how to read data from a TileUTFGrid layer.
|
shortdesc: This example shows how to read data from a UTFGrid source.
|
||||||
docs: >
|
docs: >
|
||||||
<p>Point to a country to see its name and flag.</p>
|
<p>Point to a country to see its name and flag.</p>
|
||||||
Tiles made with [TileMill](http://tilemill.com). Hosting on MapBox.com or with open-source [TileServer](https://github.com/klokantech/tileserver-php/).
|
Tiles made with [TileMill](http://tilemill.com). Hosting on MapBox.com or with open-source [TileServer](https://github.com/klokantech/tileserver-php/).
|
||||||
tags: "utfgrid, tileutfgrid, tilejson"
|
tags: "utfgrid, tilejson"
|
||||||
cloak:
|
cloak:
|
||||||
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg
|
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg
|
||||||
value: Your Mapbox access token from http://mapbox.com/ here
|
value: Your Mapbox access token from http://mapbox.com/ here
|
||||||
@@ -3,7 +3,7 @@ import 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 TileJSON from '../src/ol/source/TileJSON.js';
|
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||||
import UTFGrid from '../src/ol/source/TileUTFGrid.js';
|
import UTFGrid from '../src/ol/source/UTFGrid.js';
|
||||||
|
|
||||||
const key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
const key = 'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg';
|
||||||
|
|
||||||
@@ -20,9 +20,9 @@ export {default as TileArcGISRest} from './source/TileArcGISRest.js';
|
|||||||
export {default as TileDebug} from './source/TileDebug.js';
|
export {default as TileDebug} from './source/TileDebug.js';
|
||||||
export {default as TileImage} from './source/TileImage.js';
|
export {default as TileImage} from './source/TileImage.js';
|
||||||
export {default as TileJSON} from './source/TileJSON.js';
|
export {default as TileJSON} from './source/TileJSON.js';
|
||||||
export {default as TileUTFGrid} from './source/TileUTFGrid.js';
|
|
||||||
export {default as TileWMS} from './source/TileWMS.js';
|
export {default as TileWMS} from './source/TileWMS.js';
|
||||||
export {default as UrlTile} from './source/UrlTile.js';
|
export {default as UrlTile} from './source/UrlTile.js';
|
||||||
|
export {default as UTFGrid} from './source/UTFGrid.js';
|
||||||
export {default as Vector} from './source/Vector.js';
|
export {default as Vector} from './source/Vector.js';
|
||||||
export {default as WMTS} from './source/WMTS.js';
|
export {default as WMTS} from './source/WMTS.js';
|
||||||
export {default as XYZ} from './source/XYZ.js';
|
export {default as XYZ} from './source/XYZ.js';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/source/TileUTFGrid
|
* @module ol/source/UTFGrid
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import Tile from '../Tile.js';
|
import Tile from '../Tile.js';
|
||||||
@@ -252,7 +252,7 @@ CustomTile.prototype.load = function() {
|
|||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {boolean} [preemptive=true]
|
* @property {boolean} [preemptive=true]
|
||||||
* If `true` the TileUTFGrid source loads the tiles based on their "visibility".
|
* If `true` the UTFGrid source loads the tiles based on their "visibility".
|
||||||
* This improves the speed of response, but increases traffic.
|
* This improves the speed of response, but increases traffic.
|
||||||
* Note that if set to `false`, you need to pass `true` as `opt_request`
|
* Note that if set to `false`, you need to pass `true` as `opt_request`
|
||||||
* to the `forDataAtCoordinateAndResolution` method otherwise no data
|
* to the `forDataAtCoordinateAndResolution` method otherwise no data
|
||||||
@@ -272,7 +272,7 @@ CustomTile.prototype.load = function() {
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {module:ol/source/Tile}
|
* @extends {module:ol/source/Tile}
|
||||||
* @param {module:ol/source/TileUTFGrid~Options=} options Source options.
|
* @param {module:ol/source/UTFGrid~Options=} options Source options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const UTFGrid = function(options) {
|
const UTFGrid = function(options) {
|
||||||
@@ -384,7 +384,7 @@ UTFGrid.prototype.forDataAtCoordinateAndResolution = function(
|
|||||||
if (this.tileGrid) {
|
if (this.tileGrid) {
|
||||||
const tileCoord = this.tileGrid.getTileCoordForCoordAndResolution(
|
const tileCoord = this.tileGrid.getTileCoordForCoordAndResolution(
|
||||||
coordinate, resolution);
|
coordinate, resolution);
|
||||||
const tile = /** @type {!module:ol/source/TileUTFGrid~CustomTile} */(this.getTile(
|
const tile = /** @type {!module:ol/source/UTFGrid~CustomTile} */(this.getTile(
|
||||||
tileCoord[0], tileCoord[1], tileCoord[2], 1, this.getProjection()));
|
tileCoord[0], tileCoord[1], tileCoord[2], 1, this.getProjection()));
|
||||||
tile.forDataAtCoordinate(coordinate, callback, null, opt_request);
|
tile.forDataAtCoordinate(coordinate, callback, null, opt_request);
|
||||||
} else {
|
} else {
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import {get as getProjection, transformExtent, fromLonLat} from '../../../../src/ol/proj.js';
|
import {get as getProjection, transformExtent, fromLonLat} from '../../../../src/ol/proj.js';
|
||||||
import TileSource from '../../../../src/ol/source/Tile.js';
|
import TileSource from '../../../../src/ol/source/Tile.js';
|
||||||
import UTFGrid, {CustomTile} from '../../../../src/ol/source/TileUTFGrid.js';
|
import UTFGrid, {CustomTile} from '../../../../src/ol/source/UTFGrid.js';
|
||||||
import TileGrid from '../../../../src/ol/tilegrid/TileGrid.js';
|
import TileGrid from '../../../../src/ol/tilegrid/TileGrid.js';
|
||||||
|
|
||||||
|
|
||||||
describe('ol.source.TileUTFGrid', function() {
|
describe('ol.source.UTFGrid', function() {
|
||||||
|
|
||||||
const url = 'spec/ol/data/tileutfgrid.json';
|
const url = 'spec/ol/data/utfgrid.json';
|
||||||
let tileJson = null;
|
let tileJson = null;
|
||||||
|
|
||||||
// Load and parse the UTFGrid fixture
|
// Load and parse the UTFGrid fixture
|
||||||
@@ -27,7 +27,7 @@ describe('ol.source.TileUTFGrid', function() {
|
|||||||
tileJson = null;
|
tileJson = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
function getTileUTFGrid() {
|
function getUTFGrid() {
|
||||||
return new UTFGrid({
|
return new UTFGrid({
|
||||||
url: url
|
url: url
|
||||||
});
|
});
|
||||||
@@ -51,7 +51,7 @@ describe('ol.source.TileUTFGrid', function() {
|
|||||||
return new UTFGrid({});
|
return new UTFGrid({});
|
||||||
}).to.throwException();
|
}).to.throwException();
|
||||||
|
|
||||||
expect(getTileUTFGrid()).to.be.an(UTFGrid);
|
expect(getUTFGrid()).to.be.an(UTFGrid);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -93,7 +93,7 @@ describe('ol.source.TileUTFGrid', function() {
|
|||||||
describe('#handleTileJSONResponse', function() {
|
describe('#handleTileJSONResponse', function() {
|
||||||
|
|
||||||
it('sets up a tileGrid', function() {
|
it('sets up a tileGrid', function() {
|
||||||
const source = getTileUTFGrid();
|
const source = getUTFGrid();
|
||||||
expect(source.getTileGrid()).to.be(null);
|
expect(source.getTileGrid()).to.be(null);
|
||||||
// call the handleTileJSONResponse method with our
|
// call the handleTileJSONResponse method with our
|
||||||
// locally available tileJson (from `before`)
|
// locally available tileJson (from `before`)
|
||||||
@@ -105,7 +105,7 @@ describe('ol.source.TileUTFGrid', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('sets up a tilegrid with expected extent', function() {
|
it('sets up a tilegrid with expected extent', function() {
|
||||||
const source = getTileUTFGrid();
|
const source = getUTFGrid();
|
||||||
// call the handleTileJSONResponse method with our
|
// call the handleTileJSONResponse method with our
|
||||||
// locally available tileJson (from `before`)
|
// locally available tileJson (from `before`)
|
||||||
source.handleTileJSONResponse(tileJson);
|
source.handleTileJSONResponse(tileJson);
|
||||||
@@ -127,7 +127,7 @@ describe('ol.source.TileUTFGrid', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('sets up a tilegrid with expected minZoom', function() {
|
it('sets up a tilegrid with expected minZoom', function() {
|
||||||
const source = getTileUTFGrid();
|
const source = getUTFGrid();
|
||||||
// call the handleTileJSONResponse method with our
|
// call the handleTileJSONResponse method with our
|
||||||
// locally available tileJson (from `before`)
|
// locally available tileJson (from `before`)
|
||||||
source.handleTileJSONResponse(tileJson);
|
source.handleTileJSONResponse(tileJson);
|
||||||
@@ -138,7 +138,7 @@ describe('ol.source.TileUTFGrid', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('sets up a tilegrid with expected maxZoom', function() {
|
it('sets up a tilegrid with expected maxZoom', function() {
|
||||||
const source = getTileUTFGrid();
|
const source = getUTFGrid();
|
||||||
// call the handleTileJSONResponse method with our
|
// call the handleTileJSONResponse method with our
|
||||||
// locally available tileJson (from `before`)
|
// locally available tileJson (from `before`)
|
||||||
source.handleTileJSONResponse(tileJson);
|
source.handleTileJSONResponse(tileJson);
|
||||||
@@ -149,7 +149,7 @@ describe('ol.source.TileUTFGrid', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('sets up a template', function() {
|
it('sets up a template', function() {
|
||||||
const source = getTileUTFGrid();
|
const source = getUTFGrid();
|
||||||
expect(source.getTemplate()).to.be(undefined);
|
expect(source.getTemplate()).to.be(undefined);
|
||||||
|
|
||||||
// call the handleTileJSONResponse method with our
|
// call the handleTileJSONResponse method with our
|
||||||
@@ -162,7 +162,7 @@ describe('ol.source.TileUTFGrid', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('sets up correct attribution', function() {
|
it('sets up correct attribution', function() {
|
||||||
const source = getTileUTFGrid();
|
const source = getUTFGrid();
|
||||||
expect(source.getAttributions()).to.be(null);
|
expect(source.getAttributions()).to.be(null);
|
||||||
|
|
||||||
// call the handleTileJSONResponse method with our
|
// call the handleTileJSONResponse method with our
|
||||||
@@ -175,7 +175,7 @@ describe('ol.source.TileUTFGrid', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('sets correct state', function() {
|
it('sets correct state', function() {
|
||||||
const source = getTileUTFGrid();
|
const source = getUTFGrid();
|
||||||
expect(source.getState()).to.be('loading');
|
expect(source.getState()).to.be('loading');
|
||||||
|
|
||||||
// call the handleTileJSONResponse method with our
|
// call the handleTileJSONResponse method with our
|
||||||
@@ -215,7 +215,7 @@ describe('ol.source.TileUTFGrid', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
source = getTileUTFGrid();
|
source = getUTFGrid();
|
||||||
// call the handleTileJSONResponse method with our
|
// call the handleTileJSONResponse method with our
|
||||||
// locally available tileJson (from `before`)
|
// locally available tileJson (from `before`)
|
||||||
source.handleTileJSONResponse(tileJson);
|
source.handleTileJSONResponse(tileJson);
|
||||||
Reference in New Issue
Block a user