MMapOpenMapsButton
The MMapOpenMapsButton
class is a button that opens the map.
Note
This class is a JS API module component that is not included in the core API, but can be utilized for specific tasks.
Modules are developed and maintained by the Mappable Maps JS API team. They constitute an integral part of the JS API, just like the core API.
To work with the module, it needs to be loaded.
mappable.import('@mappable-world/controls-extra').then(({MMapOpenMapsButton}) => {
const map = new mappable.MMap(document.getElementById('app'), {
location: LOCATION,
});
map.addChild(new MMapOpenMapsButton(...))
});
Usage example
vanilla
react
vue
const controls = new MMapControls({position: 'bottom left'});
const {MMapOpenMapsButton} = await mappable.import('@mappable-world/mappable-controls-extra');
const openMapsButton = new MMapOpenMapsButton({});
controls.addChild(openMapsButton);
map.addChild(controls);
Constructor
new MMapOpenMapsButton(props
)
Constructor parameters
Parameter |
Type |
|
Redefines
Props
MMapOpenMapsButtonProps: Object
Parameters
Parameter |
Type |
Description |
|
|
Button name. |
Methods
addChild
addChild(child
, index?
): MMapOpenMapsButton
Parameters
Parameter |
Type |
|
|
|
|
Returns
Inherited from
removeChild
removeChild(child
): MMapOpenMapsButton
Parameters
Parameter |
Type |
|
|
Returns
Inherited from
update
update(changedProps
): void
Parameters
Parameter |
Type |
Description |
|
New |
Returns
void