Rename ol/source/TileUTFGrid to ol/source/UTFGrid

This commit is contained in:
Frederic Junod
2018-06-19 09:59:42 +02:00
parent dbaf3d25fe
commit f257a8938f
8 changed files with 26 additions and 22 deletions

View File

@@ -2,6 +2,10 @@
### 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
The `defaultDataProjection` option is now named `dataProjection`. The protected property available on the class is also renamed.

View File

@@ -1,11 +1,11 @@
---
layout: example.html
title: Tiled UTFGrid
shortdesc: This example shows how to read data from a TileUTFGrid layer.
title: UTFGrid
shortdesc: This example shows how to read data from a UTFGrid source.
docs: >
<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/).
tags: "utfgrid, tileutfgrid, tilejson"
tags: "utfgrid, tilejson"
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiRk1kMWZaSSJ9.E5BkluenyWQMsBLsuByrmg
value: Your Mapbox access token from http://mapbox.com/ here

View File

@@ -3,7 +3,7 @@ import Overlay from '../src/ol/Overlay.js';
import View from '../src/ol/View.js';
import TileLayer from '../src/ol/layer/Tile.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';

View File

@@ -20,9 +20,9 @@ export {default as TileArcGISRest} from './source/TileArcGISRest.js';
export {default as TileDebug} from './source/TileDebug.js';
export {default as TileImage} from './source/TileImage.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 UrlTile} from './source/UrlTile.js';
export {default as UTFGrid} from './source/UTFGrid.js';
export {default as Vector} from './source/Vector.js';
export {default as WMTS} from './source/WMTS.js';
export {default as XYZ} from './source/XYZ.js';

View File

@@ -1,5 +1,5 @@
/**
* @module ol/source/TileUTFGrid
* @module ol/source/UTFGrid
*/
import {inherits} from '../index.js';
import Tile from '../Tile.js';
@@ -252,7 +252,7 @@ CustomTile.prototype.load = function() {
/**
* @typedef {Object} Options
* @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.
* Note that if set to `false`, you need to pass `true` as `opt_request`
* to the `forDataAtCoordinateAndResolution` method otherwise no data
@@ -272,7 +272,7 @@ CustomTile.prototype.load = function() {
*
* @constructor
* @extends {module:ol/source/Tile}
* @param {module:ol/source/TileUTFGrid~Options=} options Source options.
* @param {module:ol/source/UTFGrid~Options=} options Source options.
* @api
*/
const UTFGrid = function(options) {
@@ -384,7 +384,7 @@ UTFGrid.prototype.forDataAtCoordinateAndResolution = function(
if (this.tileGrid) {
const tileCoord = this.tileGrid.getTileCoordForCoordAndResolution(
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()));
tile.forDataAtCoordinate(coordinate, callback, null, opt_request);
} else {

View File

@@ -1,12 +1,12 @@
import {get as getProjection, transformExtent, fromLonLat} from '../../../../src/ol/proj.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';
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;
// Load and parse the UTFGrid fixture
@@ -27,7 +27,7 @@ describe('ol.source.TileUTFGrid', function() {
tileJson = null;
});
function getTileUTFGrid() {
function getUTFGrid() {
return new UTFGrid({
url: url
});
@@ -51,7 +51,7 @@ describe('ol.source.TileUTFGrid', function() {
return new UTFGrid({});
}).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() {
it('sets up a tileGrid', function() {
const source = getTileUTFGrid();
const source = getUTFGrid();
expect(source.getTileGrid()).to.be(null);
// call the handleTileJSONResponse method with our
// locally available tileJson (from `before`)
@@ -105,7 +105,7 @@ describe('ol.source.TileUTFGrid', function() {
});
it('sets up a tilegrid with expected extent', function() {
const source = getTileUTFGrid();
const source = getUTFGrid();
// call the handleTileJSONResponse method with our
// locally available tileJson (from `before`)
source.handleTileJSONResponse(tileJson);
@@ -127,7 +127,7 @@ describe('ol.source.TileUTFGrid', function() {
});
it('sets up a tilegrid with expected minZoom', function() {
const source = getTileUTFGrid();
const source = getUTFGrid();
// call the handleTileJSONResponse method with our
// locally available tileJson (from `before`)
source.handleTileJSONResponse(tileJson);
@@ -138,7 +138,7 @@ describe('ol.source.TileUTFGrid', function() {
});
it('sets up a tilegrid with expected maxZoom', function() {
const source = getTileUTFGrid();
const source = getUTFGrid();
// call the handleTileJSONResponse method with our
// locally available tileJson (from `before`)
source.handleTileJSONResponse(tileJson);
@@ -149,7 +149,7 @@ describe('ol.source.TileUTFGrid', function() {
});
it('sets up a template', function() {
const source = getTileUTFGrid();
const source = getUTFGrid();
expect(source.getTemplate()).to.be(undefined);
// call the handleTileJSONResponse method with our
@@ -162,7 +162,7 @@ describe('ol.source.TileUTFGrid', function() {
});
it('sets up correct attribution', function() {
const source = getTileUTFGrid();
const source = getUTFGrid();
expect(source.getAttributions()).to.be(null);
// call the handleTileJSONResponse method with our
@@ -175,7 +175,7 @@ describe('ol.source.TileUTFGrid', function() {
});
it('sets correct state', function() {
const source = getTileUTFGrid();
const source = getUTFGrid();
expect(source.getState()).to.be('loading');
// call the handleTileJSONResponse method with our
@@ -215,7 +215,7 @@ describe('ol.source.TileUTFGrid', function() {
});
beforeEach(function() {
source = getTileUTFGrid();
source = getUTFGrid();
// call the handleTileJSONResponse method with our
// locally available tileJson (from `before`)
source.handleTileJSONResponse(tileJson);