你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
MapsSearchClient.SearchPointOfInterestAlongRouteAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
“沿路由搜索”终结点允许对指定路由上的 POI 执行模糊搜索。 此搜索通过指定 maxDetourTime
限制度量值进行约束。<br><br>若要发送路由点,将使用 POST
请求,其中请求正文将包含 route
表示为 GeoJSON LineString
类型的对象, Content-Type
并且标头将设置为 application/json
。 中的每个 route
路由点表示为一种 GeoJSON Position
类型,即一个数组,其中 经度 值后跟 纬度 值, 并忽略海拔 值。 route
应至少包含 2 个路由点。<br><>原始路线可能会被更改,其中一些点可能会被跳过。 如果通过找到点的路由比原始路由快,则 detourTime
响应中的值为负。
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Maps.Search.Models.SearchAddressResult>> SearchPointOfInterestAlongRouteAsync (string query, int maxDetourTime, Azure.Core.GeoJson.GeoLineString route, Azure.Maps.Search.SearchAlongRouteOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SearchPointOfInterestAlongRouteAsync : string * int * Azure.Core.GeoJson.GeoLineString * Azure.Maps.Search.SearchAlongRouteOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Maps.Search.Models.SearchAddressResult>>
override this.SearchPointOfInterestAlongRouteAsync : string * int * Azure.Core.GeoJson.GeoLineString * Azure.Maps.Search.SearchAlongRouteOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Maps.Search.Models.SearchAddressResult>>
Public Overridable Function SearchPointOfInterestAlongRouteAsync (query As String, maxDetourTime As Integer, route As GeoLineString, Optional options As SearchAlongRouteOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of SearchAddressResult))
参数
- query
- String
要搜索的 POI 名称 (,例如“自由女神像”、“星巴克”) ,必须正确编码 URL。
- maxDetourTime
- Int32
兴趣点的最大绕行时间(以秒为单位)。 最大值为 3600 秒。
- route
- GeoLineString
这表示要沿此搜索的路由,应为有效 GeoJSON LineString
类型。 有关详细信息,请参阅 RFC 7946 。
- options
- SearchAlongRouteOptions
其他选项
- cancellationToken
- CancellationToken
要使用的取消标记。
返回
注解
沿路线搜索兴趣点