我正在尝试在 MapPolyLine 周围创建一个缓冲区,以确定 mapPolyLine 内是否有任何东西。下面是 MapPolyLine 的代码:
private void routeService_CalculateRouteCompleted(object sender, CalculateRouteCompletedEventArgs e)
{
// If the route calculate was a success and contains a route, then draw the route on the map.
if ((e.Result.ResponseSummary.StatusCode == BingMapRouteService.ResponseStatusCode.Success) & (e.Result.Result.Legs.Count != 0))
{
// Set properties of the route line you want to draw.
System.Windows.Media.Color routeColor = Colors.Blue;
SolidColorBrush routeBrush = new SolidColorBrush(routeColor);
//MapPolyline routeLine = new MapPolyline();
App.routeLine.Locations = new LocationCollection();
App.routeLine.Stroke = routeBrush;
App.routeLine.Opacity = 0.65;
App.routeLine.StrokeThickness = 5.0;
// Retrieve the route points that define the shape of the route.
foreach (Location p in e.Result.Result.RoutePath.Points)
{
App.routeLine.Locations.Add(new GeoCoordinate(p.Latitude, p.Longitude));
}
如何获取 MapPolyLine 缓冲区的坐标(仅使用 Bing Map API 而不使用 ARCGIS 扩展)?