//user map
        public ActionResult UserMaps(string map)
        {
            Gmaps req = new Gmaps();

            if (map == "" || map == null)
            {
                req.lat    = 12.972442;
                req.longit = 77.580643;
            }
            else
            {
                Location x = con.GetCoordinates(map);

                if (x == null)
                {
                    req.lat    = 12.972442;
                    req.longit = 77.580643;
                }
                else
                {
                    req.lat    = x.Longitude;
                    req.longit = x.Latitude;
                }
            }
            return(View(req));
        }
Esempio n. 2
0
 //get lat long ant time and display it on map
 public void myRoute(double lat, double lng, DateTime time, string url)
 {
     //invoke the main window thread
     Dispatcher.Invoke(() =>
     {
         dynamic doc = Gmaps.Document;
         Gmaps.InvokeScript("drawRoute", new Object[] { lat, lng, time.ToString(), url });
     });
 }
Esempio n. 3
0
        public MainWindow()
        {
            InitializeComponent();
            ResizeMode = ResizeMode.NoResize;//disable sizing options
            DroneManager.SetMainWindow(this);

            //gives promition to HTML/pilot
            string curdir = Directory.GetCurrentDirectory();

            Gmaps.Navigate(String.Format("file:///{0}/HTML/pilot.html", curdir));


            refreshCom();
        }
Esempio n. 4
0
        private async void DibujarMapa_OnClicked(object sender, EventArgs args)
        {
            var positionsUno = (await(new Geocoder()).GetPositionsForAddressAsync(txtOrigen.Text)).ToList();

            if (!positionsUno.Any())
            {
                lblError.Text      = "Origen no existe";
                lblError.IsVisible = true;
            }

            var positionsDos = (await(new Geocoder()).GetPositionsForAddressAsync(txtDestino.Text)).ToList();

            if (!positionsDos.Any())
            {
                lblError.Text      = "Destino no existe";
                lblError.IsVisible = true;
            }

            var pos1 = new Xamarin.Forms.Labs.Services.Geolocation.Position()
            {
                Latitude  = positionsUno.First().Latitude,
                Longitude = positionsUno.First().Longitude
            };

            var pos2 = new Xamarin.Forms.Labs.Services.Geolocation.Position()
            {
                Latitude  = positionsDos.First().Latitude,
                Longitude = positionsDos.First().Longitude
            };

            Gmaps.MoveToRegion(MapSpan.FromCenterAndRadius(positionsUno.First(), Distance.FromMiles(0.1)));

            Gmaps.EPins.Add(new PinExtend
            {
                Name     = "Origen",
                Location = positionsUno.First(),
                Details  = txtOrigen.Text
            });

            Gmaps.EPins.Add(new PinExtend
            {
                Name     = "Destino",
                Location = positionsDos.First(),
                Details  = txtDestino.Text
            });

            await Gmaps.CreateRoute(positionsUno.First(), positionsDos.First());
        }
Esempio n. 5
0
 private void toPalletizePage_Click(object sender, RoutedEventArgs e)
 {
     Gmaps.Dispose();
     SDesignDesktop.Main.GetWindow(this).Content = new PalletizePage();
 }
Esempio n. 6
0
 private void Logout_Click(object sender, RoutedEventArgs e)
 {
     Gmaps.Dispose();
     SDesignDesktop.Main.GetWindow(this).Content = new LoginPage();
 }
Esempio n. 7
0
 private void Logout_Click(object sender, RoutedEventArgs e)
 {
     View.Content = new LoginPage();
     Gmaps.Dispose();
 }