This updates ESLint and our shared eslint-config-openlayers to use Prettier. Most formatting changes were automatically applied with this:
npm run lint -- --fix
A few manual changes were required:
* In `examples/offscreen-canvas.js`, the `//eslint-disable-line` comment needed to be moved to the appropriate line to disable the error about the `'worker-loader!./offscreen-canvas.worker.js'` import.
* In `examples/webpack/exapmle-builder.js`, spaces could not be added after a couple `function`s for some reason. While editing this, I reworked `ExampleBuilder` to be a class.
* In `src/ol/format/WMSGetFeatureInfo.js`, the `// @ts-ignore` comment needed to be moved down one line so it applied to the `parsersNS` argument.
36 lines
988 B
JavaScript
36 lines
988 B
JavaScript
/**
|
|
* @module ol/layer/Tile
|
|
*/
|
|
import BaseTileLayer from './BaseTile.js';
|
|
import CanvasTileLayerRenderer from '../renderer/canvas/TileLayer.js';
|
|
|
|
/**
|
|
* @classdesc
|
|
* For layer sources that provide pre-rendered, tiled images in grids that are
|
|
* organized by zoom levels for specific resolutions.
|
|
* Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}
|
|
* property on the layer object; for example, setting `title: 'My Title'` in the
|
|
* options means that `title` is observable, and has get/set accessors.
|
|
*
|
|
* @api
|
|
*/
|
|
class TileLayer extends BaseTileLayer {
|
|
/**
|
|
* @param {import("./BaseTile.js").Options=} opt_options Tile layer options.
|
|
*/
|
|
constructor(opt_options) {
|
|
super(opt_options);
|
|
}
|
|
|
|
/**
|
|
* Create a renderer for this layer.
|
|
* @return {import("../renderer/Layer.js").default} A layer renderer.
|
|
* @protected
|
|
*/
|
|
createRenderer() {
|
|
return new CanvasTileLayerRenderer(this);
|
|
}
|
|
}
|
|
|
|
export default TileLayer;
|