Exemplo n.º 1
0
 public void plotPath(string start, string end)
 {
     string [] result = mySocket.getLocations((App.Current as App).uid, start, end);
     if (!result.Equals("error"))
     {
         int       resultLength = result.Length();
         VELatLong points       = new VELatLong[resultLength];
         int       i            = 0;
         while (i < resultLength)
         {
             string[] resString = result[i].Split(new Char [] { '|' });
             int      lat       = ToInt32(resString[0]);
             int      longi     = ToInt32(resString[1]);
             points[i] = new VELatLong[lat, longi];
         }
         VEColor    color      = new VEColor(0, 0, 255, 1);
         int        width      = 5;
         string     id         = "Movement from " + start + " to " + end;
         VEPolyline actualLine = new VEPolyline(id, points, color, width);
         map.AddPolyline(actualLine);
         map.SetMapView(points);
     }
     else
     {
         //bitch and moan somehow.
     }
 }
Exemplo n.º 2
0
 public void plotPath(string start, string end)
 {
     string [] result = mySocket.getLocations((App.Current as App).uid, start, end);
     if (!result.Equals("error"))
     {
         int resultLength = result.Length();
         VELatLong points = new VELatLong[resultLength];
         int i = 0;
         while (i < resultLength)
         {
             string[] resString = result[i].Split(new Char [] {'|'});
             int lat = ToInt32(resString[0]);
             int longi = ToInt32(resString[1]);
             points[i] = new VELatLong[lat, longi];
         }
         VEColor color = new VEColor(0, 0, 255, 1);
         int width = 5;
         string id = "Movement from " + start + " to " + end;
         VEPolyline actualLine = new VEPolyline(id, points, color, width);
         map.AddPolyline(actualLine);
         map.SetMapView(points);
     }
     else
     {
         //bitch and moan somehow.
     }
 }
Exemplo n.º 3
0
        void addPushPin(PacketInfo packetInfo)
        {
            var latLong = new VELatLong(
                packetInfo.Latitude.Value,
                packetInfo.Longitude.Value);

            var pushPin = new VEPushPin(latLong);

            map.Items.Add(pushPin);
        }
Exemplo n.º 4
0
        void MapLocationVM_TrackingObject(object sender, EventArgs e)
        {
            var latLong = new VELatLong(
                _TrackerViewModel.MapLocationVM.Latitude,
                _TrackerViewModel.MapLocationVM.Longitude);

            map.Items.Add(new VEPushPin(latLong));

            Thread.Sleep(100);

            Dispatcher.Invoke((Action)(() => map.FlyTo(
                                           latLong,
                                           -90,
                                           0,
                                           _TrackerViewModel.MapLocationVM.TargetAltitude,
                                           null)));
        }
Exemplo n.º 5
0
 private void CreateMarker(VELatLong currentLocation, string pushpinstyle)
 {
     var newPin = new VEPushPin(currentLocation);
     newPin.Style = (Style)FindResource(pushpinstyle);
     newPin.Content = new Label
                          {
                              Content = new Border() { Width = 40, Height = 40, Background = new ImageBrush(new BitmapImage(new Uri(@"blueMarker.png", UriKind.Relative))) },
                              HorizontalAlignment = HorizontalAlignment.Center,
                              FontSize = 20
                          };
     //newPin.Click += VEPushPin_Click;
     newPin.PreviewMouseDown += newPin_PreviewMouseDown;
     newPin.MouseMove += newPin_MouseMove;
     //newPin.PreviewMouseUp += NewPinMouseUp;
     //newPin.PreviewMouseMove += NewPinMouseMove;
     Map.Items.Add(newPin);
 }