Do not expose static render function of controls
This commit is contained in:
@@ -325,7 +325,6 @@ class Attribution extends Control {
|
||||
* Update the attribution element.
|
||||
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||
* @this {Attribution}
|
||||
* @api
|
||||
*/
|
||||
export function render(mapEvent) {
|
||||
this.updateElement_(mapEvent.frameState);
|
||||
|
||||
@@ -79,9 +79,10 @@ class Control extends BaseObject {
|
||||
this.listenerKeys = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {function(import("../MapEvent.js").default): void}
|
||||
*/
|
||||
this.render = options.render ? options.render : VOID;
|
||||
this.render_ = options.render ? options.render : VOID;
|
||||
|
||||
if (options.target) {
|
||||
this.setTarget(options.target);
|
||||
@@ -134,6 +135,16 @@ class Control extends BaseObject {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the projection. Rendering of the coordinates is done in
|
||||
* `handleMouseMove` and `handleMouseUp`.
|
||||
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||
* @api
|
||||
*/
|
||||
render(mapEvent) {
|
||||
this.render_.call(this, mapEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to set a target element for the control. It has no
|
||||
* effect if it is called after the control has been added to the map (i.e.
|
||||
|
||||
@@ -248,7 +248,6 @@ class MousePosition extends Control {
|
||||
* `handleMouseMove` and `handleMouseUp`.
|
||||
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||
* @this {MousePosition}
|
||||
* @api
|
||||
*/
|
||||
export function render(mapEvent) {
|
||||
const frameState = mapEvent.frameState;
|
||||
|
||||
@@ -603,7 +603,6 @@ class OverviewMap extends Control {
|
||||
* Update the overview map element.
|
||||
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||
* @this {OverviewMap}
|
||||
* @api
|
||||
*/
|
||||
export function render(mapEvent) {
|
||||
this.validateExtent_();
|
||||
|
||||
@@ -151,7 +151,6 @@ class Rotate extends Control {
|
||||
* Update the rotate control element.
|
||||
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||
* @this {Rotate}
|
||||
* @api
|
||||
*/
|
||||
export function render(mapEvent) {
|
||||
const frameState = mapEvent.frameState;
|
||||
|
||||
@@ -418,7 +418,6 @@ class ScaleLine extends Control {
|
||||
* Update the scale line element.
|
||||
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||
* @this {ScaleLine}
|
||||
* @api
|
||||
*/
|
||||
export function render(mapEvent) {
|
||||
const frameState = mapEvent.frameState;
|
||||
|
||||
@@ -339,7 +339,6 @@ class ZoomSlider extends Control {
|
||||
* Update the zoomslider element.
|
||||
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||
* @this {ZoomSlider}
|
||||
* @api
|
||||
*/
|
||||
export function render(mapEvent) {
|
||||
if (!mapEvent.frameState) {
|
||||
|
||||
Reference in New Issue
Block a user