Set pointer-event: none for ScaleLine
There is no reason to interact with this control and for the `bar` option the blocked rect may be unexpectedly large
This commit is contained in:
@@ -80,15 +80,11 @@ class ScaleLine extends Control {
|
|||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
const options = opt_options ? opt_options : {};
|
const options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
const className =
|
const element = document.createElement('div');
|
||||||
options.className !== undefined
|
element.style.pointerEvents = 'none';
|
||||||
? options.className
|
|
||||||
: options.bar
|
|
||||||
? 'ol-scale-bar'
|
|
||||||
: 'ol-scale-line';
|
|
||||||
|
|
||||||
super({
|
super({
|
||||||
element: document.createElement('div'),
|
element: element,
|
||||||
render: options.render,
|
render: options.render,
|
||||||
target: options.target,
|
target: options.target,
|
||||||
});
|
});
|
||||||
@@ -108,6 +104,13 @@ class ScaleLine extends Control {
|
|||||||
*/
|
*/
|
||||||
this.un;
|
this.un;
|
||||||
|
|
||||||
|
const className =
|
||||||
|
options.className !== undefined
|
||||||
|
? options.className
|
||||||
|
: options.bar
|
||||||
|
? 'ol-scale-bar'
|
||||||
|
: 'ol-scale-line';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {HTMLElement}
|
* @type {HTMLElement}
|
||||||
|
|||||||
Reference in New Issue
Block a user