Remove LayerType
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* @module ol/LayerType
|
||||
*/
|
||||
|
||||
/**
|
||||
* A layer type used when creating layer renderers.
|
||||
* @enum {string}
|
||||
*/
|
||||
export default {
|
||||
IMAGE: 'IMAGE',
|
||||
TILE: 'TILE',
|
||||
VECTOR_TILE: 'VECTOR_TILE',
|
||||
VECTOR: 'VECTOR'
|
||||
};
|
||||
@@ -65,21 +65,6 @@ class BaseLayer extends BaseObject {
|
||||
*/
|
||||
this.state_ = null;
|
||||
|
||||
/**
|
||||
* The layer type.
|
||||
* @type {import("../LayerType.js").default}
|
||||
* @protected;
|
||||
*/
|
||||
this.type;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the layer type (used when creating a layer renderer).
|
||||
* @return {import("../LayerType.js").default} The layer type.
|
||||
*/
|
||||
getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* @module ol/layer/BaseImage
|
||||
*/
|
||||
import LayerType from '../LayerType.js';
|
||||
import Layer from './Layer.js';
|
||||
|
||||
|
||||
@@ -46,14 +45,6 @@ class BaseImageLayer extends Layer {
|
||||
constructor(opt_options) {
|
||||
const options = opt_options ? opt_options : {};
|
||||
super(options);
|
||||
|
||||
/**
|
||||
* The layer type.
|
||||
* @protected
|
||||
* @type {import("../LayerType.js").default}
|
||||
*/
|
||||
this.type = LayerType.IMAGE;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* @module ol/layer/BaseTile
|
||||
*/
|
||||
import LayerType from '../LayerType.js';
|
||||
import Layer from './Layer.js';
|
||||
import TileProperty from './TileProperty.js';
|
||||
import {assign} from '../obj.js';
|
||||
@@ -59,13 +58,6 @@ class BaseTileLayer extends Layer {
|
||||
this.setUseInterimTilesOnError(options.useInterimTilesOnError !== undefined ?
|
||||
options.useInterimTilesOnError : true);
|
||||
|
||||
/**
|
||||
* The layer type.
|
||||
* @protected
|
||||
* @type {import("../LayerType.js").default}
|
||||
*/
|
||||
this.type = LayerType.TILE;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* @module ol/layer/BaseVector
|
||||
*/
|
||||
import LayerType from '../LayerType.js';
|
||||
import Layer from './Layer.js';
|
||||
import {assign} from '../obj.js';
|
||||
import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.js';
|
||||
@@ -123,12 +122,6 @@ class BaseVectorLayer extends Layer {
|
||||
this.updateWhileInteracting_ = options.updateWhileInteracting !== undefined ?
|
||||
options.updateWhileInteracting : false;
|
||||
|
||||
/**
|
||||
* The layer type.
|
||||
* @protected
|
||||
* @type {import("../LayerType.js").default}
|
||||
*/
|
||||
this.type = LayerType.VECTOR;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* @module ol/layer/VectorTile
|
||||
*/
|
||||
import LayerType from '../LayerType.js';
|
||||
import {assert} from '../asserts.js';
|
||||
import TileProperty from './TileProperty.js';
|
||||
import BaseVectorLayer from './BaseVector.js';
|
||||
@@ -113,12 +112,6 @@ class VectorTileLayer extends BaseVectorLayer {
|
||||
this.setUseInterimTilesOnError(options.useInterimTilesOnError !== undefined ?
|
||||
options.useInterimTilesOnError : true);
|
||||
|
||||
/**
|
||||
* The layer type.
|
||||
* @protected
|
||||
* @type {import("../LayerType.js").default}
|
||||
*/
|
||||
this.type = LayerType.VECTOR_TILE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -206,7 +206,7 @@ class MapRenderer extends Disposable {
|
||||
|
||||
const renderer = layer.getRenderer(this);
|
||||
if (!renderer) {
|
||||
throw new Error('Unable to create renderer for layer: ' + layer.getType());
|
||||
throw new Error('Unable to create renderer for layer');
|
||||
}
|
||||
|
||||
this.layerRenderers_[layerKey] = renderer;
|
||||
|
||||
Reference in New Issue
Block a user