Shared module for tile layer property enum

This commit is contained in:
Tim Schaub
2016-12-27 13:38:19 -07:00
parent 9b6256613c
commit 3a77d73c02
3 changed files with 17 additions and 16 deletions

View File

@@ -2,6 +2,7 @@ goog.provide('ol.layer.Tile');
goog.require('ol'); goog.require('ol');
goog.require('ol.layer.Layer'); goog.require('ol.layer.Layer');
goog.require('ol.layer.TileProperty');
goog.require('ol.obj'); goog.require('ol.obj');
@@ -42,7 +43,7 @@ ol.inherits(ol.layer.Tile, ol.layer.Layer);
* @api * @api
*/ */
ol.layer.Tile.prototype.getPreload = function() { ol.layer.Tile.prototype.getPreload = function() {
return /** @type {number} */ (this.get(ol.layer.Tile.Property.PRELOAD)); return /** @type {number} */ (this.get(ol.layer.TileProperty.PRELOAD));
}; };
@@ -62,7 +63,7 @@ ol.layer.Tile.prototype.getSource;
* @api * @api
*/ */
ol.layer.Tile.prototype.setPreload = function(preload) { ol.layer.Tile.prototype.setPreload = function(preload) {
this.set(ol.layer.Tile.Property.PRELOAD, preload); this.set(ol.layer.TileProperty.PRELOAD, preload);
}; };
@@ -74,7 +75,7 @@ ol.layer.Tile.prototype.setPreload = function(preload) {
*/ */
ol.layer.Tile.prototype.getUseInterimTilesOnError = function() { ol.layer.Tile.prototype.getUseInterimTilesOnError = function() {
return /** @type {boolean} */ ( return /** @type {boolean} */ (
this.get(ol.layer.Tile.Property.USE_INTERIM_TILES_ON_ERROR)); this.get(ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR));
}; };
@@ -86,14 +87,5 @@ ol.layer.Tile.prototype.getUseInterimTilesOnError = function() {
*/ */
ol.layer.Tile.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) { ol.layer.Tile.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) {
this.set( this.set(
ol.layer.Tile.Property.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError); ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError);
};
/**
* @enum {string}
*/
ol.layer.Tile.Property = {
PRELOAD: 'preload',
USE_INTERIM_TILES_ON_ERROR: 'useInterimTilesOnError'
}; };

View File

@@ -0,0 +1,9 @@
goog.provide('ol.layer.TileProperty');
/**
* @enum {string}
*/
ol.layer.TileProperty = {
PRELOAD: 'preload',
USE_INTERIM_TILES_ON_ERROR: 'useInterimTilesOnError'
};

View File

@@ -2,7 +2,7 @@ goog.provide('ol.layer.VectorTile');
goog.require('ol'); goog.require('ol');
goog.require('ol.asserts'); goog.require('ol.asserts');
goog.require('ol.layer.Tile'); goog.require('ol.layer.TileProperty');
goog.require('ol.layer.Vector'); goog.require('ol.layer.Vector');
goog.require('ol.obj'); goog.require('ol.obj');
@@ -86,7 +86,7 @@ ol.layer.VectorTile.prototype.getUseInterimTilesOnError = function() {
* @api * @api
*/ */
ol.layer.VectorTile.prototype.setPreload = function(preload) { ol.layer.VectorTile.prototype.setPreload = function(preload) {
this.set(ol.layer.Tile.Property.PRELOAD, preload); this.set(ol.layer.TileProperty.PRELOAD, preload);
}; };
@@ -98,7 +98,7 @@ ol.layer.VectorTile.prototype.setPreload = function(preload) {
*/ */
ol.layer.VectorTile.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) { ol.layer.VectorTile.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) {
this.set( this.set(
ol.layer.Tile.Property.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError); ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError);
}; };