Place Widget Content Customization

PlaceContentConfigElement 类

google.maps.places.PlaceContentConfigElement 类

配置 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement 以显示自定义内容集。附加此元素作为子元素以使用它。

对于 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement,请将以下任一元素附加到 PlaceContentConfigElement,以显示相应的内容:
PlaceAddressElement、PlaceAccessibleEntranceIconElement、PlaceAttributionElement PlaceMediaElement、PlaceOpenNowStatusElement、PlacePriceElement、PlaceRatingElement、PlaceTypeElement。

对于 PlaceDetailsElement,您还可以附加以下任一元素:
PlaceFeatureListElement PlaceOpeningHoursElement、PlacePhoneNumberElement、PlacePlusCodeElement、PlaceReviewsElement、PlaceSummaryElement、PlaceTypeSpecificHighlightsElement、PlaceWebsiteElement。

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

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

PlaceContentConfigElementOptions 接口

google.maps.places.PlaceContentConfigElementOptions 接口

PlaceContentConfigElement 的选项。

PlaceAllContentElement 类

google.maps.places.PlaceAllContentElement 类

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

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

PlaceAllContentElementOptions 接口

google.maps.places.PlaceAllContentElementOptions 接口

PlaceAllContentElement 的选项。

PlaceStandardContentElement 类

google.maps.places.PlaceStandardContentElement 类

配置 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement 以显示一组标准内容。附加此元素作为子元素以使用它。
对于 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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener。
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener。

PlaceStandardContentElementOptions 接口

google.maps.places.PlaceStandardContentElementOptions 接口

PlaceStandardContentElement 的选项。

PlaceMediaElement 类

google.maps.places.PlaceMediaElement 类

配置 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement 以显示地点的媒体内容(例如照片)。将此元素作为 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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  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 类

配置 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement 以显示地点的地址。将此元素作为 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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener。
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener。

PlaceAddressElementOptions 接口

google.maps.places.PlaceAddressElementOptions 接口

PlaceAddressElement 的选项。

PlaceRatingElement 类

google.maps.places.PlaceRatingElement 类

配置 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement 以显示地点的评分。将此元素作为 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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener。
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener。

PlaceRatingElementOptions 接口

google.maps.places.PlaceRatingElementOptions 接口

PlaceRatingElement 的选项。

PlaceTypeElement 类

google.maps.places.PlaceTypeElement 类

配置 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement 以显示地点的类型。将此元素作为 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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener。
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener。

PlaceTypeElementOptions 接口

google.maps.places.PlaceTypeElementOptions 接口

PlaceTypeElement 的选项。

PlacePriceElement 类

google.maps.places.PlacePriceElement 类

配置 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement 以显示某个地点的价格水平或价格范围。将此元素作为 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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener。
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener。

PlacePriceElementOptions 接口

google.maps.places.PlacePriceElementOptions 接口

PlacePriceElement 的选项。

PlaceAccessibleEntranceIconElement 类

google.maps.places.PlaceAccessibleEntranceIconElement 类

配置 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement,以便在地点设有无障碍入口时显示轮椅图标。将此元素作为 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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener。
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener。

PlaceAccessibleEntranceIconElementOptions 接口

google.maps.places.PlaceAccessibleEntranceIconElementOptions 接口

PlaceAccessibleEntranceIconElement 的选项。

PlaceOpenNowStatusElement 类

google.maps.places.PlaceOpenNowStatusElement 类

配置 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement 以显示某个地点的当前营业状态。将此元素作为 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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  void
设置一个函数,每当指定事件传递到目标时,系统都会调用该函数。请参阅 addEventListener。
removeEventListener
removeEventListener(type, listener[, options])
参数: 
返回值:  void
从目标中移除之前通过 addEventListener 注册的事件监听器。请参阅 removeEventListener。

PlaceWebsiteElementOptions 接口

google.maps.places.PlaceWebsiteElementOptions 接口

PlaceWebsiteElement 的选项。

PlaceAttributionElement 类

google.maps.places.PlaceAttributionElement 类

允许在 PlaceDetailsCompactElement、PlaceDetailsElement 或 PlaceSearchElement 中自定义 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])
参数: 
  • type:string一个区分大小写的字符串,表示要监听的事件类型。
  • listener:EventListener|EventListenerObject 接收通知的对象。必须是函数或具有 handleEvent 方法的对象
  • options:boolean|AddEventListenerOptions optional 请参阅选项。自定义事件仅支持 capture 和 passive。
返回值:  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 白色提供方信息文字。