Support tile, image and vector layers
This commit is contained in:
@@ -113,7 +113,7 @@ inherits(RasterSourceEvent, Event);
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {Array.<module:ol/source/Source|module:ol/layer/Vector>} sources Input sources.
|
||||
* @property {Array.<module:ol/source/Source|module:ol/layer/Layer>} sources Input sources or layers.
|
||||
* @property {module:ol/source/Raster~Operation} [operation] Raster operation.
|
||||
* The operation will be called with data from input sources
|
||||
* and the output will be assigned to the raster source.
|
||||
@@ -489,7 +489,10 @@ function createRenderer(source) {
|
||||
renderer = createTileRenderer(source);
|
||||
} else if (source instanceof ImageSource) {
|
||||
renderer = createImageRenderer(source);
|
||||
} else if (source instanceof Layer && source.getType() == LayerType.VECTOR) {
|
||||
} else if (source instanceof TileLayer) {
|
||||
renderer = new CanvasTileLayerRenderer(source);
|
||||
} else if (source instanceof Layer &&
|
||||
(source.getType() == LayerType.IMAGE || source.getType() == LayerType.VECTOR)) {
|
||||
renderer = new CanvasImageLayerRenderer(source);
|
||||
}
|
||||
return renderer;
|
||||
|
||||
Reference in New Issue
Block a user