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

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

props

MMapOpenMapsButtonProps

Redefines

MMapGroupEntity.constructor

Props

MMapOpenMapsButtonProps: Object

Parameters

Parameter

Type

Description

title?

string

Button name.

Methods

addChild

addChild(child, index?): MMapOpenMapsButton

Parameters

Parameter

Type

child

MMapEntity<unknown, {}>

index?

number

Returns

MMapOpenMapsButton

Inherited from

MMapGroupEntity.addChild

removeChild

removeChild(child): MMapOpenMapsButton

Parameters

Parameter

Type

child

MMapEntity<unknown, {}>

Returns

MMapOpenMapsButton

Inherited from

MMapGroupEntity.removeChild

update

update(changedProps): void

Parameters

Parameter

Type

Description

changedProps

Partial<MMapOpenMapsButtonProps>

New props values.

Returns

void

Inherited from

MMapGroupEntity.update