Skip to main content

mapConfig (since v4.0.0)

Usage

This parameter allows you to configure the options available for the interactive map. Its definition is as follows:

interface MapConfiguration {
mapCenter?: {
lat: number;
lng: number;
alt?: number;
} | [number, number, number?]
limitAroundCenter?: number
settings?: {
categories?: Array<CustomCategory>;
hospitalityCategories?: {
restaurant?: HospitalityCategory;
afaire?: HospitalityCategory;
avoir?: HospitalityCategory;
hebergement?: HospitalityCategory;
produit?: HospitalityCategory;
service?: HospitalityCategory;
};
showFilter?: Array<POIType>;
}
}

interface CustomCategory {
name: string;
color?: string;
filter?: FilterData;
}

interface FilterData {
iconUrl?: string;
label?: string;
localizedLabel?: Record<string, string>;
}

interface HospitalityCategory {
display: boolean;
label?: string;
localizedLabel?: Record<string, string>;
color?: string;
}

Parameters

NameRequiredTypeDescription
mapCenterNo{ lat: number, lng: number, alt?: number } | [number, number, number?]Coordinates of the map center on load
limitAroundCenterNonumberRadius in kilometers around the center within which POIs will be displayed
settingsNoSettingsConfiguration of the filters and categories available on the map

Settings

NameRequiredTypeDescription
categoriesNoarray of CustomCategory objectsCustom categories to filter POIs on the map
hospitalityCategoriesNoHospitalityCategoriesConfiguration of the built-in hospitality categories
showFilterNoArray<POIType>List of POI types for which a filter will be displayed

CustomCategory

NameRequiredTypeDescription
nameYesstringCategory name, used in graphql / elasticsearch queries
colorNostringColor applied to the filter button and pin icons on the map
filterNoFilterDataData used for the filter button and pin icon on the map

FilterData

NameRequiredTypeDescription
iconUrlNostringPath to the icon displayed on the button and the pin on the map
labelNostringButton label, to be used if the same label is used across all languages
localizedLabelNoRecord<string, string>Labels per language. Each entry must follow the format <locale>: <label> (e.g. "fr-FR": "bonjour")

HospitalityCategories

NameRequiredTypeDescription
restaurantNoHospitalityCategoryConfiguration of the Restaurants category
afaireNoHospitalityCategoryConfiguration of the Things to Do category
avoirNoHospitalityCategoryConfiguration of the Things to See category
hebergementNoHospitalityCategoryConfiguration of the Accommodations category
produitNoHospitalityCategoryConfiguration of the Products category
serviceNoHospitalityCategoryConfiguration of the Services category

HospitalityCategory

NameRequiredTypeDescription
displayYesbooleanThe category is displayed if this parameter is true
labelNostringCategory label, to be used if the same label is used across all languages
localizedLabelNoRecord<string, string>Labels per language. Each entry must follow the format <locale>: <label> (e.g. "fr-FR": "bonjour")
colorNostringColor applied to the filter button and pin icons on the map for this category

POIType

enum POIType {
restaurant = "restaurant",
afaire = "afaire",
avoir = "avoir",
hebergement = "hebergement",
produit = "produit",
service = "service"
}