Skip to main content
All docs
V24.1

BingRouteIsochronePolygonResult Class

Stores an isochrone polygon’s calculation results received from the Bing Maps service.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.1.dll

NuGet Package: DevExpress.Win.Map

Declaration

public class BingRouteIsochronePolygonResult

Remarks

The following code plots a polygon that shows an area accessible from the specified point:

Isochrone map

using DevExpress.XtraMap;
using System;
using System.Drawing;
using System.Windows.Forms;

    private void Form1_Load(object sender, EventArgs e) {
        ImageLayer imageLayer = new ImageLayer();
        mapControl1.Layers.Add(imageLayer);
        BingMapDataProvider provider = new BingMapDataProvider();
        provider.BingKey = "Insert your Bing key.";
        provider.Kind = BingMapKind.RoadLight;
        imageLayer.DataProvider = provider;       

        InformationLayer infoLayer = new InformationLayer();
        mapControl1.Layers.Add(infoLayer);

        BingRouteIsochroneDataProvider isochroneDataProvider = new BingRouteIsochroneDataProvider();
        isochroneDataProvider.BingKey = "Insert your Bing Maps key.";
        GeoPoint origin = new GeoPoint(36.1532403246368, -86.7701703811725);
        mapControl1.CenterPoint = origin;
        isochroneDataProvider.CalculateIsochroneByDistance(new RouteWaypoint("", origin), 10);
        isochroneDataProvider.GenerateLayerItems = false;
        isochroneDataProvider.IsochroneCalculated += IsochroneCalculated;
        infoLayer.DataProvider = isochroneDataProvider;

    }

    private void IsochroneCalculated(object sender, BingRouteIsochroneCalculatedEventArgs e) {
        foreach (var polygon in e.CalculationResult.IsochroneResult.Polygons) {
            MapPolyline item = new MapPolyline();
            foreach (var points in polygon.Coordinates)
                item.Points.Add(points);
            item.StrokeWidth = 4;
            item.Stroke = Color.Red;

            VectorItemsLayer vectorLayer = new VectorItemsLayer();
            mapControl1.Layers.Add(vectorLayer);
            MapItemStorage storage = new MapItemStorage();
            vectorLayer.Data = storage;
            storage.Items.Add(item);
        }
        mapControl1.ZoomToFitLayerItems();
    }

Inheritance

Object
BingRouteIsochronePolygonResult
See Also