/* * Copyright (c) 2025, Salesforce, Inc. * All rights reserved. * For full license text, see the LICENSE.txt file */ /** * The `lightning/map` component displays a map with markers for one or more locations. * @see {@link https://developer.salesforce.com/docs/component-library/bundle/lightning-map/documentation | Lightning Map Documentation} */ declare module "lightning/map" { import { LightningElement } from "lwc"; /** * Displays a map with markers for one or more locations. */ export default class LightningMap extends LightningElement { /** * Sets the region for the map. Defaults to user locale. * Possible values can be found in the "Region Code" column * in table at https://developers.google.com/maps/coverage */ region: string; /** * If present, the footer element is displayed below the map. * The footer shows an 'Open in Google Maps' link that opens an external window * to display the selected marker location in Google Maps. Default value is false. * The */ showFooter: boolean; /** * Displays or hides the list of locations. Valid values are visible, hidden, or auto. * This value defaults to auto, which shows the list only when multiple markers are present. * Passing in an invalid value hides the list view. * The default value is auto. */ listView: "visible" | "hidden" | "auto"; /** * The zoom levels as defined by Google Maps API. * If a zoom level is not specified, a default zoom level is applied to accommodate all markers on the map. */ zoomLevel: number | null; /** * A location to use as the map's center. * If center is not specified, the map centers automatically. */ center: MapMarker | null; /** * Provides the heading title for the markers. Required if specifying multiple markers. * The title is displayed below the map as a header for the list of clickable addresses. */ markersTitle: string; /** * Provides the value of the currently selected marker. * Returns undefined if you don’t pass value to map-markers. */ selectedMarkerValue: string | undefined; /** * Provides the list of map settings/options. * The options contain different map settings with either true/false value. */ options: Record; /** * One or more objects with the address or latitude and longitude to be displayed on the map. * If latitude and longitude are provided, the address is ignored. */ mapMarkers: MapMarker[] | null; } /** * Represents a marker to be displayed on the map. */ export interface MapMarker { // Location Information: location?: { City?: string; Country?: string; PostalCode?: string; State?: string; Street?: string; Latitude?: number; Longitude?: number; }; // Descriptive Information title?: string; description?: string; icon?: string; value?: string; mapIcon?: MapIcon; type?: "Circle" | "Rectangle" | "Polygon"; scale?: number; anchor?: { x: number; y: number; }; strokeColor?: string; strokeOpacity?: number; strokeWeight?: number; fillColor?: string; fillOpacity?: number; // for type Circle radius?: number; // for type Rectangle bounds?: { north: number; south: number; east: number; west: number; }; // for type Polygon paths?: { lat: number; lng: number; }[]; } /** * Represents a custom icon for a map marker. */ export interface MapIcon { path: string; scale: number; anchor: { x: number; y: number; }; strokeColor?: string; strokeOpacity?: number; strokeWeight: number; fillColor?: string; fillOpacity?: number; } }