MMapControl
The MMapControl class is a DOM shell for creating custom controls. It contains styles for a control.
Usage example
vanilla
react
vue
const control = new MMapControl();
class MMapSomeController extends DomEntity {
_createDom() {
const element = document.createElement('button');
this._updateDom(element, this._props, true);
return element;
}
_updateDom(element, props, init = false) {
element.innerText = props.title;
}
}
const button = new MMapSomeController({
title: 'Click me!'
});
control.addChild(button);
map.addChild(control);
@see [[MMapControlCommonButton]]
Constructor
new MMapControl(props?, element?)
Constructor parameters
|
Parameter |
Type |
|
|
|
|
|
Redefines
Props
MMapControlProps: Object
Parameters
|
Parameter |
Type |
Description |
|
|
|
Makes a control transparent, removing the background color and shadows. |
Methods
addChild
addChild(child, index?): MMapControl
Parameters
|
Parameter |
Type |
|
|
|
|
|
|
Returns
Inherited from
removeChild
removeChild(child): MMapControl
Parameters
|
Parameter |
Type |
|
|
|
Returns
Inherited from
update
update(changedProps): void
Parameters
|
Parameter |
Type |
Description |
|
|
New props values. |
Returns
void