Hints Package
- Class: MMapHint
- Class: Config
- Class: Context<_T>
- Class: GenericComplexEntity<Props, DefaultProps, Root>
- Class: GenericEntity<Props, DefaultProps, Root>
- Class: GenericGroupEntity<Props, DefaultProps, Root>
- Class: GenericRootEntity<Props, DefaultProps>
- Class: MMap
- Class: MMapComplexEntity<Props, DefaultProps>
- Class: MMapEntity<Props, DefaultProps>
- Class: MMapFeature
- Class: MMapGroupEntity<Props, DefaultProps>
- Class: MMapHotspot
- Class: MMapMarker
- Class: MMapContext<T>
- Interface: Apikeys
- Interface: BlockingProps
- Interface: ComplexOptions<Root>
- Interface: DraggableProps<Callback>
- Interface: DrawingStyle
- Interface: DrawingStyleIcon
- Interface: FeatureClickEvents
- Interface: GenericLineStringGeometry<TCoordinates>
- Interface: GenericMultiLineStringGeometry<TCoordinates>
- Interface: GenericMultiPolygonGeometry<TCoordinates>
- Interface: GenericPointGeometry<TCoordinates>
- Interface: GenericPolygonGeometry<TCoordinates>
- Interface: GenericProjection<TSource>
- Interface: MapEvent
- Interface: PaletteEntry
- Interface: PixelCoordinates
- Interface: ReactParent
- Interface: StrokeStyle
- Interface: TiltRange
- Interface: Vec2
- Interface: VuefyModuleFn
- Interface: WorldCoordinates
- Interface: WorldOptions
- Interface: ZoomRange
- Namespace: "/place/sandbox-data/tasks/9/9/2654217999/mounted_arcadia/maps/front/packages/mappable/build/types-mappable/imperative/MMapEnities"
- Module: <internal>
Class: MMapHint
Display hint on map elements.
Example
const {MMapHint, MMapHintContext} = await mappable.import('@mappable-world/mappable-hint@0.0.1');
map.addChild(defaultFeatures = new MMapDefaultFeaturesLayer());
map.addChild(hint = MMapHint({
   layers: [defaultFeatures.layer],
   hint: object => object?.properties?.hint
}));
const {MMapDefaultMarker} = await mappable.import('@mappable-world/mappable-markers@0.0.1');
map.addChild(new MMapDefaultMarker({coordinates: [37, 55], properties: {hint: 'Hello world!'}}));
hint.addChild(new class MyHint extends mappable.MMapEntity {
   _onAttach() {
        this._element = document.createElement('div');
        this._element.className = 'my-hint';
        this._detachDom = mappable.useDomContext(this, this._element);
        this._watchContext(MMapHintContext, () => {
             this._element.textContent = this._consumeContext(MMapHintContext)?.hint;
        }, {immediate: true});
   }
   _onDetach() {
       this._detachDom();
       this._detachDom = undefined;
   }
});Constructors
constructor
new MMapHint(props)
Parameters
| Name | Type | 
|---|---|
| props | MMapHintProps | 
Overrides
Properties
children
readonly children: readonly MMapEntity<unknown, {}>[]Inherited from
[optionsKeyVuefy]
static [optionsKeyVuefy]: CustomVuefyOptions<MMapHint>[overrideKeyReactify]
static [overrideKeyReactify]: CustomReactify<MMapHint, FC<MMapHintProps>>[overrideKeyVuefy]
static [overrideKeyVuefy]: CustomVuefyFn<MMapHint>Accessors
parent
get parent(): null | MMapComplexEntity<unknown, {}>
Get parent entity.
Returns
null | MMapComplexEntity<unknown, {}>
Inherited from
mappable.MMapGroupEntity.parent
root
get root(): null | MMap
Get root entity.
Returns
null | MMap
Inherited from
mappable.MMapGroupEntity.root
Methods
addChild
addChild(child, index?): MMapHint
Parameters
| Name | Type | 
|---|---|
| child | MMapEntity<unknown, {}> | 
| index? | number | 
Returns
Inherited from
removeChild
removeChild(child): MMapHint
Parameters
| Name | Type | 
|---|---|
| child | MMapEntity<unknown, {}> | 
Returns
Inherited from
update
update(changedProps): void
Method for updating props of Entity.
Parameters
| Name | Type | Description | 
|---|---|---|
| changedProps | Partial<MMapHintProps> | New props values. | 
Returns
void
Inherited from
Class: Config
Configuration object for whole API.
For example, it can be used to set experiments or apikeys.
mappable.getDefaultConfig().setApikeys({search: "YOUR_SEARCH_API_KEY"})`.Constructors
constructor
new Config()
Properties
description
readonly description: stringMethods
setApikeys
setApikeys(apikeys): void
Set apikeys for http-services.
mappable.getDefaultConfig().setApikeys({search: "YOUR_SEARCH_API_KEY"})`.Parameters
| Name | Type | 
|---|---|
| apikeys | Apikeys | 
Returns
void
setExperiments
setExperiments(experiments): void
Set experiments for map.
Parameters
| Name | Type | 
|---|---|
| experiments | Record<string,boolean> | 
Returns
void
Class: Context<_T>
Type parameters
| Name | 
|---|
| _T | 
Constructors
constructor
new Context<_T>(name)
Type parameters
| Name | 
|---|
| _T | 
Parameters
| Name | Type | 
|---|---|
| name | string | 
Properties
name
readonly name: stringClass: 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> {
 static defaultProps = 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
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>.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
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> {
 static defaultProps = 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> {
 static defaultProps = 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 objectType 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
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> {
 static defaultProps = defaultProps;
 // ...
}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
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
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
Class: MMap
Main API class. Create a map container.
Example
const map = new MMap(
    document.getElementById('map-root'),
    {location: {center: [-0.118092, 51.509865], 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
Properties
children
readonly children: MMapEntity<unknown, {}>[]Overrides
[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;
	showScaleInCopyrights?: boolean;
	theme?: MMapTheme;
	tiltRange?: TiltRange;
	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;
	showScaleInCopyrights: 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
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
container
get container(): HTMLElement
Main map container
Returns
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
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
theme
get theme(): "dark" | "light"
getter for MMapProps.theme prop
Returns
"dark" | "light"
tilt
get tilt(): number
Returns
number
tiltRange
get tiltRange(): Readonly<TiltRange>
Returns
zoom
get zoom(): number
getter for MMapProps.location.zoom prop
Returns
number
zoomRange
get zoomRange(): Readonly<ZoomRange>
getter for MMapProps.zoomRange prop
Returns
Methods
addChild
addChild(child, index?): MMap
Parameters
| Name | Type | 
|---|---|
| child | MMapEntity<unknown, {}> | 
| index? | number | 
Returns
Overrides
destroy
destroy(): void
Destroy map and remove it from user DOM-element
Returns
void
Overrides
removeChild
removeChild(child): MMap
Parameters
| Name | Type | 
|---|---|
| child | MMapEntity<unknown, {}> | 
Returns
Overrides
setBehaviors
setBehaviors(behaviors): void
setter for MMapProps.behaviors prop
Parameters
| Name | Type | 
|---|---|
| behaviors | BehaviorType[] | 
Returns
void
setCamera
setCamera(camera): void
setter for MMapProps.camera prop
Parameters
| Name | Type | 
|---|---|
| camera | MMapCameraRequest | 
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
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> {
 static defaultProps = 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
- MMapEntity<- Props,- DefaultProps>
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
Inherited from
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> {
 static defaultProps = 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
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
Class: MMapFeature
Component for creating a geo object on the map.
Supports drag-and-drop functionality, drawing styles, and event handling.
Supported geometries: Point, LineString, MultiLineString, Polygon and MultiPolygon.
const feature = new MMapFeature({
    geometry: {
        type: 'LineString',
        coordinates: [
            [37.40108963847453, 55.70173382087952],
            [37.60954231796791, 55.57717912610197]
        ]
    },
    style: {
        stroke: [{width: 12, color: 'rgb(14, 194, 219)'}]
    }})
map
    .addChild(new MMapDefaultSchemeLayer())
    .addChild(new MMapDefaultFeaturesLayer())
    .addChild(feature);You can add Point geometry with HTMLElement:
const feature = new MMapFeature({
   geometry: {
     type: 'Point',
     coordinates: [37.40108963847453, 55.70173382087952]
   },
   style: {
     element: document.createElement('div')
   }
});But better to use MMapMarker for this.
Constructors
constructor
new MMapFeature(props)
Parameters
| Name | Type | 
|---|---|
| props | MMapFeatureProps | 
Overrides
Properties
defaultProps
static defaultProps: Readonly<{
	source: "mappable-default-feature" 
}>Accessors
geometry
get geometry(): GenericGeometry<LngLat>
Returns
id
get id(): string
Returns
string
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
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> {
 static defaultProps = 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 objectType 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
- MMapComplexEntity<- Props,- DefaultProps>
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
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
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
Inherited from
Class: MMapHotspot
Some active area on the map that can be clicked.
This is not a real MMapEntity, it cannot be added to the map.
But you can check it by instance of in MMapListener handlers
For example, in custom layers you can pass an object of this type in the findObjectInPosition method
Or just listen to the onEventName event and check the object:
const map = new mappable.MMap(document.getElementById('map-root'), {...});
map.addChild(new mappable.MMapListener({
  layer: 'any',
  onClick: (object) => {
     if (object instanceof mappable.MMapHotspot) {
         console.log('Hotspot clicked', object);
     }
  }
}))Constructors
constructor
new MMapHotspot(geometry, properties)
Parameters
| Name | Type | 
|---|---|
| geometry | undefined|GenericGeometry<LngLat> | 
| properties | Record<string,unknown> | 
Properties
geometry
optional readonly geometry: GenericGeometry<LngLat>id
readonly id: stringproperties
readonly properties: Record<string, unknown>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: [37, 55],
    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
Properties
children
readonly children: readonly MMapEntity<unknown, {}>[]Inherited from
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, `mapEvent`: MapEvent) => void;
	onDoubleClick?: (`event`: MouseEvent, `mapEvent`: MapEvent) => void;
	onDragEnd?: MMapMarkerEventHandler;
	onDragMove?: MMapMarkerEventHandler;
	onDragStart?: MMapMarkerEventHandler;
	onFastClick?: (`event`: MouseEvent, `mapEvent`: MapEvent) => 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> & BlockingProps & 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
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
Inherited from
removeChild
removeChild(child): MMapMarker
Parameters
| Name | Type | 
|---|---|
| child | MMapEntity<unknown, {}> | 
Returns
Inherited from
update
update(changedProps): void
Method for updating props of Entity.
Parameters
| Name | Type | Description | 
|---|---|---|
| changedProps | Partial<MMapMarkerProps> | New props values. | 
Returns
void
Inherited from
Class: MMapContext<T>
Context for MMap. It allows you to provide a value to the context and use it in the children of the context provider.
const MMapSomeContext = new mappable.MMapContext('MMapSomeContext');
class SomeValueProvider extends mappable.MMapGroupEntity<{}> {
 constructor() {
    super({});
    this._provideContext(MMapSomeContext, {your: 'value'}); // Special method to provide context value
 }
}And some child entity can use this context:
class SomeContextConsumer extends mappable.MMapEntity<{}> {
   constructor() {
       super({});
   }
   _onAttach() {
     const value = this._consumeContext(MMapSomeContext); // Special method to get context value
     console.log(value); // {your: 'value'}
   }
}In any level of nesting:
<SomeValueProvider>
    <MMapContainer>
         <MMapContainer>
             <SomeContextConsumer />
         </MMapContainer>
    </MMapContainer>
</SomeEntity>You can set the context value using MMapContextProvider:
<MMapContextProvider context={MMapSomeContext} value={{your: 'value'}}>
    <MMapContainer>
         <MMapContainer>
             <SomeContextConsumer />
         </MMapContainer>
    </MMapContainer>
</SomeEntity>Type parameters
| Name | 
|---|
| T | 
Constructors
constructor
new MMapContext<T>(name)
Type parameters
| Name | 
|---|
| T | 
Parameters
| Name | Type | 
|---|---|
| name | string | 
Inherited from
Properties
name
readonly name: stringInherited from
Interface: Apikeys
All possible apikeys for http-services.
Properties
router
optional router: stringsearch
optional search: stringsuggest
optional suggest: stringInterface: BlockingProps
Properties
blockBehaviors
optional blockBehaviors: booleanThis parameter block all map behaviors for the element.
The element itself can be zoomed and scrolled by mouse and gestures.
The map will no longer be able to respond to any BehaviorType on this element (except dblClick).
Double clicks and other map events will be blocked by the blockEvents parameter.
blockEvents
optional blockEvents: booleanThis parameter block all map events for the element.
The map will no longer be able to respond to any DomEvents on this element, including clicks, double-clicks and others.
Interface: ComplexOptions<Root>
Type parameters
| Name | Type | 
|---|---|
| Root | extends GenericRootEntity<unknown> =GenericRootEntity<unknown> | 
Properties
children
optional children: GenericEntity<unknown, {}, Root>[]container
optional container: booleanInterface: DraggableProps<Callback>
Type parameters
| Name | 
|---|
| Callback | 
Properties
draggable
optional draggable: booleanFeature 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: CallbackMay be a function that will be called when the user drags and drops an element to a new location on the map.
The arguments to the function will include the new coordinates.
A component that uses this component should immediately save the new coordinates in its state and then use
the new coordinates as props for the marker.
onDragMove
optional onDragMove: CallbackFires on drag move
onDragStart
optional onDragStart: CallbackFires on drag start
Interface: DrawingStyle
Properties
cursor
optional cursor: stringelement
optional element: HTMLElementfill
optional fill: stringfillOpacity
optional fillOpacity: numberfillRule
optional fillRule: FillRuleicon
optional icon: DrawingStyleIconinteractive
optional interactive: booleansimplificationRate
optional simplificationRate: numberstroke
optional stroke: StrokezIndex
optional zIndex: numberInterface: DrawingStyleIcon
Properties
offset
optional readonly offset: [number, number]scale
optional readonly scale: numberurl
readonly url: stringInterface: FeatureClickEvents
Properties
onClick
optional onClick: (`event`: MouseEvent, `mapEvent`: MapEvent) => voidType declaration
(event, mapEvent): void
Click handler
Parameters
| Name | Type | 
|---|---|
| event | MouseEvent | 
| mapEvent | MapEvent | 
Returns
void
onDoubleClick
optional onDoubleClick: (`event`: MouseEvent, `mapEvent`: MapEvent) => voidType declaration
(event, mapEvent): void
Double click handler
Parameters
| Name | Type | 
|---|---|
| event | MouseEvent | 
| mapEvent | MapEvent | 
Returns
void
onFastClick
optional onFastClick: (`event`: MouseEvent, `mapEvent`: MapEvent) => voidType declaration
(event, mapEvent): void
Fast click handler
Parameters
| Name | Type | 
|---|---|
| event | MouseEvent | 
| mapEvent | MapEvent | 
Returns
void
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: TCoordinatestype
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 | 
Properties
type
optional readonly type: stringProjection identity type. It may be:
- EPSG-code (e.g. EPSG:3857)
- any other string to identify (e.g. 'cartesian')
Methods
fromWorldCoordinates
fromWorldCoordinates(coordinates): TSource
Parameters
| Name | Type | 
|---|---|
| coordinates | WorldCoordinates | 
Returns
TSource
toWorldCoordinates
toWorldCoordinates(point): WorldCoordinates
Parameters
| Name | Type | 
|---|---|
| point | TSource | 
Returns
Interface: MapEvent
Properties
coordinates
coordinates: LngLatscreenCoordinates
screenCoordinates: [number, number][x, y]
stopPropagation
stopPropagation: () => voidType declaration
(): void
Returns
void
Interface: PaletteEntry
Properties
color
color: stringcount
count: numberInterface: 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: numberInherited from
y
y: numberInherited from
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: StrokeStyle
Properties
color
optional color: stringdash
optional dash: number[]opacity
optional opacity: numberpalette
optional palette: PalettesimplifyPalette
optional simplifyPalette: booleanwidth
optional width: numberInterface: TiltRange
Properties
expansion
readonly expansion: numberBehavior tilt expansion in radians. E.g. you can tilt map with fingers a little bit more than max.
max
readonly max: numberMaximum tilt in radians.
min
readonly min: numberMinimum tilt in radians.
Interface: Vec2
Properties
x
x: numbery
y: numberInterface: VuefyModuleFn
Callable
VuefyModuleFn
VuefyModuleFn<TModule>(module, props?): VuefiedModule<TModule>
Type parameters
| Name | Type | 
|---|---|
| TModule | extends BaseModule=BaseModule | 
Parameters
| Name | Type | 
|---|---|
| module | TModule | 
| props? | VuefyPropsModule<TModule> | 
Returns
VuefiedModule<TModule>
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: numberInherited from
y
y: numberInherited from
z
optional z: numberInterface: WorldOptions
Properties
cycledX
readonly cycledX: booleanInterface: ZoomRange
Properties
max
max: numbermin
min: numberVariables
MMapHintContext
const MMapHintContext: "/place/sandbox-data/tasks/9/9/2654217999/mounted_arcadia/maps/front/packages/mappable/build/types-mappable/imperative/MMapEnities"Namespace: "/place/sandbox-data/tasks/9/9/2654217999/mounted_arcadia/maps/front/packages/mappable/build/types-mappable/imperative/MMapEnities"
References
MMapComplexEntity
Re-exports MMapComplexEntity
MMapEntity
Re-exports MMapEntity
MMapGroupEntity
Re-exports MMapGroupEntity
Module: <internal>
Type Aliases
BaseModule
BaseModule: Record<string | symbol, unknown>BehaviorType
BehaviorType: "drag" | "pinchZoom" | "scrollZoom" | "dblClick" | "magnifier" | "oneFingerZoom" | "mouseRotate" | "mouseTilt" | "pinchRotate" | "panTilt"ContextWatcherFn
ContextWatcherFn: () => voidType declaration
(): void
Returns
void
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>>> 
	} 
}) => TResultType 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]) =>TextendsOverrided<T,TResult> ?TResult:ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<EntityProps<InstanceType<T>>>> &RefAttributes<undefined|InstanceType<T>>> | 
Returns
TResult
CustomVuefyFn
CustomVuefyFn<TEntity,
 TExternalProps\>: (`ctor`: EntityConstructor<TEntity>, `props`: VuefyPropsObject<TExternalProps>, `params`: {
	Vue: typeof TVue;
	vuefy: {
		context: VuefyContextFn;
		entity: VuefyEntityFn;
		module: VuefyModuleFn 
	} 
}) => TVue.Component<TExternalProps>Type parameters
| Name | Type | 
|---|---|
| TEntity | extends DefaultEntity | 
| TExternalProps | EntityProps<TEntity> | 
Type declaration
(ctor, props, params): TVue.Component<TExternalProps>
Parameters
| Name | Type | 
|---|---|
| ctor | EntityConstructor<TEntity> | 
| props | VuefyPropsObject<TExternalProps> | 
| params | Object | 
| params.Vue | typeof TVue | 
| params.vuefy | Object | 
| params.vuefy.context | VuefyContextFn | 
| params.vuefy.entity | VuefyEntityFn | 
| params.vuefy.module | VuefyModuleFn | 
Returns
TVue.Component<TExternalProps>
CustomVuefyOptions
CustomVuefyOptions<TEntity,
 TExternalProps\>: ObjectType parameters
| Name | Type | 
|---|---|
| TEntity | extends DefaultEntity | 
| TExternalProps | EntityProps<TEntity> | 
Type declaration
| Name | Type | 
|---|---|
| props | VuefyPropsObject<TExternalProps> |VuefyPropsArray<TExternalProps> | 
DefaultContext
DefaultContext: Context<unknown>DefaultCtor
DefaultCtor: EntityConstructor<DefaultEntity>DefaultEntity
DefaultEntity: GenericEntity<unknown>DefaultProps
DefaultProps: typeof defaultPropsDefaultProps
DefaultProps: typeof defaultProps & {
	id: string 
}DefaultProps
DefaultProps: typeof defaultPropsEasingBezierPreset
EasingBezierPreset: ObjectType declaration
| Name | Type | 
|---|---|
| p1 | Vec2 | 
| p2 | Vec2 | 
EasingFunction
EasingFunction: (`x`: number) => numberType declaration
(x): number
Parameters
| Name | Type | 
|---|---|
| x | number | 
Returns
number
EasingFunctionDescription
EasingFunctionDescription: EasingPresetName | EasingBezierPreset | EasingFunctionEasingPresetName
EasingPresetName: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out"EntityConstructor
EntityConstructor<TEntity\>: (...`args`: any[]) => TEntityType parameters
| Name | Type | 
|---|---|
| TEntity | extends GenericEntity<unknown> | 
Type declaration
(...args)
Parameters
| Name | Type | 
|---|---|
| ...args | any[] | 
EntityProps
EntityProps<T\>: T extends GenericEntity<infer P> ? P : neverType parameters
| Name | Type | 
|---|---|
| T | extends GenericEntity<unknown> | 
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 | 
Geometry
Geometry: PolygonGeometry | MultiPolygonGeometry | LineStringGeometry | MultiLineStringGeometry | PointGeometryHideOutsideRule
HideOutsideRule: {
	extent: number 
} | booleanLineStringGeometry
LineStringGeometry: GenericLineStringGeometry<LngLat>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 top-left and bottom-right coordinates
MMapBoundsLocation
MMapBoundsLocation: ObjectCalculate the center and zoom by specifying the coordinates of the top left and bottom right corners of the map.
In this case, the center of the map will be in the center of the rectangle described at the given coordinates.
If the map have an aspect ratio different from this rectangle, the rectangle will be inscribed in height and the map will be centered in width.
map.update({
    location: {bounds: [[-0.118092, 51.509865], [-0.118092, 51.509865]]}
});Type declaration
| Name | Type | 
|---|---|
| bounds | LngLatBounds | 
MMapCamera
MMapCamera: ObjectObserver camera position
Type declaration
| Name | Type | Description | 
|---|---|---|
| azimuth? | number | Map rotation in radians. Can take values from -Math.PI to Math.PI | 
| tilt? | number | Map tilt in radians. Can take values from 0 to 50 degrees (degrees * (Math.PI / 180)) | 
MMapCameraRequest
MMapCameraRequest: MMapCamera & {
	duration?: number;
	easing?: EasingFunctionDescription 
}Describes how to change current camera position. Change can be instantaneous or animated if duration property is set.
map.update({camera: {
     tilt: 45 * (Math.PI / 180), // 45 degrees
     azimuth: 30 * (Math.PI / 180) // 30 degrees
     duration: 200, // Animation of moving camera will take 200 milliseconds
     easing: 'ease-in-out'
 }});MMapCenterLocation
MMapCenterLocation: ObjectSets map center. In this case, the zoom of the map remains unchanged.
map.update({
  location: {center: [-0.118092, 51.509865]}
});Type declaration
| Name | Type | 
|---|---|
| center | LngLat | 
MMapCenterZoomLocation
MMapCenterZoomLocation: MMapCenterLocation & MMapZoomLocationSets map center and zoom. Combination of MMapCenterLocation and MMapZoomLocation
map.update({
 location: {center: [-0.118092, 51.509865], zoom: 10}
});MMapCopyrightsPosition
MMapCopyrightsPosition: "top left" | "top right" | "bottom left" | "bottom right"Copyrights position on the map container. By default, 'bottom right'.
For example, 'top left' or 'bottom right'
const map = new mappable.MMap(document.getElementById('map-root'), {
 copyrightsPosition: 'top left'
});MMapFeatureEventHandler
MMapFeatureEventHandler: (`coordinates`: Geometry["coordinates"]) => void | falseType declaration
(coordinates): void | false
Feature drag event handler.
function onDragEvent(type, coordinates) => {
   console.log('Event:', type, coordinates);
};
const feature = new MMapFeature({
  geometry: {...},
  draggable: true,
  onDragStart: onDragEvent.bind(null, 'dragStart'),
  onDragMove: onDragEvent.bind(null, 'dragMove'),
  onDragEnd: onDragEvent.bind(null, 'dragEnd'),
});Parameters
| Name | Type | 
|---|---|
| coordinates | Geometry["coordinates"] | 
Returns
void | false
MMapFeatureProps
MMapFeatureProps: {
	disableRoundCoordinates?: boolean;
	geometry: Geometry;
	hideOutsideViewport?: HideOutsideRule;
	id?: string;
	properties?: Record<string, unknown>;
	source?: string;
	style?: DrawingStyle 
} & DraggableProps<MMapFeatureEventHandler> & BlockingProps & FeatureClickEventsMMapFeature props
MMapHintProps
MMapHintProps: ObjectType declaration
| Name | Type | 
|---|---|
| hint | ( object:MMapFeature|MMapMarker|MMapHotspot|undefined) =>unknown | 
MMapLocationRequest
MMapLocationRequest: MMapBoundsLocation | MMapCenterLocation | MMapZoomLocation | MMapCenterZoomLocation & {
	duration?: number;
	easing?: EasingFunctionDescription 
}Describes how to change current map location. Change can be instantaneous or animated if duration property is set.
map.update({
 location: {
     center: [-0.118092, 51.509865], // Center of the map
     zoom: 10, // Zoom level
     duration: 200, // Animation of moving map will take 200 milliseconds
     easing: 'ease-in-out' // Animation easing function
 }
});or just change center of the map
map.update({
 location: {
    center: [-0.118092, 51.509865], // Center of the map
    duration: 200, // Animation of moving map will take 200 milliseconds
    easing: 'linear' // Animation easing function
 }
})';MMapMarkerEventHandler
MMapMarkerEventHandler: (`coordinates`: LngLat) => void | falseType 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> & BlockingProps & FeatureClickEventsMMapMarker props
MMapProps
MMapProps: ObjectMap settings. Allow to set map mode, behaviors, margin, zoom rounding, zoom range, restrict map area, theme and other settings.
const map = new MMap(document.getElementById('map-root'), {
   className: 'custom-map',
   location: {center: [-0.118092, 51.509865], zoom: 10},
   camera: {tilt: 45 * (Math.PI / 180), azimuth: 30 * (Math.PI / 180)}
   mode: 'raster',
   behaviors: ['drag', 'scrollZoom', 'dblClick', 'mouseRotate', 'mouseTilt'],
   margin: [0, 100, 0, 0],
   theme: 'light'
});But required only location prop.
const map = new MMap(document.getElementById('map-root'), {
  location: {center: [-0.118092, 51.509865], zoom: 10}
});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. | 
| showScaleInCopyrights? | boolean | Show the map scale next to copyright | 
| 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 autois selected, zoom will besnapforrasterandsmoothforvectorMapMode. Default isauto. | 
| zoomStrategy? | ZoomStrategy | Zoom strategy describes if map center is bound to the zoom point or not | 
MMapTheme
MMapTheme: "light" | "dark"Map theme. Affects the colors of the map controls and background.
const map = new mappable.MMap({
   location: {center: [55.751574, 37.573856], zoom: 9},
   theme: 'dark'
});MMapZoomLocation
MMapZoomLocation: ObjectSets map zoom. In this case, the center of the map remains unchanged.
map.update({
   location: {zoom: 10}
});Type declaration
| Name | Type | 
|---|---|
| zoom | number | 
MapMode
MapMode: "raster" | "vector" | "auto"Margin
Margin: [number, number, number, number]Map margins in pixels. Order is top, right, bottom, left.
MultiLineStringGeometry
MultiLineStringGeometry: GenericMultiLineStringGeometry<LngLat>MultiPolygonGeometry
MultiPolygonGeometry: GenericMultiPolygonGeometry<LngLat>Overrided
Overrided<TCtor,
 TReactResult\>: ObjectType 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>Projection
Projection: GenericProjection<LngLat>PropsFromCtor
PropsFromCtor<TCtor\>: EntityProps<InstanceType<TCtor>>Type parameters
| Name | Type | 
|---|---|
| TCtor | extends DefaultCtor | 
RefInstance
RefInstance<TEntity\>: React.MutableRefObject<TEntity | undefined>Type parameters
| Name | Type | 
|---|---|
| TEntity | extends GenericEntity<unknown> | 
Stroke
Stroke: StrokeStyle[]VuefiedModule
VuefiedModule<TModule\>: { [Property in keyof TModule]: TModule[Property] extends DefaultCtor ? ReturnType<VuefyEntityFnGen<TModule[Property]\>\> : TModule[Property] extends typeof Context ? ReturnType<VuefyContextFn\> : TModule[Property] }Type parameters
| Name | Type | 
|---|---|
| TModule | extends BaseModule | 
VuefyContextFn
VuefyContextFn: <TContext>(`context?`: TContext) => symbolType declaration
<TContext>(context?): symbol
Type parameters
| Name | Type | 
|---|---|
| TContext | extends DefaultContext | 
Parameters
| Name | Type | 
|---|---|
| context? | TContext | 
Returns
symbol
VuefyEntityFn
VuefyEntityFn: <TCtor, TProps>(...`args`: Parameters<VuefyEntityFnGen<TCtor, TProps>>) => ReturnType<VuefyEntityFnGen<TCtor, TProps>>Type declaration
<TCtor, TProps>(...args): ReturnType<VuefyEntityFnGen<TCtor, TProps>>
Type parameters
| Name | Type | 
|---|---|
| TCtor | extends DefaultCtor | 
| TProps | PropsFromCtor<TCtor> | 
Parameters
| Name | Type | 
|---|---|
| ...args | Parameters<VuefyEntityFnGen<TCtor,TProps>> | 
Returns
ReturnType<VuefyEntityFnGen<TCtor, TProps>>
VuefyEntityFnGen
VuefyEntityFnGen<TCtor,
 TProps\>: (`ctor`: TCtor, `props?`: VuefyPropsObject<TProps> | VuefyPropsArray<TProps>, `displayName?`: string) => TVue.Component<TProps>Type parameters
| Name | Type | 
|---|---|
| TCtor | extends DefaultCtor | 
| TProps | PropsFromCtor<TCtor> | 
Type declaration
(ctor, props?, displayName?): TVue.Component<TProps>
Parameters
| Name | Type | 
|---|---|
| ctor | TCtor | 
| props? | VuefyPropsObject<TProps> |VuefyPropsArray<TProps> | 
| displayName? | string | 
Returns
TVue.Component<TProps>
VuefyPropsArray
VuefyPropsArray<RawProps\>: keyof RawProps[]Type parameters
| Name | 
|---|
| RawProps | 
VuefyPropsModule
VuefyPropsModule<TModule\>: { [Key in keyof TModule]: TModule[Key] extends GenericEntity<infer Props\> ? VuefyPropsObject<Props\> \| VuefyPropsArray<Props\> : unknown }Type parameters
| Name | Type | 
|---|---|
| TModule | extends BaseModule | 
VuefyPropsObject
VuefyPropsObject<RawProps\>: { [K in keyof RawProps]-?: TVue.PropType<RawProps[K]\> \| TVue.Prop<RawProps[K]\> }Type parameters
| Name | 
|---|
| RawProps | 
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> | 
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
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;
	showScaleInCopyrights: false;
	theme: "light";
	worldOptions: {
		cycledX: boolean;
		cycledY: boolean 
	};
	zoomRange: ZoomRange;
	zoomRounding: "auto";
	zoomStrategy: "zoomToPointer" 
}>defaultProps
const defaultProps: Readonly<{
	source: "mappable-default-feature" 
}>defaultProps
const defaultProps: Readonly<{
	blockBehaviors: false;
	blockEvents: false;
	draggable: false;
	hideOutsideViewport: false;
	mapFollowsOnDrag: false;
	source: "mappable-default-feature";
	zIndex: 0 
}>