Beispiel #1
0
        private async Task DrawSymbolOnMap(YouMapsSymbol symbol, TappedRoutedEventArgs e)
        {
            Point pp = e.GetPosition(myMap);
            

            AddSymbolToMap astm = new AddSymbolToMap(pp);

            List<PointCollection> pCollect = await astm.ChangePointToPlaceSymbol();
            foreach(PointCollection pc in pCollect)
            {
                SharpKml.Dom.CoordinateCollection coordCollection = new SharpKml.Dom.CoordinateCollection();
                MapControl.LocationCollection locationCollection = new MapControl.LocationCollection();
                loadMap.Polylines.Add(new Points.YouMapPolyline { Locations = locationCollection, ColorOfLine = LineColorBrush, LocationAsCords = coordCollection });

                foreach(Point p in pc)
                {
                    
                    MapControl.Location location = myMap.ViewportPointToLocation(p);
                    StyleUserControl sty = new StyleUserControl(LineColorBrush);

                    loadMap.Polylines.ElementAt(locationInLocationsArray).Locations.Add(location);
                    loadMap.Polylines.ElementAt(locationInLocationsArray).LocationAsCords.Add(new SharpKml.Base.Vector { Latitude = location.Latitude, Longitude = location.Longitude });

                }
                locationInLocationsArray++;
            }

        }
Beispiel #2
0
        private void drawingPointerHasMoved(object sender, PointerRoutedEventArgs e)
        {

            if (drawingPointerIsOn && drawingPressedIsOn)
            {
                
                AddPointPopup.IsOpen = false;
                PointerPoint pp = e.GetCurrentPoint(myMap);
                MapControl.Location location = myMap.ViewportPointToLocation(pp.Position);
                MapControl.LocationCollection locationCollection = new MapControl.LocationCollection();
                StyleUserControl sty = new StyleUserControl(LineColorBrush);
                SharpKml.Dom.CoordinateCollection coordCollection = new SharpKml.Dom.CoordinateCollection();

                     
                loadMap.Polylines.Add(new Points.YouMapPolyline { Locations = locationCollection,ColorOfLine = LineColorBrush, LocationAsCords = coordCollection});
                loadMap.Polylines.ElementAt(locationInLocationsArray).Locations.Add(location);
                loadMap.Polylines.ElementAt(locationInLocationsArray).LocationAsCords.Add(new SharpKml.Base.Vector { Latitude = location.Latitude, Longitude = location.Longitude });

                
            }
        }