YMapOpenMapsButton
The YMapOpenMapsButton 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 Yandex 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.
ymaps3.import('@yandex/controls-extra').then(({YMapOpenMapsButton}) => {
const map = new ymaps3.YMap(document.getElementById('app'), {
location: LOCATION,
});
map.addChild(new YMapOpenMapsButton(...))
});
Usage example
vanilla
react
vue
const controls = new YMapControls({position: 'bottom left'});
const {YMapOpenMapsButton} = await ymaps3.import('@yandex/ymaps3-controls-extra');
const openMapsButton = new YMapOpenMapsButton({});
controls.addChild(openMapsButton);
map.addChild(controls);
Constructor
new YMapOpenMapsButton(props)
Constructor parameters
|
Parameter |
Type |
|
|
Redefines
Props
YMapOpenMapsButtonProps: Object
Parameters
|
Parameter |
Type |
Description |
|
|
|
Button name. |
Methods
addChild
addChild(child, index?): YMapOpenMapsButton
Parameters
|
Parameter |
Type |
|
|
|
|
|
|
Returns
Inherited from
removeChild
removeChild(child): YMapOpenMapsButton
Parameters
|
Parameter |
Type |
|
|
|
Returns
Inherited from
update
update(changedProps): void
Parameters
|
Parameter |
Type |
Description |
|
|
New |
Returns
void