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) {
|
||||
const options = opt_options ? opt_options : {};
|
||||
|
||||
const className =
|
||||
options.className !== undefined
|
||||
? options.className
|
||||
: options.bar
|
||||
? 'ol-scale-bar'
|
||||
: 'ol-scale-line';
|
||||
const element = document.createElement('div');
|
||||
element.style.pointerEvents = 'none';
|
||||
|
||||
super({
|
||||
element: document.createElement('div'),
|
||||
element: element,
|
||||
render: options.render,
|
||||
target: options.target,
|
||||
});
|
||||
@@ -108,6 +104,13 @@ class ScaleLine extends Control {
|
||||
*/
|
||||
this.un;
|
||||
|
||||
const className =
|
||||
options.className !== undefined
|
||||
? options.className
|
||||
: options.bar
|
||||
? 'ol-scale-bar'
|
||||
: 'ol-scale-line';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {HTMLElement}
|
||||
|
||||
Reference in New Issue
Block a user