Ejemplo n.º 1
0
        private async Task MoveLine(MemoryLayer highlightLayer, GeoLine baseline, double percentageRatio, int i, bool reverse = false)
        {
            GeoLine line = await Task.Run(() => (GeoLine)baseline.GetSegmentation((float)percentageRatio *i));

            highlightLayer.Features.Clear();

            if (line != null)
            {
                highlightLayer.Features.Add(new Feature(line));

                GeoCoordinate currentPoint = line.Coordinates.Last();
                highlightLayer.Features.Add(new Feature(new GeoPoint(currentPoint)));
                if (line.Coordinates.Count > 1)
                {
                    GeoCoordinate previousPoint = line.Coordinates.ElementAt(line.Coordinates.Count - 2);
                    double        angle         = Math.Atan2(currentPoint.Y - previousPoint.Y, currentPoint.X - previousPoint.X);
                    float         degree        = (float)(angle * 180 / Math.PI);
                    if (reverse)
                    {
                        degree = degree + 180;
                    }
                    highlightLayer.Styles.OfType <IconStyle>().First().Rotation = degree;
                }
            }
            Map1.Refresh("HighlightOverlay");

            await Task.Run(() => Thread.Sleep(50));
        }
Ejemplo n.º 2
0
        private async Task MoveLine(MemoryLayer highlightLayer, GeoLine baseline, double percentageRatio, int i)
        {
            GeoLinearBase line = await Task.Run(() => baseline.GetSegmentation((float)percentageRatio *i));

            highlightLayer.Features.Clear();

            if (line != null)
            {
                highlightLayer.Features.Add(new Feature(line));
            }
            Map1.Refresh("HighlightOverlay");

            await Task.Run(() => Thread.Sleep(50));
        }