Transformed

This commit is contained in:
Tim Schaub
2017-12-11 16:29:33 -07:00
parent 1cdb6a66f0
commit 7f47883c48
737 changed files with 22216 additions and 21609 deletions

View File

@@ -1,14 +1,14 @@
goog.provide('ol.source.VectorTile');
goog.require('ol');
goog.require('ol.TileState');
goog.require('ol.VectorImageTile');
goog.require('ol.VectorTile');
goog.require('ol.size');
goog.require('ol.source.UrlTile');
goog.require('ol.tilecoord');
goog.require('ol.tilegrid');
/**
* @module ol/source/VectorTile
*/
import _ol_ from '../index.js';
import _ol_TileState_ from '../TileState.js';
import _ol_VectorImageTile_ from '../VectorImageTile.js';
import _ol_VectorTile_ from '../VectorTile.js';
import _ol_size_ from '../size.js';
import _ol_source_UrlTile_ from '../source/UrlTile.js';
import _ol_tilecoord_ from '../tilecoord.js';
import _ol_tilegrid_ from '../tilegrid.js';
/**
* @classdesc
@@ -26,19 +26,19 @@ goog.require('ol.tilegrid');
* @param {olx.source.VectorTileOptions} options Vector tile options.
* @api
*/
ol.source.VectorTile = function(options) {
var _ol_source_VectorTile_ = function(options) {
var projection = options.projection || 'EPSG:3857';
var extent = options.extent || ol.tilegrid.extentFromProjection(projection);
var extent = options.extent || _ol_tilegrid_.extentFromProjection(projection);
var tileGrid = options.tileGrid || ol.tilegrid.createXYZ({
var tileGrid = options.tileGrid || _ol_tilegrid_.createXYZ({
extent: extent,
maxZoom: options.maxZoom || 22,
minZoom: options.minZoom,
tileSize: options.tileSize || 512
});
ol.source.UrlTile.call(this, {
_ol_source_UrlTile_.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize !== undefined ? options.cacheSize : 128,
extent: extent,
@@ -48,7 +48,7 @@ ol.source.VectorTile = function(options) {
state: options.state,
tileGrid: tileGrid,
tileLoadFunction: options.tileLoadFunction ?
options.tileLoadFunction : ol.VectorImageTile.defaultLoadFunction,
options.tileLoadFunction : _ol_VectorImageTile_.defaultLoadFunction,
tileUrlFunction: options.tileUrlFunction,
url: options.url,
urls: options.urls,
@@ -79,7 +79,7 @@ ol.source.VectorTile = function(options) {
* @type {function(new: ol.VectorTile, ol.TileCoord, ol.TileState, string,
* ol.format.Feature, ol.TileLoadFunctionType)}
*/
this.tileClass = options.tileClass ? options.tileClass : ol.VectorTile;
this.tileClass = options.tileClass ? options.tileClass : _ol_VectorTile_;
/**
* @private
@@ -88,13 +88,14 @@ ol.source.VectorTile = function(options) {
this.tileGrids_ = {};
};
ol.inherits(ol.source.VectorTile, ol.source.UrlTile);
_ol_.inherits(_ol_source_VectorTile_, _ol_source_UrlTile_);
/**
* @return {boolean} The source can have overlapping geometries.
*/
ol.source.VectorTile.prototype.getOverlaps = function() {
_ol_source_VectorTile_.prototype.getOverlaps = function() {
return this.overlaps_;
};
@@ -102,7 +103,7 @@ ol.source.VectorTile.prototype.getOverlaps = function() {
* clear {@link ol.TileCache} and delete all source tiles
* @api
*/
ol.source.VectorTile.prototype.clear = function() {
_ol_source_VectorTile_.prototype.clear = function() {
this.tileCache.clear();
this.sourceTiles_ = {};
};
@@ -110,17 +111,17 @@ ol.source.VectorTile.prototype.clear = function() {
/**
* @inheritDoc
*/
ol.source.VectorTile.prototype.getTile = function(z, x, y, pixelRatio, projection) {
var tileCoordKey = ol.tilecoord.getKeyZXY(z, x, y);
_ol_source_VectorTile_.prototype.getTile = function(z, x, y, pixelRatio, projection) {
var tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
if (this.tileCache.containsKey(tileCoordKey)) {
return /** @type {!ol.Tile} */ (this.tileCache.get(tileCoordKey));
} else {
var tileCoord = [z, x, y];
var urlTileCoord = this.getTileCoordForTileUrlFunction(
tileCoord, projection);
var tile = new ol.VectorImageTile(
var tile = new _ol_VectorImageTile_(
tileCoord,
urlTileCoord !== null ? ol.TileState.IDLE : ol.TileState.EMPTY,
urlTileCoord !== null ? _ol_TileState_.IDLE : _ol_TileState_.EMPTY,
this.getRevision(),
this.format_, this.tileLoadFunction, urlTileCoord, this.tileUrlFunction,
this.tileGrid, this.getTileGridForProjection(projection),
@@ -137,14 +138,14 @@ ol.source.VectorTile.prototype.getTile = function(z, x, y, pixelRatio, projectio
/**
* @inheritDoc
*/
ol.source.VectorTile.prototype.getTileGridForProjection = function(projection) {
_ol_source_VectorTile_.prototype.getTileGridForProjection = function(projection) {
var code = projection.getCode();
var tileGrid = this.tileGrids_[code];
if (!tileGrid) {
// A tile grid that matches the tile size of the source tile grid is more
// likely to have 1:1 relationships between source tiles and rendered tiles.
var sourceTileGrid = this.tileGrid;
tileGrid = this.tileGrids_[code] = ol.tilegrid.createForProjection(projection, undefined,
tileGrid = this.tileGrids_[code] = _ol_tilegrid_.createForProjection(projection, undefined,
sourceTileGrid ? sourceTileGrid.getTileSize(sourceTileGrid.getMinZoom()) : undefined);
}
return tileGrid;
@@ -154,7 +155,7 @@ ol.source.VectorTile.prototype.getTileGridForProjection = function(projection) {
/**
* @inheritDoc
*/
ol.source.VectorTile.prototype.getTilePixelRatio = function(pixelRatio) {
_ol_source_VectorTile_.prototype.getTilePixelRatio = function(pixelRatio) {
return pixelRatio;
};
@@ -162,7 +163,8 @@ ol.source.VectorTile.prototype.getTilePixelRatio = function(pixelRatio) {
/**
* @inheritDoc
*/
ol.source.VectorTile.prototype.getTilePixelSize = function(z, pixelRatio, projection) {
var tileSize = ol.size.toSize(this.getTileGridForProjection(projection).getTileSize(z));
_ol_source_VectorTile_.prototype.getTilePixelSize = function(z, pixelRatio, projection) {
var tileSize = _ol_size_.toSize(this.getTileGridForProjection(projection).getTileSize(z));
return [Math.round(tileSize[0] * pixelRatio), Math.round(tileSize[1] * pixelRatio)];
};
export default _ol_source_VectorTile_;