Place 类
类 google.maps.places.Place
实现 PlaceOptions
库 "places"
const {Place} = await google.maps.importLibrary("places");
构造函数 | |
|---|---|
Place |
Place(options)参数:
|
静态方法 | |
|---|---|
searchByText |
searchByText(request)参数:
基于文本查询的地点搜索。 |
searchNearby |
searchNearby(request)参数:
搜索附近的地点。 |
属性 | |
|---|---|
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 |
此地点的包含地点列表。包含地点是指包含该地点的地点。 |
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。 |
googleMapsLinks
readonly |
类型:
GoogleMapsLinks optional用于触发不同 Google 地图操作的链接。 |
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 |
此地点的照片。该集合最多可包含 10 个 Photo 对象。 |
plusCode
readonly |
类型:
PlusCode optional |
postalAddress
readonly |
类型:
PostalAddress optional |
priceLevel
readonly |
类型:
PriceLevel optional相应地点的价格水平。此属性可以返回以下任一值
|
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 |
此地点的评价列表。 |
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 |
此地点的子目的地列表。子目的地是与主要地点相关联的具体地点。这些子地点为在大型或复杂场所(例如机场、国家公园、大学或体育场)内搜索的用户提供了更具体的目的地。 |
svgIconMaskURI
readonly |
类型:
string optional指向 SVG 图片遮罩资源的 URI,该资源可用于表示地点的类别。 |
timeZone
readonly |
类型:
TimeZone optional此地点的时区。 |
transitStation
readonly |
类型:
TransitStation optional有关公交站点的信息。如果尚未从服务器加载公交数据,则为 undefined。 |
types
readonly |
类型:
Array<string> optional |
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此地点的官方网站,例如商家主页。 |
readonly |
类型:
OpeningHours optional |
readonly |
类型:
boolean optional |
方法 | |
|---|---|
fetchFields |
fetchFields(options)参数:
|
|
getNextOpeningTime([date])参数:
使用地点的 Place.regularOpeningHours 计算下一个营业时间的 Date。如果数据不足,无法计算结果,或者此地点未营业,则返回 undefined。 |
|
isOpen([date])参数:
返回值:
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 |
包含或相邻区域的排名列表。最容易识别且最精确的区域排在最前面。 |
landmarks
readonly |
附近地标的排名列表。最容易识别且距离最近的地标会排在最前面。 |
方法 | |
|---|---|
继承:
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 |
引用的 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 |
此加油站提供的每种燃油的价格列表,每种燃油类型对应一个条目。 |
方法 | |
|---|---|
继承:
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
|
GoogleMapsLinks 类
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 |
类型:
stringISO 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 |
一个日期数组,表示当前周期内的特殊日期。特殊日期会影响地点的营业时间,例如圣诞节或一次性停业。如果存在特殊营业时间,请为 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 |
类型:
numberOpeningHoursPoint.time 对应的小时数,以数字表示,范围为 [0, 23]。该值以地点所在时区为准。 |
minute
readonly |
类型:
numberOpeningHoursPoint.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> |
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
可选 |
类型:
LatLngBounds|LatLngBoundsLiteral optional要搜索的区域。此位置用作限制条件,这意味着系统不会返回给定位置以外的结果。无法与 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 等字段以及其他与营业地点相关的字段。 |
可选 |
类型:
string optional |
可选 |
类型:
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当您不使用 时,此参数为必填。文本搜索的文本查询。 |
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> |
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 optionalIANA 时区数据库时区。例如“America/New_York”。 |
version
readonly |
类型:
string optionalIANA 时区数据库版本号。例如“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 |
类型:
Array<TransitAgency>服务于此车站的公共交通公司。 |
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 |
无轨电车。如需了解详情,请参阅网络服务文档。 |