Options
All
  • Public
  • Public/Protected
  • All
Menu

Available only in the v=beta channel: https://goo.gle/3oAthT3.

Shows a Local Context experience with a google.maps.Map.

Access by calling const {LocalContextMapView} = await google.maps.importLibrary("localContext"). See https://developers.google.com/maps/documentation/javascript/libraries.

deprecated

Local Context is deprecated, and no longer recommended for new websites. The feature will continue to work, and 12 months notice will be given before support is discontinued. If you are interested in building a Local Context-like experience yourself, we suggest that you check out the "Neighborhood Discovery" solution in Quick Builder or use the Places Library, Maps JavaScript API. Code samples and codelabs for the Places Library can help you.

Hierarchy

  • LocalContextMapView

Implements

Index

Constructors

Properties

directionsOptions?: null | MapDirectionsOptionsLiteral
element?: null | HTMLElement | SVGElement

This Field is read-only. The DOM Element backing the view.

isTransitioningMapBounds: boolean

Is set to true before google.maps.localContext.LocalContextMapView begins changing the bounds of the inner google.maps.Map, and set to false after google.maps.localContext.LocalContextMapView finishes changing the bounds of the inner google.maps.Map. (Not set when layout mode changes happen due to responsive resizing.)

locationBias?: null | string | Circle | LatLngBounds | LatLngBoundsLiteral | LatLng | LatLngLiteral | CircleLiteral

See google.maps.localContext.LocalContextMapViewOptions.locationBias. Changing this property on the LocalContextMapView may trigger a new search.

locationRestriction?: null | LatLngBounds | LatLngBoundsLiteral

See google.maps.localContext.LocalContextMapViewOptions.locationRestriction. Changing this property on the LocalContextMapView may trigger a new search.

map?: null | Map

An already instantiated google.maps.Map instance. If passed in, the map will be moved into the LocalContextMapView's DOM, and will not be re-styled. The element associated with the Map may also have styles and classes applied to it by the LocalContextMapView.

maxPlaceCount: number

See google.maps.localContext.LocalContextMapViewOptions.maxPlaceCount. Changing this property on the LocalContextMapView may trigger a new search.

pinOptionsSetup?: null | ((a: { isHighlighted: boolean; isSelected: boolean }) => undefined | null | PinOptions) | PinOptions

Configure the place marker icon based on the icon state. Invoked whenever the input to the callback changes. Pass a function to dynamically override the default setup when the LocalContextMapView draws the place marker. Errors and invalid configurations may be determined asynchronously, and will be ignored (defaults will be used, and errors will be logged to the console).

placeChooserViewSetup?: null | ((a: { defaultLayoutMode: PlaceChooserLayoutMode; defaultPosition: null | PlaceChooserPosition }) => undefined | null | PlaceChooserViewSetupOptions) | PlaceChooserViewSetupOptions

Overrides the setup of the place chooser view. Pass a function to dynamically override the default setup when the LocalContextMapView might change its layout due to resizing. Errors and invalid configurations may be determined asynchronously, and will be ignored (defaults will be used instead, and errors will be logged to the console). Errors detected at construction will cause errors to be thrown synchronously.

placeDetailsViewSetup?: null | ((a: { defaultLayoutMode: PlaceDetailsLayoutMode; defaultPosition: null | PlaceDetailsPosition }) => undefined | null | PlaceDetailsViewSetupOptions) | PlaceDetailsViewSetupOptions

Overrides the setup of the place details view. Pass a function to dynamically override the default setup when the LocalContextMapView might change its layout due to resizing. Errors and invalid configurations may be determined asynchronously, and will be ignored (defaults will be used, and errors will be logged to the console). Errors detected at construction will cause errors to be thrown synchronously.

placeTypePreferences: PlaceTypePreference[]

See google.maps.localContext.LocalContextMapViewOptions.placeTypePreferences. Changing this property on the LocalContextMapView may trigger a new search. Iterable<string|PlaceTypePreference> is also accepted.

Methods

  • Adds the given listener function to the given event name.

    Parameters

    • eventName: string
    • handler: Function

    Returns MapsEventListener

  • hidePlaceDetailsView(): void
  • Hides the place details.

    Returns void

  • search(): void
  • Searches for places to show the user based on the current maxPlaceCount, placeTypePreferences, locationRestriction, and locationBias.

    Returns void

Generated using TypeDoc