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
| Name | Required | Type | Description |
|---|---|---|---|
mapCenter | No | { lat: number, lng: number, alt?: number } | [number, number, number?] | Coordinates of the map center on load |
limitAroundCenter | No | number | Radius in kilometers around the center within which POIs will be displayed |
settings | No | Settings | Configuration of the filters and categories available on the map |
Settings
| Name | Required | Type | Description |
|---|---|---|---|
categories | No | array of CustomCategory objects | Custom categories to filter POIs on the map |
hospitalityCategories | No | HospitalityCategories | Configuration of the built-in hospitality categories |
showFilter | No | Array<POIType> | List of POI types for which a filter will be displayed |
CustomCategory
| Name | Required | Type | Description |
|---|---|---|---|
name | Yes | string | Category name, used in graphql / elasticsearch queries |
color | No | string | Color applied to the filter button and pin icons on the map |
filter | No | FilterData | Data used for the filter button and pin icon on the map |
FilterData
| Name | Required | Type | Description |
|---|---|---|---|
iconUrl | No | string | Path to the icon displayed on the button and the pin on the map |
label | No | string | Button label, to be used if the same label is used across all languages |
localizedLabel | No | Record<string, string> | Labels per language. Each entry must follow the format <locale>: <label> (e.g. "fr-FR": "bonjour") |
HospitalityCategories
| Name | Required | Type | Description |
|---|---|---|---|
restaurant | No | HospitalityCategory | Configuration of the Restaurants category |
afaire | No | HospitalityCategory | Configuration of the Things to Do category |
avoir | No | HospitalityCategory | Configuration of the Things to See category |
hebergement | No | HospitalityCategory | Configuration of the Accommodations category |
produit | No | HospitalityCategory | Configuration of the Products category |
service | No | HospitalityCategory | Configuration of the Services category |
HospitalityCategory
| Name | Required | Type | Description |
|---|---|---|---|
display | Yes | boolean | The category is displayed if this parameter is true |
label | No | string | Category label, to be used if the same label is used across all languages |
localizedLabel | No | Record<string, string> | Labels per language. Each entry must follow the format <locale>: <label> (e.g. "fr-FR": "bonjour") |
color | No | string | Color 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"
}