Exemplo n.º 1
0
        private async void MapControl1_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
        {
            //Geopoint pos = args.Location;
            //Point pos1 = args.Position;
            // MessageDialog   messageDialog = new MessageDialog(pos.Position.Longitude.ToString()+"  "+ pos.Position.Latitude.ToString());
            //   await messageDialog.ShowAsync();

            Ellipse myEllipse = new Ellipse()
            {
                Height          = 20,
                Width           = 20,
                Stroke          = new SolidColorBrush(Windows.UI.Colors.Blue),
                StrokeThickness = 2,
            };


            // Add XAML to the map.
            MapControl1.Children.Add(myEllipse);
            BasicGeoposition cityPosition = new BasicGeoposition()
            {
                Latitude = 55.6509863734914, Longitude = 37.6680877307923, Altitude = 10
            };

            SeattleLocation1 = new Geopoint(cityPosition);
            Geopoint cityCenter = new Geopoint(cityPosition);

            MapControl.SetLocation(myEllipse, cityCenter);
            MapControl.SetNormalizedAnchorPoint(myEllipse, new Point(0.5, 1));
            // AddLandmarkPhoto();
        }
Exemplo n.º 2
0
        private void MyMap_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
        {
            var    tappedGeoPosition = args.Location.Position;
            string status            = "MapTapped at \nLatitude:" + tappedGeoPosition.Latitude + "\nLongitude: " + tappedGeoPosition.Longitude;

            rootPage.NotifyUser(status, NotifyType.StatusMessage);
        }
 private async void MapControl_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
 {
     var    tappedGeopositoin = args.Location.Position;
     string status            = $"faisal.ishak92 - checked in at \nLatitude : {tappedGeopositoin.Latitude}" + $"\nLongitude: { tappedGeopositoin.Longitude} ";
     var    messageDialog     = new MessageDialog(status);
     await messageDialog.ShowAsync();
 }
Exemplo n.º 4
0
 private void MapControl_CenterChanged(Windows.UI.Xaml.Controls.Maps.MapControl sender, object args)
 {
     if (mapControl.LoadingStatus == MapLoadingStatus.Loaded)
     {
         getStopsInfo();
     }
 }
        private void mapaPodaci_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
        {
            brojac++;
            if (brojac > 2)
            {
                brojac = 1;
                mapaPodaci.Routes.Remove(viewOfRouteGlobal);
                mapaPodaci.MapElements.Remove(ikonica1);
                mapaPodaci.MapElements.Remove(ikonica2);
            }
            var tappedGeoPosition = args.Location.Position;

            MapIcon ikonica = new MapIcon();

            ikonica.Location = args.Location;
            mapaPodaci.MapElements.Add(ikonica);
            if (brojac == 1)
            {
                pocetna  = tappedGeoPosition;
                ikonica1 = ikonica;
            }
            else if (brojac == 2)
            {
                ikonica2 = ikonica;
                ShowRouteOnMap(pocetna, tappedGeoPosition);
                double privremeni = Math.Round(GetDistanceBetweenPoints(pocetna.Latitude, pocetna.Longitude, tappedGeoPosition.Latitude, tappedGeoPosition.Longitude), 2);
                textBlockDuzinaRute.Text = privremeni.ToString() + " m";
                textBlockCijenaP.Text    = "Cijena: " + Math.Round(cijenaRacunanje(privremeni), 2) + " KM";
            }
        }
Exemplo n.º 6
0
 private void MainMap_CenterChanged(Windows.UI.Xaml.Controls.Maps.MapControl sender, object args)
 {
     if (!User_CenterChanged.HasValue)
     {
         User_CenterChanged = true;
         SetProperCenter();
     }
 }
        private void MapControl_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
        {
            localAtual = args.Location.Position;
            var posicao           = args.Location.Position;
            var tappedGeoPosition = args.Location.Position;

            latitude  = tappedGeoPosition.Latitude;
            longitude = tappedGeoPosition.Longitude;

            localSelecionado  = "Local Selecionado! \nLatitude:" + tappedGeoPosition.Latitude + "\nLongitude: " + tappedGeoPosition.Longitude;
            LocalClicado.Text = localSelecionado;
        }
Exemplo n.º 8
0
 private void MainMap_ZoomLevelChanged(Windows.UI.Xaml.Controls.Maps.MapControl sender, object args)
 {
     if (!User_ZoomLevelChanged.HasValue)
     {
         User_ZoomLevelChanged = true;
         SetProperZoomLevel();
         if (RecalculateCenterOffset())
         {
             User_CenterChanged = true;
             SetProperCenter();
         }
     }
 }
Exemplo n.º 9
0
        private async void MapControl_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
        {
            Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            var icons             = Convert.ToInt32(localSettings.Values["icons"]);
            var tappedGeoPosition = args.Location.Position;

            if ((icons > 1) && (_first != 0))
            {
                MapControl.MapElements.Clear();
                MapControl.Routes.Clear();
                icons = 0;
            }
            else
            {
                MapIcon icon = new MapIcon();
                icon.Location = new Geopoint(tappedGeoPosition);
                //icon.ZIndex = 0;
                MapControl.MapElements.Add(icon);
                icons++;
                _first++;
                if (icons == 1)
                {
                    _startLocation = icon.Location;
                }
                else
                {
                    _endLocation = icon.Location;
                    MapRouteFinderResult routeResult = await MapRouteFinder.GetDrivingRouteAsync(
                        _startLocation,
                        _endLocation,
                        MapRouteOptimization.Time,
                        MapRouteRestrictions.None
                        );

                    if (routeResult.Status == MapRouteFinderStatus.Success)
                    {
                        MapRouteView viewOfRoute = new MapRouteView(routeResult.Route)
                        {
                            RouteColor   = Colors.Yellow,
                            OutlineColor = Colors.Black
                        };
                        MapControl.Routes.Add(viewOfRoute);
                        await MapControl.TrySetViewBoundsAsync(
                            routeResult.Route.BoundingBox,
                            null,
                            Windows.UI.Xaml.Controls.Maps.MapAnimationKind.None);
                    }
                }
            }
            localSettings.Values["icons"] = icons;
        }
Exemplo n.º 10
0
        private async void CTRL_Map_Main_MapElementClick(Windows.UI.Xaml.Controls.Maps.MapControl sender, MapElementClickEventArgs args)
        {
            if (args.MapElements.Count < 1 || args.MapElements[0] == null)
            {
                return;
            }

            await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High,
                                                                                                        () =>
            {
                MapIcon selectedMapIcon = args.MapElements.FirstOrDefault(x => x is MapIcon) as MapIcon;

                if (selectedMapIcon is null)
                {
                    var clickedProjectName = args.MapElements[0].Tag.ToString();
                    var position           = args.Location.Position;

                    var minLengthSufix = Math.Min(clickedProjectName.Length, 3);
                    var length         = 16;
                    var datetime       = DateTime.Now.Ticks.ToString(CultureInfo.InvariantCulture);
                    var projectName    = clickedProjectName.Substring(0, minLengthSufix).ToUpper(CultureInfo.InvariantCulture);
                    var deviceID       = projectName + datetime.Substring(datetime.Length - length, length);


                    AddPushpin(deviceID, position);

                    CTRL_NewDevices.AddDevice(deviceID, deviceID, position);
                }
                else
                {
                    string tag = selectedMapIcon.Tag.ToString();

                    if (tag.Equals("NEW"))
                    {
                        return;
                    }

                    selectedMapIcon.Image = RandomAccessStreamReference.CreateFromUri(new Uri(resourceLoader.GetString("Map_Pushpin_Red")));

                    CTRL_Telemetry.AddDevice(selectedMapIcon.Title, selectedMapIcon.Title, selectedMapIcon.Location.Position);
                }
            });
        }
Exemplo n.º 11
0
        private async void map_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
        {
            Geopoint pointToReverseGeocode = new Geopoint(args.Location.Position);

            // Reverse geocode the specified geographic location.
            MapLocationFinderResult result =
                await MapLocationFinder.FindLocationsAtAsync(pointToReverseGeocode);

            var resultText = new StringBuilder();

            if (result.Status == MapLocationFinderStatus.Success)
            {
                resultText.AppendLine(
                    result.Locations[0].Address.StreetNumber + ", " +
                    result.Locations[0].Address.Street + ", " +
                    result.Locations[0].Address.District + ", " +
                    result.Locations[0].Address.PostCode);
            }
            tbxAddress.Text = resultText.ToString();
            altitude        = args.Location.Position.Altitude;
            latitude        = args.Location.Position.Latitude;
        }
Exemplo n.º 12
0
        public void MapControl_MapElementClick(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapElementClickEventArgs args)
        {
            var    tappedGeoPosition = args.Location.Position;
            string status            = "MapTapped at \nLatitude:" + tappedGeoPosition.Latitude + "\nLongitude: " + tappedGeoPosition.Longitude;

            Debug.WriteLine(status);

            var area = App.core.areaList.GetAreaTaped(tappedGeoPosition);

            if (area != null)
            {
                Debug.WriteLine(area.Name);
                mapView.PopupMain.Child            = new AreaInfoView(area);
                mapView.PopupMain.HorizontalOffset = Window.Current.Bounds.Width / 2 - 200;
                mapView.PopupMain.VerticalOffset   = (Window.Current.Bounds.Height / 2 - 200) - 150;

                mapView.PopupMain.IsOpen = true;
            }
            else
            {
                Debug.WriteLine("NONE");
            }
        }
Exemplo n.º 13
0
        private void map_holding(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
        {
            Debug.WriteLine("map_holding");

            Geopoint chosenDestinationLocation;

            //Muis locatie ophalen
            sender.GetLocationFromOffset(args.Position, out chosenDestinationLocation);
            Debug.WriteLine("Geklikt op positie: " + chosenDestinationLocation.Position.Latitude + ", " + chosenDestinationLocation.Position.Longitude);

            //Tijdelijke locatie aanmaken
            BasicGeoposition tempbasic = new BasicGeoposition();

            //Parsen
            tempbasic.Latitude  = chosenDestinationLocation.Position.Latitude;
            tempbasic.Longitude = chosenDestinationLocation.Position.Longitude;

            //Tijdelijke locatie aanmaken, om de gekozen locatie om te zetten.
            Geopoint temppoint = new Geopoint(tempbasic);

            //Muis locatie porten op kaart
            MapIcon mapIconDestinationLocation = new MapIcon();

            mapIconDestinationLocation.Location = temppoint;
            mapIconDestinationLocation.Image    = mapIconStreamReference;
            mapIconDestinationLocation.Title    = "Bestemming";
            mapIconDestinationLocation.NormalizedAnchorPoint = new Point(0.5, 1.0); //Verzet het icoontje, zodat de punt van de marker staat op waar de locatie is. (anders zou de linkerbovenhoek op de locatie staan)
            MapNieuweBestemming.MapElements.Add(mapIconDestinationLocation);        //Marker op de map plaatsen

            //Bestemming in string opslaan
            string locatie = "{latitude:" + tempbasic.Latitude + ",longitude:" + tempbasic.Longitude + "}";

            //string doorsturen
            //BestemmingenVM.setDestinationLocation(locatie);
            txtBlockNewDestinationLocation.Text = locatie;
        }
Exemplo n.º 14
0
 void Map_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
 {
     ViewModel.Location = Tuple.Create <double, double>(args.Location.Position.Latitude, args.Location.Position.Longitude);
 }
Exemplo n.º 15
0
 private void map_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, MapInputEventArgs args)
 {
     coord.Text    = "Изменено на " + args.Location.Position.Latitude + " " + args.Location.Position.Longitude;
     geo.Latitude  = args.Location.Position.Latitude;
     geo.Longitude = args.Location.Position.Longitude;
 }
Exemplo n.º 16
0
 private void MainMap_CenterChanged(Windows.UI.Xaml.Controls.Maps.MapControl sender, object args)
 {
 }
Exemplo n.º 17
0
 private void MainMap_ZoomLevelChanged(Windows.UI.Xaml.Controls.Maps.MapControl sender, object args)
 {
 }
Exemplo n.º 18
0
 private void MainMap_MapElementClick(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapElementClickEventArgs args)
 {
 }
Exemplo n.º 19
0
 private void BranchesMap_ZoomLevelChanged(Windows.UI.Xaml.Controls.Maps.MapControl sender, object args)
 {
     System.Diagnostics.Debug.WriteLine($"ZoomLevel: {branchesMap.ZoomLevel}");
 }
Exemplo n.º 20
0
 private void MapMain_MapHolding(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
 {
 }
Exemplo n.º 21
0
 private void myMap_MapTapped(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
 {
 }
Exemplo n.º 22
0
 void MapCtrl_MapHolding(Windows.UI.Xaml.Controls.Maps.MapControl sender, Windows.UI.Xaml.Controls.Maps.MapInputEventArgs args)
 {
     AddEvent(args.Location);
 }