Exemplo n.º 1
0
        protected void UploadRoutes()
        {
            DataMarkers dataroute = new DataMarkers();

            routes = new GMapOverlay("routes");

            for (int i = 0; i < (int)Math.Sqrt(dataMarkers.arcs.Length); i++)
            {
                for (int j = 0; j < (int)Math.Sqrt(dataMarkers.arcs.Length); j++)
                {
                    if (dataroute.arcs[i, j] == 1)
                    {
                        List <PointLatLng> points = new List <PointLatLng>();
                        points.Add(new PointLatLng(dataMarkers.places[i].latitude, dataMarkers.places[i].longitud)); //Source
                        points.Add(new PointLatLng(dataMarkers.places[j].latitude, dataMarkers.places[j].longitud)); //End
                        GMapRoute route = new GMapRoute(points, "Path");
                        route.Stroke = new Pen(Color.Blue, 3);
                        routes.Routes.Add(route);
                        dataMarkers.arcs[i, j] = route.Distance;
                        ShowDistances();
                    }
                }
            }
            this.auxMatrix = dataMarkers.arcs;
            gmap.Overlays.Add(routes);
        }
Exemplo n.º 2
0
 public MapGrafo()
 {
     InitializeComponent();
     dataMarkers         = new DataMarkers();
     gmap.MapProvider    = BingMapProvider.Instance;
     GMaps.Instance.Mode = AccessMode.ServerAndCache;
     gmap.Position       = new PointLatLng(9.921031, -84.036371);
     gmap.ShowCenter     = false;
     gmap.OnMarkerClick += Gmap_OnMarkerClick;
 }