Remove PluggableMap

This commit is contained in:
Tim Schaub
2022-07-31 09:39:59 -06:00
parent b534368394
commit 85ef563ba8
57 changed files with 1959 additions and 1993 deletions
+2 -2
View File
@@ -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) {
+3 -3
View File
@@ -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) {
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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) {
+12 -15
View File
@@ -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() {
+1 -1
View File
@@ -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) {