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、PlaceReviewSummaryElement、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”的选项。

PlaceReviewSummaryElement 类

google.maps.places.PlaceReviewSummaryElement 类

配置 PlaceDetailsElement 以显示地点的评价摘要。将此元素附加为 PlaceContentConfigElement 的子元素即可使用。例如:

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

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

此类扩展了 HTMLElement。

此类实现 PlaceReviewSummaryElementOptions。

通过拨打 const {PlaceReviewSummaryElement} = 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。

PlaceReviewSummaryElementOptions 接口

google.maps.places.PlaceReviewSummaryElementOptions 接口

“PlaceReviewSummaryElement”的选项。

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 白色提供方文字。