Class: MVXPlace
MapVX place object, is a custom object containing data of a specific real place. Represents a physical location with all its associated metadata and properties.
Example
const place = new MVXPlace(placeResponse)
console.log(place.title) // "Coffee Shop"
console.log(place.position) // { lat: 40.7128, lng: -74.0060 }Constructors
Constructor
new MVXPlace(rawPlace): MVXPlace;Creates a new place instance with the parameters specified in the data.
Parameters
rawPlace
JSON configuration parameters for the place from API response
Returns
MVXPlace
A new instance of MVXPlace
Example
const placeResponse = await fetchPlaceData(placeId)
const place = new MVXPlace(placeResponse)Methods
inFloor()
inFloor(parentPlaceFloors): InnerFloor | undefined;Returns the floor in which the place exists as an InnerFloor object. If no matching available floor is found or if the place is not indoor, an undefined value will be returned.
Parameters
parentPlaceFloors
Array of existing parent place floors to search in
Returns
InnerFloor | undefined
The matching InnerFloor object or undefined if not found
Example
const buildingFloors = getBuildingFloors()
const placeFloor = place.inFloor(buildingFloors)
if (placeFloor) {
console.log(`Place is on floor: ${placeFloor.name}`)
}toString()
toString(): string;Returns a string representation of the place
Returns
string
String in format “MVXPlace {mapvxId}“
fromCache()
static fromCache(value): MVXPlace;Rebuilds an MVXPlace from a value that has lost its prototype — e.g. a place rehydrated from the
persistent (localStorage) cache, where JSON.parse produces a plain object stripped of the class
methods.
The place’s methods only read its own data fields, so restoring the prototype is sufficient; the raw
API PlaceResponse shape is not needed (and would not fit, since a
serialized place already carries the mapped MVXPlace fields). Live instances and non-object values
are returned unchanged.
Parameters
value
unknown
A cached place value (plain object) or an existing instance.
Returns
MVXPlace
An MVXPlace whose methods (e.g. inFloor) work again.
Example
const place = MVXPlace.fromCache(cachedValue)
place.inFloor(parentFloors) // no longer throwsProperties
address?
optional address?: string;Physical address of the place in plain text (if provided)
banners
banners: Banner[];List of available banner images for the place
See
Banner for banner structure
category
category: stringCategory identifier for the place
clientId?
optional clientId?: string;Client-side identifier for the place (optional) Used for custom identification in client applications
description?
optional description?: string;Detailed description text for the place (localized based on client language)
generalCategory
generalCategory: stringGeneral purpose category string for the place (localized)
hidePlace
hidePlace: booleanFlag to control visibility of the place in search results
images
images: string[];List of available image URLs for the place
inFloors?
optional inFloors?: string[];Specific floor identifiers where this place exists (for indoor locations)
innerFloors
innerFloors: InnerFloor[];Floors available in the parent place. If this exists, the place is indoor. Otherwise, the place is considered outdoor.
See
InnerFloor for floor structure
localizedCategory?
optional localizedCategory?: string;Localized category name for the place (based on client language)
logo?
optional logo?: string;URL of the place’s logo image
mapvxId
mapvxId: stringUnique identifier to reference the place in MapVX system
metadata?
optional metadata?: Metadata;Metadata of the place.
openingHours?
optional openingHours?: OpeningHours;Business hours when the place is open
See
OpeningHours for schedule structure
parentId
parentId: stringUnique identifier of the parent place or object
parentInstitutionId
parentInstitutionId: stringUnique identifier of the institution to which this place belongs
parentType
parentType: stringType of the object being referenced by parentId
position
position: LatLngCentral position coordinates for the place
See
LatLng for coordinate structure
properties?
optional properties?: Property[];List of properties connected to the place
See
Property for property structure
shortDescription?
optional shortDescription?: string;Short description text for the place (localized based on client language)
tags
tags: string[];Tags associated with the place for categorization and filtering
title
title: stringTitle text for the place (localized based on client language)
transportLine?
optional transportLine?: TransportLine[];Transport services associated with this place
See
TransportLine for transport service structure
visibility
visibility: "public" | "protected" | "hidden"Visibility of the place