如何从用户选定的位置提取地理坐标?
据我所知,BotBuilder-Location只允许提取诸如place.streetAddress、place.locality、place.region、place.postalCode、place.country等信息。但我对接收地理坐标感兴趣。
发布于 2017-09-07 03:15:08
Place类有一个GetGeoCoordinates函数,您可以使用它来获取它的坐标。下面是源代码:https://github.com/Microsoft/BotBuilder-Location/blob/c4bdfa32c7190e92fc38ec02c6887edcace2dcf5/CSharp/BotBuilderLocation/Extensions.cs
下面是一个示例(参见最后一个函数方法),它从这个位置获取地址,使用GetGeoCoordinates函数从这个位置获取坐标。https://github.com/Microsoft/BotBuilder-Location/blob/master/CSharp/BotBuilderLocation.Sample/Controllers/MessagesController.cs
https://stackoverflow.com/questions/46081003
复制相似问题