Ejemplo n.º 1
0
        public void PelayananTerdekat_click(object sender, RoutedEventArgs e)
        {
            if (!NetworkInterface.GetIsNetworkAvailable())
            {
                MessageBox.Show("No Connection");
            }
            else
            {
                //NavigationService.Navigate(new Uri("/PelayananTerdekat.xaml", UriKind.Relative));
                //menampilkan koordinat lokasi sesuai lokasi user~
                GeoCoordinateWatcher watcher; watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.Default);
                watcher.Start();
                //MessageBox.Show(watcher.Position.Location.Latitude.ToString() + " " + watcher.Position.Location.Longitude.ToString());
                //menampilkan peta~
                ExploremapsShowMapTask showMaps = new ExploremapsShowMapTask();
                showMaps.Location = new GeoCoordinate((Double)watcher.Position.Location.Latitude, (Double)watcher.Position.Location.Longitude);
                showMaps.Zoom     = 40;

                //kategori rumahsakit~
                ExploremapsSearchPlacesTask searchMap = new ExploremapsSearchPlacesTask();
                searchMap.Location   = new GeoCoordinate((Double)watcher.Position.Location.Latitude, (Double)watcher.Position.Location.Longitude);
                searchMap.SearchTerm = "Rumah Sakit";
                searchMap.Show();
                showMaps.Show();
            }
        }
Ejemplo n.º 2
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            //menampilkan koordinat lokasi sesuai lokasi user~
            GeoCoordinateWatcher watcher; watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.Default);

            watcher.Start();
            //MessageBox.Show(watcher.Position.Location.Latitude.ToString() + " " + watcher.Position.Location.Longitude.ToString());
            //menampilkan peta~
            ExploremapsShowMapTask showMaps = new ExploremapsShowMapTask();

            showMaps.Location = new GeoCoordinate((Double)watcher.Position.Location.Latitude, (Double)watcher.Position.Location.Longitude);
            showMaps.Zoom     = 40;

            //kategori rumahsakit~
            ExploremapsSearchPlacesTask searchMap = new ExploremapsSearchPlacesTask();

            searchMap.Location   = new GeoCoordinate((Double)watcher.Position.Location.Latitude, (Double)watcher.Position.Location.Longitude);
            searchMap.SearchTerm = "Bidan";
            searchMap.Show();
            showMaps.Show();
        }
Ejemplo n.º 3
0
        private void Button_gridbut_Click(object sender, RoutedEventArgs e)
        {
            if (sender == LaunchButton)
            {
                try
                {
                    ExploremapsShowMapTask showMap = new ExploremapsShowMapTask();

                    showMap.Location = new GeoCoordinate(Double.Parse(LatitudeBox.Text), Double.Parse(LongittudeBox.Text));
                    showMap.Zoom     = (int)zoomSlider.Value;
                    showMap.Show();
                }
                catch (Exception erno)
                {
                    MessageBox.Show("Error message: " + erno.Message);
                }
            }
            else if (sender == getGeoButton)
            {
                NavigationService.Navigate(new Uri("/LocationSelectorPage.xaml?target=Location", UriKind.Relative));
            }
        }