Exemple #1
0
        public void AddPolygon(List<PointLatLng> CoordinatesList, PointLatLng Position, Brush FillColor, Brush StrokeColor)
        {
            GMapMarker m = new GMapMarker(Position);

            //m.Polygon.AddRange(CoordinatesList);
            foreach (PointLatLng p in CoordinatesList)
            {
                m.Polygon.Add(p);
                m.RegeneratePolygonShape(MainMap);
            }
            //m.Shape = new PolygonMarker(this, m);
            //m.RegeneratePolygonShape(MainMap);
            //m.Position = Position;

            (m.Shape as System.Windows.Shapes.Path).Fill = FillColor;
            (m.Shape as System.Windows.Shapes.Path).Stroke = StrokeColor;
            MainMap.Markers.Add(m);
            SelectedMarker = m;
        }
        private void Polygun_Click(object sender, RoutedEventArgs e)
        {
            if (RoutePoints.Count > 1)
            {
                GMapMarker mRoute = new GMapMarker(RoutePoints[0]);
                {
                    //for show polygon
                    RoutePoints.Add(RoutePoints[0]);
                    mRoute.Polygon.AddRange(RoutePoints);

                    mRoute.RegeneratePolygonShape(MainMap);
                    mRoute.ZIndex = -1;
                }

                MainMap.Markers.Add(mRoute);
            }
        }