Place Widget Content Customization

PlaceContentConfigElement

google.maps.places.PlaceContentConfigElement

配置 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement 以显示自定义内容集。附加此元素作为子元素以使用它。

对于 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement,请将以下任一元素附加到 PlaceContentConfigElement,以显示相应的内容:
PlaceAddressElementPlaceAccessibleEntranceIconElementPlaceAttributionElement PlaceMediaElementPlaceOpenNowStatusElementPlacePriceElementPlaceRatingElementPlaceTypeElement

对于 PlaceDetailsElement,您还可以附加以下任一元素:
PlaceFeatureListElement PlaceOpeningHoursElementPlacePhoneNumberElementPlacePlusCodeElementPlaceReviewsElementPlaceSummaryElementPlaceTypeSpecificHighlightsElementPlaceWebsiteElement

子元素的顺序无关紧要;该元素会以标准顺序呈现内容,且该顺序无法自定义。示例:

 <gmp-place-details>
  <gmp-place-content-config>
    <gmp-place-media lightbox-preferred></gmp-place-media>
    <gmp-place-address></gmp-place-address>
  </gmp-place-content-config>
</gmp-place-details>

自定义元素:
<gmp-place-content-config></gmp-place-content-config>

此类扩展了 HTMLElement

此类实现了 PlaceContentConfigElementOptions

通过调用 const {PlaceContentConfigElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlaceContentConfigElement
PlaceContentConfigElement([options])
参数: 
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceContentConfigElementOptions 接口

google.maps.places.PlaceContentConfigElementOptions 接口

PlaceContentConfigElement 的选项。

PlaceAllContentElement

google.maps.places.PlaceAllContentElement

配置 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement 以显示所有可用的内容。附加此元素作为子元素以使用它。例如:

 <gmp-place-details>
  <gmp-place-all-content></gmp-place-all-content>
</gmp-place-details>

自定义元素:
<gmp-place-all-content></gmp-place-all-content>

此类扩展了 HTMLElement

此类实现了 PlaceAllContentElementOptions

通过调用 const {PlaceAllContentElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlaceAllContentElement
PlaceAllContentElement([options])
参数: 
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceAllContentElementOptions 接口

google.maps.places.PlaceAllContentElementOptions 接口

PlaceAllContentElement 的选项。

PlaceStandardContentElement

google.maps.places.PlaceStandardContentElement

配置 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement 以显示一组标准内容。附加此元素作为子元素以使用它。
对于 PlaceDetailsElement,标准内容包括:

  • 媒体
  • 地址
  • 评分
  • 类型
  • 价格
  • “无障碍入口”图标
  • 网站
  • 电话号码
  • 营业时间
  • 摘要
  • 特定类型的精彩集锦
  • 评价
  • 功能列表

对于 PlaceDetailsCompactElement,标准内容包括:
  • 媒体
  • 评分
  • 类型
  • 价格
  • “无障碍入口”图标
  • “营业中”状态

对于 PlaceSearchElement,标准内容包括:
  • 媒体
  • 评分
  • 类型
  • 价格
  • “无障碍入口”图标

例如:
 <gmp-place-details>
  <gmp-place-standard-content></gmp-place-standard-content>
</gmp-place-details>

自定义元素:
<gmp-place-standard-content></gmp-place-standard-content>

此类扩展了 HTMLElement

此类实现了 PlaceStandardContentElementOptions

通过调用 const {PlaceStandardContentElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlaceStandardContentElement
PlaceStandardContentElement([options])
参数: 
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceStandardContentElementOptions 接口

google.maps.places.PlaceStandardContentElementOptions 接口

PlaceStandardContentElement 的选项。

PlaceMediaElement

google.maps.places.PlaceMediaElement

配置 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement 以显示地点的媒体内容(例如照片)。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-media lightbox-preferred></gmp-place-media>
</gmp-place-content-config>

自定义元素:
<gmp-place-media lightbox-preferred preferred-size="small"></gmp-place-media>

此类扩展了 HTMLElement

此类实现了 PlaceMediaElementOptions

通过调用 const {PlaceMediaElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlaceMediaElement
PlaceMediaElement([options])
参数: 
lightboxPreferred
类型:  boolean optional
默认值false
在支持这两种选项的情况下,是否启用或停用媒体灯箱。
HTML 属性
  • <gmp-place-media lightbox-preferred></gmp-place-media>
preferredSize
类型:  MediaSize optional
默认值null
在支持多种尺寸的情况下,首选的媒体尺寸,例如竖屏 PlaceSearchElement。如果未指定,垂直 PlaceSearchElement 将默认使用 MediaSize.SMALL
HTML 属性
  • <gmp-place-media preferred-size="small"></gmp-place-media>
  • <gmp-place-media preferred-size="medium"></gmp-place-media>
  • <gmp-place-media preferred-size="large"></gmp-place-media>
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceMediaElementOptions 接口

google.maps.places.PlaceMediaElementOptions 接口

PlaceMediaElement 的选项。

lightboxPreferred optional
类型:  boolean optional
preferredSize optional
类型:  MediaSize optional

MediaSize 常量

google.maps.places.MediaSize 常量

在支持多种尺寸的情况下,首选的媒体尺寸,例如竖屏 PlaceSearchElement

通过调用 const {MediaSize} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

LARGE 媒体文件过大。
MEDIUM 中等媒体大小。
SMALL 媒体文件较小。

PlaceAddressElement

google.maps.places.PlaceAddressElement

配置 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement 以显示地点的地址。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-address></gmp-place-address>
</gmp-place-content-config>

自定义元素:
<gmp-place-address></gmp-place-address>

此类扩展了 HTMLElement

此类实现了 PlaceAddressElementOptions

通过调用 const {PlaceAddressElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlaceAddressElement
PlaceAddressElement([options])
参数: 
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceAddressElementOptions 接口

google.maps.places.PlaceAddressElementOptions 接口

PlaceAddressElement 的选项。

PlaceRatingElement

google.maps.places.PlaceRatingElement

配置 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement 以显示地点的评分。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-rating></gmp-place-rating>
</gmp-place-content-config>

自定义元素:
<gmp-place-rating></gmp-place-rating>

此类扩展了 HTMLElement

此类实现了 PlaceRatingElementOptions

通过调用 const {PlaceRatingElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlaceRatingElement
PlaceRatingElement([options])
参数: 
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceRatingElementOptions 接口

google.maps.places.PlaceRatingElementOptions 接口

PlaceRatingElement 的选项。

PlaceTypeElement

google.maps.places.PlaceTypeElement

配置 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement 以显示地点的类型。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-type></gmp-place-type>
</gmp-place-content-config>

自定义元素:
<gmp-place-type></gmp-place-type>

此类扩展了 HTMLElement

此类实现了 PlaceTypeElementOptions

通过调用 const {PlaceTypeElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlaceTypeElement
PlaceTypeElement([options])
参数: 
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceTypeElementOptions 接口

google.maps.places.PlaceTypeElementOptions 接口

PlaceTypeElement 的选项。

PlacePriceElement

google.maps.places.PlacePriceElement

配置 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement 以显示某个地点的价格水平或价格范围。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-price></gmp-place-price>
</gmp-place-content-config>

自定义元素:
<gmp-place-price></gmp-place-price>

此类扩展了 HTMLElement

此类实现了 PlacePriceElementOptions

通过调用 const {PlacePriceElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlacePriceElement
PlacePriceElement([options])
参数: 
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlacePriceElementOptions 接口

google.maps.places.PlacePriceElementOptions 接口

PlacePriceElement 的选项。

PlaceAccessibleEntranceIconElement

google.maps.places.PlaceAccessibleEntranceIconElement

配置 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement,以便在地点设有无障碍入口时显示轮椅图标。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-accessible-entrance-icon></gmp-place-accessible-entrance-icon>
</gmp-place-content-config>

自定义元素:
<gmp-place-accessible-entrance-icon></gmp-place-accessible-entrance-icon>

此类扩展了 HTMLElement

此类实现了 PlaceAccessibleEntranceIconElementOptions

通过调用 const {PlaceAccessibleEntranceIconElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlaceAccessibleEntranceIconElement
PlaceAccessibleEntranceIconElement([options])
参数: 
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceAccessibleEntranceIconElementOptions 接口

google.maps.places.PlaceAccessibleEntranceIconElementOptions 接口

PlaceAccessibleEntranceIconElement 的选项。

PlaceOpenNowStatusElement

google.maps.places.PlaceOpenNowStatusElement

配置 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement 以显示某个地点的当前营业状态。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-open-now-status></gmp-place-open-now-status>
</gmp-place-content-config>

自定义元素:
<gmp-place-open-now-status></gmp-place-open-now-status>

此类扩展了 HTMLElement

此类实现了 PlaceOpenNowStatusElementOptions

通过调用 const {PlaceOpenNowStatusElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlaceOpenNowStatusElement
PlaceOpenNowStatusElement([options])
参数: 
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceOpenNowStatusElementOptions 接口

google.maps.places.PlaceOpenNowStatusElementOptions 接口

PlaceOpenNowStatusElement 的选项。

PlaceReviewsElement

google.maps.places.PlaceReviewsElement

配置 PlaceDetailsElement 以显示地点的评价。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-reviews></gmp-place-reviews>
</gmp-place-content-config>

自定义元素:
<gmp-place-reviews></gmp-place-reviews>

此类扩展了 HTMLElement

此类实现了 PlaceReviewsElementOptions

通过调用 const {PlaceReviewsElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceReviewsElementOptions 接口

google.maps.places.PlaceReviewsElementOptions 接口

PlaceReviewsElement 的选项。

PlaceSummaryElement

google.maps.places.PlaceSummaryElement

配置 PlaceDetailsElement 以显示地点的摘要。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-summary></gmp-place-summary>
</gmp-place-content-config>

自定义元素:
<gmp-place-summary></gmp-place-summary>

此类扩展了 HTMLElement

此类实现了 PlaceSummaryElementOptions

通过调用 const {PlaceSummaryElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceSummaryElementOptions 接口

google.maps.places.PlaceSummaryElementOptions 接口

PlaceSummaryElement 的选项。

PlaceFeatureListElement

google.maps.places.PlaceFeatureListElement

配置 PlaceDetailsElement 以在“关于”标签页中显示地点的功能列表。功能列表可以包括无障碍选项、设施、接受的付款方式等。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-feature-list></gmp-place-feature-list>
</gmp-place-content-config>

自定义元素:
<gmp-place-feature-list></gmp-place-feature-list>

此类扩展了 HTMLElement

此类实现了 PlaceFeatureListElementOptions

通过调用 const {PlaceFeatureListElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceFeatureListElementOptions 接口

google.maps.places.PlaceFeatureListElementOptions 接口

PlaceFeatureListElement 的选项。

PlaceOpeningHoursElement

google.maps.places.PlaceOpeningHoursElement

配置 PlaceDetailsElement 以显示地点的营业时间。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-opening-hours></gmp-place-opening-hours>
</gmp-place-content-config>

自定义元素:
<gmp-place-opening-hours></gmp-place-opening-hours>

此类扩展了 HTMLElement

此类实现了 PlaceOpeningHoursElementOptions

通过调用 const {PlaceOpeningHoursElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceOpeningHoursElementOptions 接口

google.maps.places.PlaceOpeningHoursElementOptions 接口

PlaceOpeningHoursElement 的选项。

PlacePhoneNumberElement

google.maps.places.PlacePhoneNumberElement

配置 PlaceDetailsElement 以显示地点的电话号码。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-phone-number></gmp-place-phone-number>
</gmp-place-content-config>

自定义元素:
<gmp-place-phone-number></gmp-place-phone-number>

此类扩展了 HTMLElement

此类实现了 PlacePhoneNumberElementOptions

通过调用 const {PlacePhoneNumberElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlacePhoneNumberElementOptions 接口

google.maps.places.PlacePhoneNumberElementOptions 接口

PlacePhoneNumberElement 的选项。

PlacePlusCodeElement

google.maps.places.PlacePlusCodeElement

配置 PlaceDetailsElement 以显示某个地点的 Plus Code。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-plus-code></gmp-place-plus-code>
</gmp-place-content-config>

自定义元素:
<gmp-place-plus-code></gmp-place-plus-code>

此类扩展了 HTMLElement

此类实现了 PlacePlusCodeElementOptions

通过调用 const {PlacePlusCodeElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlacePlusCodeElementOptions 接口

google.maps.places.PlacePlusCodeElementOptions 接口

PlacePlusCodeElement 的选项。

PlaceTypeSpecificHighlightsElement

google.maps.places.PlaceTypeSpecificHighlightsElement

配置 PlaceDetailsElement 以显示特定于地点的突出信息,例如汽油价格和电动汽车充电器可用性。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-type-specific-highlights></gmp-place-type-specific-highlights>
</gmp-place-content-config>

自定义元素:
<gmp-place-type-specific-highlights></gmp-place-type-specific-highlights>

此类扩展了 HTMLElement

此类实现了 PlaceTypeSpecificHighlightsElementOptions

通过调用 const {PlaceTypeSpecificHighlightsElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceTypeSpecificHighlightsElementOptions 接口

google.maps.places.PlaceTypeSpecificHighlightsElementOptions 接口

PlaceTypeSpecificHighlightsElement 的选项。

PlaceWebsiteElement

google.maps.places.PlaceWebsiteElement

配置 PlaceDetailsElement 以显示地点的网站。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。例如:

 <gmp-place-content-config>
  <gmp-place-website></gmp-place-website>
</gmp-place-content-config>

自定义元素:
<gmp-place-website></gmp-place-website>

此类扩展了 HTMLElement

此类实现了 PlaceWebsiteElementOptions

通过调用 const {PlaceWebsiteElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceWebsiteElementOptions 接口

google.maps.places.PlaceWebsiteElementOptions 接口

PlaceWebsiteElement 的选项。

PlaceAttributionElement

google.maps.places.PlaceAttributionElement

允许在 PlaceDetailsCompactElementPlaceDetailsElementPlaceSearchElement 中自定义 Google 地图提供方文字。将此元素作为 PlaceContentConfigElement 的子元素附加,以便使用它。如果省略此元素,系统仍会显示提供方信息,但会使用默认颜色。例如:

 <gmp-place-content-config>
  <gmp-place-attribution
     light-scheme-color="black"
     dark-scheme-color="white"
  ></gmp-place-attribution>
</gmp-place-content-config>

自定义元素:
<gmp-place-attribution dark-scheme-color="white" light-scheme-color="white"></gmp-place-attribution>

此类扩展了 HTMLElement

此类实现了 PlaceAttributionElementOptions

通过调用 const {PlaceAttributionElement} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

PlaceAttributionElement
PlaceAttributionElement([options])
参数: 
darkSchemeColor
类型:  AttributionColor optional
默认值AttributionColor.WHITE
深色模式下 Google 地图提供方信息的颜色。
HTML 属性
  • <gmp-place-attribution dark-scheme-color="white"></gmp-place-attribution>
  • <gmp-place-attribution dark-scheme-color="black"></gmp-place-attribution>
  • <gmp-place-attribution dark-scheme-color="gray"></gmp-place-attribution>
lightSchemeColor
类型:  AttributionColor optional
默认值AttributionColor.GRAY
浅色模式下 Google 地图提供方信息的颜色。
HTML 属性
  • <gmp-place-attribution light-scheme-color="white"></gmp-place-attribution>
  • <gmp-place-attribution light-scheme-color="black"></gmp-place-attribution>
  • <gmp-place-attribution light-scheme-color="gray"></gmp-place-attribution>
addEventListener
addEventListener(type, listener[, options])
参数: 
  • typestring一个区分大小写的字符串,表示要监听的事件类型。
  • listenerEventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • optionsboolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capturepassive
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener

PlaceAttributionElementOptions 接口

google.maps.places.PlaceAttributionElementOptions 接口

PlaceAttributionElement 的选项。

darkSchemeColor optional
类型:  AttributionColor optional
lightSchemeColor optional
类型:  AttributionColor optional

AttributionColor 常量

google.maps.places.AttributionColor 常量

Google 地图提供方信息文本的颜色选项。您可以自定义提供方信息,以使用上述任何颜色。

通过调用 const {AttributionColor} = await google.maps.importLibrary("places") 进行访问。
请参阅 Maps JavaScript API 中的库

BLACK 黑色提供方文字。
GRAY 灰色的提供方文字。
WHITE 白色提供方信息文字。