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

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

props

YMapOpenMapsButtonProps

Redefines

YMapGroupEntity.constructor

Props

YMapOpenMapsButtonProps: Object

Parameters

Parameter

Type

Description

title?

string

Button name.

Methods

addChild

addChild(child, index?): YMapOpenMapsButton

Parameters

Parameter

Type

child

YMapEntity<unknown, {}>

index?

number

Returns

YMapOpenMapsButton

Inherited from

YMapGroupEntity.addChild

removeChild

removeChild(child): YMapOpenMapsButton

Parameters

Parameter

Type

child

YMapEntity<unknown, {}>

Returns

YMapOpenMapsButton

Inherited from

YMapGroupEntity.removeChild

update

update(changedProps): void

Parameters

Parameter

Type

Description

changedProps

Partial<YMapOpenMapsButtonProps>

New props values.

Returns

void

Inherited from

YMapGroupEntity.update