Esempio n. 1
0
        /// <summary> Initializes a new instance of the <see cref="OverviewMapView"/> class. </summary>
        public OverviewMapView()
        {
            ZoomDelta = 4;
            IsEnabled = false;

            dragRectangle = new Rectangle
            {
                IsHitTestVisible = false,
                Fill             = new SolidColorBrush(Color.FromArgb(0x80, 0xaa, 0xaa, 0xaa)),
                Stroke           = new SolidColorBrush(Colors.Black),
                StrokeDashArray  = new DoubleCollection(new double[] { 1, 4 }),
                StrokeEndLineCap = PenLineCap.Round,
                StrokeDashCap    = PenLineCap.Round,
                StrokeThickness  = 1.5,
                RadiusX          = 8,
                RadiusY          = 8
            };

            var c = new Canvas();

            c.Children.Add(dragRectangle);
            c.RenderTransform = TransformFactory.CreateTransform(SpatialReference.PtvMercator);
            Panel.SetZIndex(c, 15000);
            GeoCanvas.Children.Add(c);
        }
Esempio n. 2
0
        /// <summary> Initializes the transformation instance which is needed to transform coordinates from one format
        /// to another one. </summary>
        public virtual void InitializeTransform()
        {
            var trans = TransformFactory.CreateTransform(SpatialReference.PtvMercatorInvertedY);

            offsetTransform = new TranslateTransform(MapView.OriginOffset.X + localOffset.X,
                                                     MapView.OriginOffset.Y - localOffset.Y);
            trans = new TransformGroup
            {
                Children = { offsetTransform, trans }
            };

            RenderTransform = trans;
        }
Esempio n. 3
0
        /// <summary> Initializes a new instance of the <see cref="WorldCanvas"/> class. If the parameter
        /// <paramref name="addToMap"/> is set to true, the canvas is added to the parent map. </summary>
        /// <param name="mapView"> The instance of the parent map. </param>
        /// <param name="addToMap"> Indicates that the canvas should inserted to the parent map immediately. </param>
        protected WorldCanvas(MapView mapView, bool addToMap)
            : base(mapView)
        {
            var ct = TransformFactory.CreateTransform(SpatialReference.PtvMercatorInvertedY);

            offsetTransform = new TranslateTransform(mapView.OriginOffset.X, mapView.OriginOffset.Y);
            var tg = new TransformGroup();

            tg.Children.Add(offsetTransform);
            tg.Children.Add(ct);
            canvasTransform = tg;

            InitializeTransform();

            if (addToMap)
            {
                mapView.GeoCanvas.Children.Add(this);
            }
        }
Esempio n. 4
0
 /// <inheritdoc/>
 public override void InitializeTransform()
 {
     RenderTransform = TransformFactory.CreateTransform(SpatialReference.PtvMercatorInvertedY);
 }