Ejemplo n.º 1
0
        /// <summary>
        /// Create a new pipe to transform an enumeration of mouse positions
        /// on the map into their corresponding geo coordinates.
        /// </summary>
        /// <param name="ZoomLevel">The current zoom level of the Aegir map.</param>
        /// <param name="IEnumerable">An optional IEnumerable&lt;S&gt; as element source.</param>
        /// <param name="IEnumerator">An optional IEnumerator&lt;S&gt; as element source.</param>
        public Mouse2GeoCoordinatePipe(UInt32 ZoomLevel,
                                       IEnumerable <Tuple <Double, Double> > IEnumerable = null,
                                       IEnumerator <Tuple <Double, Double> > IEnumerator = null)

            : base(IEnumerable,
                   Item => GeoCalculations.Mouse2GeoCoordinate(Item.Item1, Item.Item2, ZoomLevel))

        {
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new arrow to transform an enumeration of mouse positions
        /// on the map into their corresponding geo coordinates.
        /// </summary>
        /// <param name="ZoomLevel">The current zoom level of the Aegir map.</param>
        /// <param name="OnError">A delegate to transform an incoming error into an outgoing error.</param>
        /// <param name="ArrowSender">The sender of the messages/objects.</param>
        public Mouse2GeoCoordinateArrow(UInt32 ZoomLevel,
                                        Func <Exception, Exception> OnError = null,
                                        IArrowSender <Tuple <Double, Double> > ArrowSender = null)

            : base(Item => GeoCalculations.Mouse2GeoCoordinate(Item.Item1, Item.Item2, ZoomLevel),
                   OnError,
                   ArrowSender)

        {
        }
Ejemplo n.º 3
0
        private void ProcessPreviewMouseRightButtonDown(Object Sender, MouseEventArgs MouseEventArgs)
        {
            var Mouse = MouseEventArgs.GetPosition(this);

            AddFeature("NewFeature",
                       GeoCalculations.Mouse2GeoCoordinate(Mouse.X - this.MapControl.ScreenOffset.X,
                                                           Mouse.Y - this.MapControl.ScreenOffset.Y,
                                                           this.MapControl.ZoomLevel),
                       5, 5,
                       Brushes.Blue,
                       Brushes.Black,
                       1.0);

            Redraw();
        }