Azure Maps(预览版)

Azure Maps提供地理空间 API,用于映射、路由、地理编码和反向地理编码。

此连接器在以下产品和区域中可用:

服务 Class 区域
Copilot Studio 标准 除以下各项外的所有 Power Automate 区域:
     - 由世纪互联运营的中国云
逻辑应用程序 标准 除以下各项外的所有 逻辑应用区域 :
     - Azure中国区域
     - 美国国防部(DoD)
Power Apps 标准 除以下各项外的所有 Power Apps 区域:
     - 由世纪互联运营的中国云
Power Automate 标准 除以下各项外的所有 Power Automate 区域:
     - 由世纪互联运营的中国云
联系人​​
名称 Microsoft
URL https://www.microsoft.com/
连接器元数据
Publisher Microsoft
网站 https://azure.microsoft.com/products/azure-maps
隐私策略 https://privacy.microsoft.com/privacystatement
类别 数据;生产力

Azure Maps 连接器

类型: 无代码 | 层: 标准 | 地位: 预览

通过 Azure Maps REST API 提供映射、路由、地理编码和反向地理编码功能。 请求完全由 APIM 策略处理 - 没有连接器 Webapp。

Authentication

API 密钥身份验证。 连接需要Azure Maps订阅密钥。

参数 类型 必选 Description
subscription_key 安全字符串 是的 Azure Maps 订阅密钥

密钥从连接令牌中提取,并作为策略 (CheckForToken / GetAuthHeaderValue) 的查询参数传递给 Azure Maps。subscription-key

云可用性

云 可用的
公众 是的
费尔法克斯 (GCC) 是的
GCC High 是的
DoD 是的

行动

获取路由 - GetRoute

计算两个路点之间的驾驶或步行路线。 路点必须是坐标对(latitude,longitude)。 不支持地址 - 首先使用 按地址获取位置对地址进行地理编码。

终结点(策略后):POST https://atlas.microsoft.com/route/directions?api-version=2025-01-01

该策略将 GET 样式的查询参数转换为 GeoJSON FeatureCollection POST 正文,将坐标翻转为longitude,latitude顺序,并将避免/优化值映射到Azure Maps等效项。

参数 必选 类型 Description
Waypoint 1 (wp.0) 是的 字符串 起始点( latitude,longitude 例如 47.610,-122.107)
Waypoint 2 (wp.1) 是的 字符串 结束点( latitude,longitude 例如 47.612,-122.204)
旅行模式 (travelMode) 否 字符串 driving (默认值) 或 walking
避免高速公路 否 boolean 映射到 avoid=limitedAccessHighways
避免收费 否 boolean 映射到 avoid=tollRoads
避免渡轮 否 boolean 映射到 avoid=ferries
避免越境 否 boolean 映射到 avoid=borderCrossings
Optimize 否 字符串 fastestWithoutTraffic、fastestWithTraffic 或 shortest

响应: 路线摘要(米)、工期(秒)、交通持续时间(秒)和路线段详细信息。

注意: 不支持传输路由。 Azure Maps路线方向仅支持driving和 walking。


按地址获取位置 - GetLocationByAddress

对结构化地址进行地理编码,以坐标和位置详细信息。

终结点:GET https://atlas.microsoft.com/geocode?api-version=2023-06-01

参数 必选 类型 Description
地址行 (addressLine) 否 字符串 街道线(例如 15595 NE 36th St)
区域(locality) 否 字符串 城市(例如 Redmond)
管理区 (adminDistrict) 否 字符串 州缩写(例如 WA)
邮政编码 (postalCode) 否 字符串 邮政编码(例如 98052)
国家/地区(countryRegion) 否 字符串 ISO 2 字母国家/地区代码(例如 US)
最大结果 (top) 否 整数 1–20,默认值 5

响应: GeoJSON FeatureCollection. 每个功能都有:

  • geometry.coordinates — [longitude, latitude]
  • properties.confidence— High、 或 MediumLow
  • properties.address— addressLine、 、 locality、 postalCodeadminDistricts、 countryRegion (对象和 nameISO)formattedAddress

注意:Azure Maps地理编码不支持中国的地址。


按点获取位置 - GetLocationByPoint

反向地理编码纬度/经度坐标到地址。

终结点(策略后):GET https://atlas.microsoft.com/reverseGeocode?api-version=2023-06-01&coordinates={longitude},{latitude}

该策略按顺序将单独的 latitude 参数和 longitude 参数合并到 coordinates 查询参数 longitude,latitude 中。

参数 必选 类型 Description
点纬度 (latitude) 是的 double 例如,47.64054
点经度 (longitude) 是的 double 例如,-122.12934

响应: 与 按地址获取位置 相同的架构(GetLocationByAddress_Response)。


获取静态地图 - GetMap

获取以点为中心的静态地图图像。

终结点(策略后):GET https://atlas.microsoft.com/map/static?api-version=2024-04-01

该策略将纬度/经度合并到center参数(longitude,latitude)、映射到imagerySetAzure Mapsstyle值,并将可选的图钉作为pins参数传递。

参数 必选 类型 Description
中心纬度 (latitude) 是的 double 例如,47.64054
中心经度 (longitude) 是的 double 例如,-122.12934
地图样式 (imagerySet) 是的 字符串 请参阅下面的样式映射
缩放级别 (zoomLevel) 是的 字符串 0–20,默认值 10
宽度(像素) 否 整数 默认值 512
高度(像素) 否 整数 默认值 512
图像格式 否 字符串 jpeg 或 png (默认值 png)。 不支持 GIF。
图钉纬度 否 double 图钉位置纬度
图钉经度 否 double 图钉位置经度
图钉标签 否 字符串 短标签文本

图像集映射:

imagerySet 输入 Azure Maps style
Road main
Aerial satellite
AerialWithLabels satellite_road_labels
CanvasDark dark
CanvasLight road_shaded_relief
CanvasGray grayscale_light

响应: 二进制图像(image/jpeg 或 image/png)。 在Power Automate流中,响应正文是 base64 编码的。 若要显示或保存图像,请执行以下操作:

  • 在保存到OneDrive/SharePoint之前,base64ToBinary()请使用表达式进行转换。
  • 使用 HTML 表或包含<img src="data:image/png;base64,{body/$content}">标记的电子邮件操作来内联呈现。

策略说明

  • subscription-key 由策略注入;它永远不会从调用方传递。
  • origin入站x-ms-apim-tokens时会剥离标头。
  • Content-Type: application/json 对所有非映像请求强制使用;图像响应在出站时还原正确的 image/* 内容类型。
  • GetRoute 将简单的查询参数请求转换为具有 GeoJSON 正文的 POST — 调用方不需要自行构造正文。

文件存储

File Purpose
apiDefinition.swagger.json OpenAPI 定义
部署/policies.xml APIM 策略
部署/PolicySourceCode.cs 策略 C# 逻辑
connector-config-internal.json 身份验证和环境配置
connector-config-cli.json 功能(actions)
connector-config-certification.json API 名称(azuremaps)和层(标准)
connector-config-metadata.json 所有权元数据

正在创建连接

连接器支持以下身份验证类型:

默认 用于创建连接的参数。 所有区域 可共享

违约

适用:所有区域

用于创建连接的参数。

这是可共享的连接。 如果 Power App 与其他用户共享,则连接也会共享。 有关详细信息,请参阅 画布应用的连接器概述 - Power Apps |Microsoft Docs

名称 类型 Description 必选
订阅密钥 安全字符串 Azure Maps 订阅密钥 True

操作

按地址获取位置(预览版)

对地址进行地理编码以获取其坐标和位置详细信息。

按点获取位置(预览版)

获取与纬度和经度坐标关联的位置信息。

获取路由(预览版)

使用路点计算驾驶或步行路线。 必须以纬度、经度坐标的形式提供路点。

获取静态地图(预览版)

获取以点为中心的静态地图图像。 不支持 GIF;使用 JPEG 或 PNG。

按地址获取位置(预览版)

对地址进行地理编码以获取其坐标和位置详细信息。

参数

名称 密钥 必需 类型 说明
地址行
addressLine string

地址的街道线(不包括城市、州等)。

地方(城市)
locality string

当地,如美国城市。

管理区(州)
adminDistrict string

一个细分,如美国州缩写(例如 WA)。

邮政编码
postalCode string

邮政编码。

国家/地区
countryRegion string

ISO 2 字母国家/地区代码(例如美国)。

最大结果
top integer

要返回的最大结果数(1-20)。 默认值:5。

返回

按点获取位置(预览版)

获取与纬度和经度坐标关联的位置信息。

参数

名称 密钥 必需 类型 说明
点纬度
latitude True double

要反向地理编码的纬度坐标。 示例:47.64054

点经度
longitude True double

要反向地理编码的经度坐标。 示例:-122.12934

返回

获取路由(预览版)

使用路点计算驾驶或步行路线。 必须以纬度、经度坐标的形式提供路点。

参数

名称 密钥 必需 类型 说明
Waypoint 1
wp.0 True string

作为纬度、经度(例如 47.610,-122.107)开始。

Waypoint 2
wp.1 True string

结束路点作为纬度,经度(例如 47.612,-122.204)。

出行模式
travelMode string

路线的旅行模式。

避免高速公路
avoid_highways boolean

避免在路线中使用高速公路。

避免收费
avoid_tolls boolean

避免在路线中使用收费公路。

避免渡轮
avoid_ferry boolean

避免在路线中使用渡轮。

避免越境
avoid_borderCrossing boolean

避免在路线中越过国家/地区边界。

Optimize
optimize string

指定要为其优化路由的内容。

返回

获取静态地图(预览版)

获取以点为中心的静态地图图像。 不支持 GIF;使用 JPEG 或 PNG。

参数

名称 密钥 必需 类型 说明
中心纬度
latitude True double

地图中心的纬度。 示例:47.64054

中心经度
longitude True double

地图中心的经度。 示例:-122.12934

地图样式
imagerySet True string

要显示的地图样式。

缩放级别
zoomLevel True string

缩放级别介于 0 和 20 之间。 默认值:10

宽度(像素)
width integer

输出图像的宽度(以像素为单位)。 默认值:512

高度(像素)
height integer

输出图像的高度(以像素为单位)。 默认值:512

图像格式
format string

图像格式。 默认值:png

图钉纬度
pushpinLatitude double

图钉纬度。

图钉经度
pushpinLongitude double

图钉经度。

图钉标签
pushpinLabel string

图钉标签(最多 3 个字符)。

返回

定义

GetRoute_Response

名称 路径 类型 说明
类型
type string

GeoJSON 类型(始终为 FeatureCollection)。

Features
features array of object

GeoJSON 功能的数组:Waypoint(开始/结束)、ManeuverPoint(逐轮次步骤)和 RoutePath(路线摘要)。

功能类型
features.type string
Geometry
features.geometry object
功能类型
features.properties.type string

功能类型:Waypoint(起点/终点)、ManeuverPoint(逐轮次步骤)或 RoutePath(总体路由摘要)。

距离(米)
features.properties.distanceInMeters float

总路线距离(以米为单位)。 在 RoutePath 功能上显示。

持续时间 (秒)
features.properties.durationInSeconds integer

估计的行程时间(以秒为单位)(没有交通)。 在 RoutePath 功能上显示。

流量延迟(秒)
features.properties.trafficDelayInSeconds integer

由于流量,额外的时间(以秒为单位)。 在 RoutePath 功能上显示。

交通拥堵
features.properties.trafficCongestion string

交通拥堵级别(例如低、中、高)。 在 RoutePath 功能上显示。

使用的流量数据
features.properties.trafficDataUsed string

使用的流量数据类型(例如 None、Flow)。 在 RoutePath 功能上显示。

出发地点
features.properties.departureAt string

估计出发时间(ISO 8601)。 在 RoutePath 功能上显示。

到达时间
features.properties.arrivalAt string

估计到达时间(ISO 8601)。 在 RoutePath 功能上显示。

指令文本
features.properties.instruction.text string

可读指令文本(例如“左转到 NE 8th St”)。

操纵类型
features.properties.instruction.maneuverType string

操纵类型代码(例如 TurnLeft、TurnRight、Straight、ArriveFinish)。

Waypoint 索引
features.properties.order.inputIndex integer

相应输入路点的索引(0 = start,1 = end)。

腿索引
features.properties.order.legIndex integer

此功能所属的路线段的索引。

GetLocationByAddress_Response

名称 路径 类型 说明
类型
type string

GeoJSON 类型(始终为 FeatureCollection)。

Features
features array of object

地理编码位置功能的数组。

功能类型
features.type string
几何图形类型
features.geometry.type string
坐标
features.geometry.coordinates array of double

坐标为 [经度, 纬度]。

功能类型
features.properties.type string

功能类型:地址或 PopulatedPlace。

置信度
features.properties.confidence string

比赛的置信度(高、中、低)。

匹配代码
features.properties.matchCodes array of string

匹配代码(良好、不明确、UpHierarchy)。

地址行
features.properties.address.addressLine string

街道地址行。

地方(城市)
features.properties.address.locality string

城市或区域。

管理区域
features.properties.address.adminDistricts array of object

行政区(如州、县)的数组。

短名称
features.properties.address.adminDistricts.shortName string
名称
features.properties.address.adminDistricts.name string
邮政编码
features.properties.address.postalCode string

邮政编码。

国家/地区
features.properties.address.countryRegion string

国家或地区名称。

带格式的地址
features.properties.address.formattedAddress string

完整的格式化地址字符串。

GetMap_Response

地图图像
binary