Example #1
0
        private void RouteProvider_RoutingCompleted(object sender, RoutingCompletedEventArgs e)
        {
            this.findRouteButton.IsEnabled = true;

            RouteResponse routeResponse = e.Response as RouteResponse;

            if (routeResponse != null &&
                routeResponse.Error == null)
            {
                if (routeResponse.Result != null &&
                    routeResponse.Result.RoutePath != null)
                {
                    PolylineData routeLine = new PolylineData()
                    {
                        Points    = routeResponse.Result.RoutePath.Points,
                        ShapeFill = new MapShapeFill()
                        {
                            Stroke          = new SolidColorBrush(Colors.Red),
                            StrokeThickness = 2
                        }
                    };

                    this.routeLayer.Items.Add(routeLine);
                }
            }
        }
Example #2
0
        private void RouteProvider_RoutingCompleted(object sender, RoutingCompletedEventArgs e)
        {
            this.findRouteButton.IsEnabled = true;

            RouteResponse routeResponse = e.Response as RouteResponse;
            if (routeResponse != null
                && routeResponse.Error == null)
            {
                if (routeResponse.Result != null
                    && routeResponse.Result.RoutePath != null)
                {
                    PolylineData routeLine = new PolylineData()
                    {
                        Points = routeResponse.Result.RoutePath.Points,
                        ShapeFill = new MapShapeFill()
                        {
                            Stroke = new SolidColorBrush(Colors.Red),
                            StrokeThickness = 2
                        }
                    };

                    this.routeLayer.Items.Add(routeLine);
                }
            }
        }
Example #3
0
 private void routeProvider_RoutingCompleted(object sender, RoutingCompletedEventArgs e)
 {
     RouteResponse response = e.Response as RouteResponse;
     if (response != null)
     {
         if (response.Result.RoutePath != null)
         {
             MapPolyline route = new MapPolyline();
             route.Points = response.Result.RoutePath.Points;
             route.Stroke = new SolidColorBrush(Colors.Red);
             route.StrokeThickness = 3;
             this.informationLayer.Items.Add(route);
         }
     }
 }
Example #4
0
        private void routeProvider_RoutingCompleted(object sender, RoutingCompletedEventArgs e)
        {
            RouteResponse response = e.Response as RouteResponse;

            if (response != null)
            {
                if (response.Result.RoutePath != null)
                {
                    MapPolyline route = new MapPolyline();
                    route.Points          = response.Result.RoutePath.Points;
                    route.Stroke          = new SolidColorBrush(Colors.Red);
                    route.StrokeThickness = 3;
                    this.informationLayer.Items.Add(route);
                }
            }
        }
        private void Provider_RoutingCompleted(object sender, RoutingCompletedEventArgs e)
        {

            RouteResponse routeResponse = e.Response as RouteResponse;
            if (routeResponse != null &&
                routeResponse.Result != null &&
                routeResponse.Result.RoutePath != null)
            {

            Location loc = new Location();
            loc = routeResponse.Result.RoutePath.Points[0];
            
            Entities.DatasYol[ClientIslem.dtYolindex[0]].DT_ENLEM = loc.Latitude.ToString();
            Entities.DatasYol[ClientIslem.dtYolindex[0]].DT_BOYLAM = loc.Longitude.ToString();

            //sonKonum verisinde aracın yol ustunde olması
            Entities.AracDataList[ClientIslem.dtYolindex[0]].Data = Entities.DatasYol[ClientIslem.dtYolindex[0]];

            List<int> bos = new List<int>();
            for (int i = 1; i < ClientIslem.dtYolindex.Count; i++)
            {
                bos.Add(ClientIslem.dtYolindex[i]);
            }

            ClientIslem.dtYolindex = bos;

            if (ClientIslem.dtYolindex.Count > 0)
            {
                double en = double.Parse(Entities.DatasList[ClientIslem.dtYolindex[0]].DT_ENLEM);
                double boy = double.Parse(Entities.DatasList[ClientIslem.dtYolindex[0]].DT_BOYLAM);
                Location yer = new Location(en, boy);
                ClientIslem.yolBul(yer);
            }

            if (ClientIslem.dtYolindex.Count == 0)
                ClientIslem.dtYolIndex = -1;

            }
        }
        private void Provider_Yol2Completed(object sender, RoutingCompletedEventArgs e)
        {
            RouteResponse routeResponse = e.Response as RouteResponse;
            if (routeResponse != null &&
                routeResponse.Result != null &&
                routeResponse.Result.RoutePath != null)
            {
                if (!PaneAnimeOptions.IsHidden)
                {
                    if (routeResponse.Result.RoutePath.Points.Count >= 2)
                    {
                        Entities.GecmisYollar.CalYol.Add(new MapPolyline());
                        int yolIndex = Entities.GecmisYollar.CalYol.Count - 1;
                        Entities.GecmisYollar.CalYol[yolIndex].Points = new LocationCollection();

                        for (int i = 0; i < routeResponse.Result.RoutePath.Points.Count; i++)
                        {
                            //ClientIslem.calYol.Points.Add(routeResponse.Result.RoutePath.Points[i]);
                            Entities.GecmisYollar.CalYol[yolIndex].Points.Add(routeResponse.Result.RoutePath.Points[i]);
                        }
                        
                    }

                    sycGecmisRes++;
                    if (sycGecmisReq == sycGecmisRes)
                        GecmisYolCiz();
                }

                if (!PaneYol.IsHidden)
                {
                    ClientIslem.yolLine = new MapPolyline();
                    ClientIslem.yolLine.Points = routeResponse.Result.RoutePath.Points;

                    if (ClientIslem.yolLine.Points.Count > 2)
                    {
                        this.SetDefaultStyle(ClientIslem.yolLine);
                        layerYol.Items.Clear();
                        layerYol.Items.Add(ClientIslem.yolLine);
                    }

                }

            }
        else
        {
            
            if (!PaneAnimeOptions.IsHidden)
            {
                /*
                btnPlay.IsEnabled = false;
                btnStop.IsEnabled = false;
                MessageBox.Show("Bu tarihler için sonuç bulunamıyor..", "Dikkat!", MessageBoxButton.OK);
                 */
            }
            if (!PaneYol.IsHidden)
            {
                layerYol.Items.Clear();
                MessageBox.Show("Bu ayarlar için sonuç bulunamıyor..", "Dikkat!", MessageBoxButton.OK);
            }
        }
        }
		private void Provider_RoutingCompleted(object sender, RoutingCompletedEventArgs e)
		{
			this.findRouteButton.IsEnabled = true;

            RouteResponse routeResponse = e.Response as RouteResponse;
            if (routeResponse != null && routeResponse.Error == null &&
                routeResponse.Result != null && routeResponse.Result.RoutePath != null)
            {
                this.routeLine = new PolylineData()
                {
                    Points = routeResponse.Result.RoutePath.Points,
                    ShapeFill = new MapShapeFill()
                    {
                        Stroke = this.GetBrushFromCombo(),
                        StrokeThickness = 2
                    }
                };

                this.routeLayer.Items.Add(this.routeLine);
            }
            else
            {
                this.ErrorSummary.Visibility = Visibility.Visible;
            }
		}
        private void Provider_RoutingCompleted(object sender, RoutingCompletedEventArgs e)
        {  
            RouteResponse routeResponse = e.Response as RouteResponse;
            if (routeResponse != null)
            {
                if (routeResponse.Result.RoutePath != null)
                {
                    routeLine.Points = routeResponse.Result.RoutePath.Points;
                    routeLine.Stroke = new SolidColorBrush(Color.FromArgb(255, 53, 191, 74));
                    routeLine.StrokeThickness = 2;

                    this.informationLayer.Items.Add(routeLine);
                }
                else
                {
                    this.ErrorSummary.Visibility = Visibility.Visible;
                }
            }
        }