JS API Reference

This reference guide describes the JavaScript API version v3.

The guide is intended for website developers who want to use interactive Maps on their web pages.

The guide describes the public classes and methods in the API and assumes that developers are familiar with JavaScript and Maps. The classes are listed in alphabetical order.

Class: Config

Constructors

constructor

new Config()

Properties

description

readonly description: string

Methods

setApikeys

setApikeys(apikeys): void

Parameters
Name Type
apikeys Apikeys
Returns

void


setExperiments

setExperiments(experiments): void

Parameters
Name Type
experiments Record<string, boolean>
Returns

void

Class: MMap

Main API class. Create a map container.

Example

const map = new MMap(
    document.getElementById('map-root'),
    {location: {center: [55.44222, 25.24680], zoom: 10}}
);
// add default Mappable scheme layer
map.addChild(new MMapDefaultSchemeLayer());
// relocate map to another point with animation in 200 milliseconds
map.setLocation({center: [48.707067, 44.516975], duration: 200});
// change mode from default `auto` to `raster`
map.setMode('raster');
// get map zoom for some calculations
const zoom = map.zoom;

Constructors

constructor

new MMap(rootContainer, props, children?)

Parameters
Name Type
rootContainer HTMLElement
props MMapProps
children? MMapEntity<unknown, {}>[]
Overrides

GenericRootEntity.constructor

Properties

children

readonly children: MMapEntity<unknown, {}>[]
Overrides

GenericRootEntity.children


[overrideKeyReactify]

static [overrideKeyReactify]: CustomReactify<MMap, ForwardRefExoticComponent<{
	behaviors?: BehaviorType[];
	camera?: MMapCameraRequest;
	children?: ReactNode;
	className?: string;
	config?: Config;
	copyrights?: boolean;
	copyrightsPosition?: MMapCopyrightsPosition;
	hotspotsStrategy?: "forViewport" | "forPointerPosition";
	key?: null | Key;
	location: MMapLocationRequest;
	margin?: Margin;
	mode?: MapMode;
	projection?: Projection;
	ref?: Ref<MMap>;
	restrictMapArea?: false | LngLatBounds;
	theme?: MMapTheme;
	worldOptions?: WorldOptions;
	zoomRange?: ZoomRange;
	zoomRounding?: ZoomRounding;
	zoomStrategy?: ZoomStrategy 
}>>

defaultProps

static defaultProps: Readonly<{
	behaviors: string[];
	camera: {
		azimuth: number;
		tilt: number 
	};
	className: "";
	config: Config;
	copyrights: true;
	copyrightsPosition: "bottom right";
	hotspotsStrategy: "forViewport" | "forPointerPosition";
	margin: undefined | Margin;
	mode: "auto";
	projection: Projection;
	restrictMapArea: false;
	theme: "light";
	worldOptions: {
		cycledX: boolean;
		cycledY: boolean 
	};
	zoomRange: ZoomRange;
	zoomRounding: "auto";
	zoomStrategy: "zoomToPointer" 
}>

Accessors

azimuth

get azimuth(): number

Returns

number


behaviors

get behaviors(): readonly BehaviorType[]

getter for MMapProps.behaviors prop

Returns

readonly BehaviorType[]


bounds

get bounds(): LngLatBounds

getter for MMapProps.location.bounds prop

Returns

LngLatBounds


center

get center(): readonly [number, number, undefined | number]

getter for MMapProps.location.center prop

Returns

readonly [number, number, undefined | number]


config

get config(): Readonly<Config>

getter for MMapProps.config prop

Returns

Readonly<Config>


container

get container(): HTMLElement

Main map container

Returns

HTMLElement


parent

get parent(): null | GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>>

Get parent entity.

Returns

null | GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>>

Inherited from

GenericRootEntity.parent


projection

get projection(): Projection

getter for MMapProps.projection prop

Returns

Projection


restrictMapArea

get restrictMapArea(): Readonly<false | LngLatBounds>

getter for MMapProps.restrictMapArea prop

Returns

Readonly<false | LngLatBounds>


root

get root(): this

Get root entity.

Returns

this

Inherited from

GenericRootEntity.root


size

get size(): PixelCoordinates

getter for map size

Returns

PixelCoordinates


theme

get theme(): "dark" | "light"

getter for MMapProps.theme prop

Returns

"dark" | "light"


tilt

get tilt(): number

Returns

number


zoom

get zoom(): number

getter for MMapProps.location.zoom prop

Returns

number


zoomRange

get zoomRange(): Readonly<ZoomRange>

getter for MMapProps.zoomRange prop

Returns

Readonly<ZoomRange>

Methods

addChild

addChild(child, index?): MMap

Parameters
Name Type
child MMapEntity<unknown, {}>
index? number
Returns

MMap

Overrides

GenericRootEntity.addChild


destroy

destroy(): void

Destroy map and remove it from user DOM-element

Returns

void

Overrides

GenericRootEntity.destroy


removeChild

removeChild(child): MMap

Parameters
Name Type
child MMapEntity<unknown, {}>
Returns

MMap

Overrides

GenericRootEntity.removeChild


setBehaviors

setBehaviors(behaviors): void

setter for MMapProps.behaviors prop

Parameters
Name Type
behaviors BehaviorType[]
Returns

void


setConfig

setConfig(config): void

setter for MMapProps.config prop

Parameters
Name Type
config Config
Returns

void


setLocation

setLocation(location): void

setter for MMapProps.location prop

Parameters
Name Type
location MMapLocationRequest
Returns

void


setMargin

setMargin(margin): void

setter for MMapProps.margin prop

Parameters
Name Type
margin Margin
Returns

void


setMode

setMode(mode): void

setter for MMapProps.mode prop

Parameters
Name Type
mode MapMode
Returns

void


setProjection

setProjection(projection): void

setter for MMapProps.projection prop

Parameters
Name Type
projection Projection
Returns

void


setRestrictMapArea

setRestrictMapArea(restrictMapArea): void

setter for MMapProps.config prop

Parameters
Name Type
restrictMapArea LngLatBounds
Returns

void


setZoomRange

setZoomRange(zoomRange): void

setter for MMapProps.zoomRange prop

Parameters
Name Type
zoomRange ZoomRange
Returns

void


setZoomRounding

setZoomRounding(zoomRounding): void

setter for MMapProps.zoomRounding prop

Parameters
Name Type
zoomRounding ZoomRounding
Returns

void


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapProps> New props values.
Returns

void

Inherited from

GenericRootEntity.update

Class: MMapCollection

Entity that aggregates multiple Entities, and allows you to publicly add and remove entities to a subtree.

Type Param

Root Entity Class.

Example

type MMapSomeGroupEntityProps = {
 name?: string;
};
const defaultProps = {
 name: 'entity'
};
class MMapSomeGroupEntity extends MMapGroupEntity<MMapSomeGroupEntityProps, typeof defaultProps> {
 // ...
}
const groupEntity = new MMapSomeGroupEntity()
const someEntity = new MMapSomeEntity(); // MMapSomeEntity extends GenericEntity
groupEntity.addChild(someEntity); // add someEntity in MMapSomeGroupEntity object
groupEntity.removeChild(someEntity); // remove someEntity from MMapSomeGroupEntity object

Constructors

constructor

new MMapCollection(props, options?)

Parameters
Name Type Description
props Object The value of input props.
options? ComplexOptions<MMap> Optional options object.
Inherited from

MMapGroupEntity.constructor

new MMapCollection(props, children?, options?)

Parameters
Name Type
props Object
children? GenericEntity<unknown, {}, MMap>[]
options? Omit<ComplexOptions<MMap>, "children">
Inherited from

MMapGroupEntity.constructor

Properties

children

readonly children: readonly MMapEntity<unknown, {}>[]
Inherited from

MMapGroupEntity.children

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapGroupEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapGroupEntity.root

Methods

addChild

addChild(child, index?): MMapCollection

Parameters
Name Type
child MMapEntity<unknown, {}>
index? number
Returns

MMapCollection

Inherited from

MMapGroupEntity.addChild


removeChild

removeChild(child): MMapCollection

Parameters
Name Type
child MMapEntity<unknown, {}>
Returns

MMapCollection

Inherited from

MMapGroupEntity.removeChild


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<{}> New props values.
Returns

void

Inherited from

MMapGroupEntity.update

Class: MMapComplexEntity<Props, DefaultProps>

Entity that aggregates multiple Entities but looks basic from the outside.

Type Param

Root Entity Class.

Example

type MMapSomeComplexEntityProps = {
 name?: string;
};
const defaultProps = {
 name: 'entity'
};
class MMapSomeComplexEntity extends MMapComplexEntity<MMapSomeComplexEntityProps, typeof defaultProps> {
 private _someEntity?: MMapSomeEntity; // MMapSomeEntity extends GenericEntity
 protected _onAttach(): void {
     this._someEntity = new MMapSomeEntity();
     this.addChild(this._someEntity); // add someEntity as children
     // ...
 }
 // ...
}

Type parameters

Name Type Description
Props Props Type of input props of the Entity.
DefaultProps extends Object = {} Type of default input props of the Entity.

Implements

Implemented by

Constructors

constructor

new MMapComplexEntity<Props, DefaultProps>(props, options?)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Parameters
Name Type Description
props Props The value of input props.
options? ComplexOptions<MMap> Optional options object.
Inherited from

GenericComplexEntity.constructor

new MMapComplexEntity<Props, DefaultProps>(props, children?, options?)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Parameters
Name Type
props Props
children? GenericEntity<unknown, {}, MMap>[]
options? Omit<ComplexOptions<MMap>, "children">
Inherited from

GenericComplexEntity.constructor

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Implementation of

MMapEntity.parent

Overrides

GenericComplexEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Implementation of

MMapEntity.root

Overrides

GenericComplexEntity.root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<Props> New props values.
Returns

void

Implementation of

MMapEntity.update

Inherited from

GenericComplexEntity.update

Class: MMapContainer

Entity that aggregates multiple Entities, and allows you to publicly add and remove entities to a subtree.

Type Param

Root Entity Class.

Example

type MMapSomeGroupEntityProps = {
 name?: string;
};
const defaultProps = {
 name: 'entity'
};
class MMapSomeGroupEntity extends MMapGroupEntity<MMapSomeGroupEntityProps, typeof defaultProps> {
 // ...
}
const groupEntity = new MMapSomeGroupEntity()
const someEntity = new MMapSomeEntity(); // MMapSomeEntity extends GenericEntity
groupEntity.addChild(someEntity); // add someEntity in MMapSomeGroupEntity object
groupEntity.removeChild(someEntity); // remove someEntity from MMapSomeGroupEntity object

Constructors

constructor

new MMapContainer(props, options?)

Parameters
Name Type Description
props ComputedMMapContainerProps<unknown> The value of input props.
options? ComplexOptions<MMap> Optional options object.
Inherited from

MMapGroupEntity.constructor

new MMapContainer(props, children?, options?)

Parameters
Name Type
props ComputedMMapContainerProps<unknown>
children? GenericEntity<unknown, {}, MMap>[]
options? Omit<ComplexOptions<MMap>, "children">
Inherited from

MMapGroupEntity.constructor

Properties

children

readonly children: readonly MMapEntity<unknown, {}>[]
Inherited from

MMapGroupEntity.children


element

optional element: Element

[overrideKeyReactify]

static [overrideKeyReactify]: CustomReactify<MMapReactContainer, FC<MMapReactContainerProps<unknown> & {
	children?: ReactNode 
}>>

defaultProps

static defaultProps: Object
Type declaration
Name Type
tagName string

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapGroupEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapGroupEntity.root

Methods

addChild

addChild(child, index?): MMapContainer

Parameters
Name Type
child MMapEntity<unknown, {}>
index? number
Returns

MMapContainer

Inherited from

MMapGroupEntity.addChild


removeChild

removeChild(child): MMapContainer

Parameters
Name Type
child MMapEntity<unknown, {}>
Returns

MMapContainer

Inherited from

MMapGroupEntity.removeChild


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<ComputedMMapContainerProps<unknown>> New props values.
Returns

void

Inherited from

MMapGroupEntity.update

Class: MMapContext<_T>

Type parameters

Name
_T

Constructors

constructor

new MMapContext<_T>(name)

Type parameters
Name
_T
Parameters
Name Type
name string

Properties

name

readonly name: string

Class: MMapControl<T>

Entity that aggregates multiple Entities, and allows you to publicly add and remove entities to a subtree.

Type Param

Root Entity Class.

Example

type MMapSomeGroupEntityProps = {
 name?: string;
};
const defaultProps = {
 name: 'entity'
};
class MMapSomeGroupEntity extends MMapGroupEntity<MMapSomeGroupEntityProps, typeof defaultProps> {
 // ...
}
const groupEntity = new MMapSomeGroupEntity()
const someEntity = new MMapSomeEntity(); // MMapSomeEntity extends GenericEntity
groupEntity.addChild(someEntity); // add someEntity in MMapSomeGroupEntity object
groupEntity.removeChild(someEntity); // remove someEntity from MMapSomeGroupEntity object

Type parameters

Name Type Description
T extends MMapControlProps = MMapControlProps Type of input props of the Entity.

Constructors

constructor

new MMapControl<T>()

Type parameters
Name Type
T extends MMapControlProps = MMapControlProps
Overrides

MMapGroupEntity.constructor

Properties

children

readonly children: readonly MMapEntity<unknown, {}>[]
Inherited from

MMapGroupEntity.children


[overrideKeyReactify]

static [overrideKeyReactify]: CustomReactify<MMapControl<MMapControlProps>, ForwardRefExoticComponent<{
	children?: ReactNode;
	key?: null | Key;
	ref?: Ref<GenericEntity<{
	controlElement: HTMLElement 
}, {}, GenericRootEntity<unknown, {}>>> 
}>>

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapGroupEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapGroupEntity.root

Methods

addChild

addChild(child, index?): MMapControl<T>

Parameters
Name Type
child MMapEntity<unknown, {}>
index? number
Returns

MMapControl<T>

Inherited from

MMapGroupEntity.addChild


removeChild

removeChild(child): MMapControl<T>

Parameters
Name Type
child MMapEntity<unknown, {}>
Returns

MMapControl<T>

Inherited from

MMapGroupEntity.removeChild


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<T> New props values.
Returns

void

Inherited from

MMapGroupEntity.update

Class: MMapControlButton

The control element - button.

const map = new MMap(document.getElementById('map-root'), {...});
const controls = new MMapControls({position: 'top left horizontal'});
let count = 0;
const button = new MMapControlButton({
    text: 'Click me!',
    onClick: () => {
        button.update({text: 'Clicked:' + ++count});
    }
});
controls.addChild(button);
map.addChild(controls);

See

https://mappable.world/docs/jsapi/dg/concepts/controls/about.html

Constructors

constructor

new MMapControlButton(props, options?)

Parameters
Name Type Description
props MMapControlCommonButtonProps The value of input props.
options? ComplexOptions<MMap> Optional options object.
Inherited from

MMapComplexEntity.constructor

new MMapControlButton(props, children?, options?)

Parameters
Name Type
props MMapControlCommonButtonProps
children? GenericEntity<unknown, {}, MMap>[]
options? Omit<ComplexOptions<MMap>, "children">
Inherited from

MMapComplexEntity.constructor

Properties

[overrideKeyReactify]

static [overrideKeyReactify]: CustomReactify<MMapControlButton, ForwardRefExoticComponent<{
	background?: string;
	children?: ReactNode;
	color?: string;
	disabled?: boolean;
	element?: HTMLElement;
	key?: null | Key;
	onClick?: () => void;
	ref?: Ref<GenericEntity<MMapControlCommonButtonProps, {}, GenericRootEntity<unknown, {}>>>;
	text?: string 
}>>

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapComplexEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapComplexEntity.root


text

get text(): undefined | string

Returns

undefined | string

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapControlCommonButtonProps> New props values.
Returns

void

Inherited from

MMapComplexEntity.update

Class: MMapControlCommonButton

Default control button.

Constructors

constructor

new MMapControlCommonButton(props, options?)

Parameters
Name Type Description
props MMapControlCommonButtonProps The value of input props.
options? ComplexOptions<MMap> Optional options object.
Inherited from

MMapGroupEntity.constructor

new MMapControlCommonButton(props, children?, options?)

Parameters
Name Type
props MMapControlCommonButtonProps
children? GenericEntity<unknown, {}, MMap>[]
options? Omit<ComplexOptions<MMap>, "children">
Inherited from

MMapGroupEntity.constructor

Properties

children

readonly children: readonly MMapEntity<unknown, {}>[]
Inherited from

MMapGroupEntity.children

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapGroupEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapGroupEntity.root

Methods

addChild

addChild(child, index?): MMapControlCommonButton

Parameters
Name Type
child MMapEntity<unknown, {}>
index? number
Returns

MMapControlCommonButton

Inherited from

MMapGroupEntity.addChild


removeChild

removeChild(child): MMapControlCommonButton

Parameters
Name Type
child MMapEntity<unknown, {}>
Returns

MMapControlCommonButton

Inherited from

MMapGroupEntity.removeChild


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapControlCommonButtonProps> New props values.
Returns

void

Inherited from

MMapGroupEntity.update

Class: MMapControls

DOM container for grouping a number of controls to group and position them

Example

const map = new MMap(document.getElementById('map-root'), {
    location: [55.44222, 25.24680],
    mode: 'raster'
});
const controls = new MMapControls({position: 'top left horizontal'});
const button = text => new MMapControlButton({
    text: 'Click me',
    onClick: () => {
        alert('Click');
    }
});
map.addChild(controls);

Constructors

constructor

new MMapControls(props, children?)

Parameters
Name Type
props MMapControlsProps
children? MMapEntity<unknown, {}>[]
Overrides

MMapGroupEntity.constructor

Properties

children

readonly children: readonly MMapEntity<unknown, {}>[]
Inherited from

MMapGroupEntity.children

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapGroupEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapGroupEntity.root

Methods

addChild

addChild(child, index?): MMapControls

Parameters
Name Type
child MMapEntity<unknown, {}>
index? number
Returns

MMapControls

Inherited from

MMapGroupEntity.addChild


removeChild

removeChild(child): MMapControls

Parameters
Name Type
child MMapEntity<unknown, {}>
Returns

MMapControls

Inherited from

MMapGroupEntity.removeChild


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapControlsProps> New props values.
Returns

void

Inherited from

MMapGroupEntity.update

Class: MMapDefaultFeaturesLayer

Map defaults layer to show features on map.

Example

const defaultFeaturesLayer = new MMapDefaultFeaturesLayer();
// add to map
map.addChild(defaultFeaturesLayer);
// update
defaultFeaturesLayer.update({zIndex: 1501});

Constructors

constructor

new MMapDefaultFeaturesLayer(props, options?)

Parameters
Name Type Description
props MMapDefaultFeaturesLayerProps The value of input props.
options? ComplexOptions<MMap> Optional options object.
Inherited from

MMapComplexEntity.constructor

new MMapDefaultFeaturesLayer(props, children?, options?)

Parameters
Name Type
props MMapDefaultFeaturesLayerProps
children? GenericEntity<unknown, {}, MMap>[]
options? Omit<ComplexOptions<MMap>, "children">
Inherited from

MMapComplexEntity.constructor

Properties

defaultProps

static defaultProps: Readonly<{
	source: "mappable-default-feature";
	visible: true 
}>

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapComplexEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapComplexEntity.root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapDefaultFeaturesLayerProps> New props values.
Returns

void

Inherited from

MMapComplexEntity.update

Class: MMapDefaultSchemeLayer

Map default layer to show mappable-world scheme on map.

Example

const defaultSchemeLayer = new MMapDefaultSchemeLayer({theme: 'dark'});
// add to map
map.addChild(defaultSchemeLayer);
// update
defaultSchemeLayer.update({theme: 'light'});

Constructors

constructor

new MMapDefaultSchemeLayer(props, options?)

Parameters
Name Type Description
props MMapDefaultSchemeLayerProps The value of input props.
options? ComplexOptions<MMap> Optional options object.
Inherited from

MMapComplexEntity.constructor

new MMapDefaultSchemeLayer(props, children?, options?)

Parameters
Name Type
props MMapDefaultSchemeLayerProps
children? GenericEntity<unknown, {}, MMap>[]
options? Omit<ComplexOptions<MMap>, "children">
Inherited from

MMapComplexEntity.constructor

Properties

defaultProps

static defaultProps: Object
Type declaration
Name Type
layersInfo { buildings: { type: string ; zIndex: number } ; ground: { type: string ; zIndex: number } ; icons: { type: string ; zIndex: number } ; labels: { type: string ; zIndex: number } }
layersInfo.buildings { type: string ; zIndex: number }
layersInfo.buildings.type string
layersInfo.buildings.zIndex number
layersInfo.ground { type: string ; zIndex: number }
layersInfo.ground.type string
layersInfo.ground.zIndex number
layersInfo.icons { type: string ; zIndex: number }
layersInfo.icons.type string
layersInfo.icons.zIndex number
layersInfo.labels { type: string ; zIndex: number }
layersInfo.labels.type string
layersInfo.labels.zIndex number
source string
visible boolean

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapComplexEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapComplexEntity.root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapDefaultSchemeLayerProps> New props values.
Returns

void

Inherited from

MMapComplexEntity.update

Class: MMapEntity<Props, DefaultProps>

Entity Base Class. It has event handlers for attaching, detaching and updating props. Has a method for providing and using context.

Example

type MMapSomeEntityProps = {
 name?: string;
};
const defaultProps = {
 name: 'entity'
};
class MMapSomeEntity extends MMapEntity<MMapSomeEntityProps, typeof defaultProps> {
 public isAttached: boolean;
 constructor(props: MMapSomeEntityProps) {
     super(props);
     this.isAttached = false
     // Additional actions can be taken in the constructor of a class.
 }
 protected _onAttach(): void {
     this.isAttached = true;
     // Additional actions can be taken when an Entity is attached.
 }
 // ...
}

Type parameters

Name Type Description
Props Props Type of input props of the Entity.
DefaultProps extends Object = {} Type of default input props of the Entity.

Implemented by

Constructors

constructor

new MMapEntity<Props, DefaultProps>(props)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Parameters
Name Type Description
props Props The value of input props.
Inherited from

GenericEntity.constructor

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Overrides

GenericEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Overrides

GenericEntity.root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<Props> New props values.
Returns

void

Inherited from

GenericEntity.update

Class: MMapFeature

The feature component on the map.

Example

const feature = new MMapFeature({
    geometry: {
        type: 'LineString',
        coordinates: [
            [55.22080, 25.19532],
            [55.42926, 25.07077]
        ]
    },
    style: {
        stroke: [{width: 12, color: 'rgb(14, 194, 219)'}]
    }})
map
    .addChild(new MMapDefaultSchemeLayer())
    .addChild(new MMapDefaultFeaturesLayer())
    .addChild(feature);

Constructors

constructor

new MMapFeature(props)

Parameters
Name Type
props MMapFeatureProps
Overrides

MMapEntity.constructor

Properties

defaultProps

static defaultProps: Readonly<{
	source: "mappable-default-feature" 
}>

Accessors

geometry

get geometry(): GenericGeometry<LngLat>

Returns

GenericGeometry<LngLat>


parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapEntity.parent


properties

get properties(): undefined | Record<string, unknown>

Returns

undefined | Record<string, unknown>


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapEntity.root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapFeatureProps> New props values.
Returns

void

Inherited from

MMapEntity.update

Class: MMapFeatureDataSource

Map geojson data source. Used to upload objects to the map in geojson format

Example

const ID = 'id';
const dataSource = new MMapFeatureDataSource({id: ID});
const layer = new MMapLayer({source: ID, type: 'features', zIndex: 10});
map
    .addChild(dataSource)
    .addChild(layer);

Constructors

constructor

new MMapFeatureDataSource(props)

Parameters
Name Type Description
props MMapFeatureDataSourceProps The value of input props.
Inherited from

MMapEntity.constructor

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapEntity.root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapFeatureDataSourceProps> New props values.
Returns

void

Inherited from

MMapEntity.update

Class: MMapGroupEntity<Props, DefaultProps>

Entity that aggregates multiple Entities, and allows you to publicly add and remove entities to a subtree.

Type Param

Root Entity Class.

Example

type MMapSomeGroupEntityProps = {
 name?: string;
};
const defaultProps = {
 name: 'entity'
};
class MMapSomeGroupEntity extends MMapGroupEntity<MMapSomeGroupEntityProps, typeof defaultProps> {
 // ...
}
const groupEntity = new MMapSomeGroupEntity()
const someEntity = new MMapSomeEntity(); // MMapSomeEntity extends GenericEntity
groupEntity.addChild(someEntity); // add someEntity in MMapSomeGroupEntity object
groupEntity.removeChild(someEntity); // remove someEntity from MMapSomeGroupEntity object

Type parameters

Name Type Description
Props Props Type of input props of the Entity.
DefaultProps extends Object = {} Type of default input props of the Entity.

Implements

Constructors

constructor

new MMapGroupEntity<Props, DefaultProps>(props, options?)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Parameters
Name Type Description
props Props The value of input props.
options? ComplexOptions<MMap> Optional options object.
Inherited from

GenericGroupEntity.constructor

new MMapGroupEntity<Props, DefaultProps>(props, children?, options?)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Parameters
Name Type
props Props
children? GenericEntity<unknown, {}, MMap>[]
options? Omit<ComplexOptions<MMap>, "children">
Inherited from

GenericGroupEntity.constructor

Properties

children

readonly children: readonly MMapEntity<unknown, {}>[]
Implementation of

MMapComplexEntity.children

Overrides

GenericGroupEntity.children

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Implementation of

MMapComplexEntity.parent

Overrides

GenericGroupEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Implementation of

MMapComplexEntity.root

Overrides

GenericGroupEntity.root

Methods

addChild

addChild(child, index?): MMapGroupEntity<Props, DefaultProps>

Parameters
Name Type
child MMapEntity<unknown, {}>
index? number
Returns

MMapGroupEntity<Props, DefaultProps>

Implementation of

MMapComplexEntity.addChild

Overrides

GenericGroupEntity.addChild


removeChild

removeChild(child): MMapGroupEntity<Props, DefaultProps>

Parameters
Name Type
child MMapEntity<unknown, {}>
Returns

MMapGroupEntity<Props, DefaultProps>

Implementation of

MMapComplexEntity.removeChild

Overrides

GenericGroupEntity.removeChild


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<Props> New props values.
Returns

void

Implementation of

MMapComplexEntity.update

Inherited from

GenericGroupEntity.update

Class: MMapHotspot

This is not a real MMapEntity, it cannot be added to the map.
But you can check it by instance of in MMapListener handlers

Constructors

constructor

new MMapHotspot(geometry, properties)

Parameters
Name Type
geometry undefined | GenericGeometry<LngLat>
properties Record<string, unknown>

Properties

geometry

optional readonly geometry: GenericGeometry<LngLat>

properties

readonly properties: Record<string, unknown>

Class: MMapLayer

Map layer.

Constructors

constructor

new MMapLayer(props)

Parameters
Name Type Description
props MMapLayerProps The value of input props.
Inherited from

MMapEntity.constructor

Properties

defaultProps

static defaultProps: Readonly<{
	zIndex: 1500 
}>

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapEntity.root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapLayerProps> New props values.
Returns

void

Inherited from

MMapEntity.update

Class: MMapListener

A component for handling events of the map and its child elements. DOM events are also hung through this component.

Example

const clickCallback = () => alert("Clicked!");

const mapListener = new MMapListener({
    layerId: "any",
    onClick: clickCallback,
});

map.addChild(mapListener);

See

More about events

Constructors

constructor

new MMapListener(props)

Parameters
Name Type Description
props MMapListenerProps The value of input props.
Inherited from

MMapEntity.constructor

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapEntity.root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapListenerProps> New props values.
Returns

void

Inherited from

MMapEntity.update

Class: MMapMarker

The marker component on the map. Allows you to insert your own DOM implementation of the marker.

Does not provide a default implementation. See MMapDefaultMarker

Example

const content = document.createElement('div');
content.innerHTML = '<p>Draggable paragraph</p>';
map.addChild(new MMapDefaultFeaturesLayer({zIndex: 1800}))
map.addChild(new MMapMarker({
    coordinates: [54.81971, 24.49359],
    draggable: true
}, content));

Note: to insert a marker on the map, you need a MMapLayer layer with type 'markers'.
The example above uses MMapDefaultFeaturesLayer, which automatically adds the layer and the required datasource.

Constructors

constructor

new MMapMarker(props, element?)

Parameters
Name Type
props MMapMarkerProps
element? HTMLElement
Overrides

MMapGroupEntity.constructor

Properties

children

readonly children: readonly MMapEntity<unknown, {}>[]
Inherited from

MMapGroupEntity.children


element

readonly element: HTMLElement

[overrideKeyReactify]

static [overrideKeyReactify]: CustomReactify<MMapMarker, ForwardRefExoticComponent<{
	blockBehaviors?: boolean;
	blockEvents?: boolean;
	children?: ReactNode;
	coordinates: LngLat;
	disableRoundCoordinates?: boolean;
	draggable?: boolean;
	hideOutsideViewport?: HideOutsideRule;
	id?: string;
	key?: null | Key;
	mapFollowsOnDrag?: boolean | {
	activeZoneMargin?: Margin 
};
	markerElement?: HTMLElement;
	onClick?: (`event`: MouseEvent) => void;
	onDoubleClick?: (`event`: MouseEvent) => void;
	onDragEnd?: MMapMarkerEventHandler;
	onDragMove?: MMapMarkerEventHandler;
	onDragStart?: MMapMarkerEventHandler;
	onFastClick?: (`event`: MouseEvent) => void;
	properties?: Record<string, unknown>;
	ref?: Ref<GenericEntity<{
	coordinates: LngLat;
	disableRoundCoordinates?: boolean;
	hideOutsideViewport?: HideOutsideRule;
	id?: string;
	properties?: Record<string, unknown>;
	source?: string;
	zIndex?: number 
} & DraggableProps<MMapMarkerEventHandler> & FeatureClickEvents & {
	markerElement?: HTMLElement 
}, {}, GenericRootEntity<unknown, {}>>>;
	source?: string;
	zIndex?: number 
}>>

defaultProps

static defaultProps: Readonly<{
	blockBehaviors: false;
	blockEvents: false;
	draggable: false;
	hideOutsideViewport: false;
	mapFollowsOnDrag: false;
	source: "mappable-default-feature";
	zIndex: 0 
}>

Accessors

coordinates

get coordinates(): LngLat

Returns

LngLat


parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapGroupEntity.parent


properties

get properties(): undefined | Record<string, unknown>

Returns

undefined | Record<string, unknown>


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapGroupEntity.root

Methods

_onAttach

_onAttach(): void

Returns

void

Overrides

MMapGroupEntity._onAttach


_onDetach

_onDetach(): void

Returns

void

Overrides

MMapGroupEntity._onDetach


addChild

addChild(child, index?): MMapMarker

Parameters
Name Type
child MMapEntity<unknown, {}>
index? number
Returns

MMapMarker

Inherited from

MMapGroupEntity.addChild


removeChild

removeChild(child): MMapMarker

Parameters
Name Type
child MMapEntity<unknown, {}>
Returns

MMapMarker

Inherited from

MMapGroupEntity.removeChild


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapMarkerProps> New props values.
Returns

void

Inherited from

MMapGroupEntity.update

Class: MMapTileDataSource

Create map tile data source.

Example

const layer = new MMapLayer({
    id: 'layer-source-ground',
    source: 'source',
    type: 'ground',
    raster: {
        awaitAllTilesOnFirstDisplay: true
    }
});
const map = new MMap(ref.current, {
    location: [55.44222, 25.24680],
    mode: 'vector'
});
map.addChild(new MMapTileDataSource({
    id: 'source',
    raster: {
        type: 'ground',
        fetchTile: 'https://my.host.example/tiles?x=x&y=y&z=z&scale=scale'
    },
    zoomRange: {min: 0, max: 19},
    clampMapZoom: true
}));
map.addChild(layer);

Constructors

constructor

new MMapTileDataSource(props)

Parameters
Name Type Description
props MMapTileDataSourceProps The value of input props.
Inherited from

MMapEntity.constructor

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapEntity.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapEntity.root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<MMapTileDataSourceProps> New props values.
Returns

void

Inherited from

MMapEntity.update

Class: GenericComplexEntity<Props, DefaultProps, Root>

Entity that aggregates multiple Entities but looks basic from the outside.

Example

type MMapSomeComplexEntityProps = {
 name?: string;
};
const defaultProps = {
 name: 'entity'
};
class MMapSomeComplexEntity extends GenericComplexEntity<MMapSomeComplexEntityProps, typeof defaultProps> {
 private _someEntity?: MMapSomeEntity; // MMapSomeEntity extends GenericEntity
 protected _onAttach(): void {
     this._someEntity = new MMapSomeEntity();
     this.addChild(this._someEntity); // add someEntity as children
     // ...
 }
 // ...
}

Type parameters

Name Type Description
Props Props Type of input props of the Entity.
DefaultProps extends Object = {} Type of default input props of the Entity.
Root extends GenericRootEntity<unknown> = GenericRootEntity<unknown> Root Entity Class.

Constructors

constructor

new GenericComplexEntity<Props, DefaultProps, Root>(props, options?)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Root extends GenericRootEntity<unknown, {}, Root> = GenericRootEntity<unknown, {}>
Parameters
Name Type Description
props Props The value of input props.
options? ComplexOptions<Root> Optional options object.
Overrides

GenericEntity.constructor

new GenericComplexEntity<Props, DefaultProps, Root>(props, children?, options?)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Root extends GenericRootEntity<unknown, {}, Root> = GenericRootEntity<unknown, {}>
Parameters
Name Type
props Props
children? GenericEntity<unknown, {}, Root>[]
options? Omit<ComplexOptions<Root>, "children">
Overrides

GenericEntity<Props, DefaultProps, Root&gt;.constructor

Accessors

parent

get parent(): null | GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>>

Get parent entity.

Returns

null | GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>>

Inherited from

GenericEntity.parent


root

get root(): null | Root

Get root entity.

Returns

null | Root

Inherited from

GenericEntity.root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<Props> New props values.
Returns

void

Inherited from

GenericEntity.update

Class: GenericEntity<Props, DefaultProps, Root>

Entity Base Class. It has event handlers for attaching, detaching and updating props. Has a method for providing and using context.

Example

type MMapSomeEntityProps = {
 name?: string;
};
const defaultProps = {
 name: 'entity'
};
class MMapSomeEntity extends GenericEntity<MMapSomeEntityProps, typeof defaultProps> {
 public isAttached: boolean;
 constructor(props: MMapSomeEntityProps) {
     super(props);
     this.isAttached = false
     // Additional actions can be taken in the constructor of a class.
 }
 protected _onAttach(): void {
     this.isAttached = true;
     // Additional actions can be taken when an Entity is attached.
 }
 // ...
}

Type parameters

Name Type Description
Props Props Type of input props of the Entity.
DefaultProps extends Object = {} Type of default input props of the Entity.
Root extends GenericRootEntity<unknown> = GenericRootEntity<unknown> Root Entity Class.

Constructors

constructor

new GenericEntity<Props, DefaultProps, Root>(props)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Root extends GenericRootEntity<unknown, {}, Root> = GenericRootEntity<unknown, {}>
Parameters
Name Type Description
props Props The value of input props.

Accessors

parent

get parent(): null | GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>>

Get parent entity.

Returns

null | GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>>


root

get root(): null | Root

Get root entity.

Returns

null | Root

Methods

update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<Props> New props values.
Returns

void

Class: GenericGroupEntity<Props, DefaultProps, Root>

Entity that aggregates multiple Entities, and allows you to publicly add and remove entities to a subtree.

Example

type MMapSomeGroupEntityProps = {
 name?: string;
};
const defaultProps = {
 name: 'entity'
};
class MMapSomeGroupEntity extends GenericGroupEntity<MMapSomeGroupEntityProps, typeof defaultProps> {
 // ...
}
const groupEntity = new MMapSomeGroupEntity()
const someEntity = new MMapSomeEntity(); // MMapSomeEntity extends GenericEntity
groupEntity.addChild(someEntity); // add someEntity in MMapSomeGroupEntity object
groupEntity.removeChild(someEntity); // remove someEntity from MMapSomeGroupEntity object

Type parameters

Name Type Description
Props Props Type of input props of the Entity.
DefaultProps extends Object = {} Type of default input props of the Entity.
Root extends GenericRootEntity<unknown> = GenericRootEntity<unknown> Root Entity Class.

Constructors

constructor

new GenericGroupEntity<Props, DefaultProps, Root>(props, options?)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Root extends GenericRootEntity<unknown, {}, Root> = GenericRootEntity<unknown, {}>
Parameters
Name Type Description
props Props The value of input props.
options? ComplexOptions<Root> Optional options object.
Inherited from

GenericComplexEntity.constructor

new GenericGroupEntity<Props, DefaultProps, Root>(props, children?, options?)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Root extends GenericRootEntity<unknown, {}, Root> = GenericRootEntity<unknown, {}>
Parameters
Name Type
props Props
children? GenericEntity<unknown, {}, Root>[]
options? Omit<ComplexOptions<Root>, "children">
Inherited from

GenericComplexEntity.constructor

Properties

children

readonly children: readonly GenericEntity<unknown, {}, Root>[]
Overrides

GenericComplexEntity.children

Accessors

parent

get parent(): null | GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>>

Get parent entity.

Returns

null | GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>>

Inherited from

GenericComplexEntity.parent


root

get root(): null | Root

Get root entity.

Returns

null | Root

Inherited from

GenericComplexEntity.root

Methods

addChild

addChild(child, index?): GenericGroupEntity<Props, DefaultProps, Root>

Parameters
Name Type
child GenericEntity<unknown, {}, Root>
index? number
Returns

GenericGroupEntity<Props, DefaultProps, Root>

Overrides

GenericComplexEntity.addChild


removeChild

removeChild(child): GenericGroupEntity<Props, DefaultProps, Root>

Parameters
Name Type
child GenericEntity<unknown, {}, Root>
Returns

GenericGroupEntity<Props, DefaultProps, Root>

Overrides

GenericComplexEntity.removeChild


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<Props> New props values.
Returns

void

Inherited from

GenericComplexEntity.update

Class: GenericRootEntity<Props, DefaultProps>

Entity that is root and cannot be added anywhere

Example

type MMapProps = {
 name?: string;
};
class MMap extends GenericRootEntity<MMapProps, typeof defaultProps> {
 // ...
}
// Now we can specify their root element for the Entity
class MMapSomeEntity extends GenericEntity<MMapSomeEntityProps, typeof defaultProps, MMap> {
 // ...
}

Type parameters

Name Type Description
Props Props Type of input props of the Entity.
DefaultProps extends Object = {} Type of default input props of the Entity.

Constructors

constructor

new GenericRootEntity<Props, DefaultProps>(props, options?)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Parameters
Name Type Description
props Props The value of input props.
options? ComplexOptions<GenericRootEntity<unknown, {}>> Optional options object.
Inherited from

GenericGroupEntity.constructor

new GenericRootEntity<Props, DefaultProps>(props, children?, options?)

Type parameters
Name Type
Props Props
DefaultProps extends Object = {}
Parameters
Name Type
props Props
children? GenericEntity<unknown, {}, GenericRootEntity<unknown, {}>>[]
options? Omit<ComplexOptions<GenericRootEntity<unknown, {}>>, "children">
Inherited from

GenericGroupEntity.constructor

Properties

children

readonly children: readonly GenericEntity<unknown, {}, GenericRootEntity<unknown, {}>>[]
Inherited from

GenericGroupEntity.children

Accessors

parent

get parent(): null | GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>>

Get parent entity.

Returns

null | GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>>

Inherited from

GenericGroupEntity.parent


root

get root(): this

Get root entity.

Returns

this

Overrides

GenericGroupEntity.root

Methods

addChild

addChild(child, index?): GenericRootEntity<Props, DefaultProps>

Parameters
Name Type
child GenericEntity<unknown, {}, GenericRootEntity<unknown, {}>>
index? number
Returns

GenericRootEntity<Props, DefaultProps>

Inherited from

GenericGroupEntity.addChild


destroy

Abstract destroy(): void

Completely destroys the entity tree including the current entity

Returns

void


removeChild

removeChild(child): GenericRootEntity<Props, DefaultProps>

Parameters
Name Type
child GenericEntity<unknown, {}, GenericRootEntity<unknown, {}>>
Returns

GenericRootEntity<Props, DefaultProps>

Inherited from

GenericGroupEntity.removeChild


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<Props> New props values.
Returns

void

Inherited from

GenericGroupEntity.update

Class: MMapReactContainer

Deprecated

Use MMapContainer instead

Constructors

constructor

new MMapReactContainer(props, options?)

Parameters
Name Type Description
props ComputedMMapContainerProps<unknown> The value of input props.
options? ComplexOptions<MMap> Optional options object.
Inherited from

MMapContainer.constructor

new MMapReactContainer(props, children?, options?)

Parameters
Name Type
props ComputedMMapContainerProps<unknown>
children? GenericEntity<unknown, {}, MMap>[]
options? Omit<ComplexOptions<MMap>, "children">
Inherited from

MMapContainer.constructor

Properties

children

readonly children: readonly MMapEntity<unknown, {}>[]
Inherited from

MMapContainer.children


element

optional element: Element
Inherited from

MMapContainer.element


[overrideKeyReactify]

static [overrideKeyReactify]: CustomReactify<MMapReactContainer, FC<MMapReactContainerProps<unknown> & {
	children?: ReactNode 
}>>
Inherited from

MMapContainer.overrideKeyReactify(MMapContainer.md#[overrideKeyReactify])


defaultProps

static defaultProps: Object
Type declaration
Name Type
tagName string
Inherited from

MMapContainer.defaultProps

Accessors

parent

get parent(): null | MMapComplexEntity<unknown, {}>

Get parent entity.

Returns

null | MMapComplexEntity<unknown, {}>

Inherited from

MMapContainer.parent


root

get root(): null | MMap

Get root entity.

Returns

null | MMap

Inherited from

MMapContainer.root

Methods

addChild

addChild(child, index?): MMapReactContainer

Parameters
Name Type
child MMapEntity<unknown, {}>
index? number
Returns

MMapReactContainer

Inherited from

MMapContainer.addChild


removeChild

removeChild(child): MMapReactContainer

Parameters
Name Type
child MMapEntity<unknown, {}>
Returns

MMapReactContainer

Inherited from

MMapContainer.removeChild


update

update(changedProps): void

Method for updating props of Entity.

Parameters
Name Type Description
changedProps Partial<ComputedMMapContainerProps<unknown>> New props values.
Returns

void

Inherited from

MMapContainer.update

Class: SphericalMercator

Name

projection.sphericalMercator

Static

Example

// Create a map in the spherical Mercator projection
const map = new mappable.MMap(document.getElementById('MMapsID'), {
    location: {
        center: [54.81971, 24.49359],
        zoom: 6
    },
    projection: new mappable.SphericalMercator()
});
const dataSourceProps = {
    raster: {
        type: 'ground',
        fetchTile: "https://tile.openstreetmap.org/z/y/x"
    }
};
// Add osm tiles
const dataSource = new mappable.MMapTileDataSource({
    id: "osmSource",
    ...dataSourceProps,
});

const layer = new mappable.MMapLayer({
    id: "osm",
    source: "osmSource",
    type: "ground",
});

Implements

Constructors

constructor

new SphericalMercator()

Methods

fromWorldCoordinates

fromWorldCoordinates(world): LngLat

Parameters
Name Type
world WorldCoordinates
Returns

LngLat

Implementation of

Projection.fromWorldCoordinates


toWorldCoordinates

toWorldCoordinates(coords): WorldCoordinates

Parameters
Name Type
coords LngLat
Returns

WorldCoordinates

Implementation of

Projection.toWorldCoordinates

Interface: BaseRouteResponse

Methods

toRoute

toRoute(): RouteFeature

Return requested route as RouteFeature.

Returns

RouteFeature

Interface: DomEvent

Properties

coordinates

coordinates: LngLat

screenCoordinates

screenCoordinates: [number, number]

Interface: DrawingStyle

Properties

cursor

optional cursor: string

element

optional element: HTMLElement

fill

optional fill: string

fillOpacity

optional fillOpacity: number

fillRule

optional fillRule: FillRule

icon

optional icon: DrawingStyleIcon

interactive

optional interactive: boolean

simplificationRate

optional simplificationRate: number

stroke

optional stroke: Stroke

zIndex

optional zIndex: number

Interface: DrawingStyleIcon

Properties

offset

optional readonly offset: [number, number]

scale

optional readonly scale: number

url

readonly url: string

Interface: MMapContainerProps<TContext>

Type parameters

Name
TContext

Properties

className

optional className: string

context

optional context: MMapContext<TContext>

style

optional style: CSSProperties

tagName

optional tagName: string

Interface: MMapContainerPropsImpl<TContext>

Type parameters

Name
TContext

Properties

onContext

onContext: (`context?`: TContext) => void
Type declaration

(context?): void

Parameters
Name Type
context? TContext
Returns

void


onElement

onElement: (`element?`: Element) => void
Type declaration

(element?): void

Parameters
Name Type
element? Element
Returns

void

Interface: RasterTileDataSourceDescription

Properties

fetchHotspots

optional fetchHotspots: FetchHotspotsFunction

Returns promise that is going to be resolved by hotspots for tile, or rejected with {name: 'AbortError'}.
Hotspots are expected to be sorted from bottom to top (aka far to near).


fetchTile

fetchTile: string | ComposeTileUrlFunction | FetchTileFunction

Either template tile url:

  • x y z placeholders for tile coordinates
  • scale placeholders for pixel scale (e.g. retina is 2)
    Or function that returns final url.
    Or function that fetches tile manually.

hotspotAbortRadius

optional hotspotAbortRadius: number

Defines maximum distance between tile and pointer, till which we keep alive unfinished requests
for hotspots for that tile.


hotspotInset

optional hotspotInset: number

Defines how far inside into tile hotspots from other tile can go.
For example, tile may have a little part of POI from neightbour tile, but no hotspot for it in data.


hotspotPadding

optional hotspotPadding: number

Defines how much pixels should be added to hotspot to increase its area.
Moves each point of hotspot X pixels away from the center of the hotspots.
NOTE: Currently works only on hotspots with Polygon geometry.


size

optional size: number

Tile size in pixels. Default is 256.


transparent

optional transparent: boolean

type

type: string

Name of data provided by this data source. Should be referenced in layer.

Interface: RouteOptions

Properties

avoidTolls

optional avoidTolls: boolean

Avoid roads with tolls. Default is false.


bounds

optional bounds: boolean

If specified, bounding box of the route will be returned in properties. Default is false.


points

points: LngLat[]

Route points represented by LngLat coordinates.


type

type: "driving"

Route type. Only 'driving' type is available at this moment.

Interface: VectorTileDataSourceDescription

Properties

allObjectsInteractive

optional allObjectsInteractive: boolean

collisionPriority

optional collisionPriority: VectorObjectsCollisionPriority

customization

optional customization: VectorCustomization

fontListUrl

optional fontListUrl: string

fontObjectUrl

optional fontObjectUrl: string

glyphRangeUrl

optional glyphRangeUrl: string

glyphRequestHeaders

optional glyphRequestHeaders: Record<string, string>

glyphRequestWithCredentials

optional glyphRequestWithCredentials: boolean

hotspots

optional hotspots: Record<string, boolean | FetchHotspotsFunction | HotspotsOptions>

Defines how hotspots of type should be treated: enabled/disabled or use custom hotspots instead.


iconRequestHeaders

optional iconRequestHeaders: Record<string, string>

iconsOnlyTiles

optional iconsOnlyTiles: boolean

Forces tiles to wait for the icons, disables hiding icons by zoom diff


imageRequestWithCredentials

optional imageRequestWithCredentials: boolean

imageUrl

optional imageUrl: string

indoorPlanUrl

optional indoorPlanUrl: string

lowPrecisionBeltTiles

optional lowPrecisionBeltTiles: boolean

meshRequestHeaders

optional meshRequestHeaders: Record<string, string>

meshRequestWithCredentials

optional meshRequestWithCredentials: boolean

meshUrl

optional meshUrl: string

priority

priority: VectorDataSourcePriority

requestTileSize

optional requestTileSize: VectorTileSize

richModelCacheSize

optional richModelCacheSize: number

richModelEnabled

optional richModelEnabled: boolean

richModelRequestHeaders

optional richModelRequestHeaders: Record<string, string>

richModelRequestWithCredentials

optional richModelRequestWithCredentials: boolean

richModelUrl

optional richModelUrl: string

styleUrl

optional styleUrl: string

theme

optional theme: "dark"

tileBeltSize

optional tileBeltSize: number

tileCacheSize

optional tileCacheSize: number

tileFormat

optional tileFormat: "vmap2" | "vmap3"

Default is 'vmap2'


tileRequestHeaders

optional tileRequestHeaders: Record<string, string>

tileRequestWithCredentials

optional tileRequestWithCredentials: boolean

tileUrl

tileUrl: string

Interface: ZoomRange

Properties

max

max: number

min

min: number

Interface: Apikeys

Properties

router

optional router: string

suggest

optional suggest: string

Interface: Camera

Properties

azimuth

readonly azimuth: number

tilt

readonly tilt: number

worldCenter

readonly worldCenter: WorldCoordinates

zoom

readonly zoom: number

Interface: ComplexOptions<Root>

Type parameters

Name Type
Root extends GenericRootEntity<unknown> = GenericRootEntity<unknown>

Properties

children

optional children: GenericEntity<unknown, {}, Root>[]

container

optional container: boolean

Interface: DraggableProps<Callback>

Type parameters

Name
Callback

Properties

blockBehaviors

optional blockBehaviors: boolean

Will block maps behaviors on marker


blockEvents

optional blockEvents: boolean

Will block maps events on marker


draggable

optional draggable: boolean

Feature can be draggable


mapFollowsOnDrag

optional mapFollowsOnDrag: boolean | {
	activeZoneMargin?: Margin 
}

Will map center follows marker on drag if marker near the edge of the map


onDragEnd

optional onDragEnd: Callback

Maybe a function which will be called when the user drags and drops the element to a new position in the map.
The arguments to the function will be with new coordinates.
A component using with component should immediately store the new coordinates into its state and then pass
the new coordinates as the marker's props.


onDragMove

optional onDragMove: Callback

Fires on drag move


onDragStart

optional onDragStart: Callback

Fires on drag start

Interface: FeatureClickEvents

Properties

onClick

optional onClick: (`event`: MouseEvent) => void
Type declaration

(event): void

Click handler

Parameters
Name Type
event MouseEvent
Returns

void


onDoubleClick

optional onDoubleClick: (`event`: MouseEvent) => void
Type declaration

(event): void

Double click handler

Parameters
Name Type
event MouseEvent
Returns

void


onFastClick

optional onFastClick: (`event`: MouseEvent) => void
Type declaration

(event): void

Fast click handler

Parameters
Name Type
event MouseEvent
Returns

void

Interface: FetchedTile

Properties

image

image: ImageBitmap | HTMLCanvasElement | HTMLImageElement

Interface: GenericFeature<TCoordinates>

Type parameters

Name
TCoordinates

Properties

geometry

geometry: GenericGeometry<TCoordinates>

id

id: string

properties

optional properties: Record<string, unknown>

type

type: "Feature"

Interface: GenericLineStringGeometry<TCoordinates>

Type parameters

Name
TCoordinates

Properties

coordinates

coordinates: TCoordinates[]

type

type: "LineString"

Interface: GenericMultiLineStringGeometry<TCoordinates>

Type parameters

Name
TCoordinates

Properties

coordinates

coordinates: TCoordinates[][]

type

type: "MultiLineString"

Interface: GenericMultiPolygonGeometry<TCoordinates>

Type parameters

Name
TCoordinates

Properties

coordinates

coordinates: TCoordinates[][][]

Array of polygons. See GenericPolygonGeometry.


type

type: "MultiPolygon"

Interface: GenericPointGeometry<TCoordinates>

Type parameters

Name
TCoordinates

Properties

coordinates

coordinates: TCoordinates

type

type: "Point"

Interface: GenericPolygonGeometry<TCoordinates>

Type parameters

Name
TCoordinates

Properties

coordinates

coordinates: TCoordinates[][]

Polygon's rings.

Remarks

Inner rings may extend beyond outer ring.
GeoJSON doesn't allow this, but there's a lot of data like this in this JS API.


type

type: "Polygon"

Interface: GenericProjection<TSource>

Type parameters

Name
TSource

Methods

fromWorldCoordinates

fromWorldCoordinates(coordinates): TSource

Parameters
Name Type
coordinates WorldCoordinates
Returns

TSource


toWorldCoordinates

toWorldCoordinates(point): WorldCoordinates

Parameters
Name Type
point TSource
Returns

WorldCoordinates

Interface: HotspotFeature<TCoordinates>

Type parameters

Name
TCoordinates

Properties

geometry

optional geometry: GenericGeometry<TCoordinates>

id

id: string

properties

properties: Record<string, unknown>

type

type: "Feature"

Interface: HotspotsOptions

Properties

minZoom

optional minZoom: number

Interface: IndoorLevel

Properties

id

id: string

isUnderground

optional isUnderground: boolean

name

name: string

Interface: IndoorPlan

Properties

source

source: string

Methods

getActiveLevel

getActiveLevel(): IndoorLevel

Returns

IndoorLevel


getBounds

getBounds(): [[number, number], [number, number]]

Returns bounds of indoor plan in [[lng, lat], [lng, lat]].

Returns

[[number, number], [number, number]]


getDefaultLevel

getDefaultLevel(): IndoorLevel

Returns

IndoorLevel


getId

getId(): string

Returns

string


getLevels

getLevels(): IndoorLevel[]

Returns

IndoorLevel[]


getOpacity

getOpacity(): number

Returns

number


isVisible

isVisible(): boolean

Returns

boolean


setActiveLevel

setActiveLevel(id): void

Parameters
Name Type
id string
Returns

void


setOpacity

setOpacity(value): void

Parameters
Name Type
value number
Returns

void


setVisible

setVisible(value): void

Parameters
Name Type
value boolean
Returns

void

Interface: LayerImplementationClasses

Callable

LayerImplementationClasses

LayerImplementationClasses<Result>(props): Result

Type parameters
Name Type
Result extends RasterLayerImplementationConstructor = RasterLayerImplementationConstructor
Parameters
Name Type
props LayerImplementationClassesProps<"raster">
Returns

Result

LayerImplementationClasses

LayerImplementationClasses<Result>(props): Result

Type parameters
Name Type
Result extends VectorLayerImplementationConstructor = VectorLayerImplementationConstructor
Parameters
Name Type
props LayerImplementationClassesProps<"vector">
Returns

Result

Interface: LayerImplementationRenderProps

Properties

size

size: PixelCoordinates

Interface: MapState

Methods

getLayerState

getLayerState(layerId, type, effectiveMode?): undefined | Record<string, unknown>

Parameters
Name Type
layerId string
type string
effectiveMode? "raster" | "vector"
Returns

undefined | Record<string, unknown>

getLayerState(layerId, type, effectiveMode?): undefined | TileLayerState

Parameters
Name Type
layerId string
type "tile"
effectiveMode? "raster" | "vector"
Returns

undefined | TileLayerState

Interface: Matrix4

Matrix stored as an array in column-major order:

[
    m11, m21, m31, m41,
    m12, m22, m32, m42,
    m13, m23, m33, m43,
    m14, m24, m34, m44
],

where mij - matrix element in the i-th row and j-th column.

Indexable

▪ [i: number]: number

Properties

length

readonly length: number

Interface: PaletteEntry

Properties

color

color: string

count

count: number

Interface: PixelCoordinates

Global pixel coordinates. World size depends on zoom.
Left top is (0; 0).
Right bottom is (2**(zoom + 8); 2**(zoom + 8)).

Properties

type

optional readonly type: "pixel"

x

x: number
Inherited from

Vec2.x


y

y: number
Inherited from

Vec2.y

Interface: RasterLayerImplementation

Methods

destroy

destroy(): void

Returns

void


render

render(props): void

Parameters
Name Type
props RasterLayerImplementationRenderProps
Returns

void

Interface: RasterLayerImplementationConstructor

Constructors

constructor

new RasterLayerImplementationConstructor(props)

Parameters
Name Type
props RasterLayerImplementationConstructorProps

Interface: RasterLayerImplementationConstructorProps

Properties

camera

camera: Camera

element

element: HTMLElement

options

optional options: RasterLayerOptions

projection

projection: GenericProjection<unknown>

requestRender

requestRender: () => void
Type declaration

(): void

Returns

void


size

size: PixelCoordinates

worldOptions

worldOptions: WorldOptions

Interface: RasterLayerImplementationRenderProps

Properties

camera

camera: Camera

size

size: PixelCoordinates
Inherited from

LayerImplementationRenderProps.size


worlds

worlds: WorldOffset[]

Interface: ReactParent

Properties

entityRef

entityRef: RefInstance<GenericEntity<unknown, {}, GenericRootEntity<unknown, {}>>>

Methods

positionChild

positionChild(entity): number

Parameters
Name Type
entity RefInstance<GenericEntity<unknown, {}, GenericRootEntity<unknown, {}>>>
Returns

number


requestReposition

requestReposition(): void

Returns

void

Interface: RenderedHotspot

Properties

feature

readonly feature: HotspotFeature<unknown>

geometry

readonly geometry: GenericGeometry<PixelCoordinates>

type

readonly type: "rendered"

Interface: ResizeObject

Properties

mapInAction

mapInAction: boolean

size

size: Readonly<PixelCoordinates>

type

type: "resize"

Interface: RouteFeature

Properties

geometry

geometry: LineStringGeometry
Overrides

GenericFeature.geometry


id

id: string
Inherited from

GenericFeature.id


properties

properties: Object
Type declaration
Name Type
bounds? LngLatBounds
flags? { hasNonTransactionalTolls?: boolean ; hasTolls?: boolean }
flags.hasNonTransactionalTolls? boolean
flags.hasTolls? boolean
Overrides

GenericFeature.properties


type

type: "Feature"
Inherited from

GenericFeature.type

Interface: StrokeStyle

Properties

color

optional color: string

dash

optional dash: number[]

opacity

optional opacity: number

palette

optional palette: Palette

simplifyPalette

optional simplifyPalette: boolean

width

optional width: number

Interface: TileLayerState

Properties

tilesLoaded

tilesLoaded: number

Number of tiles loaded from the server.


tilesReady

tilesReady: number

Number of tiles ready to be displayed.


tilesTotal

tilesTotal: number

Total number of tiles in the visible area.

Interface: UpdateObject

Properties

camera

camera: MMapCamera

location

location: Required<MMapLocation>

mapInAction

mapInAction: boolean

type

type: "update"

Interface: Vec2

Properties

x

x: number

y

y: number

Interface: VectorLayerImplementation

Methods

destroy

destroy(): void

Returns

void


render

render(props): Object

Parameters
Name Type
props VectorLayerImplementationRenderProps
Returns

Object

Name Type
color WebGLTexture
depth? WebGLTexture

Interface: VectorLayerImplementationConstructor

Constructors

constructor

new VectorLayerImplementationConstructor(gl, options)

Parameters
Name Type
gl WebGLRenderingContext
options Object
options.requestRender () => void

Interface: VectorLayerImplementationRenderProps

Properties

camera

camera: Camera

size

size: PixelCoordinates
Inherited from

LayerImplementationRenderProps.size


worlds

worlds: {
	lookAt: Vec2;
	viewProjMatrix: Matrix4 
}[]

Interface: WorldCoordinates

Coordinates in [-1 ... +1].
Left bottom is (-1; -1).
Right top is (+1; +1).
Center is (0; 0).

Properties

type

optional readonly type: "world"

x

x: number
Inherited from

Vec2.x


y

y: number
Inherited from

Vec2.y


z

optional z: number

Interface: WorldHotspot

Properties

feature

readonly feature: HotspotFeature<unknown>

geometry

readonly geometry: GenericGeometry<WorldCoordinates>

type

readonly type: "world"

Interface: WorldOffset

Properties

height

readonly height: number

left

readonly left: number

top

readonly top: number

width

readonly width: number

Interface: WorldOptions

Properties

cycledX

readonly cycledX: boolean

Type Aliases

BehaviorEvents

BehaviorEvents: Object
Type declaration
Name Type
onActionEnd BehaviorMapEventHandler
onActionStart BehaviorMapEventHandler

BehaviorMapEventHandler

BehaviorMapEventHandler: (`object`: {
	camera: MMapCamera;
	location: Location;
	type: BehaviorType 
}) => void
Type declaration

(object): void

Parameters
Name Type
object Object
object.camera MMapCamera
object.location Location
object.type BehaviorType
Returns

void


BehaviorType

BehaviorType: "drag" | "pinchZoom" | "scrollZoom" | "dblClick" | "magnifier" | "oneFingerZoom" | "mouseRotate" | "mouseTilt" | "pinchRotate" | "panTilt"

ComputedMMapContainerProps

ComputedMMapContainerProps<TContext\>: MMapContainerProps<TContext> & MMapContainerPropsImpl<TContext>
Type parameters
Name
TContext

DomDetach

DomDetach: () => void
Type declaration

(): void

Returns

void


DomEventHandler

DomEventHandler: (`object`: DomEventHandlerObject, `event`: DomEvent) => void
Type declaration

(object, event): void

Parameters
Name Type
object DomEventHandlerObject
event DomEvent
Returns

void


DomEventHandlerObject

DomEventHandlerObject: HandlerEntity<"feature", MMapFeature> | HandlerEntity<"marker", MMapMarker> | HandlerEntity<"hotspot", MMapHotspot> | undefined

DomEvents

DomEvents: Object
Type declaration
Name Type
onClick DomEventHandler
onContextMenu DomEventHandler
onDblClick DomEventHandler
onFastClick DomEventHandler
onMouseDown DomEventHandler
onMouseEnter DomEventHandler
onMouseLeave DomEventHandler
onMouseMove DomEventHandler
onMouseUp DomEventHandler
onPointerCancel DomEventHandler
onPointerDown DomEventHandler
onPointerMove DomEventHandler
onPointerUp DomEventHandler
onRightDblClick DomEventHandler
onTouchCancel DomEventHandler
onTouchEnd DomEventHandler
onTouchMove DomEventHandler
onTouchStart DomEventHandler

EasingBezierPreset

EasingBezierPreset: Object
Type declaration
Name Type
p1 Vec2
p2 Vec2

EasingFunction

EasingFunction: (`x`: number) => number
Type declaration

(x): number

Parameters
Name Type
x number
Returns

number


EasingFunctionDescription

EasingFunctionDescription: EasingPresetName | EasingBezierPreset | EasingFunction

EasingPresetName

EasingPresetName: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out"

Feature

Feature: Object
Type declaration
Name Type
geometry? { coordinates: LngLat ; type: "Point" }
geometry.coordinates LngLat
geometry.type "Point"
properties { description: string ; name: string }
properties.description string
properties.name string

FetchConfigOptions

FetchConfigOptions: Object

Request options

Type declaration
Name Type Description
lang string Language
signal? AbortSignal Signal to abort request

IndoorPlansHandler

IndoorPlansHandler: (`object`: {
	indoorPlans: readonly IndoorPlan[] | null;
	type: IndoorPlanType 
}) => void
Type declaration

(object): void

Parameters
Name Type
object Object
object.indoorPlans readonly IndoorPlan[] | null
object.type IndoorPlanType
Returns

void


LngLat

LngLat: [lon: number, lat: number, alt?: number]

Tuple with geodesic coordinates in longitude latitude order.
GeoJSON also uses this order https://tools.ietf.org/html/rfc7946#appendix-A.1


LngLatBounds

LngLatBounds: GenericBounds<LngLat>

Rectangle bounded by bottom-left and top-right coordinates


MMapBoundsLocation

MMapBoundsLocation: Object

Sets map bounds.

Type declaration
Name Type
bounds LngLatBounds

MMapCameraRequest

MMapCameraRequest: MMapCamera & {
	duration?: number;
	easing?: EasingFunctionDescription 
}

MMapCenterLocation

MMapCenterLocation: Object

Sets map center.

Type declaration
Name Type
center LngLat

MMapCenterZoomLocation

MMapCenterZoomLocation: MMapCenterLocation & MMapZoomLocation

Sets map center and zoom. Combination of MMapCenterLocation and MMapZoomLocation


MMapControlButtonProps

MMapControlButtonProps: MMapControlCommonButtonProps

MMapControlProps

MMapControlProps: Object

MMapControl props


MMapControlsProps

MMapControlsProps: Object

MMapControls props

Type declaration
Name Type Description
orientation? Orientation Controls orientation.
position Position Controls position.

MMapCopyrightsPosition

MMapCopyrightsPosition: "top left" | "top right" | "bottom left" | "bottom right"

MMapDefaultFeaturesLayerProps

MMapDefaultFeaturesLayerProps: Object

MMapDefaultFeaturesLayer props

Type declaration
Name Type Description
visible? boolean Should show layer. Default is true
zIndex? number Layer z-index

MMapDefaultSchemeLayerProps

MMapDefaultSchemeLayerProps: Object

MMapDefaultSchemeLayer props

Type declaration
Name Type Description
customization? VectorCustomization Vector tiles customization.
theme? "dark" | "light" Theme applied to the scheme Deprecated use MMapProps.theme prop in MMap instead
visible? boolean Should show layer

MMapFeatureDataSourceProps

MMapFeatureDataSourceProps: Object

MMapFeatureDataSource props

Type declaration
Name Type Description
id string Data source id

MMapFeatureProps

MMapFeatureProps: {
	disableRoundCoordinates?: boolean;
	geometry: Geometry;
	hideOutsideViewport?: HideOutsideRule;
	id?: string;
	properties?: Record<string, unknown>;
	source?: string;
	style?: DrawingStyle 
} & DraggableProps<MMapFeatureEventHandler> & FeatureClickEvents

MMapFeature props


MMapLayerProps

MMapLayerProps: Object

MMapLayer props

Type declaration
Name Type Description
grouppedWith? string Layer id to control order in parent group
id? string Layer id
implementation? LayerImplementationClasses Method, allows you to define your own implementation of the layer
options? { raster?: RasterLayerOptions } Layer options
options.raster? RasterLayerOptions -
source? string Layer source
type string Layer type. For tile data sources should use 'ground'
zIndex? number Layer z-index to control order. Default is 1500

MMapListenerProps

MMapListenerProps: DomEventsProps | NullablePartial<MapEvents> | NullablePartial<BehaviorEvents>

MMapLocationRequest

MMapLocationRequest: MMapBoundsLocation | MMapCenterLocation | MMapZoomLocation | MMapCenterZoomLocation & {
	duration?: number;
	easing?: EasingFunctionDescription 
}

Describes how to change current map location. Change can be instantenious or animated if duration property is set.


MMapMarkerEventHandler

MMapMarkerEventHandler: (`coordinates`: LngLat) => void | false
Type declaration

(coordinates): void | false

MMapMarker events handler

Parameters
Name Type
coordinates LngLat
Returns

void | false


MMapMarkerProps

MMapMarkerProps: {
	coordinates: LngLat;
	disableRoundCoordinates?: boolean;
	hideOutsideViewport?: HideOutsideRule;
	id?: string;
	properties?: Record<string, unknown>;
	source?: string;
	zIndex?: number 
} & DraggableProps<MMapMarkerEventHandler> & FeatureClickEvents

MMapMarker props


MMapProps

MMapProps: Object

MMap props

Type declaration
Name Type Description
behaviors? BehaviorType[] Active behaviors
camera? MMapCameraRequest Initial camera or request to change camera with duration
className? string Map container css class name
config? Config Other configs
copyrightsPosition? MMapCopyrightsPosition Position of copyright on the page. Default is 'bottom right'
hotspotsStrategy? "forViewport" | "forPointerPosition" Strategy for fetching hotspots, for whole viewport or for tiles that pointer is hovering at
location MMapLocationRequest Initial location or request to change location with duration
margin? Margin Map margins
mode? MapMode Map mode, 'auto' (default. Show raster tiles while vector tiles are loading), 'raster' or 'vector' (without raster preloading).
projection? Projection Projection used in map
restrictMapArea? LngLatBounds | false Sets the map view area so that the user cannot move outside of this area.
theme? MMapTheme Theme applied to the scheme
worldOptions? WorldOptions Whether to repeat the world in X and Y
zoomRange? ZoomRange Restrict min and max map zoom
zoomRounding? ZoomRounding Set rounding for zoom. If auto is selected, zoom will be snap for raster and smooth for vector MapMode. Default is auto.
zoomStrategy? ZoomStrategy Zoom strategy describes if map center is bound to the zoom point or not

MMapTheme

MMapTheme: "light" | "dark"

Sets map theme


MMapThemeContext

MMapThemeContext: Object
Type declaration
Name Type
theme MMapTheme

MMapTileDataSourceProps

MMapTileDataSourceProps: Object

MMapTileDataSource props

Type declaration
Name Type Description
clampMapZoom? boolean Restrict min and max map zoom. Result map zoomRange will be the intersection of the map zoomRange and all data sources with the clampMapZoom option enabled
copyrights? string[] Data source copyrights
id string Data source id
raster? RasterTileDataSourceDescription Raster data source description
zoomRange? ZoomRange Min and max zoom for tiles

MMapZoomLocation

MMapZoomLocation: Object

Sets map zoom.

Type declaration
Name Type
zoom number

MapEventReadyStateChangeHandler

MapEventReadyStateChangeHandler: MapEventHandler<MapState>

MapEventResizeHandler

MapEventResizeHandler: MapEventHandler<ResizeObject>

MapEventUpdateHandler

MapEventUpdateHandler: MapEventHandler<UpdateObject>

MapEvents

MapEvents: Object
Type declaration
Name Type
onResize MapEventResizeHandler
onStateChanged MapEventReadyStateChangeHandler
onUpdate MapEventUpdateHandler

MapMode

MapMode: "raster" | "vector" | "auto"

Margin

Margin: [number, number, number, number]

Map margins in pixels. Order is top, right, bottom, left.


NullablePartial

NullablePartial<T\>: { [P in keyof T]?: T[P] \| null }
Type parameters
Name
T

RasterLayerOptions

RasterLayerOptions: Record<string, unknown> & {
	awaitAllTilesOnFirstDisplay?: boolean;
	opacity?: number;
	tileRevealDuration?: number 
}

ReadonlyLngLat

ReadonlyLngLat: Readonly<LngLat>

Readonly version of LngLat


SearchOptions

SearchOptions: Object
Type declaration
Name Type Description
bounds? LngLatBounds bounds parameter has priority over center and SearchOptions.spn span
center? LngLat LngLat of the center point of search area. span parameter sets the length of the search area.
limit? number The maximum amount of returned objects. Parameter has to be specified explicitly if offset parameter is provided. 10 is default. 100 is maximum.
offset? number The amount of objects (if any returned) that are skipped starting from the first one. Parameter limit must be provided.
span? LngLat Parameter span is specified with two numbers that represent differences between the minimum and maximum: - longitude of the area - latitude of the area
strictBounds? boolean Flag that defines whether search area is restricted by the provided parameters. Area restriction is specified by center and span parameters or bounds parameter. false — the search area is not restricted true — the search area is restricted
text string Request string represented by a text or LngLat point.
type? SearchType[] type parameter specifies the type of objects that are being searched (and the order of objects if both types are queried): - toponyms - businesses
zoom? number Deprecated Map zoom.

SearchResponse

SearchResponse: Feature[]

SearchType

SearchType: "businesses" | "toponyms"

SuggestOptions

SuggestOptions: Object
Type declaration
Name Type Description
bounds? LngLatBounds -
center? LngLat -
countries? string Deprecated
highlight? boolean -
limit? number -
localOnly? number -
span? LngLat -
text string -
type? DeprecatedGeoSuggestType Deprecated use types instead
types? GeoSuggestType[] -

SuggestResponse

SuggestResponse: SuggestResponseItem[]

SuggestResponseItem

SuggestResponseItem: Object
Type declaration
Name Type Description
distance? Distance Distance to the object in meters
subtitle? TextWithHighlight Human-readable object subtitle with matching highlighting
tags? string[] Object tags. Possible values: business, street, metro, district, locality, area, province, country, hydro, railway, station, route, vegetation, airport, other, house
title TextWithHighlight Human-readable object title with matching highlighting
type? DeprecatedObjectType Deprecated Use tags instead
uri? string Additional object information that can be used in a Geocoder HTTP API request.
value string Deprecated Use uri instead

VectorCustomization

VectorCustomization: VectorCustomizationItem[]

VectorCustomizationElements

VectorCustomizationElements: "geometry" | "geometry.fill" | "geometry.fill.pattern" | "geometry.outline" | "label" | "label.icon" | "label.text" | "label.text.fill" | "label.text.outline"

VectorCustomizationItem

VectorCustomizationItem: Object
Type declaration
Name Type
elements? VectorCustomizationElements | VectorCustomizationElements[]
stylers? VectorCustomizationStyler | VectorCustomizationStyler[]
tags? { all?: string | string[] ; any?: string | string[] ; none?: string | string[] } | string
types? VectorCustomizationTypes | VectorCustomizationTypes[]

VectorCustomizationTypes

VectorCustomizationTypes: "point" | "polyline" | "polygon"

VectorDataSourcePriority

VectorDataSourcePriority: "low" | "medium" | "high"

VectorObjectsCollisionPriority

VectorObjectsCollisionPriority: "low" | "medium" | "high" | "ultra"

VectorTileSize

VectorTileSize: "X1" | "X4" | "X16"

ZoomRounding

ZoomRounding: "snap" | "smooth" | "auto"

Set rounding for zoom.
If auto is selected, zoom will be snap for raster and smooth for vector MapMode.
Default is auto.


ZoomStrategy

ZoomStrategy: "zoomToCenter" | "zoomToPointer"

Variables

ThemeContext

const ThemeContext: MMapContext<MMapThemeContext>

geolocation

const geolocation: Object
Type declaration
Name Type
getPosition typeof getPosition

mappableMaps

const mappableMaps: MappableMaps

optionsKeyVuefy

const optionsKeyVuefy: unique symbol

overrideKeyReactify

const overrideKeyReactify: unique symbol

Key is used in reactify wrapper, to define custom implementations for react mappable.MMapEntity entities

type MMapSomeClassProps = {
    id: string;
};
export class MMapSomeClass extends mappable.MMapComplexEntity<MMapSomeClassProps> {
 static [mappable.overrideKeyReactify] = MMapSomeClassReactifyOverride;
 //...
}

and

export const MMapSomeClassReactifyOverride = (
  MMapSomeClassI, // it is same MMapSomeClass
  {reactify, React}
) => {
  const MMapSomeClassReactified = reactify.entity(MMapSomeClassI); // Standard reactivation method
    const MMapSomeClassR = React.forwardRef((props, ref) => {
      return (<>
        <MMapSomeClassReactified {...props} ref={ref} ... />
      </>);
    })
  return MMapSomeClassR;
}

and in the end app

import {MMapSomeClass} from './some-class';
import React from 'react';
import ReactDOM from 'react-dom';
// ...
const mappableReact = await mappable.import('@mappable-world/mappable-reactify');
const reactify = mappableReact.reactify.bindTo(React, ReactDOM);
const {MMapSomeClass as MMapSomeClassR} = reactify.module({MMapSomeClass});

function App() {
    return <MMapSomeClassR id="some_id"/>;
}

overrideKeyVuefy

const overrideKeyVuefy: unique symbol

strictMode

strictMode: boolean

Toggle this to enable/disable strict mode.

Functions

fetchConfig

fetchConfig(options, config?): Promise<Config>

Requests config which is necessary for a map construction

Parameters
Name Type Description
options FetchConfigOptions Request options
config? Config Current config
Returns

Promise<Config>

config for map construction


getDefaultConfig

getDefaultConfig(): Config

Returns

Config


route

route(options, config?): Promise<BaseRouteResponse[]>

Parameters
Name Type
options RouteOptions
config? Config
Returns

Promise<BaseRouteResponse[]>


search(options, config?): Promise<SearchResponse>

Static function to work with Search API.

Parameters
Name Type Description
options SearchOptions Request options
config? Config Current config
Returns

Promise<SearchResponse>


suggest

suggest(options, config?): Promise<SuggestResponse>

Static function to work with Suggest API.

Parameters
Name Type Description
options SuggestOptions Request options
config? Config Current config
Returns

Promise<SuggestResponse>


useDomContext

useDomContext(entity, element, container): DomDetach

Hook for providing DOM context in entity

Parameters
Name Type Description
entity GenericComplexEntity<unknown, {}, GenericRootEntity<unknown, {}>> Entity to provide the DomContext
element Element Dom element that is passed to DomContext
container null | Element Inner DOM element that is passed to the DOMContext
Returns

DomDetach

Function that detaches the DOM element and DomContext from the entity

Module: <internal>

Type Aliases

ComposeTileUrlFunction

ComposeTileUrlFunction: (`x`: number, `y`: number, `z`: number, `scale`: number, `signal`: AbortSignal) => string
Type declaration

(x, y, z, scale, signal): string

Parameters
Name Type
x number
y number
z number
scale number
signal AbortSignal
Returns

string


CustomReactify

CustomReactify<TEntity,
 TResult\>: (`ctor`: EntityConstructor<TEntity>, `params`: {
	React: typeof TReact;
	ReactDOM: typeof TReactDOM;
	ReactParent: typeof ReactParent;
	reactify: {
		context: <TContext>(`context?`: TContext) => TReact.Context<unknown>;
		module: ReactifyModule;
		entity: <T>(...`args`: [ctor: T, displayName?: string]) => T extends Overrided<T, TResult> ? TResult : ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<EntityProps<InstanceType<T>>>> & RefAttributes<undefined | InstanceType<T>>> 
	} 
}) => TResult
Type parameters
Name Type
TEntity extends GenericEntity<unknown>
TResult TResult
Type declaration

(ctor, params): TResult

Parameters
Name Type
ctor EntityConstructor<TEntity>
params Object
params.React typeof TReact
params.ReactDOM typeof TReactDOM
params.ReactParent typeof ReactParent
params.reactify Object
params.reactify.context <TContext>(context?: TContext) => TReact.Context<unknown>
params.reactify.module ReactifyModule
params.reactify.entity <T>(...args: [ctor: T, displayName?: string]) => T extends Overrided<T, TResult> ? TResult : ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<EntityProps<InstanceType<T>>>> & RefAttributes<undefined | InstanceType<T>>>
Returns

TResult


DefaultProps

DefaultProps: typeof defaultProps

DefaultProps

DefaultProps: typeof defaultProps

DefaultProps

DefaultProps: typeof defaultProps

DefaultProps

DefaultProps: typeof defaultProps & {
	id: string 
}

DefaultProps

DefaultProps: typeof defaultProps

DefaultProps

DefaultProps: typeof defaultProps

DefaultProps

DefaultProps: typeof defaultProps & {
	id: string 
}

DeprecatedGeoSuggestType

DeprecatedGeoSuggestType: "all" | "toponyms" | "addresses" | "organizations"

DeprecatedObjectType

DeprecatedObjectType: "unknown" | "toponym" | "business" | "transit"

Distance

Distance: Object
Type declaration
Name Type
text string
value number

DomEventsProps

DomEventsProps: Partial<DomEvents> & {
	layer?: string 
}

EntityConstructor

EntityConstructor<TEntity\>: (...`args`: any[]) => TEntity
Type parameters
Name Type
TEntity extends GenericEntity<unknown>
Type declaration

(...args)

Parameters
Name Type
...args any[]

EntityProps

EntityProps<T\>: T extends GenericEntity<infer P> ? P : never
Type parameters
Name Type
T extends GenericEntity<unknown>

FetchHotspotsFunction

FetchHotspotsFunction: (`x`: number, `y`: number, `z`: number, `signal`: AbortSignal) => Promise<Hotspot[]>
Type declaration

(x, y, z, signal): Promise<Hotspot[]>

Provides hotspots for given tile coordinates and zoom.

Parameters
Name Type Description
x number Tile X
y number Tile Y
z number Tile Z
signal AbortSignal is used to abort request in case if hotspots for given tile are no longer required
Returns

Promise<Hotspot[]>


FetchTileFunction

FetchTileFunction: (`x`: number, `y`: number, `z`: number, `scale`: number, `signal`: AbortSignal) => Promise<FetchedTile>
Type declaration

(x, y, z, scale, signal): Promise<FetchedTile>

Parameters
Name Type
x number
y number
z number
scale number
signal AbortSignal
Returns

Promise<FetchedTile>


FillRule

FillRule: "evenodd" | "nonzero"

GenericBounds

GenericBounds<T\>: [T, T]

Generic for rectangle bounded by bottom-left and top-right coordinates

Type parameters
Name
T

GenericGeometry

GenericGeometry<TCoordinates\>: GenericPolygonGeometry<TCoordinates> | GenericMultiPolygonGeometry<TCoordinates> | GenericLineStringGeometry<TCoordinates> | GenericMultiLineStringGeometry<TCoordinates> | GenericPointGeometry<TCoordinates>
Type parameters
Name
TCoordinates

GeoSuggestType

GeoSuggestType: "biz" | "geo" | "street" | "metro" | "district" | "locality" | "area" | "province" | "country" | "house"

Geometry

Geometry: PolygonGeometry | MultiPolygonGeometry | LineStringGeometry | MultiLineStringGeometry | PointGeometry

HandlerEntity

HandlerEntity<TType,
 TEntity\>: Object
Type parameters
Name Type
TType extends string
TEntity TEntity
Type declaration
Name Type
entity TEntity
type TType

HideOutsideRule

HideOutsideRule: {
	extent: number 
} | boolean

Highlight

Highlight: [number, number]

Positions of chars to highlight between


HorizontalPosition

HorizontalPosition: "left" | "right"

Hotspot

Hotspot: WorldHotspot | RenderedHotspot

IndoorPlanType

IndoorPlanType: "indoorPlansChanged"

LayerImplementationClassesProps

LayerImplementationClassesProps<Mode\>: Object
Type parameters
Name Type
Mode extends "raster" | "vector" = "raster" | "vector"
Type declaration
Name Type
effectiveMode Mode
source string
type string

LineStringGeometry

LineStringGeometry: GenericLineStringGeometry<LngLat>

Location

Location: Required<MMapLocation>

MMapCamera

MMapCamera: Object

Observer camera position

Type declaration
Name Type Description
azimuth? number Map rotation in degrees. Can take values from -180 to 180 degrees
tilt? number Map tilt in radians. Can take values from 0 to 45 degrees (degrees * (Math.PI / 180))

MMapControlCommonButtonProps

MMapControlCommonButtonProps: Object

MMapControlButton props

Type declaration
Name Type Description
background? string Background color
color? string Text color
disabled? boolean Should be disabled
element? HTMLElement HTML element
onClick? () => void On click handler
text? string Text content

MMapFeatureEventHandler

MMapFeatureEventHandler: (`coordinates`: Geometry["coordinates"]) => void | false
Type declaration

(coordinates): void | false

Parameters
Name Type
coordinates Geometry["coordinates"]
Returns

void | false


MMapLocation

MMapLocation: MMapCenterZoomLocation & Partial<MMapBoundsLocation>

Sets map center and zoom or bounds. Combination of

Mixes

MMapZoomLocation and MMapBoundsLocation


MMapReactContainerProps

MMapReactContainerProps<TContext\>: MMapContainerProps<TContext>

Deprecated

Use MMapContainerProps instead

Type parameters
Name
TContext

MapEventHandler

MapEventHandler<TObject\>: (`object`: TObject) => void
Type parameters
Name
TObject
Type declaration

(object): void

Parameters
Name Type
object TObject
Returns

void


MappableMaps

MappableMaps: Object
Type declaration
Name Type
getLink (map: MMap) => string
open (map: MMap) => void

MultiLineStringGeometry

MultiLineStringGeometry: GenericMultiLineStringGeometry<LngLat>

MultiPolygonGeometry

MultiPolygonGeometry: GenericMultiPolygonGeometry<LngLat>

Orientation

Orientation: "horizontal" | "vertical"

Overrided

Overrided<TCtor,
 TReactResult\>: Object
Type parameters
Name Type
TCtor extends EntityConstructor<GenericEntity<unknown>>
TReactResult TReactResult
Type declaration
Name Type
[overrideKeyReactify] CustomReactify<InstanceType<TCtor>, TReactResult>

Palette

Palette: PaletteEntry[]

PointGeometry

PointGeometry: GenericPointGeometry<LngLat>

PolygonGeometry

PolygonGeometry: GenericPolygonGeometry<LngLat>

Position

Position: VerlicalPosition | HorizontalPosition | \`${VerlicalPosition} ${HorizontalPosition}\` | \`${HorizontalPosition} ${VerlicalPosition}\`

Describes controls position.


Projection

Projection: GenericProjection<LngLat>

RefInstance

RefInstance<TEntity\>: React.MutableRefObject<TEntity | undefined>
Type parameters
Name Type
TEntity extends GenericEntity<unknown>

Stroke

Stroke: StrokeStyle[]

TextWithHighlight

TextWithHighlight: Object
Type declaration
Name Type
hl Highlight[]
text string

VectorCustomizationStyler

VectorCustomizationStyler: Object
Type declaration
Name Type
color? string
hue? string
lightness? number
opacity? number
saturation? number
scale? number
secondary-color? string
tertiary-color? string
visibility? "off"
zoom? number | [number, number]

VerlicalPosition

VerlicalPosition: "top" | "bottom"

WithDefaults

WithDefaults<Props,
 DefaultProps\>: Props & { [K in keyof DefaultProps]: K extends keyof Props ? NonNullable<Props[K]\> : never }
Type parameters
Name Type
Props Props
DefaultProps extends Partial<Props>

Variables

ReactParent

ReactParent: React.Context<[ReactParent] | undefined>

ReactParent

ReactParent: Context<undefined | [ReactParent]>

defaultProps

const defaultProps: Readonly<{
	behaviors: string[];
	camera: {
		azimuth: number;
		tilt: number 
	};
	className: "";
	config: Config;
	copyrights: true;
	copyrightsPosition: "bottom right";
	hotspotsStrategy: "forViewport" | "forPointerPosition";
	margin: Margin | undefined;
	mode: "auto";
	projection: Projection;
	restrictMapArea: false;
	theme: "light";
	worldOptions: {
		cycledX: boolean;
		cycledY: boolean 
	};
	zoomRange: ZoomRange;
	zoomRounding: "auto";
	zoomStrategy: "zoomToPointer" 
}>

defaultProps

const defaultProps: Readonly<{
	source: "mappable-default-feature";
	visible: true 
}>

defaultProps

const defaultProps: Object
Type declaration
Name Type
layersInfo { buildings: { type: string ; zIndex: number } ; ground: { type: string ; zIndex: number } ; icons: { type: string ; zIndex: number } ; labels: { type: string ; zIndex: number } }
layersInfo.buildings { type: string ; zIndex: number }
layersInfo.buildings.type string
layersInfo.buildings.zIndex number
layersInfo.ground { type: string ; zIndex: number }
layersInfo.ground.type string
layersInfo.ground.zIndex number
layersInfo.icons { type: string ; zIndex: number }
layersInfo.icons.type string
layersInfo.icons.zIndex number
layersInfo.labels { type: string ; zIndex: number }
layersInfo.labels.type string
layersInfo.labels.zIndex number
source string
visible boolean

defaultProps

const defaultProps: Readonly<{
	zIndex: 1500 
}>

defaultProps

const defaultProps: Readonly<{
	blockBehaviors: false;
	blockEvents: false;
	draggable: false;
	hideOutsideViewport: false;
	mapFollowsOnDrag: false;
	source: "mappable-default-feature";
	zIndex: 0 
}>

defaultProps

const defaultProps: Object
Type declaration
Name Type
tagName string

defaultProps

const defaultProps: Readonly<{
	source: "mappable-default-feature" 
}>

Functions

getPosition

getPosition(options?, config?): Promise<{ accuracy?: number ; coords: LngLat }>

Parameters
Name Type
options? PositionOptions
config? Config
Returns

Promise<{ accuracy?: number ; coords: LngLat }>

Namespace: projections

Variables

sphericalMercator

const sphericalMercator: SphericalMercator
In this article: