Places Data

Place 类

类 google.maps.places.Place 实现 PlaceOptions
库 "places"

const {Place} = await google.maps.importLibrary("places");
Place
Place(options)
参数:
searchByText
searchByText(request)
参数:
返回值:Promise<{places:Array<Place>}>
基于文本查询的地点搜索。
searchNearby
searchNearby(request)
参数:
返回值:Promise<{places:Array<Place>}>
搜索附近的地点。
accessibilityOptions
readonly
类型:AccessibilityOptions optional
此地点的无障碍选项。如果尚未从服务器调用无障碍选项数据,则为 undefined。
addressComponents
readonly
类型:Array<AddressComponent> optional
此地点位置的地址组成部分集合。如果地址数据未知,则为空对象。如果尚未从服务器调用地址数据,则为 undefined。
addressDescriptor
readonly
类型:AddressDescriptor optional
此地点的地址描述符。地址描述符包含其他信息,有助于使用地标和区域来描述位置。如需了解地址描述符的区域覆盖范围,请参阅 https://developers.google.com/maps/documentation/geocoding/address-descriptors/coverage。
adrFormatAddress
readonly
类型:string optional
以 adr 微格式表示的地点地址。
allowsDogs
readonly
类型:boolean optional
attributions
readonly
类型:Array<Attribution> optional
必须为地点显示的数据提供方。
businessStatus
readonly
类型:BusinessStatus optional
营业地点的营业状态。如果状态未知,则为 null。如果尚未从服务器加载状态数据,则为 undefined。
consumerAlert
readonly
类型:ConsumerAlert optional
此地点的消费者提醒。
containingPlaces
readonly
类型:Array<Place> optional
此地点的包含地点列表。包含地点是指包含该地点的地点。
currentOpeningHours
readonly
类型:OpeningHours optional
接下来 7 天(包括今天)的营业时间。这包括节假日和不定期停业等特殊营业时间。
currentSecondaryOpeningHours
readonly
类型:Array<SecondaryOpeningHours> optional
此地点当前的次要营业时间,包括未来 7 天内的特殊营业时间(例如节假日和不定期停业)。次要营业时间与地点的主要营业时间不同。例如,餐厅可以将免下车服务时间或配送时间指定为次要营业时间。
displayName
readonly
类型:string optional
营业地点的显示名称。null(如果没有名称)。如果尚未从服务器加载名称数据,则为 undefined。
displayNameLanguageCode
readonly
类型:string optional
营业地点显示名称的语言。null(如果没有名称)。如果尚未从服务器加载名称数据,则为 undefined。
editorialSummary
readonly
类型:string optional
此地点的编辑摘要。如果不存在编辑摘要,则为 null。undefined(如果尚未请求此字段)。
editorialSummaryLanguageCode
readonly
类型:string optional
此地点的编辑摘要所用的语言。如果不存在编辑摘要,则为 null。undefined(如果尚未请求此字段)。
evChargeAmenitySummary
readonly
类型:EVChargeAmenitySummary optional
此地点的 EVChargeAmenitySummary。
evChargeOptions
readonly
类型:EVChargeOptions optional
该地点提供的电动汽车充电选项。undefined(如果尚未从服务器调用电动汽车充电选项)。
formattedAddress
readonly
类型:string optional
营业地点的完整地址。
fuelOptions
readonly
类型:FuelOptions optional
该地点提供的燃料选项。undefined(如果尚未从服务器调用燃油选项)。
futureOpeningDate
readonly
类型:Date optional
此地点的开业日期(如果其 businessStatus 为 FUTURE_OPENING)。如果未请求该字段,则此字段将处于未定义状态。否则,此字段将填充开业日期(如果有),如果没有,则填充 null。
generativeSummary
readonly
类型:GenerativeSummary optional
此地点的 GenerativeSummary。
googleMapsURI
readonly
类型:string optional
此地点的官方 Google 页面的网址。这是由 Google 拥有的页面,其中包含有关该地点的实用信息。
hasCurbsidePickup
readonly
类型:boolean optional
地点是否提供路边自提服务。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
hasDelivery
readonly
类型:boolean optional
地点是否提供送货服务。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
hasDineIn
readonly
类型:boolean optional
地点是否提供堂食服务。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
hasLiveMusic
readonly
类型:boolean optional
hasMenuForChildren
readonly
类型:boolean optional
hasOutdoorSeating
readonly
类型:boolean optional
hasRestroom
readonly
类型:boolean optional
hasTakeout
readonly
类型:boolean optional
地点是否提供外带服务。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
iconBackgroundColor
readonly
类型:string optional
地点类别的默认十六进制颜色码。
id
readonly
类型:string
唯一地点 ID。
internationalPhoneNumber
readonly
类型:string optional
地点的电话号码(采用国际电话号码格式)。国际格式包含国家/地区代码,并且带有一个加号 (+) 前缀。
isGoodForChildren
readonly
类型:boolean optional
isGoodForGroups
readonly
类型:boolean optional
isGoodForWatchingSports
readonly
类型:boolean optional
isPureServiceAreaBusiness
readonly
类型:boolean optional
指明该地点是否为纯上门服务商家。纯上门服务商家是指为客户送货上门或提供上门服务,但不在自己的商家地址为客户提供服务的商家。例如,清洁服务类商家或管道工可能没有实体地址,也可能未在 Google 地图上显示营业地点。
isReservable
readonly
类型:boolean optional
地点是否可预订。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
location
readonly
类型:LatLng optional
地点的地理坐标。
nationalPhoneNumber
readonly
类型:string optional
地点的电话号码,按号码所属地区的格式规范显示。
neighborhoodSummary
readonly
类型:NeighborhoodSummary optional
此地点的 NeighborhoodSummary。
parkingOptions
readonly
类型:ParkingOptions optional
该地点提供的停车选项。undefined(如果尚未从服务器调用停车选项数据)。
paymentOptions
readonly
类型:PaymentOptions optional
地点提供的支付方式。undefined(如果尚未从服务器调用支付方式数据)。
photos
readonly
类型:Array<Photo> optional
此地点的照片。该集合最多可包含 10 个 Photo 对象。
plusCode
readonly
类型:PlusCode optional
postalAddress
readonly
类型:PostalAddress optional
priceLevel
readonly
类型:PriceLevel optional
相应地点的价格水平。此属性可以返回以下任一值
  • Free
  • Inexpensive
  • Moderate
  • Expensive
  • Very Expensive
priceRange
readonly
类型:PriceRange optional
此地点的价格范围。endPrice 可以不设置,这表示没有上限的范围(例如“超过 100 美元”)。
primaryType
readonly
类型:string optional
营业地点的主要类型。如果没有类型,则为 null。如果尚未从服务器加载类型数据,则为 undefined。
primaryTypeDisplayName
readonly
类型:string optional
营业地点的主要类型显示名称。如果没有类型,则为 null。如果尚未从服务器加载类型数据,则为 undefined。
primaryTypeDisplayNameLanguageCode
readonly
类型:string optional
营业地点的主要类型显示名称所用的语言。如果没有类型,则为 null。如果尚未从服务器加载类型数据,则为 undefined。
rating
readonly
类型:number optional
根据此地点的用户评价得出的评分,介于 1.0 到 5.0 之间。
regularOpeningHours
readonly
类型:OpeningHours optional
此地点的正常营业时间。这不包括节假日等特殊营业时间。
regularSecondaryOpeningHours
readonly
类型:Array<SecondaryOpeningHours> optional
此地点的常规次要营业时间,不包括节假日和不定期停业等特殊营业时间。次要营业时间与地点的主要营业时间不同。例如,餐厅可以将免下车服务时间或配送时间指定为次要营业时间。
requestedLanguage
类型:string optional
此地点的请求语言。
requestedRegion
类型:string optional
此地点请求的区域。
resourceName
readonly
类型:string
唯一的地点资源名称。
reviews
readonly
类型:Array<Review> optional
此地点的评价列表。
reviewSummary
readonly
类型:ReviewSummary optional
此地点的 ReviewSummary。
servesBeer
readonly
类型:boolean optional
某地点是否供应啤酒。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
servesBreakfast
readonly
类型:boolean optional
地点是否供应早餐。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
servesBrunch
readonly
类型:boolean optional
地点是否供应早午餐。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
servesCocktails
readonly
类型:boolean optional
servesCoffee
readonly
类型:boolean optional
servesDessert
readonly
类型:boolean optional
servesDinner
readonly
类型:boolean optional
某地点是否供应晚餐。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
servesLunch
readonly
类型:boolean optional
地点是否供应午餐。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
servesVegetarianFood
readonly
类型:boolean optional
某地点是否提供素食。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
servesWine
readonly
类型:boolean optional
地点是否供应葡萄酒。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。如果尚未请求此字段,则返回“undefined”。
shortFormattedAddress
readonly
类型:string optional
营业地点的简短地址。
subDestinations
readonly
类型:Array<Place> optional
此地点的子目的地列表。子目的地是与主要地点相关联的具体地点。这些子地点为在大型或复杂场所(例如机场、国家公园、大学或体育场)内搜索的用户提供了更具体的目的地。
svgIconMaskURI
readonly
类型:string optional
指向 SVG 图片遮罩资源的 URI,该资源可用于表示地点的类别。
timeZone
readonly
类型:TimeZone optional
此地点的时区。
transitStation
readonly
类型:TransitStation optional
有关公交站点的信息。如果尚未从服务器加载公交数据,则为 undefined。
types
readonly
类型:Array<string> optional
相应地点的类型数组(例如 ["political", "locality"] 或 ["restaurant", "establishment"])。
userRatingCount
readonly
类型:number optional
参与相应地点的 Place.rating 的用户评分数量。
utcOffsetMinutes
readonly
类型:number optional
地点当前时区相对于世界协调时间 (UTC) 的偏移量(以分钟为单位)。例如,澳大利亚东部标准时间 (GMT+10) 在夏令时期间比世界协调时间 (UTC) 早 11 个小时,因此 utc_offset_minutes 将为 660。对于晚于世界协调时间 (UTC) 的时区,偏移量为负。例如,佛得角的 utc_offset_minutes 为 -60。
viewport
readonly
类型:LatLngBounds optional
在地图上显示此地点时的首选视口。
websiteURI
readonly
类型:string optional
此地点的官方网站,例如商家主页。
openingHours
readonly
类型:OpeningHours optional
hasWiFi
readonly
类型:boolean optional
fetchFields
fetchFields(options)
参数:
返回值:Promise<{place:Place}>
BetagetNextOpeningTime
getNextOpeningTime([date])
参数:
  • date: Date optional
返回值:Promise<Date optional>
使用地点的 Place.regularOpeningHours 计算下一个营业时间的 Date。如果数据不足,无法计算结果,或者此地点未营业,则返回 undefined。
BetaisOpen
isOpen([date])
参数:
  • date: Date optional 默认为当前时间。
返回值:Promise<boolean optional>
检查该地点在给定的 Date 是否营业。如果地点的已知数据不足以计算此值(例如,营业时间未注册),则解析为 undefined。
继承: toJSON

PlaceOptions 接口

接口 google.maps.places.PlaceOptions
由 Place 实现

用于构建地点的选项。

id
可选
类型:string optional
唯一地点 ID。
requestedLanguage
可选
类型:string optional
语言标识符,用于指定应以哪种语言返回详细信息。请参阅支持的语言列表。
requestedRegion
可选
类型:string optional
用户所在地区的地区代码。这可能会影响返回的照片,还可能会影响其他方面。地区代码接受 ccTLD(“顶级域名”)双字符值。多数 ccTLD 代码都与 ISO 3166-1 代码相同,但也有一些需要注意的例外情况。例如,英国的 ccTLD 为“uk”(.co.uk),而其 ISO 3166-1 代码为“gb”(代表“大不列颠及北爱尔兰联合王国”)。
resourceName
可选
类型:string optional
唯一的地点资源名称。

AccessibilityOptions 类

class google.maps.places.AccessibilityOptions
library "places"

const {AccessibilityOptions} = await google.maps.importLibrary("places");
hasWheelchairAccessibleEntrance
readonly
类型:boolean optional
地点是否设有无障碍入口。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
hasWheelchairAccessibleParking
readonly
类型:boolean optional
地点是否设有无障碍停车位。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
hasWheelchairAccessibleRestroom
readonly
类型:boolean optional
地点是否设有无障碍卫生间。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
hasWheelchairAccessibleSeating
readonly
类型:boolean optional
地点是否提供无障碍座席。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。

AddressComponent 类

class google.maps.places.AddressComponent
library "places"

地点位置的地址组成部分。

const {AddressComponent} = await google.maps.importLibrary("places");
longText
readonly
类型:string optional
地址组成部分的完整文本。
shortText
readonly
类型:string optional
给定地址组成部分的简短文本。
types
readonly
类型:Array<string>
一个字符串数组,表示此地址组成部分的类型。如需查看有效类型列表,请点击此处。
继承: toJSON

AddressDescriptor 类

class google.maps.places.AddressDescriptor
library "places"

对位置的关系描述。包含一组按距离排序的附近地标和精确的包含区域,以及它们与目标位置的关系。

const {AddressDescriptor} = await google.maps.importLibrary("places");
areas
readonly
类型:Array<Area>
包含或相邻区域的排名列表。最容易识别且最精确的区域排在最前面。
landmarks
readonly
类型:Array<Landmark>
附近地标的排名列表。最容易识别且距离最近的地标会排在最前面。
继承: toJSON

Area 类

class google.maps.places.Area
library "places"

区域信息以及该区域与目标地理位置的关系。

const {Area} = await google.maps.importLibrary("places");
containment
readonly
类型:Containment optional
定义目标位置与区域之间的空间关系。
place
readonly
类型:Place
区域的地点。
继承: toJSON

Attribution 类

class google.maps.places.Attribution
library "places"

有关地点数据提供方的信息。

const {Attribution} = await google.maps.importLibrary("places");
provider
readonly
类型:string optional
地点数据提供商的名称。
providerURI
readonly
类型:string optional
地点数据提供方的 URI。
继承: toJSON

AuthorAttribution 类

class google.maps.places.AuthorAttribution
library "places"

用户生成的内容的作者的相关信息。

const {AuthorAttribution} = await google.maps.importLibrary("places");
displayName
readonly
类型:string
此结果的作者姓名。
photoURI
readonly
类型:string optional
此结果的作者照片 URI。此功能不一定始终可用。
uri
readonly
类型:string optional
此结果的作者个人资料 URI。
继承: toJSON

ConnectorAggregation 类

class google.maps.places.ConnectorAggregation
library "places"

电动汽车充电信息,按相同类型和相同充电速率的连接器汇总。

const {ConnectorAggregation} = await google.maps.importLibrary("places");
availabilityLastUpdateTime
readonly
类型:Date optional
此汇总中的连接器可用性信息的上次更新时间。
availableCount
readonly
类型:number optional
此聚合中当前可用的连接器数量。
count
readonly
类型:number
此聚合中的连接器数量。
maxChargeRateKw
readonly
类型:number
汇总中每个连接器的静态最大充电速率(以 kW 为单位)。
outOfServiceCount
readonly
类型:number optional
此聚合中当前无法使用的连接器数量。
type
readonly
类型:EVConnectorType optional
此汇总的连接器类型。

ConsumerAlert 类

class google.maps.places.ConsumerAlert
library "places"

消费者提醒消息。所有文本均以 languageCode 字段指定的语言呈现。

const {ConsumerAlert} = await google.maps.importLibrary("places");
details
readonly
类型:ConsumerAlertDetails optional
消费者提醒消息的详细信息。
languageCode
readonly
类型:string optional
消费者提醒消息的语言代码。
overview
readonly
类型:string optional
消费者提醒消息概览。
继承: toJSON

ConsumerAlertDetails 类

class google.maps.places.ConsumerAlertDetails
library "places"

消费者提醒消息的详细信息。

const {ConsumerAlertDetails} = await google.maps.importLibrary("places");
aboutLinkTitle
readonly
类型:string optional
要显示的链接标题,用于提供更多信息。
aboutLinkURI
readonly
类型:string optional
用于提供更多信息的链接的 URI。
description
readonly
类型:string optional
消费者提醒消息的说明。
title
readonly
类型:string optional
与详细说明一起显示的标题。

包含常量

常量 google.maps.places.Containment
库 "places"

定义目标位置与区域之间的空间关系。如需了解详情,请参阅网络服务文档。

这些常量也可以用作字符串。在 TypeScript 中,字符串字面量由 ContainmentString 类型定义。

const {Containment} = await google.maps.importLibrary("places");
NEAR 目标位置位于区域范围之外,但距离很近。如需了解详情,请参阅网络服务文档。
OUTSKIRTS 目标位置位于区域内,靠近边缘。如需了解详情,请参阅网络服务文档。
WITHIN 目标位置位于区域内,靠近中心。如需了解详情,请参阅网络服务文档。

ContentBlock 类

class google.maps.places.ContentBlock
library "places"

ContentBlock 描述了摘要的内容及其来源。

const {ContentBlock} = await google.maps.importLibrary("places");
content
readonly
类型:string optional
与主题相关的内容。
contentLanguageCode
readonly
类型:string optional
内容的语言代码。
referencedPlaces
readonly
类型:Array<Place>
引用的 Place 的列表。首次检索时,每个 Place 仅在 id 字段中包含地点 ID。
继承: toJSON

EVChargeAmenitySummary 类

class google.maps.places.EVChargeAmenitySummary
library "places"

AI 生成的电动车辆充电站附近设施摘要。此字段仅适用于类型为 electric_vehicle_charging_station 的地点。

const {EVChargeAmenitySummary} = await google.maps.importLibrary("places");
coffee
readonly
类型:ContentBlock optional
附近咖啡馆的摘要。
disclosureText
readonly
类型:string optional
与此摘要相关的披露声明文本。
disclosureTextLanguageCode
readonly
类型:string optional
披露声明文本的语言代码。
flagContentURI
readonly
类型:string optional
用于报告摘要问题的 URI。
overview
readonly
类型:ContentBlock optional
可用设施概览。
restaurant
readonly
类型:ContentBlock optional
附近餐厅的摘要。
store
readonly
类型:ContentBlock optional
附近商店的摘要。
继承: toJSON

EVChargeOptions 类

class google.maps.places.EVChargeOptions
library "places"

有关该地点内电动车辆充电站的信息。

const {EVChargeOptions} = await google.maps.importLibrary("places");
connectorAggregations
readonly
电动汽车充电连接器汇总列表,其中包含相同类型和相同充电速率的连接器。
connectorCount
readonly
类型:number
此充电站的连接器数量。由于某些充电桩可能有多个连接器,但一次只能为一辆车充电,因此连接器的数量可能会大于可同时充电的车辆总数。
继承: toJSON

EVConnectorType 常量

常量 google.maps.places.EVConnectorType
库 "places"

如需了解有关电动汽车充电连接器类型的更多信息/背景信息,请参阅 http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=6872107。如需了解详情,请参阅网络服务文档。

这些常量也可以用作字符串。在 TypeScript 中,字符串字面量由 EVConnectorTypeString 类型定义。

const {EVConnectorType} = await google.maps.importLibrary("places");
CCS_COMBO_1 联合充电系统(交流和直流)。如需了解详情,请参阅网络服务文档。
CCS_COMBO_2 联合充电系统(交流和直流)。如需了解详情,请参阅网络服务文档。
CHADEMO CHAdeMO 型连接器。如需了解详情,请参阅网络服务文档。
J1772 J1772 1 型连接器。如需了解详情,请参阅网络服务文档。
NACS 北美充电标准 (NACS),已标准化为 SAE J3400。如需了解详情,请参阅网络服务文档。
OTHER 其他连接器类型。如需了解详情,请参阅网络服务文档。
TESLA 通用 TESLA 连接器。如需了解详情,请参阅网络服务文档。
TYPE_2 IEC 62196 2 型连接器。如需了解详情,请参阅网络服务文档。
UNSPECIFIED_GB_T GB/T 类型对应于中国的 GB/T 标准。如需了解详情,请参阅网络服务文档。
UNSPECIFIED_WALL_OUTLET 未指定墙壁插座。如需了解详情,请参阅网络服务文档。

EVSearchOptions 接口

接口 google.maps.places.EVSearchOptions

可为地点搜索请求指定的电动汽车相关选项。

connectorTypes
可选
类型:Array<EVConnectorType> optional
首选电动汽车连接器类型列表。不支持任何所列连接器类型的地点会被滤除。
minimumChargingRateKw
可选
类型:number optional
最低充电速率(以千瓦为单位)。充电速率低于指定速率的地点会被滤除。

FetchFieldsRequest 接口

接口 google.maps.places.FetchFieldsRequest

用于提取地点字段的选项。

fields
类型:Iterable<string>
要提取的字段列表。
internalUsageAttributionIds
可选
类型:Iterable<string> optional
用于将调用归因于特定软件包或 OSS 库的标识符。

FuelOptions 类

class google.maps.places.FuelOptions
library "places"

加油站燃油选项的最新信息。此信息会定期更新。

const {FuelOptions} = await google.maps.importLibrary("places");
fuelPrices
readonly
类型:Array<FuelPrice>
此加油站提供的每种燃油的价格列表,每种燃油类型对应一个条目。
继承: toJSON

FuelPrice 类

class google.maps.places.FuelPrice
library "places"

给定燃料类型的燃料价格信息。

const {FuelPrice} = await google.maps.importLibrary("places");
price
readonly
类型:Money optional
燃油价格。
type
readonly
类型:FuelType optional
燃料类型。
updateTime
readonly
类型:Date optional
上次更新燃油价格的时间。

FuelType 常量

常量 google.maps.places.FuelType
库 "places"

燃料类型。如需了解详情,请参阅网络服务文档。

这些常量也可以用作字符串。在 TypeScript 中,字符串字面量由 FuelTypeString 类型定义。

const {FuelType} = await google.maps.importLibrary("places");
BIO_DIESEL 生物柴油。如需了解详情,请参阅网络服务文档。
DIESEL 柴油。如需了解详情,请参阅网络服务文档。
DIESEL_PLUS 柴油加燃料。如需了解详情,请参阅网络服务文档。
E100 E 100. 如需了解详情,请参阅网络服务文档。
E80 E 80. 如需了解详情,请参阅网络服务文档。
E85 E 85. 如需了解详情,请参阅网络服务文档。
LPG 液化石油气。如需了解详情,请参阅网络服务文档。
METHANE 甲烷。如需了解详情,请参阅网络服务文档。
MIDGRADE 中等汽油。如需了解详情,请参阅网络服务文档。
PREMIUM Premium。如需了解详情,请参阅网络服务文档。
REGULAR_UNLEADED 普通无铅汽油。如需了解详情,请参阅网络服务文档。
SP100 SP 100。如需了解详情,请参阅网络服务文档。
SP91 SP 91. 如需了解详情,请参阅网络服务文档。
SP91_E10 SP 91 E10. 如需了解详情,请参阅网络服务文档。
SP92 SP 92. 如需了解详情,请参阅网络服务文档。
SP95 SP 95. 如需了解详情,请参阅网络服务文档。
SP95_E10 SP95 E10。如需了解详情,请参阅网络服务文档。
SP98 SP 98. 如需了解详情,请参阅网络服务文档。
SP99 SP 99. 如需了解详情,请参阅网络服务文档。
TRUCK_DIESEL 卡车柴油。如需了解详情,请参阅网络服务文档。

GenerativeSummary 类

class google.maps.places.GenerativeSummary
library "places"

AI 生成的地点摘要。

const {GenerativeSummary} = await google.maps.importLibrary("places");
disclosureText
readonly
类型:string optional
与此摘要相关的披露声明文本。
disclosureTextLanguageCode
readonly
类型:string optional
披露声明文本的语言代码。
flagContentURI
readonly
类型:string optional
用于报告摘要问题的 URI。
overview
readonly
类型:string optional
地点的概览。
overviewLanguageCode
readonly
类型:string optional
概览的语言代码。
继承: toJSON

class google.maps.places.GoogleMapsLinks
library "places"

用于触发不同 Google 地图操作的链接。

const {GoogleMapsLinks} = await google.maps.importLibrary("places");
directionsURI
readonly
类型:string optional
一个链接,用于在 Google 地图上显示前往该地点的路线。该链接仅填充目的地位置,并使用默认出行方式 DRIVE。
photosURI
readonly
类型:string optional
一个链接,用于在 Google 地图上显示该地点的照片。
placeURI
readonly
类型:string optional
一个用于在 Google 地图上显示该地点的链接。
reviewsURI
readonly
类型:string optional
一个链接,用于在 Google 地图上显示该地点的评价。
writeAReviewURI
readonly
类型:string optional
一个链接,用于在 Google 地图上为该地点撰写评价。
继承: toJSON

Landmark 类

class google.maps.places.Landmark
library "places"

地标的基本信息以及地标与目标位置的关系。地标是可用于描述位置的醒目地点。

const {Landmark} = await google.maps.importLibrary("places");
place
readonly
类型:Place
地标的位置。
spatialRelationship
readonly
目标位置与地标之间的空间关系。
straightLineDistanceMeters
readonly
类型:number
目标中心点与地标中心点之间的直线距离(以米为单位)。在某些情况下,此值可能会超过 travelDistanceMeters。
travelDistanceMeters
readonly
类型:number optional
沿道路网从目标到地标的行程距离(以米为单位,如果已知)。此值不考虑交通方式,例如步行、驾车、骑行。
继承: toJSON

Money 类

class google.maps.places.Money
library "places"

表示带有货币类型的金额。

const {Money} = await google.maps.importLibrary("places");
currencyCode
readonly
类型:string
ISO 4217 中定义的由 3 个字母组成的货币代码。
nanos
readonly
类型:number
以纳单位 (10^-9) 表示的金额数量。
units
readonly
类型:number
金额的整数单位。例如,如果 Money.currencyCode 为“USD”,则 1 个单位为 1 美元。
toString
toString()
参数:无
返回值:string
返回金额的人类可读表示形式,并附带货币符号。
继承: toJSON

NeighborhoodSummary 类

class google.maps.places.NeighborhoodSummary
library "places"

AI 生成的地点附近地图注点摘要。

const {NeighborhoodSummary} = await google.maps.importLibrary("places");
description
readonly
类型:ContentBlock optional
对周边环境的详细描述。
disclosureText
readonly
类型:string optional
与此摘要相关的披露声明文本。
disclosureTextLanguageCode
readonly
类型:string optional
披露声明文本的语言代码。
flagContentURI
readonly
类型:string optional
用于报告摘要问题的 URI。
overview
readonly
类型:ContentBlock optional
街区概览。
继承: toJSON

OpeningHours 类

类 google.maps.places.OpeningHours
由 SecondaryOpeningHours 扩展
库 "places"

地点营业时间的相关信息。

const {OpeningHours} = await google.maps.importLibrary("places");
periods
readonly
涵盖一周中每一天的营业时段,从星期日开始,按时间顺序排列。不包括地点不营业的日子。
specialDays
readonly
类型:Array<Date>
一个日期数组,表示当前周期内的特殊日期。特殊日期会影响地点的营业时间,例如圣诞节或一次性停业。如果存在特殊营业时间,请为 currentOpeningHours 和 currentSecondaryOpeningHours 设置。
weekdayDescriptions
readonly
类型:Array<string>
包含七个字符串的数组,用于以特定格式表示一周内每天的营业时间。地点服务会根据当前语言设置营业时间格式,并进行本地化。此数组中元素的顺序取决于语言。有些语言以星期一作为一周的开始,有些语言则以星期日作为开始。
继承: toJSON

OpeningHoursPeriod 类

class google.maps.places.OpeningHoursPeriod
library "places"

地点开放的时间段。

const {OpeningHoursPeriod} = await google.maps.importLibrary("places");
close
readonly
类型:OpeningHoursPoint optional
地点的结束营业时间。
open
readonly
地点的开始营业时间。
继承: toJSON

OpeningHoursPoint 类

class google.maps.places.OpeningHoursPoint
library "places"

地点更改其营业状态的时间点。

const {OpeningHoursPoint} = await google.maps.importLibrary("places");
day
readonly
类型:number
一周中的日期,以 [0, 6] 范围内的数字表示,从星期日开始。例如,2 表示星期二。
hour
readonly
类型:number
OpeningHoursPoint.time 对应的小时数,以数字表示,范围为 [0, 23]。该值以地点所在时区为准。
minute
readonly
类型:number
OpeningHoursPoint.time 对应的分钟数,以数字表示,范围为 [0, 59]。该值以地点所在时区为准。
继承: toJSON

SecondaryOpeningHours 类

class google.maps.places.SecondaryOpeningHours extends OpeningHours
library "places"

地点的次要营业时间信息。

const {SecondaryOpeningHours} = await google.maps.importLibrary("places");
type
readonly
类型:string optional
次要营业时间的类型。这是指次要营业时间适用的服务,例如外卖、送货或自提。如需查看有效值的列表,请参阅 SecondaryHoursType。
继承的方法: periods、specialDays、weekdayDescriptions
继承: toJSON

ParkingOptions 类

class google.maps.places.ParkingOptions
library "places"

const {ParkingOptions} = await google.maps.importLibrary("places");
hasFreeGarageParking
readonly
类型:boolean optional
某地点是否提供免费停车库。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
hasFreeParkingLot
readonly
类型:boolean optional
地点是否提供免费停车场。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
hasFreeStreetParking
readonly
类型:boolean optional
某地点是否提供免费路边停车位。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
hasPaidGarageParking
readonly
类型:boolean optional
某地点是否提供收费停车库。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
hasPaidParkingLot
readonly
类型:boolean optional
地点是否提供付费停车场。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
hasPaidStreetParking
readonly
类型:boolean optional
地点是否提供收费路边停车。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
hasValetParking
readonly
类型:boolean optional
地点是否提供代客泊车服务。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。

PaymentOptions 类

class google.maps.places.PaymentOptions
library "places"

const {PaymentOptions} = await google.maps.importLibrary("places");
acceptsCashOnly
readonly
类型:boolean optional
地点是否仅接受现金付款。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
acceptsCreditCards
readonly
类型:boolean optional
地点是否接受信用卡付款。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
acceptsDebitCards
readonly
类型:boolean optional
地点是否接受借记卡付款。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。
acceptsNFC
readonly
类型:boolean optional
地点是否接受通过 NFC 付款。如果值已知,则返回“true”或“false”。如果值未知,则返回“null”。

Photo 类

class google.maps.places.Photo
library "places"

地点照片的相关信息。

const {Photo} = await google.maps.importLibrary("places");
authorAttributions
readonly
要针对此照片显示的提供方文字。
flagContentURI
readonly
类型:string optional
一个链接,用户可通过该链接举报照片存在的问题。
googleMapsURI
readonly
类型:string optional
用于在 Google 地图上显示照片的链接。
heightPx
readonly
类型:number
照片的高度(以像素为单位)。
widthPx
readonly
类型:number
照片的宽度(以像素为单位)。
getURI
getURI([options])
参数:
返回值:string
返回与指定选项对应的图片网址。
继承: toJSON

PlusCode 类

class google.maps.places.PlusCode
library "places"

地点的 Plus Code。如需了解详情,请参阅 https://plus.codes/。

const {PlusCode} = await google.maps.importLibrary("places");
compoundCode
readonly
类型:string optional
精度为 1/8000 度 × 1/8000 度的 Plus Code,其中前四个字符(区域代码)被舍弃并替换为区域描述。例如,“9G8F+5W Zurich, Switzerland”。
globalCode
readonly
类型:string optional
精度为 1/8000 度 x 1/8000 度的 Plus Code。例如,“8FVC9G8F+5W”。
继承: toJSON

PostalAddress 类

类 google.maps.places.PostalAddress 实现 PostalAddressLiteral
库 "places"

表示邮寄地址(例如,邮政服务递送物品的地址)。注意:JavaScript API 使用 PostalAddress 来实例化表示 Web 服务返回的数据的对象。

const {PostalAddress} = await google.maps.importLibrary("places");
addressLines
readonly
类型:Array<string>
描述详细地址的非结构化地址行。
administrativeArea
readonly
类型:string optional
某个国家或地区的邮政地址中使用的最高行政区划。
languageCode
readonly
类型:string optional
此地址内容的 BCP-47 语言代码。示例:“zh-Hant”、“ja”、“ja-Latn”、“en”。
locality
readonly
类型:string optional
通常指地址的城市/乡镇部分。
organization
readonly
类型:string optional
地址对应的组织的名称。
postalCode
readonly
类型:string optional
地址的邮政编码。
recipients
readonly
类型:Array<string>
地址处的收件人。
regionCode
readonly
类型:string
地址的国家/地区的 CLDR 地区代码。示例:瑞士为“CH”。如需了解详情,请参阅 https://cldr.unicode.org/ 和 https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html。
sortingCode
readonly
类型:string optional
地址的汇兑代码。
sublocality
readonly
类型:string optional
地址的次级行政区,例如街区、行政区或区。
继承: toJSON

PostalAddressLiteral 接口

接口 google.maps.places.PostalAddressLiteral
由 PostalAddress 实现

用于填充 PostalAddress 的数据。

regionCode
类型:string
addressLines
可选
类型:Iterable<string> optional
administrativeArea
可选
类型:string optional
languageCode
可选
类型:string optional
locality
可选
类型:string optional
organization
可选
类型:string optional
postalCode
可选
类型:string optional
recipients
可选
类型:Iterable<string> optional
sortingCode
可选
类型:string optional
sublocality
可选
类型:string optional

PriceLevel 常量

常量 google.maps.places.PriceLevel
库 "places"

地点的价格水平。如需了解详情,请参阅网络服务文档。

这些常量也可以用作字符串。在 TypeScript 中,字符串字面量由 PriceLevelString 类型定义。

const {PriceLevel} = await google.maps.importLibrary("places");
EXPENSIVE 此地点提供昂贵的服务。如需了解详情,请参阅网络服务文档。
FREE 此地点提供免费服务。如需了解详情,请参阅网络服务文档。
INEXPENSIVE 此地点提供价格低廉的服务。如需了解详情,请参阅网络服务文档。
MODERATE 此地点提供价格适中的服务。如需了解详情,请参阅网络服务文档。
VERY_EXPENSIVE 该场所提供的服务非常昂贵。如需了解详情,请参阅网络服务文档。

PriceRange 类

class google.maps.places.PriceRange
library "places"

与地点关联的价格范围。endPrice 可以不设置,这表示没有上限的范围(例如“超过 100 美元”)。

const {PriceRange} = await google.maps.importLibrary("places");
endPrice
readonly
类型:Money optional
价格范围的上限(含此值)。价格应低于此金额。
startPrice
readonly
类型:Money
价格范围的下限(含此值)。价格应等于或高于此金额。
继承: toJSON

Review 类

class google.maps.places.Review
library "places"

有关地点评价的信息。

const {Review} = await google.maps.importLibrary("places");
authorAttribution
readonly
类型:AuthorAttribution optional
评价者。
flagContentURI
readonly
类型:string optional
一个链接,用户可通过该链接举报评价存在的问题。
googleMapsURI
readonly
类型:string optional
用于在 Google 地图上显示评价的链接。
originalText
readonly
类型:string optional
评价文本(原始语言)。
originalTextLanguageCode
readonly
类型:string optional
表示评价原始语言的 IETF 语言代码。
publishTime
readonly
类型:Date optional
rating
readonly
类型:number optional
此评价的评分,介于 1.0 到 5.0 之间(含边界值)。
relativePublishTimeDescription
readonly
类型:string optional
一个采用特定格式的近期时间字符串,以符合相应语言和国家/地区习惯的形式表示评价时间相对于当前时间的间隔。例如“1 个月前”。
text
readonly
类型:string optional
评价的本地化文本。
textLanguageCode
readonly
类型:string optional
表示评价本地化语言的 IETF 语言代码。
visitDateMonth
readonly
类型:number optional
评价作者到访该地点的月份。此字段从 0 开始;0 表示 1 月,11 表示 12 月。
visitDateYear
readonly
类型:number optional
评价作者到访相应地点的年份。
继承: toJSON

ReviewSummary 类

class google.maps.places.ReviewSummary
library "places"

AI 生成的地点用户评价摘要。

const {ReviewSummary} = await google.maps.importLibrary("places");
disclosureText
readonly
类型:string optional
与此摘要相关的披露声明文本。
disclosureTextLanguageCode
readonly
类型:string optional
披露声明文本的语言代码。
flagContentURI
readonly
类型:string optional
用于报告摘要问题的 URI。
reviewsURI
readonly
类型:string optional
用于在 Google 地图上显示此地点评价的 URI。
text
readonly
类型:string optional
用户评价摘要。
textLanguageCode
readonly
类型:string optional
用户评价摘要的语言代码。
继承: toJSON

SearchByTextRequest 接口

接口 google.maps.places.SearchByTextRequest

Place.searchByText 的请求接口。

fields
类型:Array<string>
响应中要包含的字段,这些字段将计费。如果传入的是 ['*'],系统会返回所有可用字段并据此计费(不建议用于生产环境中的部署)。您可以将 Place 类中的任何属性作为字段进行请求。
evSearchOptions
可选
类型:EVSearchOptions optional
可为地点搜索请求指定的电动汽车相关选项。
futureOpeningBusinessesIncluded
可选
类型:boolean optional
包含尚未开业但预计未来会开业的地点。
includedType
可选
类型:string optional
请求的地点类型。如需查看支持的类型的完整列表,请访问:https://developers.google.com/maps/documentation/places/web-service/place-types。仅支持一种包含的类型。请参阅 SearchByTextRequest.useStrictTypeFiltering
internalUsageAttributionIds
可选
类型:Iterable<string> optional
用于将调用归因于特定软件包或 OSS 库的标识符。
isOpenNow
可选
类型:boolean optional
默认值:false
用于将搜索范围限制为当前营业的地点。
language
可选
类型:string optional
地点详情将以首选语言(如有)显示。默认采用浏览器的语言偏好设置。当前支持的语言列表:https://developers.google.com/maps/faq#languagesupport。
locationBias
可选
要搜索的区域。此位置用作偏向,这意味着系统可能会返回给定位置周围的结果。无法与 locationRestriction 一起设置。
locationRestriction
可选
要搜索的区域。此位置用作限制条件,这意味着系统不会返回给定位置以外的结果。无法与 locationBias 一起设置。
maxResultCount
可选
类型:number optional
页面中结果的数量上限。必须介于 1 到 20 之间(含 1 和 20)。
minRating
可选
类型:number optional
滤除平均房客评分严格低于此限制的结果。有效值必须是 0 到 5 之间(含边界值)的浮点数,步长为 0.5,即 [0, 0.5, 1.0, … , 5.0](含边界值)。输入的评分将向上舍入到最接近的 0.5(上限)。例如,如果评分为 0.6,系统会排除所有评分低于 1.0 的结果。
priceLevels
可选
类型:Array<PriceLevel> optional
用于将搜索范围限制为标记为特定价格水平的地点。您可以选择任意价格水平组合。默认值为所有价格级别。
pureServiceAreaBusinessesIncluded
可选
类型:boolean optional
如果该字段设为 true,则包含纯上门服务商家。纯上门服务商家是指为客户送货上门或提供上门服务,但不在自己的商家地址为客户提供服务的商家。例如,清洁服务类商家或管道工可能没有实体地址,也没有在 Google 地图上显示营业地点。Places 不会返回这些商家的 location、plusCode 等字段以及其他与营业地点相关的字段。
query
可选
类型:string optional
BetarankBy
可选
类型:SearchByTextRankPreference optional
rankPreference
可选
类型:SearchByTextRankPreference optional
默认值:SearchByTextRankPreference.RELEVANCE
回答中结果的排序方式。
region
可选
类型:string optional
请求来源位置的 Unicode 国家/地区代码 (CLDR)。此参数用于显示地点详情,例如特定于区域的地点名称(如果有)。该参数可能会根据适用法律影响结果。如需了解详情,请参阅 https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html。请注意,目前不支持 3 位数的地区代码。
textQuery
可选
类型:string optional
当您不使用 SearchByTextRequest.query 时,此参数为必填。文本搜索的文本查询。
useStrictTypeFiltering
可选
类型:boolean optional
默认值:false
用于为 SearchByTextRequest.includedType 设置严格的类型过滤。如果设置为 true,则系统只会返回相同类型的结果。

SearchByTextRankPreference 常量

常量 google.maps.places.SearchByTextRankPreference
库 "places"

结果在响应中的排名方式。如需了解详情,请参阅网络服务文档。

这些常量也可以用作字符串。在 TypeScript 中,字符串字面量由 SearchByTextRankPreferenceString 类型定义。

const {SearchByTextRankPreference} = await google.maps.importLibrary("places");
DISTANCE 按距离对结果进行排名。如需了解详情,请参阅网络服务文档。
RELEVANCE 按相关性对结果进行排名。如需了解详情,请参阅网络服务文档。

SearchNearbyRequest 接口

接口 google.maps.places.SearchNearbyRequest

Place.searchNearby 的请求接口。如需详细了解请求,请参阅 Places API 参考文档。

fields
类型:Array<string>
响应中要包含的字段,这些字段将计费。如果传入的是 ['*'],系统会返回所有可用字段并据此计费(不建议用于生产环境中的部署)。您可以将 Place 类中的任何属性作为字段进行请求。
locationRestriction
要搜索的区域,指定为具有中心和半径的圆形。系统不会返回指定位置以外的结果。
excludedPrimaryTypes
可选
类型:Array<string> optional
已排除的主要地点类型。查看支持的类型的完整列表。一个地点只能有一个主要类型。最多可以指定 50 种类型。如果您在 included 和 excluded 列表中指定了相同的类型,系统会返回 INVALID_ARGUMENT 错误。
excludedTypes
可选
类型:Array<string> optional
排除的地点类型。查看支持的类型的完整列表。一个地点可以有许多不同的地点类型。最多可以指定 50 种类型。如果您在 included 和 excluded 列表中指定了相同的类型,系统会返回 INVALID_ARGUMENT 错误。
futureOpeningBusinessesIncluded
可选
类型:boolean optional
包含尚未开业但预计未来会开业的地点。
includedPrimaryTypes
可选
类型:Array<string> optional
包含的主要地点类型。查看支持的类型的完整列表。一个地点只能有一个主要类型。最多可以指定 50 种类型。如果您在 included 和 excluded 列表中指定了相同的类型,系统会返回 INVALID_ARGUMENT 错误。
includedTypes
可选
类型:Array<string> optional
包含的地点类型。查看支持的类型的完整列表。一个地点可以有许多不同的地点类型。最多可以指定 50 种类型。如果您在 included 和 excluded 列表中指定了相同的类型,系统会返回 INVALID_ARGUMENT 错误。
internalUsageAttributionIds
可选
类型:Iterable<string> optional
用于将调用归因于特定软件包或 OSS 库的标识符。
language
可选
类型:string optional
地点详情将以首选语言(如有)显示。默认采用浏览器的语言偏好设置。当前支持的语言列表:https://developers.google.com/maps/faq#languagesupport。
maxResultCount
可选
类型:number optional
页面中结果的数量上限。如需了解可接受的值和默认值,请参阅 Places API 参考文档。
rankPreference
可选
类型:SearchNearbyRankPreference optional
默认值:SearchNearbyRankPreference.POPULARITY
回答中结果的排序方式。
region
可选
类型:string optional
请求来源位置的 Unicode 国家/地区代码 (CLDR)。此参数用于显示地点详情,例如特定于区域的地点名称(如果有)。该参数可能会根据适用法律影响结果。如需了解详情,请参阅 https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html。请注意,目前不支持 3 位数的地区代码。

SearchNearbyRankPreference 常量

常量 google.maps.places.SearchNearbyRankPreference
库 "places"

结果在响应中的排名方式。如需了解详情,请参阅网络服务文档。

这些常量也可以用作字符串。在 TypeScript 中,字符串字面量由 SearchNearbyRankPreferenceString 类型定义。

const {SearchNearbyRankPreference} = await google.maps.importLibrary("places");
DISTANCE 按距离对结果进行排名。如需了解详情,请参阅网络服务文档。
POPULARITY 按热门程度对结果进行排名。如需了解详情,请参阅网络服务文档。

SpatialRelationship 常量

常量 google.maps.places.SpatialRelationship
库 "places"

定义目标位置与地标之间的空间关系。如需了解详情,请参阅网络服务文档。

这些常量也可以用作字符串。在 TypeScript 中,字符串字面量由 SpatialRelationshipString 类型定义。

const {SpatialRelationship} = await google.maps.importLibrary("places");
ACROSS_THE_ROAD 目标地点位于地标的正对面,在道路的另一侧。如需了解详情,请参阅网络服务文档。
AROUND_THE_CORNER 与地标不在同一条路线上,但只需转弯一次即可到达。如需了解详情,请参阅网络服务文档。
BEHIND 靠近地标建筑,但远离其街道入口。如需了解详情,请参阅网络服务文档。
BESIDE 目标紧邻地标。如需了解详情,请参阅网络服务文档。
DOWN_THE_ROAD 与地标位于同一条路线上,但不在地标旁边或对面。如需了解详情,请参阅网络服务文档。
NEAR 如果以下更具体的关系均不适用,则此为默认关系。如需了解详情,请参阅网络服务文档。
WITHIN 地标具有空间几何图形,且目标位于其边界内。如需了解详情,请参阅网络服务文档。

TimeZone 类

class google.maps.places.TimeZone
library "places"

表示 IANA 时区数据库 https://www.iana.org/time-zones 中的时区。

const {TimeZone} = await google.maps.importLibrary("places");
id
readonly
类型:string optional
IANA 时区数据库时区。例如“America/New_York”。
version
readonly
类型:string optional
IANA 时区数据库版本号。例如“2019a”。
继承: toJSON

TransitAgency 类

class google.maps.places.TransitAgency
library "places"

代表公共交通公司。

const {TransitAgency} = await google.maps.importLibrary("places");
displayName
类型:string optional
代理机构的名称(采用所请求的语言)。
displayNameLanguageCode
类型:string optional
代理机构名称文本的 BCP-47 语言代码,例如“en-US”或“sr-Latn”。如需了解详情,请参阅 http://www.unicode.org/reports/tr35/#Unicode_locale_identifier。
fareURL
类型:URL optional
公交机构票价详情页面的网址。
icon
类型:TransitIcon optional
公交系统的本地化品牌图标。
lines
类型:Array<TransitLine>
此公交公司运营的公交线路。
url
类型:URL optional
代理机构首页的网址。
继承: toJSON

TransitIcon 类

class google.maps.places.TransitIcon
library "places"

表示公交图标。

const {TransitIcon} = await google.maps.importLibrary("places");
nameIncluded
类型:boolean optional
名称是否包含在图标中,无需在图标旁边显示。
url
类型:URL optional
图标的网址。
继承: toJSON

TransitLine 类

class google.maps.places.TransitLine
library "places"

表示公交线路。

const {TransitLine} = await google.maps.importLibrary("places");
backgroundColor
类型:string optional
此公交线路标签的背景颜色,采用十六进制格式(例如“#909CE1”)。此颜色还可用于绘制该公交线路的形状。
displayName
类型:string optional
该公交线路的全名(例如“Sunnydale local”)。
displayNameLanguageCode
类型:string optional
公交线路全名文本的 BCP-47 语言代码,例如“en-US”或“sr-Latn”。如需了解详情,请参阅 http://www.unicode.org/reports/tr35/#Unicode_locale_identifier。
icon
类型:TransitIcon optional
此特定线路的图标。
id
类型:string optional
公交线路的 ID,可用于在同一公交站点的其他公交线路中唯一标识该线路。无法保证此标识符在不同响应中保持稳定。
shortDisplayName
类型:string optional
此公交线路的简称(例如“S2”)。
shortDisplayNameLanguageCode
类型:string optional
公交线路简称文本的 BCP-47 语言代码,例如“en-US”或“sr-Latn”。如需了解详情,请参阅 http://www.unicode.org/reports/tr35/#Unicode_locale_identifier。
textColor
类型:string optional
此公交线路标签的文本颜色,采用十六进制格式(例如“#909CE1”)。
url
类型:URL optional
包含此线路详细信息的网页的网址。
vehicleIcon
类型:TransitIcon optional
此特定交通工具类型的图标。
vehicleType
类型:TransitVehicleType optional
所用车辆的类型。
继承: toJSON

TransitStation 类

class google.maps.places.TransitStation
library "places"

表示地点的公交特定信息。

const {TransitStation} = await google.maps.importLibrary("places");
agencies
服务于此车站的公共交通公司。
displayName
类型:string optional
车站的本地语言名称。
displayNameLanguageCode
类型:string optional
本地显示名称文本的 BCP-47 语言代码,例如“en-US”或“sr-Latn”。如需了解详情,请参阅 http://www.unicode.org/reports/tr35/#Unicode_locale_identifier。
stops
类型:Array<TransitStop>
公交在此站停靠。
继承: toJSON

TransitStop 类

class google.maps.places.TransitStop
library "places"

表示公交车站。

const {TransitStop} = await google.maps.importLibrary("places");
displayName
类型:string optional
经停点名称(采用请求的语言)。
displayNameLanguageCode
类型:string optional
经停点名称,采用所请求语言的 BCP-47 语言代码,例如“en-US”或“sr-Latn”。如需了解详情,请参阅 http://www.unicode.org/reports/tr35/#Unicode_locale_identifier。
hasWheelchairAccessibleEntrance
类型:boolean optional
此字段用于指明从车站外部到经停点是否存在无障碍通道。它并不表示是否可以从该站点上车。
id
类型:string optional
公交站点的 ID,可用于在同一公交车站的其他公交站点中唯一标识该站点。无法保证此标识符在不同响应中保持稳定。
location
类型:LatLngAltitude optional
站点的位置。
platformCode
类型:string optional
此站台所代表的站台代码。可以采用任何格式(例如“2”“Platform 2”“2-4”或“1x”)。
platformCodeLanguageCode
类型:string optional
平台代码文本的 BCP-47 语言代码,例如“en-US”或“sr-Latn”。如需了解详情,请参阅 http://www.unicode.org/reports/tr35/#Unicode_locale_identifier。
signageText
类型:string optional
此站台指示牌上的文字(例如“开往中环”或“东区和布鲁克林”)。如果 platformCode 不存在,此字段可能是平台的唯一标识符。不过,platformCode 和 signageText 可以同时设置。
signageTextLanguageCode
类型:string optional
标识牌文本的 BCP-47 语言代码,例如“en-US”或“sr-Latn”。如需了解详情,请参阅 http://www.unicode.org/reports/tr35/#Unicode_locale_identifier。
stopCode
类型:string optional
公交站的人类可读标识符,由公共交通公司用于区分同名公交站。
stopCodeLanguageCode
类型:string optional
经停点代码文本的 BCP-47 语言代码,例如“en-US”或“sr-Latn”。如需了解详情,请参阅 http://www.unicode.org/reports/tr35/#Unicode_locale_identifier。
继承: toJSON

TransitVehicleType 常量

常量 google.maps.places.TransitVehicleType
库 "places"

公交线路的交通工具类型。如需了解详情,请参阅网络服务文档。

这些常量也可以用作字符串。在 TypeScript 中,字符串字面量由 TransitVehicleTypeString 类型定义。

const {TransitVehicleType} = await google.maps.importLibrary("places");
AIRPLANE 飞机。如需了解详情,请参阅网络服务文档。
BUS 企业如需了解详情,请参阅网络服务文档。
CABLE_CAR 缆车。如需了解详情,请参阅网络服务文档。
COACH Coach。如需了解详情,请参阅网络服务文档。
COMMUTER_TRAIN 通勤火车。如需了解详情,请参阅网络服务文档。
FERRY 轮渡。如需了解详情,请参阅网络服务文档。
FUNICULAR 缆索铁路。如需了解详情,请参阅网络服务文档。
GONDOLA_LIFT 吊厢索道。如需了解详情,请参阅网络服务文档。
HEAVY_RAIL 重轨。如需了解详情,请参阅网络服务文档。
HIGH_SPEED_TRAIN 高速列车。如需了解详情,请参阅网络服务文档。
HORSE_CARRIAGE 马车。如需了解详情,请参阅网络服务文档。
INTERCITY_BUS 长途客车。如需了解详情,请参阅网络服务文档。
LONG_DISTANCE_TRAIN 长途列车。如需了解详情,请参阅网络服务文档。
METRO_RAIL 市区地铁。如需了解详情,请参阅网络服务文档。
MONORAIL 单轨。如需了解详情,请参阅网络服务文档。
RAIL 铁路。如需了解详情,请参阅网络服务文档。
SHARE_TAXI 共享出租车。如需了解详情,请参阅网络服务文档。
SPECIAL 特别活动。如需了解详情,请参阅网络服务文档。
SUBWAY 地铁。如需了解详情,请参阅网络服务文档。
TRAM 有轨电车。如需了解详情,请参阅网络服务文档。
TROLLEYBUS 无轨电车。如需了解详情,请参阅网络服务文档。