Esempio n. 1
0
 public void HideComponents()
 {
     CbDestiny.Hide();
     LblDestiny.Hide();
     BtnGo.Hide();
     BtnBack.Hide();
     CbOrigin_Enable();
     CbDestiny_Enable();
 }
Esempio n. 2
0
        private void BtnGo_Click(object sender, EventArgs e)
        {
            BtnGo.Hide();

            List <PointLatLng> Puntos = new List <PointLatLng>();
            Node Nodesource           = null;
            Node NodeDestination      = null;

            foreach (var item in nodes)
            {
                if (item.getName() == CbOrigin.Text)
                {
                    Nodesource = item;
                }
                if (item.getName() == CbDestiny.Text)
                {
                    NodeDestination = item;
                }
            }

            var showMst = true;

            var listShort = manager.shortest_path(NodeDestination, Nodesource);

            for (var i = 0; i < listShort.Count; i++)
            {
                GDirections direction;
                PointLatLng final;

                var inicial = new PointLatLng(listShort[i].getLatInitial(), listShort[i].getLngInitial());
                try
                {
                    final = new PointLatLng(listShort[i + 1].getLatInitial(), listShort[i + 1].getLngInitial());
                }
                catch (Exception ex)
                {
                    final = new PointLatLng(NodeDestination.getLatInitial(), NodeDestination.getLngInitial());
                }

                var       rutasDireccion = GMapProviders.GoogleMap.GetDirections(out direction, inicial, final, false, false, false, false, false);
                GMapRoute rutaObtenida   = new GMapRoute(direction.Route, "Ruta ubicacion");
                capaRutas.Routes.Add(rutaObtenida);
                gMap.Overlays.Add(capaRutas);
            }

            MessageBox.Show(string.Format("Distancia entre {0} => {1} es {2} KM", Nodesource.getName(), NodeDestination.getName(), getDistance(Nodesource, NodeDestination)));
            gMap.Zoom = gMap.Zoom + 1;
            gMap.Zoom = gMap.Zoom - 1;
        }
Esempio n. 3
0
 private void CbDestiny_SelectedIndexChanged(object sender, EventArgs e)
 {
     BtnGo.Show();
     CbDestiny_disable();
 }