Ejemplo n.º 1
0
        private void Activate(Point2D item)
        {
            if (Map == null || Map.Layers == null)
            {
                return;
            }
            ellipse = new Ellipse();
            #region 所有风格的控制
            ellipse.Stroke = Stroke;
            ellipse.StrokeThickness = StrokeThickness;
            ellipse.Fill = Fill;
            ellipse.StrokeMiterLimit = StrokeMiterLimit;
            ellipse.StrokeDashOffset = StrokeDashOffset;
            ellipse.StrokeDashArray = StrokeDashArray;
            ellipse.StrokeDashCap = StrokeDashCap;
            ellipse.StrokeEndLineCap = StrokeEndLineCap;
            ellipse.StrokeLineJoin = StrokeLineJoin;
            ellipse.StrokeStartLineCap = StrokeStartLineCap;
            ellipse.Opacity = Opacity;
            #endregion

            DrawLayer = new ElementsLayer();
            Map.Layers.Add(DrawLayer);

            ellipse.SetValue(ElementsLayer.BBoxProperty, new Rectangle2D(item, item));
            DrawLayer.Children.Add(ellipse);

            isActivated = true;
            isDrawing = true;
        }
Ejemplo n.º 2
0
        private void Activate(Point2D firstPoint)
        {
            DrawLayer = new ElementsLayer();
            if (Map.Layers == null)
            {
                return;
            }
            Map.Layers.Add(DrawLayer);

            _polyline = new PolylineElement();
            #region 所有风格的控制
            _polyline.Stroke = Stroke;
            _polyline.StrokeThickness = StrokeThickness;
            _polyline.StrokeMiterLimit = StrokeMiterLimit;
            _polyline.StrokeDashOffset = StrokeDashOffset;
            _polyline.StrokeDashArray = StrokeDashArray;
            _polyline.StrokeDashCap = StrokeDashCap;
            _polyline.StrokeEndLineCap = StrokeEndLineCap;
            _polyline.StrokeLineJoin = StrokeLineJoin;
            _polyline.StrokeStartLineCap = StrokeStartLineCap;
            _polyline.Opacity = Opacity;
            _polyline.Fill = Fill;
            _polyline.FillRule = FillRule;
            #endregion

            _points = new Point2DCollection();
            _polyline.Point2Ds = _points;
            _points.Add(firstPoint);
            _pointsCount++;
            DrawLayer.Children.Add(_polyline);

            _isActivated = true;
        }
Ejemplo n.º 3
0
 public MainPage()
 {
     this.InitializeComponent();
     _eLayer = MyMap.Layers["ELayer"] as ElementsLayer;
     _fLayer=MyMap.Layers["FLayer"] as FeaturesLayer;
     _layer=MyMap.Layers["TDLayer"] as TiledDynamicRESTLayer;
 }
Ejemplo n.º 4
0
        private void Activate(Point2D firstPoint)
        {
            if (Map == null || Map.Layers == null)
            {
                return;
            }

            polyline = new PolylineElement();
            polyline.Stroke = Stroke;
            polyline.StrokeThickness = StrokeThickness;
            polyline.Opacity = Opacity;
            polyline.StrokeMiterLimit = StrokeMiterLimit;
            polyline.StrokeDashOffset = StrokeDashOffset;
            polyline.StrokeDashArray = StrokeDashArray;
            polyline.StrokeDashCap = StrokeDashCap;
            polyline.StrokeEndLineCap = StrokeEndLineCap;
            polyline.StrokeLineJoin = StrokeLineJoin;
            polyline.StrokeStartLineCap = StrokeStartLineCap;
            polyline.Fill = Fill;
            polyline.FillRule = FillRule;

            points = new Point2DCollection();
            polyline.Point2Ds = points;
            points.Add(firstPoint);

            DrawLayer = new ElementsLayer();

            Map.Layers.Add(DrawLayer);
            DrawLayer.Children.Add(polyline);

            isActivated = true;
            isDrawing = true;
        }
 public CustomClientMeasure()
 {
     InitializeComponent();
     _layer = MyMap.Layers["bingMapLayer"] as TiledBingMapsLayer;
     _eLayer = MyMap.Layers["ELayer"] as ElementsLayer;
     this.Unloaded += CustomClientMeasure_Unloaded;
 }
Ejemplo n.º 6
0
        public GeoRSS()
        {
            InitializeComponent();
            double[] resolutions = new double[14];
            double resolution = 0.28526148969889065;
            for (int i = 0; i < 14; i++)
            {
                resolutions[i] = resolution;
                resolution /= 2;
            }
            MyMap.Resolutions = resolutions;
            elementsLayer = MyMap.Layers["MyElementsLayer"] as ElementsLayer;
            window = new InfoWindow(this.MyMap);
            MyMap.Layers["dynamicRESTLayer"].Failed += GeoRSS_Failed;
            this.MyMap.ViewBoundsChanged += new System.EventHandler<ViewBoundsEventArgs>(MyMap_ViewBoundsChanged);
            LoadRSS(url);
            DispatcherTimer updateTimer = new DispatcherTimer();
            updateTimer.Interval = new TimeSpan(0, 0, 0, 60000);
            updateTimer.Tick += (s, args) =>
            {
                LoadRSS(url);
            };
            updateTimer.Start();



        }
Ejemplo n.º 7
0
        private void Activate(Point2D item)
        {
            if (Map == null || Map.Layers == null)
            {
                return;
            }
            DrawLayer = new ElementsLayer();
            Map.Layers.Add(DrawLayer);
            rectangle = new Rectangle();
            rectangle.Stroke = this.Stroke;
            rectangle.StrokeThickness = this.StrokeThickness;
            rectangle.StrokeMiterLimit = this.StrokeMiterLimit;
            rectangle.StrokeDashOffset = this.StrokeDashOffset;
            rectangle.StrokeDashArray = this.StrokeDashArray;
            rectangle.StrokeDashCap = this.StrokeDashCap;
            rectangle.StrokeEndLineCap = this.StrokeEndLineCap;
            rectangle.StrokeLineJoin = this.StrokeLineJoin;
            rectangle.StrokeStartLineCap = this.StrokeStartLineCap;
            rectangle.Opacity = this.Opacity;
            rectangle.Fill = this.Fill;

            rectangle.SetValue(ElementsLayer.BBoxProperty , new Rectangle2D(item , item));
            DrawLayer.Children.Add(rectangle);

            isActivated = true;
            isDrawing = true;
        }
Ejemplo n.º 8
0
        private void Activate()
        {
            if (Map == null || Map.Layers == null)
            {
                return;
            }

            polygon = new PolygonElement();
            #region 所有风格的控制
            polygon.Stroke = Stroke;
            polygon.StrokeThickness = StrokeThickness;
            polygon.StrokeMiterLimit = StrokeMiterLimit;
            polygon.StrokeDashOffset = StrokeDashOffset;
            polygon.StrokeDashArray = StrokeDashArray;
            polygon.StrokeDashCap = StrokeDashCap;
            polygon.StrokeEndLineCap = StrokeEndLineCap;
            polygon.StrokeLineJoin = StrokeLineJoin;
            polygon.StrokeStartLineCap = StrokeStartLineCap;
            polygon.Opacity = Opacity;
            polygon.Fill = Fill;
            polygon.FillRule = FillRule;
            #endregion
            points = new Point2DCollection();
            polygon.Point2Ds = points;
            points.Add(startPt);

            DrawLayer = new ElementsLayer();

            Map.Layers.Add(DrawLayer);
            DrawLayer.Children.Add(polygon);

            isActivated = true;
            isDrawing = true;
        }
        public RESTFindMTSPPath()
        {
            InitializeComponent();
            double[] resolutions = new double[14];
            double resolution = 9.9772839315388211;
            for (int i = 0; i < 14; i++)
            {
                resolutions[i] = resolution;
                resolution /= 2;
            }
            MyMap.Resolutions = resolutions;

            elementsLayer = this.MyMap.Layers["MyElementsLayer"] as ElementsLayer;

            featuresLayer = this.MyMap.Layers["MyFeaturesLayer"] as FeaturesLayer;
            featuresLayerCenterPoints = this.MyMap.Layers["MyFeaturesLayer1"] as FeaturesLayer;

            Feature feature1 = new Feature
            {
                Geometry = new GeoPoint(4100, -4100),
                Style = new PredefinedMarkerStyle
                {
                    Color = new SolidColorBrush(Colors.Red),
                    Size = 20,
                    Symbol = PredefinedMarkerStyle.MarkerSymbol.Star
                }
            };

            featuresLayerCenterPoints.Features.Add(feature1);

            Feature feature2 = new Feature
            {
                Geometry = new GeoPoint(4500, -3000),
                Style = new PredefinedMarkerStyle
                {
                    Color = new SolidColorBrush(Colors.Red),
                    Size = 20,
                    Symbol = PredefinedMarkerStyle.MarkerSymbol.Star
                }
            };
            featuresLayerCenterPoints.AddFeature(feature2);

            Feature feature3 = new Feature
            {
                Geometry = new GeoPoint(5000, -3500),
                Style = new PredefinedMarkerStyle
                {
                    Color = new SolidColorBrush(Colors.Red),
                    Size = 20,
                    Symbol = PredefinedMarkerStyle.MarkerSymbol.Star
                }
            };
            featuresLayerCenterPoints.AddFeature(feature3);
            _layer = MyMap.Layers["tiledDynamicRESTLayer"] as TiledDynamicRESTLayer;
            _layer.LocalStorage = new OfflineStorage("长春市区图");
            _layer.Failed += RESTFindMTSPPath_Failed;
            this.Unloaded += RESTFindMTSPPath_Unloaded;
        }
 public MeasureArea(Map map, ElementsLayer elementsLayer)
     : base(map)
 {
     Name = "MeasureArea";
     Map = map;
     Stroke = new SolidColorBrush(Colors.Red);
     Fill = new SolidColorBrush(Color.FromArgb(0x99, 255, 255, 255));
     StrokeThickness = 3;
     Opacity = 1;
     DrawLayer = elementsLayer;
 }
 public CustomDrawStar()
 {
     InitializeComponent();
     double[] resolutions = new double[14];
     double resolution = 0.28526148969889065;
     for (int i = 0; i < 14; i++)
     {
         resolutions[i] = resolution;
         resolution /= 2;
     }
     MyMap.Resolutions = resolutions;
     elementslayer = MyMap.Layers["MyElementsLayer"] as ElementsLayer;
     _layer = MyMap.Layers["tiledLayer"] as TiledDynamicRESTLayer;
     _layer.LocalStorage = new OfflineStorage("World");
     _layer.Failed += CustomDrawStar_Failed;
     this.Unloaded += CustomDrawStar_Unloaded;
 }
 public RESTFindPath()
 {
     InitializeComponent();
     double[] resolutions = new double[14];
     double resolution = 9.9772839315388211;
     for (int i = 0; i < 14; i++)
     {
         resolutions[i] = resolution;
         resolution /= 2;
     }
     MyMap.Resolutions = resolutions;
     elementsLayer = this.MyMap.Layers["MyElementsLayer"] as ElementsLayer;
     featuresLayer = this.MyMap.Layers["MyFeaturesLayer"] as FeaturesLayer;
     _layer = MyMap.Layers["tiledDynamicRESTLayer"] as TiledDynamicRESTLayer;
     _layer.LocalStorage = new OfflineStorage("长春市区图");
     _layer.Failed += RESTFindPath_Failed;
     this.Unloaded += RESTFindPath_Unloaded;
 }
Ejemplo n.º 13
0
 public Code()
 {
     InitializeComponent();
     double[] resolutions = new double[14];
     double resolution = 0.28526148969889065;
     for (int i = 0; i < 14; i++)
     {
         resolutions[i] = resolution;
         resolution /= 2;
     }
     MyMap.Resolutions = resolutions;
     elementsLayer = this.MyMap.Layers["MyElementsLayer"] as ElementsLayer;
     MyMap.ViewBoundsChanged += MyMap_ViewBoundsChanged;
     _layer = MyMap.Layers["DynamicRESTLayer"] as TiledDynamicRESTLayer;
     _layer.LocalStorage = new OfflineStorage("World");
     _layer.Failed += Code_Failed;
     this.Unloaded += Code_Unloaded;
 }
        public UIActionsInElementsLayer( )
        {
            InitializeComponent();
            double[] resolutions = new double[14];
            double resolution = 0.28526148969889065;
            for (int i = 0; i < 14; i++)
            {
                resolutions[i] = resolution;
                resolution /= 2;
            }
            MyMap.Resolutions = resolutions;

            MyMap.Theme = new RawTheme();

            elementsLayer = MyMap.Layers["MyElementsLayer"] as ElementsLayer;
            featuresLayer = MyMap.Layers["MyFeaturesLayer"] as FeaturesLayer;
            _layer = MyMap.Layers["tiledLayer"] as TiledDynamicRESTLayer;
            _layer.LocalStorage = new OfflineStorage("World");
            _layer.Failed += UIActionsInElementsLayer_Failed;
            this.Unloaded += UIActionsInElementsLayer_Unloaded;
        }
Ejemplo n.º 15
0
        private void Activate(Point2D firstPoint)
        {
            if (Map == null || Map.Layers == null)
            {
                return;
            }

            DrawLayer = new ElementsLayer();

            Map.Layers.Add(DrawLayer);
            _startPoint = firstPoint;

            _polygon = new PolygonElement();
            #region 所有风格的控制
            _polygon.Stroke = this.Stroke;
            _polygon.StrokeThickness = this.StrokeThickness;
            _polygon.StrokeMiterLimit = this.StrokeMiterLimit;
            _polygon.StrokeDashOffset = this.StrokeDashOffset;
            _polygon.StrokeDashArray = this.StrokeDashArray;
            _polygon.StrokeDashCap = this.StrokeDashCap;
            _polygon.StrokeEndLineCap = this.StrokeEndLineCap;
            _polygon.StrokeLineJoin = this.StrokeLineJoin;
            _polygon.StrokeStartLineCap = this.StrokeStartLineCap;
            _polygon.Opacity = this.Opacity;
            _polygon.Fill = this.Fill;
            _polygon.FillRule = this.FillRule;
            #endregion

            _points = new Point2DCollection();
            _polygon.Point2Ds = _points;
            _points.Add(firstPoint);
            _pointsCount++;
            _points.Add(firstPoint.Clone());
            _pointsCount++;
            DrawLayer.Children.Add(_polygon);

            _isActivated = true;
        }
 public MeasureDistance(Map map, ElementsLayer elementsLayer)
     : base(map)
 {
     Name = "MeasureDistance";
     Map = map;
     Stroke = new SolidColorBrush(Colors.Red);
     StrokeThickness = 3;
     Opacity = 1;
     DrawLayer = elementsLayer;
 }
Ejemplo n.º 17
0
 /// <summary>${mapping_Map_method_openInfoWindow_D}</summary>
 ///  <param name="location">${mapping_Map_method_openInfoWindow_param_location}</param>
 ///  <param name="offsetPixelX">${mapping_Map_method_openInfoWindow_param_offsetPixelX}</param>
 ///  <param name="offsetPixelY">${mapping_Map_method_openInfoWindow_param_offsetPixelY}</param>
 /// <param name="element">${mapping_Map_method_openInfoWindow_param_element}</param>
 public void OpenInfoWindow(Point2D location, double offsetPixelX, double offsetPixelY, UIElement element)
 {
     if (Layers.Count == 0)
     {
         return;
     }//待补充其他异常消除
     if (windowsLayer == null)
     {
         windowsLayer = new ElementsLayer();
         Layers.Add(windowsLayer);
     }
     windowsLayer.Children.Clear();
     Point originPixel = this.MapToScreen(location);
     Point offsetPixel = new Point(originPixel.X + offsetPixelX, originPixel.Y + offsetPixelY);
     Point2D offsetLocation = this.ScreenToMap(offsetPixel);
     windowsLayer.AddChild(element, offsetLocation);
 }
Ejemplo n.º 18
0
 /// <summary>${mapping_Map_method_closeInfoWindow_D}</summary>
 public void CloseInfoWindow()
 {
     if (windowsLayer != null)
     {
         Layers.Remove(windowsLayer);
         windowsLayer = null;
     }
 }
        private void Activate()
        {
            pentagram = new PolygonElement();
            #region 所有风格的控制
            pentagram.Stroke = this.Stroke;
            pentagram.StrokeThickness = this.StrokeThickness;
            pentagram.Fill = this.Fill;
            pentagram.FillRule = this.FillRule;
            pentagram.Opacity = this.Opacity;
            pentagram.StrokeMiterLimit = this.StrokeMiterLimit;
            pentagram.StrokeDashOffset = this.StrokeDashOffset;
            pentagram.StrokeDashArray = this.StrokeDashArray;
            pentagram.StrokeDashCap = this.StrokeDashCap;
            pentagram.StrokeEndLineCap = this.StrokeEndLineCap;
            pentagram.StrokeLineJoin = this.StrokeLineJoin;
            pentagram.StrokeStartLineCap = this.StrokeStartLineCap;
            #endregion
            a0 = new Point2D();
            a1 = new Point2D();
            a2 = new Point2D();
            a3 = new Point2D();
            a4 = new Point2D();

            points = new Point2DCollection();
            pentagram.Point2Ds = points;
            oldPentagrams = new List<PolygonElement>();

            DrawLayer = new ElementsLayer();
            Map.Layers.Add(DrawLayer);

            isActivated = true;
            isDrawing = true;
        }