Remove PluggableMap
This commit is contained in:
@@ -22,6 +22,10 @@ Inserting with `setAt` or `insertAt` beyond the current length used to create a
|
||||
|
||||
The control will now by default keep displaying the last mouse position when the mouse leaves the viewport. With `placeholder: ' '` you can keep the old behaviour. The `placeholder` option no longer accepts `false` as a valid value, instead simply omit the option. The `undefinedHTML` option has been removed. You should use `placeholder` instead.
|
||||
|
||||
#### ol/PluggableMap
|
||||
|
||||
The `PluggableMap` class has been removed. If you want to create a custom map class, extend the `Map` class instead.
|
||||
|
||||
### 6.15.0
|
||||
|
||||
#### Deprecated `tilePixelRatio` option for data tile sources.
|
||||
|
||||
1766
src/ol/Map.js
1766
src/ol/Map.js
File diff suppressed because it is too large
Load Diff
@@ -6,16 +6,16 @@ import MapEvent from './MapEvent.js';
|
||||
/**
|
||||
* @classdesc
|
||||
* Events emitted as map browser events are instances of this type.
|
||||
* See {@link module:ol/PluggableMap~PluggableMap} for which events trigger a map browser event.
|
||||
* See {@link module:ol/Map~Map} for which events trigger a map browser event.
|
||||
* @template {UIEvent} EVENT
|
||||
*/
|
||||
class MapBrowserEvent extends MapEvent {
|
||||
/**
|
||||
* @param {string} type Event type.
|
||||
* @param {import("./PluggableMap.js").default} map Map.
|
||||
* @param {import("./Map.js").default} map Map.
|
||||
* @param {EVENT} originalEvent Original event.
|
||||
* @param {boolean} [opt_dragging] Is the map currently being dragged?
|
||||
* @param {import("./PluggableMap.js").FrameState} [opt_frameState] Frame state.
|
||||
* @param {import("./Map.js").FrameState} [opt_frameState] Frame state.
|
||||
* @param {Array<PointerEvent>} [opt_activePointers] Active pointers.
|
||||
*/
|
||||
constructor(
|
||||
|
||||
@@ -13,7 +13,7 @@ import {listen, unlistenByKey} from './events.js';
|
||||
|
||||
class MapBrowserEventHandler extends Target {
|
||||
/**
|
||||
* @param {import("./PluggableMap.js").default} map The map with the viewport to listen to events on.
|
||||
* @param {import("./Map.js").default} map The map with the viewport to listen to events on.
|
||||
* @param {number} [moveTolerance] The minimal distance the pointer must travel to trigger a move.
|
||||
*/
|
||||
constructor(map, moveTolerance) {
|
||||
@@ -21,7 +21,7 @@ class MapBrowserEventHandler extends Target {
|
||||
|
||||
/**
|
||||
* This is the element that we will listen to the real events on.
|
||||
* @type {import("./PluggableMap.js").default}
|
||||
* @type {import("./Map.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.map_ = map;
|
||||
|
||||
@@ -6,27 +6,27 @@ import Event from './events/Event.js';
|
||||
/**
|
||||
* @classdesc
|
||||
* Events emitted as map events are instances of this type.
|
||||
* See {@link module:ol/PluggableMap~PluggableMap} for which events trigger a map event.
|
||||
* See {@link module:ol/Map~Map} for which events trigger a map event.
|
||||
*/
|
||||
class MapEvent extends Event {
|
||||
/**
|
||||
* @param {string} type Event type.
|
||||
* @param {import("./PluggableMap.js").default} map Map.
|
||||
* @param {?import("./PluggableMap.js").FrameState} [opt_frameState] Frame state.
|
||||
* @param {import("./Map.js").default} map Map.
|
||||
* @param {?import("./Map.js").FrameState} [opt_frameState] Frame state.
|
||||
*/
|
||||
constructor(type, map, opt_frameState) {
|
||||
super(type);
|
||||
|
||||
/**
|
||||
* The map where the event occurred.
|
||||
* @type {import("./PluggableMap.js").default}
|
||||
* @type {import("./Map.js").default}
|
||||
* @api
|
||||
*/
|
||||
this.map = map;
|
||||
|
||||
/**
|
||||
* The frame state at the time of the event.
|
||||
* @type {?import("./PluggableMap.js").FrameState}
|
||||
* @type {?import("./Map.js").FrameState}
|
||||
* @api
|
||||
*/
|
||||
this.frameState = opt_frameState !== undefined ? opt_frameState : null;
|
||||
|
||||
@@ -229,13 +229,13 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the map associated with this overlay.
|
||||
* @return {import("./PluggableMap.js").default|null} The map that the
|
||||
* @return {import("./Map.js").default|null} The map that the
|
||||
* overlay is part of.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getMap() {
|
||||
return /** @type {import("./PluggableMap.js").default|null} */ (
|
||||
return /** @type {import("./Map.js").default|null} */ (
|
||||
this.get(Property.MAP) || null
|
||||
);
|
||||
}
|
||||
@@ -356,7 +356,7 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* Set the map to be associated with this overlay.
|
||||
* @param {import("./PluggableMap.js").default|null} map The map that the
|
||||
* @param {import("./Map.js").default|null} map The map that the
|
||||
* overlay is part of. Pass `null` to just remove the overlay from the current map.
|
||||
* @observable
|
||||
* @api
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -126,7 +126,7 @@ class TileQueue extends PriorityQueue {
|
||||
export default TileQueue;
|
||||
|
||||
/**
|
||||
* @param {import('./PluggableMap.js').FrameState} frameState Frame state.
|
||||
* @param {import('./Map.js').FrameState} frameState Frame state.
|
||||
* @param {import("./Tile.js").default} tile Tile.
|
||||
* @param {string} tileSourceKey Tile source key.
|
||||
* @param {import("./coordinate.js").Coordinate} tileCenter Tile center.
|
||||
|
||||
@@ -186,7 +186,7 @@ class Attribution extends Control {
|
||||
|
||||
/**
|
||||
* Collect a list of visible attributions and set the collapsible state.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
* @return {Array<string>} Attributions.
|
||||
* @private
|
||||
*/
|
||||
@@ -253,7 +253,7 @@ class Attribution extends Control {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {?import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {?import("../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
updateElement_(frameState) {
|
||||
if (!frameState) {
|
||||
|
||||
@@ -69,7 +69,7 @@ class Control extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {import("../PluggableMap.js").default|null}
|
||||
* @type {import("../Map.js").default|null}
|
||||
*/
|
||||
this.map_ = null;
|
||||
|
||||
@@ -98,7 +98,7 @@ class Control extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the map associated with this control.
|
||||
* @return {import("../PluggableMap.js").default|null} Map.
|
||||
* @return {import("../Map.js").default|null} Map.
|
||||
* @api
|
||||
*/
|
||||
getMap() {
|
||||
@@ -110,7 +110,7 @@ class Control extends BaseObject {
|
||||
* Pass `null` to just remove the control from the current map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
* @api
|
||||
*/
|
||||
setMap(map) {
|
||||
|
||||
@@ -285,7 +285,7 @@ class FullScreen extends Control {
|
||||
* Pass `null` to just remove the control from the current map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
* @api
|
||||
*/
|
||||
setMap(map) {
|
||||
|
||||
@@ -188,7 +188,7 @@ class MousePosition extends Control {
|
||||
* Pass `null` to just remove the control from the current map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
* @api
|
||||
*/
|
||||
setMap(map) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* @module ol/control/OverviewMap
|
||||
*/
|
||||
import CompositeMapRenderer from '../renderer/Composite.js';
|
||||
import Collection from '../Collection.js';
|
||||
import Control from './Control.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import Map from '../Map.js';
|
||||
import MapEventType from '../MapEventType.js';
|
||||
import MapProperty from '../MapProperty.js';
|
||||
import ObjectEventType from '../ObjectEventType.js';
|
||||
import Overlay from '../Overlay.js';
|
||||
import PluggableMap from '../PluggableMap.js';
|
||||
import View from '../View.js';
|
||||
import ViewProperty from '../ViewProperty.js';
|
||||
import {CLASS_COLLAPSED, CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
|
||||
@@ -37,12 +37,6 @@ const MAX_RATIO = 0.75;
|
||||
*/
|
||||
const MIN_RATIO = 0.1;
|
||||
|
||||
class ControlledMap extends PluggableMap {
|
||||
createRenderer() {
|
||||
return new CompositeMapRenderer(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {string} [className='ol-overviewmap'] CSS class name.
|
||||
@@ -179,14 +173,17 @@ class OverviewMap extends Control {
|
||||
*/
|
||||
this.view_ = options.view;
|
||||
|
||||
const ovmap = new Map({
|
||||
view: options.view,
|
||||
controls: new Collection(),
|
||||
interactions: new Collection(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @type {ControlledMap}
|
||||
* @type {Map}
|
||||
* @private
|
||||
*/
|
||||
this.ovmap_ = new ControlledMap({
|
||||
view: options.view,
|
||||
});
|
||||
const ovmap = this.ovmap_;
|
||||
this.ovmap_ = ovmap;
|
||||
|
||||
if (options.layers) {
|
||||
options.layers.forEach(function (layer) {
|
||||
@@ -269,7 +266,7 @@ class OverviewMap extends Control {
|
||||
* Pass `null` to just remove the control from the current map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
* @api
|
||||
*/
|
||||
setMap(map) {
|
||||
@@ -661,7 +658,7 @@ class OverviewMap extends Control {
|
||||
|
||||
/**
|
||||
* Return the overview map.
|
||||
* @return {import("../PluggableMap.js").default} Overview map.
|
||||
* @return {import("../Map.js").default} Overview map.
|
||||
* @api
|
||||
*/
|
||||
getOverviewMap() {
|
||||
|
||||
@@ -164,7 +164,7 @@ class ZoomSlider extends Control {
|
||||
* Pass `null` to just remove the control from the current map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
* @api
|
||||
*/
|
||||
setMap(map) {
|
||||
|
||||
@@ -20,7 +20,6 @@ export {default as MapEvent} from './MapEvent.js';
|
||||
export {default as Object} from './Object.js';
|
||||
export {default as Observable} from './Observable.js';
|
||||
export {default as Overlay} from './Overlay.js';
|
||||
export {default as PluggableMap} from './PluggableMap.js';
|
||||
export {default as Tile} from './Tile.js';
|
||||
export {default as TileCache} from './TileCache.js';
|
||||
export {default as TileQueue} from './TileQueue.js';
|
||||
|
||||
@@ -254,7 +254,7 @@ class DragAndDrop extends Interaction {
|
||||
* Remove the interaction from its current map and attach it to the new map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
*/
|
||||
setMap(map) {
|
||||
this.unregisterListeners_();
|
||||
|
||||
@@ -521,7 +521,7 @@ class Draw extends PointerInteraction {
|
||||
* Remove the interaction from its current map and attach it to the new map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
*/
|
||||
setMap(map) {
|
||||
super.setMap(map);
|
||||
|
||||
@@ -211,7 +211,7 @@ class Extent extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* @param {import("../pixel.js").Pixel} pixel cursor location
|
||||
* @param {import("../PluggableMap.js").default} map map
|
||||
* @param {import("../Map.js").default} map map
|
||||
* @return {import("../coordinate.js").Coordinate|null} snapped vertex on extent
|
||||
* @private
|
||||
*/
|
||||
@@ -424,7 +424,7 @@ class Extent extends PointerInteraction {
|
||||
* Remove the interaction from its current map and attach it to the new map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
*/
|
||||
setMap(map) {
|
||||
this.extentOverlay_.setMap(map);
|
||||
|
||||
@@ -66,7 +66,7 @@ class Interaction extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {import("../PluggableMap.js").default|null}
|
||||
* @type {import("../Map.js").default|null}
|
||||
*/
|
||||
this.map_ = null;
|
||||
|
||||
@@ -85,7 +85,7 @@ class Interaction extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the map associated with this interaction.
|
||||
* @return {import("../PluggableMap.js").default|null} Map.
|
||||
* @return {import("../Map.js").default|null} Map.
|
||||
* @api
|
||||
*/
|
||||
getMap() {
|
||||
@@ -116,7 +116,7 @@ class Interaction extends BaseObject {
|
||||
* Remove the interaction from its current map and attach it to the new map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
*/
|
||||
setMap(map) {
|
||||
this.map_ = map;
|
||||
|
||||
@@ -164,7 +164,7 @@ class Link extends Interaction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
*/
|
||||
setMap(map) {
|
||||
const oldMap = this.getMap();
|
||||
@@ -183,7 +183,7 @@ class Link extends Interaction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
* @private
|
||||
*/
|
||||
registerListeners_(map) {
|
||||
@@ -199,7 +199,7 @@ class Link extends Interaction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
* @private
|
||||
*/
|
||||
unregisterListeners_(map) {
|
||||
|
||||
@@ -538,7 +538,7 @@ class Modify extends PointerInteraction {
|
||||
* Remove the interaction from its current map and attach it to the new map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
*/
|
||||
setMap(map) {
|
||||
this.overlay_.setMap(map);
|
||||
@@ -1158,7 +1158,7 @@ class Modify extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* @param {import("../pixel.js").Pixel} pixel Pixel
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
* @param {import("../coordinate.js").Coordinate} [opt_coordinate] The pixel Coordinate.
|
||||
* @private
|
||||
*/
|
||||
|
||||
@@ -254,7 +254,7 @@ class MouseWheelZoom extends Interaction {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
*/
|
||||
handleWheelZoom_(map) {
|
||||
const view = map.getView();
|
||||
|
||||
@@ -332,7 +332,7 @@ class Select extends Interaction {
|
||||
/**
|
||||
* Remove the interaction from its current map, if any, and attach it to a new
|
||||
* map, if any. Pass `null` to just remove the interaction from the current map.
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
* @api
|
||||
*/
|
||||
setMap(map) {
|
||||
|
||||
@@ -368,7 +368,7 @@ class Snap extends PointerInteraction {
|
||||
* Remove the interaction from its current map and attach it to the new map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
*/
|
||||
setMap(map) {
|
||||
const currentMap = this.getMap();
|
||||
@@ -423,7 +423,7 @@ class Snap extends PointerInteraction {
|
||||
/**
|
||||
* @param {import("../pixel.js").Pixel} pixel Pixel
|
||||
* @param {import("../coordinate.js").Coordinate} pixelCoordinate Coordinate
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
* @return {Result|null} Snap result
|
||||
*/
|
||||
snapTo(pixel, pixelCoordinate, map) {
|
||||
|
||||
@@ -336,7 +336,7 @@ class Translate extends PointerInteraction {
|
||||
* Tests to see if the given coordinates intersects any of our selected
|
||||
* features.
|
||||
* @param {import("../pixel.js").Pixel} pixel Pixel coordinate to test for intersection.
|
||||
* @param {import("../PluggableMap.js").default} map Map to test the intersection on.
|
||||
* @param {import("../Map.js").default} map Map to test the intersection on.
|
||||
* @return {import("../Feature.js").default} Returns the feature found at the specified pixel
|
||||
* coordinates.
|
||||
* @private
|
||||
@@ -381,7 +381,7 @@ class Translate extends PointerInteraction {
|
||||
* Remove the interaction from its current map and attach it to the new map.
|
||||
* Subclasses may set up event handlers to get notified about changes to
|
||||
* the map here.
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
*/
|
||||
setMap(map) {
|
||||
const oldMap = this.getMap();
|
||||
@@ -397,7 +397,7 @@ class Translate extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../PluggableMap.js").default} oldMap Old map.
|
||||
* @param {import("../Map.js").default} oldMap Old map.
|
||||
* @private
|
||||
*/
|
||||
updateState_(oldMap) {
|
||||
|
||||
@@ -23,10 +23,10 @@ import Layer from './Layer.js';
|
||||
* visible.
|
||||
* @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will
|
||||
* be visible.
|
||||
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* @property {import("../Map.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link import("../PluggableMap.js").default#addLayer map.addLayer()}.
|
||||
* use {@link import("../Map.js").default#addLayer map.addLayer()}.
|
||||
* @property {ImageSourceType} [source] Source for this layer.
|
||||
* @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.
|
||||
*/
|
||||
|
||||
@@ -37,10 +37,10 @@ import TileProperty from './TileProperty.js';
|
||||
* @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0`
|
||||
* means no preloading.
|
||||
* @property {TileSourceType} [source] Source for this layer.
|
||||
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* @property {import("../Map.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link import("../PluggableMap.js").default#addLayer map.addLayer()}.
|
||||
* use {@link import("../Map.js").default#addLayer map.addLayer()}.
|
||||
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
|
||||
* @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.
|
||||
*/
|
||||
|
||||
@@ -36,10 +36,10 @@ import {toStyle} from '../style/flat.js';
|
||||
* renderer when getting features from the vector source for the rendering or hit-detection.
|
||||
* Recommended value: the size of the largest symbol, line width or label.
|
||||
* @property {VectorSourceType} [source] Source.
|
||||
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* @property {import("../Map.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link import("../PluggableMap.js").default#addLayer map.addLayer()}.
|
||||
* use [map.addLayer()]{@link import("../Map.js").default#addLayer}.
|
||||
* @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all
|
||||
* image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority
|
||||
* is defined by the z-index of the layer, the `zIndex` of the style and the render order of features.
|
||||
@@ -161,8 +161,8 @@ class BaseVectorLayer extends Layer {
|
||||
* when a hit was detected, or it will be empty.
|
||||
*
|
||||
* The hit detection algorithm used for this method is optimized for performance, but is less
|
||||
* accurate than the one used in {@link import("../PluggableMap.js").default#getFeaturesAtPixel}: Text
|
||||
* is not considered, and icons are only represented by their bounding box instead of the exact
|
||||
* accurate than the one used in [map.getFeaturesAtPixel()]{@link import("../Map.js").default#getFeaturesAtPixel}.
|
||||
* Text is not considered, and icons are only represented by their bounding box instead of the exact
|
||||
* image.
|
||||
*
|
||||
* @param {import("../pixel.js").Pixel} pixel Pixel.
|
||||
@@ -227,7 +227,7 @@ class BaseVectorLayer extends Layer {
|
||||
|
||||
/**
|
||||
* Render declutter items for this layer
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
renderDeclutter(frameState) {
|
||||
if (!frameState.declutterTree) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import {assert} from '../asserts.js';
|
||||
import {listen, unlistenByKey} from '../events.js';
|
||||
|
||||
/**
|
||||
* @typedef {function(import("../PluggableMap.js").FrameState):HTMLElement} RenderFunction
|
||||
* @typedef {function(import("../Map.js").FrameState):HTMLElement} RenderFunction
|
||||
*/
|
||||
|
||||
/***
|
||||
@@ -45,7 +45,7 @@ import {listen, unlistenByKey} from '../events.js';
|
||||
* @property {SourceType} [source] Source for this layer. If not provided to the constructor,
|
||||
* the source can be set by calling {@link module:ol/layer/Layer~Layer#setSource layer.setSource(source)} after
|
||||
* construction.
|
||||
* @property {import("../PluggableMap.js").default|null} [map] Map.
|
||||
* @property {import("../Map.js").default|null} [map] Map.
|
||||
* @property {RenderFunction} [render] Render function. Takes the frame state as input and is expected to return an
|
||||
* HTML element. Will overwrite the default rendering for the layer.
|
||||
* @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.
|
||||
@@ -75,10 +75,10 @@ import {listen, unlistenByKey} from '../events.js';
|
||||
* Layers group together those properties that pertain to how the data is to be
|
||||
* displayed, irrespective of the source of that data.
|
||||
*
|
||||
* Layers are usually added to a map with {@link import("../PluggableMap.js").default#addLayer map.addLayer()}. Components
|
||||
* like {@link module:ol/interaction/Draw~Draw} use unmanaged layers
|
||||
* Layers are usually added to a map with [map.addLayer()]{@link import("../Map.js").default#addLayer}.
|
||||
* Components like {@link module:ol/interaction/Draw~Draw} use unmanaged layers
|
||||
* internally. These unmanaged layers are associated with the map using
|
||||
* {@link module:ol/layer/Layer~Layer#setMap} instead.
|
||||
* [layer.setMap()]{@link module:ol/layer/Layer~Layer#setMap} instead.
|
||||
*
|
||||
* A generic `change` event is fired when the state of the source changes.
|
||||
*
|
||||
@@ -262,7 +262,7 @@ class Layer extends BaseLayer {
|
||||
/**
|
||||
* In charge to manage the rendering of the layer. One layer type is
|
||||
* bounded with one layer renderer.
|
||||
* @param {?import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {?import("../Map.js").FrameState} frameState Frame state.
|
||||
* @param {HTMLElement} target Target which the renderer may (but need not) use
|
||||
* for rendering its content.
|
||||
* @return {HTMLElement} The rendered element.
|
||||
@@ -285,7 +285,7 @@ class Layer extends BaseLayer {
|
||||
|
||||
/**
|
||||
* For use inside the library only.
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
*/
|
||||
setMapInternal(map) {
|
||||
if (!map) {
|
||||
@@ -296,7 +296,7 @@ class Layer extends BaseLayer {
|
||||
|
||||
/**
|
||||
* For use inside the library only.
|
||||
* @return {import("../PluggableMap.js").default|null} Map.
|
||||
* @return {import("../Map.js").default|null} Map.
|
||||
*/
|
||||
getMapInternal() {
|
||||
return this.get(LayerProperty.MAP);
|
||||
@@ -310,7 +310,7 @@ class Layer extends BaseLayer {
|
||||
*
|
||||
* To add the layer to a map and have it managed by the map, use
|
||||
* {@link module:ol/Map~Map#addLayer} instead.
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
* @api
|
||||
*/
|
||||
setMap(map) {
|
||||
|
||||
@@ -88,10 +88,10 @@ class ErrorEvent extends BaseEvent {
|
||||
* * `'vector'`: Everything is rendered as vectors. Use this mode for improved performance on vector
|
||||
* tile layers with only a few rendered features (e.g. for highlighting a subset of features of
|
||||
* another layer with the same source).
|
||||
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* @property {import("../Map.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link import("../PluggableMap.js").default#addLayer map.addLayer()}.
|
||||
* use [map.addLayer()]{@link import("../Map.js").default#addLayer}.
|
||||
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
|
||||
* recreated during animations. This means that no vectors will be shown clipped, but the setting
|
||||
* will have a performance impact for large amounts of vector data. When set to `false`, batches
|
||||
|
||||
@@ -31,10 +31,10 @@ import CanvasVectorImageLayerRenderer from '../renderer/canvas/VectorImageLayer.
|
||||
* renderer when getting features from the vector source for the rendering or hit-detection.
|
||||
* Recommended value: the size of the largest symbol, line width or label.
|
||||
* @property {VectorSourceType} [source] Source.
|
||||
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* @property {import("../Map.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link import("../PluggableMap.js").default#addLayer map.addLayer()}.
|
||||
* use [map.addLayer()]{@link import("../Map.js").default#addLayer}.
|
||||
* @property {boolean} [declutter=false] Declutter images and text on this layer. The priority is defined
|
||||
* by the `zIndex` of the style and the render order of features. Higher z-index means higher priority.
|
||||
* Within the same z-index, a feature rendered before another has higher priority.
|
||||
|
||||
@@ -55,10 +55,10 @@ import {assert} from '../asserts.js';
|
||||
* tile layers with only a few rendered features (e.g. for highlighting a subset of features of
|
||||
* another layer with the same source).
|
||||
* @property {import("../source/VectorTile.js").default} [source] Source.
|
||||
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* @property {import("../Map.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link import("../PluggableMap.js").default#addLayer map.addLayer()}.
|
||||
* use [map.addLayer()]{@link import("../Map.js").default#addLayer}.
|
||||
* @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all
|
||||
* image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority
|
||||
* is defined by the z-index of the layer, the `zIndex` of the style and the render order of features.
|
||||
@@ -171,8 +171,8 @@ class VectorTileLayer extends BaseVectorLayer {
|
||||
* when a hit was detected, or it will be empty.
|
||||
*
|
||||
* The hit detection algorithm used for this method is optimized for performance, but is less
|
||||
* accurate than the one used in {@link import("../PluggableMap.js").default#getFeaturesAtPixel map.getFeaturesAtPixel()}: Text
|
||||
* is not considered, and icons are only represented by their bounding box instead of the exact
|
||||
* accurate than the one used in [map.getFeaturesAtPixel()]{@link import("../Map.js").default#getFeaturesAtPixel}.
|
||||
* Text is not considered, and icons are only represented by their bounding box instead of the exact
|
||||
* image.
|
||||
*
|
||||
* @param {import("../pixel.js").Pixel} pixel Pixel.
|
||||
|
||||
@@ -68,7 +68,7 @@ import {
|
||||
* expects an extent and a resolution (in view projection units per pixel) and returns an array of sources. See
|
||||
* {@link module:ol/source.sourcesFromTileGrid} for a helper function to generate sources that are organized in a
|
||||
* pyramid following the same pattern as a tile grid. **Note:** All sources must have the same band count and content.
|
||||
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* @property {import("../Map.js").default} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link module:ol/Map~Map#addLayer}.
|
||||
@@ -422,7 +422,7 @@ class WebGLTileLayer extends BaseTileLayer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../PluggableMap").FrameState} frameState Frame state.
|
||||
* @param {import("../Map").FrameState} frameState Frame state.
|
||||
* @param {Array<SourceType>} sources Sources.
|
||||
* @return {HTMLElement} Canvas.
|
||||
*/
|
||||
@@ -439,7 +439,7 @@ class WebGLTileLayer extends BaseTileLayer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {?import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {?import("../Map.js").FrameState} frameState Frame state.
|
||||
* @param {HTMLElement} target Target which the renderer may (but need not) use
|
||||
* for rendering its content.
|
||||
* @return {HTMLElement} The rendered element.
|
||||
|
||||
@@ -29,7 +29,7 @@ class RenderBox extends Disposable {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {import("../PluggableMap.js").default|null}
|
||||
* @type {import("../Map.js").default|null}
|
||||
*/
|
||||
this.map_ = null;
|
||||
|
||||
@@ -68,7 +68,7 @@ class RenderBox extends Disposable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../PluggableMap.js").default|null} map Map.
|
||||
* @param {import("../Map.js").default|null} map Map.
|
||||
*/
|
||||
setMap(map) {
|
||||
if (this.map_) {
|
||||
|
||||
@@ -9,7 +9,7 @@ class RenderEvent extends Event {
|
||||
* @param {import("./EventType.js").default} type Type.
|
||||
* @param {import("../transform.js").Transform} [opt_inversePixelTransform] Transform for
|
||||
* CSS pixels to rendered pixels.
|
||||
* @param {import("../PluggableMap.js").FrameState} [opt_frameState] Frame state.
|
||||
* @param {import("../Map.js").FrameState} [opt_frameState] Frame state.
|
||||
* @param {?(CanvasRenderingContext2D|WebGLRenderingContext)} [opt_context] Context.
|
||||
*/
|
||||
constructor(type, opt_inversePixelTransform, opt_frameState, opt_context) {
|
||||
@@ -25,7 +25,7 @@ class RenderEvent extends Event {
|
||||
|
||||
/**
|
||||
* An object representing the current render frame state.
|
||||
* @type {import("../PluggableMap.js").FrameState|undefined}
|
||||
* @type {import("../Map.js").FrameState|undefined}
|
||||
* @api
|
||||
*/
|
||||
this.frameState = opt_frameState;
|
||||
|
||||
@@ -70,7 +70,7 @@ class AbstractBatchRenderer {
|
||||
* Rebuild rendering instructions and webgl buffers based on the provided frame state
|
||||
* Note: this is a costly operation.
|
||||
* @param {import("./MixedGeometryBatch.js").GeometryBatch} batch Geometry batch
|
||||
* @param {import("../../PluggableMap").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map").FrameState} frameState Frame state.
|
||||
* @param {import("../../geom/Geometry.js").Type} geometryType Geometry type
|
||||
* @param {function(): void} callback Function called once the render buffers are updated
|
||||
*/
|
||||
@@ -89,7 +89,7 @@ class AbstractBatchRenderer {
|
||||
* the invert transform of the webgl buffers
|
||||
* @param {import("./MixedGeometryBatch.js").GeometryBatch} batch Geometry batch
|
||||
* @param {import("../../transform.js").Transform} currentTransform Transform
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {number} offsetX X offset
|
||||
*/
|
||||
render(batch, currentTransform, frameState, offsetX) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import {replaceChildren} from '../dom.js';
|
||||
*/
|
||||
class CompositeMapRenderer extends MapRenderer {
|
||||
/**
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
*/
|
||||
constructor(map) {
|
||||
super(map);
|
||||
@@ -63,7 +63,7 @@ class CompositeMapRenderer extends MapRenderer {
|
||||
|
||||
/**
|
||||
* @param {import("../render/EventType.js").default} type Event type.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
dispatchRenderEvent(type, frameState) {
|
||||
const map = this.getMap();
|
||||
@@ -81,7 +81,7 @@ class CompositeMapRenderer extends MapRenderer {
|
||||
|
||||
/**
|
||||
* Render.
|
||||
* @param {?import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {?import("../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
renderFrame(frameState) {
|
||||
if (!frameState) {
|
||||
|
||||
@@ -58,7 +58,7 @@ class LayerRenderer extends Observable {
|
||||
/**
|
||||
* Determine whether render should be called.
|
||||
* @abstract
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
*/
|
||||
prepareFrame(frameState) {
|
||||
@@ -68,7 +68,7 @@ class LayerRenderer extends Observable {
|
||||
/**
|
||||
* Render the layer.
|
||||
* @abstract
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
* @param {HTMLElement} target Target that may be used to render content to.
|
||||
* @return {HTMLElement} The rendered element.
|
||||
*/
|
||||
@@ -116,7 +116,7 @@ class LayerRenderer extends Observable {
|
||||
/**
|
||||
* @abstract
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {import("./vector.js").FeatureCallback<T>} callback Feature callback.
|
||||
* @param {Array<import("./Map.js").HitMatch<T>>} matches The hit detected matches with tolerance.
|
||||
|
||||
@@ -25,14 +25,14 @@ import {wrapX} from '../coordinate.js';
|
||||
*/
|
||||
class MapRenderer extends Disposable {
|
||||
/**
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
*/
|
||||
constructor(map) {
|
||||
super();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {import("../PluggableMap.js").default}
|
||||
* @type {import("../Map.js").default}
|
||||
*/
|
||||
this.map_ = map;
|
||||
}
|
||||
@@ -40,14 +40,14 @@ class MapRenderer extends Disposable {
|
||||
/**
|
||||
* @abstract
|
||||
* @param {import("../render/EventType.js").default} type Event type.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
dispatchRenderEvent(type, frameState) {
|
||||
abstract();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState FrameState.
|
||||
* @param {import("../Map.js").FrameState} frameState FrameState.
|
||||
* @protected
|
||||
*/
|
||||
calculateMatrices2D(frameState) {
|
||||
@@ -71,7 +71,7 @@ class MapRenderer extends Disposable {
|
||||
|
||||
/**
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState FrameState.
|
||||
* @param {import("../Map.js").FrameState} frameState FrameState.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {boolean} checkWrapped Check for wrapped geometries.
|
||||
* @param {import("./vector.js").FeatureCallback<T>} callback Feature callback.
|
||||
@@ -172,7 +172,7 @@ class MapRenderer extends Disposable {
|
||||
|
||||
/**
|
||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState FrameState.
|
||||
* @param {import("../Map.js").FrameState} frameState FrameState.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {boolean} checkWrapped Check for wrapped geometries.
|
||||
* @param {function(this: U, import("../layer/Layer.js").default): boolean} layerFilter Layer filter
|
||||
@@ -206,7 +206,7 @@ class MapRenderer extends Disposable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {import("../PluggableMap.js").default} Map.
|
||||
* @return {import("../Map.js").default} Map.
|
||||
*/
|
||||
getMap() {
|
||||
return this.map_;
|
||||
@@ -215,14 +215,14 @@ class MapRenderer extends Disposable {
|
||||
/**
|
||||
* Render.
|
||||
* @abstract
|
||||
* @param {?import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {?import("../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
renderFrame(frameState) {
|
||||
abstract();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
* @protected
|
||||
*/
|
||||
scheduleExpireIconCache(frameState) {
|
||||
@@ -233,8 +233,8 @@ class MapRenderer extends Disposable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").default} map Map.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
function expireIconCache(map, frameState) {
|
||||
iconImageCache.expire();
|
||||
|
||||
@@ -50,7 +50,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
/**
|
||||
* Determine whether render should be called.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
*/
|
||||
prepareFrame(frameState) {
|
||||
@@ -152,7 +152,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
/**
|
||||
* Render the layer.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {HTMLElement} target Target that may be used to render content to.
|
||||
* @return {HTMLElement} The rendered element.
|
||||
*/
|
||||
|
||||
@@ -102,7 +102,7 @@ class CanvasLayerRenderer extends LayerRenderer {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {import("../../PluggableMap.js").FrameState|null}
|
||||
* @type {import("../../Map.js").FrameState|null}
|
||||
*/
|
||||
this.frameState = null;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ class CanvasLayerRenderer extends LayerRenderer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import('../../PluggableMap.js').FrameState} frameState Frame state.
|
||||
* @param {import('../../Map.js').FrameState} frameState Frame state.
|
||||
* @return {string} Background color.
|
||||
*/
|
||||
getBackground(frameState) {
|
||||
@@ -207,7 +207,7 @@ class CanvasLayerRenderer extends LayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../extent.js").Extent} extent Clip extent.
|
||||
* @protected
|
||||
*/
|
||||
@@ -240,7 +240,7 @@ class CanvasLayerRenderer extends LayerRenderer {
|
||||
/**
|
||||
* @param {import("../../render/EventType.js").default} type Event type.
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @private
|
||||
*/
|
||||
dispatchRenderEvent_(type, context, frameState) {
|
||||
@@ -258,7 +258,7 @@ class CanvasLayerRenderer extends LayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @protected
|
||||
*/
|
||||
preRender(context, frameState) {
|
||||
@@ -268,7 +268,7 @@ class CanvasLayerRenderer extends LayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @protected
|
||||
*/
|
||||
postRender(context, frameState) {
|
||||
|
||||
@@ -117,7 +117,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
||||
* @param {number} z Tile coordinate z.
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {!import("../../Tile.js").default} Tile.
|
||||
*/
|
||||
getTile(z, x, y, frameState) {
|
||||
@@ -230,7 +230,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
/**
|
||||
* Determine whether render should be called.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
*/
|
||||
prepareFrame(frameState) {
|
||||
@@ -239,7 +239,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
/**
|
||||
* Render the layer.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {HTMLElement} target Target that may be used to render content to.
|
||||
* @return {HTMLElement} The rendered element.
|
||||
*/
|
||||
@@ -571,7 +571,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {import("../../ImageTile.js").default} tile Tile.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {number} x Left of the tile.
|
||||
* @param {number} y Top of the tile.
|
||||
* @param {number} w Width of the tile.
|
||||
@@ -635,7 +635,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../source/Tile.js").default} tileSource Tile source.
|
||||
* @protected
|
||||
*/
|
||||
@@ -643,8 +643,8 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
||||
if (tileSource.canExpireCache()) {
|
||||
/**
|
||||
* @param {import("../../source/Tile.js").default} tileSource Tile source.
|
||||
* @param {import("../../PluggableMap.js").default} map Map.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").default} map Map.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
const postRenderFunction = function (tileSource, map, frameState) {
|
||||
const tileSourceKey = getUid(tileSource);
|
||||
@@ -657,7 +657,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
||||
}.bind(null, tileSource);
|
||||
|
||||
frameState.postRenderFunctions.push(
|
||||
/** @type {import("../../PluggableMap.js").PostRenderFunction} */ (
|
||||
/** @type {import("../../Map.js").PostRenderFunction} */ (
|
||||
postRenderFunction
|
||||
)
|
||||
);
|
||||
@@ -686,7 +686,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
||||
* - registers idle tiles in frameState.wantedTiles so that they are not
|
||||
* discarded by the tile queue
|
||||
* - enqueues missing tiles
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../source/Tile.js").default} tileSource Tile source.
|
||||
* @param {import("../../tilegrid/TileGrid.js").default} tileGrid Tile grid.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
|
||||
@@ -81,7 +81,7 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
|
||||
|
||||
/**
|
||||
* Determine whether render should be called.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
*/
|
||||
prepareFrame(frameState) {
|
||||
@@ -109,8 +109,7 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
|
||||
const layerState = frameState.layerStatesArray[frameState.layerIndex];
|
||||
context.globalAlpha = layerState.opacity;
|
||||
const imageLayerState = Object.assign({}, layerState, {opacity: 1});
|
||||
const imageFrameState =
|
||||
/** @type {import("../../PluggableMap.js").FrameState} */ (
|
||||
const imageFrameState = /** @type {import("../../Map.js").FrameState} */ (
|
||||
Object.assign({}, frameState, {
|
||||
declutterTree: new RBush(9),
|
||||
extent: renderedExtent,
|
||||
@@ -194,7 +193,7 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {import("../vector.js").FeatureCallback<T>} callback Feature callback.
|
||||
* @param {Array<import("../Map.js").HitMatch<T>>} matches The hit detected matches with tolerance.
|
||||
|
||||
@@ -158,7 +158,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {ExecutorGroup} executorGroup Executor group.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {import("rbush").default} [opt_declutterTree] Declutter tree.
|
||||
*/
|
||||
renderWorlds(executorGroup, frameState, opt_declutterTree) {
|
||||
@@ -236,7 +236,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
/**
|
||||
* Render declutter items for this layer
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
renderDeclutter(frameState) {
|
||||
if (this.declutterExecutorGroup) {
|
||||
@@ -252,7 +252,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
/**
|
||||
* Render the layer.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {HTMLElement} target Target that may be used to render content to.
|
||||
* @return {HTMLElement} The rendered element.
|
||||
*/
|
||||
@@ -432,7 +432,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {import("../vector.js").FeatureCallback<T>} callback Feature callback.
|
||||
* @param {Array<import("../Map.js").HitMatch<T>>} matches The hit detected matches with tolerance.
|
||||
@@ -534,7 +534,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
||||
|
||||
/**
|
||||
* Determine whether render should be called.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
*/
|
||||
prepareFrame(frameState) {
|
||||
|
||||
@@ -117,7 +117,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
||||
* @param {number} z Tile coordinate z.
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {!import("../../Tile.js").default} Tile.
|
||||
*/
|
||||
getTile(z, x, y, frameState) {
|
||||
@@ -168,7 +168,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
||||
|
||||
/**
|
||||
* Determine whether render should be called.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
*/
|
||||
prepareFrame(frameState) {
|
||||
@@ -321,7 +321,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {import("../vector.js").FeatureCallback<T>} callback Feature callback.
|
||||
* @param {Array<import("../Map.js").HitMatch<T>>} matches The hit detected matches with tolerance.
|
||||
@@ -548,7 +548,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
||||
|
||||
/**
|
||||
* Render declutter items for this layer
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
renderDeclutter(frameState) {
|
||||
const context = this.context;
|
||||
@@ -618,7 +618,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
||||
|
||||
/**
|
||||
* Render the layer.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {HTMLElement} target Target that may be used to render content to.
|
||||
* @return {HTMLElement} The rendered element.
|
||||
*/
|
||||
@@ -797,7 +797,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {import("../../VectorRenderTile.js").default} tile Tile.
|
||||
* @param {import("../../PluggableMap").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map").FrameState} frameState Frame state.
|
||||
* @private
|
||||
*/
|
||||
renderTileImage_(tile, frameState) {
|
||||
|
||||
@@ -81,7 +81,7 @@ class WebGLLayerRenderer extends LayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {WebGLRenderingContext} context The WebGL rendering context.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @protected
|
||||
*/
|
||||
dispatchPreComposeEvent(context, frameState) {
|
||||
@@ -99,7 +99,7 @@ class WebGLLayerRenderer extends LayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {WebGLRenderingContext} context The WebGL rendering context.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @protected
|
||||
*/
|
||||
dispatchPostComposeEvent(context, frameState) {
|
||||
@@ -138,7 +138,7 @@ class WebGLLayerRenderer extends LayerRenderer {
|
||||
|
||||
/**
|
||||
* Determine whether renderFrame should be called.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
*/
|
||||
prepareFrame(frameState) {
|
||||
@@ -194,7 +194,7 @@ class WebGLLayerRenderer extends LayerRenderer {
|
||||
|
||||
/**
|
||||
* Determine whether renderFrame should be called.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
* @protected
|
||||
*/
|
||||
@@ -213,7 +213,7 @@ class WebGLLayerRenderer extends LayerRenderer {
|
||||
/**
|
||||
* @param {import("../../render/EventType.js").default} type Event type.
|
||||
* @param {WebGLRenderingContext} context The rendering context.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @private
|
||||
*/
|
||||
dispatchRenderEvent_(type, context, frameState) {
|
||||
@@ -242,7 +242,7 @@ class WebGLLayerRenderer extends LayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {WebGLRenderingContext} context The rendering context.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @protected
|
||||
*/
|
||||
preRender(context, frameState) {
|
||||
@@ -251,7 +251,7 @@ class WebGLLayerRenderer extends LayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {WebGLRenderingContext} context The rendering context.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @protected
|
||||
*/
|
||||
postRender(context, frameState) {
|
||||
|
||||
@@ -456,7 +456,7 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* Render the layer.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {HTMLElement} The rendered element.
|
||||
*/
|
||||
renderFrame(frameState) {
|
||||
@@ -512,7 +512,7 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* Determine whether renderFrame should be called.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
*/
|
||||
prepareFrameInternal(frameState) {
|
||||
@@ -555,7 +555,7 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* Rebuild internal webgl buffers based on current view extent; costly, should not be called too much
|
||||
* @param {import("../../PluggableMap").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map").FrameState} frameState Frame state.
|
||||
* @private
|
||||
*/
|
||||
rebuildBuffers_(frameState) {
|
||||
@@ -672,7 +672,7 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {import("../vector.js").FeatureCallback<T>} callback Feature callback.
|
||||
* @param {Array<import("../Map.js").HitMatch<T>>} matches The hit detected matches with tolerance.
|
||||
@@ -712,7 +712,7 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* Render the hit detection data to the corresponding render target
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState current frame state
|
||||
* @param {import("../../Map.js").FrameState} frameState current frame state
|
||||
* @param {number} startWorld the world to render in the first iteration
|
||||
* @param {number} endWorld the last world to render
|
||||
* @param {number} worldWidth the width of the worlds being rendered
|
||||
|
||||
@@ -95,7 +95,7 @@ function addTileTextureToLookup(tileTexturesByZ, tileTexture, z) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../extent.js").Extent} extent The frame extent.
|
||||
* @return {import("../../extent.js").Extent} Frame extent intersected with layer extents.
|
||||
*/
|
||||
@@ -244,7 +244,7 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {import("../../PluggableMap.js").FrameState|null}
|
||||
* @type {import("../../Map.js").FrameState|null}
|
||||
*/
|
||||
this.frameState_ = null;
|
||||
}
|
||||
@@ -295,7 +295,7 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* Determine whether renderFrame should be called.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
*/
|
||||
prepareFrameInternal(frameState) {
|
||||
@@ -312,7 +312,7 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../extent.js").Extent} extent The extent to be rendered.
|
||||
* @param {number} initialZ The zoom level.
|
||||
* @param {Object<number, Array<TileTexture>>} tileTexturesByZ The zoom level.
|
||||
@@ -412,7 +412,7 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* Render the layer.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {HTMLElement} The rendered element.
|
||||
*/
|
||||
renderFrame(frameState) {
|
||||
@@ -670,8 +670,8 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
|
||||
/**
|
||||
* Here we unconditionally expire the source cache since the renderer maintains
|
||||
* its own cache.
|
||||
* @param {import("../../PluggableMap.js").default} map Map.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").default} map Map.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
const postRenderFunction = function (map, frameState) {
|
||||
tileSource.expireCache(frameState.viewState.projection, empty);
|
||||
|
||||
@@ -255,7 +255,7 @@ class WebGLVectorLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* Render the layer.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {HTMLElement} The rendered element.
|
||||
*/
|
||||
renderFrame(frameState) {
|
||||
@@ -312,7 +312,7 @@ class WebGLVectorLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* Determine whether renderFrame should be called.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @return {boolean} Layer is ready to be rendered.
|
||||
*/
|
||||
prepareFrameInternal(frameState) {
|
||||
@@ -375,7 +375,7 @@ class WebGLVectorLayerRenderer extends WebGLLayerRenderer {
|
||||
|
||||
/**
|
||||
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {import("../vector.js").FeatureCallback<T>} callback Feature callback.
|
||||
* @param {Array<import("../Map.js").HitMatch<T>>} matches The hit detected matches with tolerance.
|
||||
|
||||
@@ -466,7 +466,7 @@ const RasterEventType = {
|
||||
export class RasterSourceEvent extends Event {
|
||||
/**
|
||||
* @param {string} type Type.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState The frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState The frame state.
|
||||
* @param {Object|Array<Object>} data An object made available to operations. For "afteroperations" evenets
|
||||
* this will be an array of objects if more than one thread is used.
|
||||
*/
|
||||
@@ -600,7 +600,7 @@ class RasterSource extends ImageSource {
|
||||
|
||||
/**
|
||||
* The most recently requested frame state.
|
||||
* @type {import("../PluggableMap.js").FrameState}
|
||||
* @type {import("../Map.js").FrameState}
|
||||
* @private
|
||||
*/
|
||||
this.requestedFrameState_;
|
||||
@@ -620,7 +620,7 @@ class RasterSource extends ImageSource {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {import("../PluggableMap.js").FrameState}
|
||||
* @type {import("../Map.js").FrameState}
|
||||
*/
|
||||
this.frameState_ = {
|
||||
animate: false,
|
||||
@@ -699,11 +699,11 @@ class RasterSource extends ImageSource {
|
||||
* @param {import("../extent.js").Extent} extent The view extent (in map units).
|
||||
* @param {number} resolution The view resolution.
|
||||
* @param {import("../proj/Projection.js").default} projection The view projection.
|
||||
* @return {import("../PluggableMap.js").FrameState} The updated frame state.
|
||||
* @return {import("../Map.js").FrameState} The updated frame state.
|
||||
* @private
|
||||
*/
|
||||
updateFrameState_(extent, resolution, projection) {
|
||||
const frameState = /** @type {import("../PluggableMap.js").FrameState} */ (
|
||||
const frameState = /** @type {import("../Map.js").FrameState} */ (
|
||||
Object.assign({}, this.frameState_)
|
||||
);
|
||||
|
||||
@@ -817,7 +817,7 @@ class RasterSource extends ImageSource {
|
||||
|
||||
/**
|
||||
* Called when pixel processing is complete.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState The frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState The frame state.
|
||||
* @param {Error} err Any error during processing.
|
||||
* @param {ImageData} output The output image data.
|
||||
* @param {Object|Array<Object>} data The user data (or an array if more than one thread).
|
||||
@@ -890,7 +890,7 @@ let sharedContext = null;
|
||||
/**
|
||||
* Get image data from a layer.
|
||||
* @param {import("../layer/Layer.js").default} layer Layer to render.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState The frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState The frame state.
|
||||
* @return {ImageData} The image data.
|
||||
*/
|
||||
function getImageData(layer, frameState) {
|
||||
|
||||
@@ -11,10 +11,10 @@ import {get as getProjection} from '../proj.js';
|
||||
*/
|
||||
|
||||
/**
|
||||
* A function that takes a {@link module:ol/PluggableMap~FrameState} and returns a string or
|
||||
* A function that takes a {@link module:ol/Map~FrameState} and returns a string or
|
||||
* an array of strings representing source attributions.
|
||||
*
|
||||
* @typedef {function(import("../PluggableMap.js").FrameState): (string|Array<string>)} Attribution
|
||||
* @typedef {function(import("../Map.js").FrameState): (string|Array<string>)} Attribution
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -82,7 +82,7 @@ export const AttributeType = {
|
||||
/**
|
||||
* Uniform value can be a number, array of numbers (2 to 4), canvas element or a callback returning
|
||||
* one of the previous types.
|
||||
* @typedef {UniformLiteralValue|function(import("../PluggableMap.js").FrameState):UniformLiteralValue} UniformValue
|
||||
* @typedef {UniformLiteralValue|function(import("../Map.js").FrameState):UniformLiteralValue} UniformValue
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -548,7 +548,7 @@ class WebGLHelper extends Disposable {
|
||||
* Clear the buffer & set the viewport to draw.
|
||||
* Post process passes will be initialized here, the first one being bound as a render target for
|
||||
* subsequent draw calls.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState current frame state
|
||||
* @param {import("../Map.js").FrameState} frameState current frame state
|
||||
* @param {boolean} [opt_disableAlphaBlend] If true, no alpha blending will happen.
|
||||
*/
|
||||
prepareDraw(frameState, opt_disableAlphaBlend) {
|
||||
@@ -583,7 +583,7 @@ class WebGLHelper extends Disposable {
|
||||
* Clear the render target & bind it for future draw operations.
|
||||
* This is similar to `prepareDraw`, only post processes will not be applied.
|
||||
* Note: the whole viewport will be drawn to the render target, regardless of its size.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState current frame state
|
||||
* @param {import("../Map.js").FrameState} frameState current frame state
|
||||
* @param {import("./RenderTarget.js").default} renderTarget Render target to draw to
|
||||
* @param {boolean} [opt_disableAlphaBlend] If true, no alpha blending will happen.
|
||||
*/
|
||||
@@ -622,9 +622,9 @@ class WebGLHelper extends Disposable {
|
||||
|
||||
/**
|
||||
* Apply the successive post process passes which will eventually render to the actual canvas.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState current frame state
|
||||
* @param {function(WebGLRenderingContext, import("../PluggableMap.js").FrameState):void} [preCompose] Called before composing.
|
||||
* @param {function(WebGLRenderingContext, import("../PluggableMap.js").FrameState):void} [postCompose] Called before composing.
|
||||
* @param {import("../Map.js").FrameState} frameState current frame state
|
||||
* @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [preCompose] Called before composing.
|
||||
* @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [postCompose] Called before composing.
|
||||
*/
|
||||
finalizeDraw(frameState, preCompose, postCompose) {
|
||||
// apply post processes using the next one as target
|
||||
@@ -662,7 +662,7 @@ class WebGLHelper extends Disposable {
|
||||
|
||||
/**
|
||||
* Sets the default matrix uniforms for a given frame state. This is called internally in `prepareDraw`.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
applyFrameState(frameState) {
|
||||
const size = frameState.size;
|
||||
@@ -701,7 +701,7 @@ class WebGLHelper extends Disposable {
|
||||
|
||||
/**
|
||||
* Sets the custom uniforms based on what was given in the constructor. This is called internally in `prepareDraw`.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
applyUniforms(frameState) {
|
||||
const gl = this.getGL();
|
||||
@@ -794,7 +794,7 @@ class WebGLHelper extends Disposable {
|
||||
* Set up a program for use. The program will be set as the current one. Then, the uniforms used
|
||||
* in the program will be set based on the current frame state and the helper configuration.
|
||||
* @param {WebGLProgram} program Program.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
*/
|
||||
useProgram(program, frameState) {
|
||||
const gl = this.getGL();
|
||||
@@ -906,7 +906,7 @@ class WebGLHelper extends Disposable {
|
||||
/**
|
||||
* Modifies the given transform to apply the rotation/translation/scaling of the given frame state.
|
||||
* The resulting transform can be used to convert world space coordinates to view coordinates.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
* @param {import("../transform").Transform} transform Transform to update.
|
||||
* @return {import("../transform").Transform} The updated transform object.
|
||||
*/
|
||||
|
||||
@@ -191,7 +191,7 @@ class WebGLPostProcessingPass {
|
||||
* Initialize the render target texture of the post process, make sure it is at the
|
||||
* right size and bind it as a render target for the next draw calls.
|
||||
* The last step to be initialized will be the one where the primitives are rendered.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState current frame state
|
||||
* @param {import("../Map.js").FrameState} frameState current frame state
|
||||
* @api
|
||||
*/
|
||||
init(frameState) {
|
||||
@@ -250,10 +250,10 @@ class WebGLPostProcessingPass {
|
||||
|
||||
/**
|
||||
* Render to the next postprocessing pass (or to the canvas if final pass).
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState current frame state
|
||||
* @param {import("../Map.js").FrameState} frameState current frame state
|
||||
* @param {WebGLPostProcessingPass} [nextPass] Next pass, optional
|
||||
* @param {function(WebGLRenderingContext, import("../PluggableMap.js").FrameState):void} [preCompose] Called before composing.
|
||||
* @param {function(WebGLRenderingContext, import("../PluggableMap.js").FrameState):void} [postCompose] Called before composing.
|
||||
* @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [preCompose] Called before composing.
|
||||
* @param {function(WebGLRenderingContext, import("../Map.js").FrameState):void} [postCompose] Called before composing.
|
||||
* @api
|
||||
*/
|
||||
apply(frameState, nextPass, preCompose, postCompose) {
|
||||
@@ -325,7 +325,7 @@ class WebGLPostProcessingPass {
|
||||
|
||||
/**
|
||||
* Sets the custom uniforms based on what was given in the constructor.
|
||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||
* @param {import("../Map.js").FrameState} frameState Frame state.
|
||||
* @private
|
||||
*/
|
||||
applyUniforms(frameState) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import OlEvent from '../../../../../src/ol/events/Event.js';
|
||||
import PointerInteraction from '../../../../../src/ol/interaction/Pointer.js';
|
||||
import View from '../../../../../src/ol/View.js';
|
||||
|
||||
describe('ol.interaction.Pointer', function () {
|
||||
describe('ol/interaction/Pointer', function () {
|
||||
describe('#handleEvent', function () {
|
||||
let event;
|
||||
let defaultPrevented;
|
||||
@@ -194,7 +194,7 @@ describe('ol.layer.VectorTile', function () {
|
||||
});
|
||||
const renderer = layer.getRenderer();
|
||||
const frameState =
|
||||
/** @type {import("../../../../../src/ol/PluggableMap.js").FrameState} */ ({
|
||||
/** @type {import("../../../../../src/ol/Map.js").FrameState} */ ({
|
||||
pixelRatio: 1,
|
||||
viewState: {
|
||||
zoom: zoom,
|
||||
|
||||
@@ -248,12 +248,12 @@ describe('ol/renderer/canvas/VectorLayer', function () {
|
||||
});
|
||||
|
||||
describe('#prepareFrame and #compose', function () {
|
||||
/** @type {import("../../../../../../src/ol/PluggableMap").FrameState*/ let frameState;
|
||||
/** @type {import("../../../../../../src/ol/extent").Extent*/ let projExtent;
|
||||
/** @type {import("../../../../../../src/ol/Map").FrameState} */ let frameState;
|
||||
/** @type {import("../../../../../../src/ol/extent").Extent} */ let projExtent;
|
||||
/** @type {CanvasVectorLayerRenderer} */ let renderer;
|
||||
/** @type {number} */ let worldWidth;
|
||||
/** @type {number} */ let buffer;
|
||||
/** @type {Array<import("../../../../../../src/ol/extent").Extent>*/ let loadExtents;
|
||||
/** @type {Array<import("../../../../../../src/ol/extent").Extent>} */ let loadExtents;
|
||||
|
||||
function loader(extent) {
|
||||
loadExtents.push(extent);
|
||||
@@ -661,7 +661,7 @@ describe('ol/renderer/canvas/VectorLayer', function () {
|
||||
const projection = getProjection('EPSG:3857');
|
||||
const projExtent = projection.getExtent();
|
||||
const worldWidth = getWidth(projExtent);
|
||||
/** @type {import("../../../../../../src/ol/PluggableMap").FrameState*/
|
||||
/** @type {import("../../../../../../src/ol/Map").FrameState} */
|
||||
const frameState = {
|
||||
viewHints: [],
|
||||
pixelRatio: 1,
|
||||
|
||||
@@ -13,7 +13,7 @@ describe('ol/renderer/webgl/TileLayer', function () {
|
||||
let renderer;
|
||||
/** @type {WebGLTileLayer} */
|
||||
let tileLayer;
|
||||
/** @type {import('../../../../../../src/ol/PluggableMap.js').FrameState} */
|
||||
/** @type {import('../../../../../../src/ol/Map.js').FrameState} */
|
||||
let frameState;
|
||||
beforeEach(function () {
|
||||
const size = 256;
|
||||
|
||||
Reference in New Issue
Block a user