示例#1
0
        protected Point?GetPosition(VELatLong latLong)
        {
            VEPushPinAltitudeEvent alt;
            bool isVisible;

            return(GetPosition(latLong, out alt, out isVisible));
        }
        public VECameraChangedEventArgs(VELatLong oldLatLong, VELatLong newLatLong, VERollPitchYaw oldRPY, VERollPitchYaw newRPY)
        {
            this.OldLatLong      = oldLatLong;
            this.NewLatLong      = newLatLong;
            this.OldRollPitchYaw = oldRPY;
            this.NewRollPitchYaw = newRPY;

            if (oldLatLong == null)
            {
                throw new ArgumentNullException("oldLatLong");
            }

            if (newLatLong == null)
            {
                throw new ArgumentNullException("newLatLong");
            }

            if (oldRPY == null)
            {
                throw new ArgumentNullException("oldRPY");
            }

            if (newRPY == null)
            {
                throw new ArgumentNullException("newRPY");
            }
        }
示例#3
0
        public VEPushPin(VELatLong latLong, double minAltitude, double maxAltitude)
        {
            this.Latitude  = latLong.Latitude;
            this.Longitude = latLong.Longitude;
            this.Altitude  = latLong.Altitude;
            this.AltMode   = latLong.AltMode;

            this.DisplayLatitude  = this.Latitude;
            this.DisplayLongitude = this.Longitude;

            this.MinAltitude = minAltitude;
            this.MaxAltitude = maxAltitude;

            Initialize();
        }
示例#4
0
        public VEPushPin(VELatLong latLong)
        {
            if (latLong != null)
            {
                this.Latitude  = latLong.Latitude;
                this.Longitude = latLong.Longitude;

                this.DisplayLatitude  = this.Latitude;
                this.DisplayLongitude = this.Longitude;

                this.Altitude = latLong.Altitude;
                this.AltMode  = latLong.AltMode;
            }

            Initialize();
        }
示例#5
0
 public static double GreatCircleDistance(VELatLong a, VELatLong b)
 {
     return(LatLonAlt.GreatCircleDistance(a.ToLatLonAlt(), b.ToLatLonAlt()));
 }
示例#6
0
        protected Point?GetPosition(VELatLong latLong, out VEPushPinAltitudeEvent altEvent, out bool isVisible)
        {
            Point?position = null;

            isVisible = true;
            altEvent  = VEPushPinAltitudeEvent.None;

            if (this.Map != null)
            {
                position = this.Map.LatLongToPointInternal(latLong, this);

                //Not visible if no position (off screen)
                if (position == null)
                {
                    isVisible = false;
                }

                //Not visible if behind planet
                if (behindPlanetCheckCount++ > behindPlanetCheckMax)
                {
                    behindPlanetCheckCount = 0;

                    if (this.Map.IsBehindPlanet(latLong))
                    {
                        isVisible = false;
                    }
                }

                //Not visible if out of altitude range
                double newCameraAltitude = Map.Altitude;

                if (newCameraAltitude > this.MaxAltitude ||
                    newCameraAltitude < this.MinAltitude)
                {
                    isVisible = false;
                }

                if (newCameraAltitude <= this.MaxAltitude &&
                    newCameraAltitude >= this.MinAltitude &&
                    previousCameraAltitude > this.MaxAltitude)
                {
                    altEvent = VEPushPinAltitudeEvent.TransitionIntoUpperRange;
                }
                else if (newCameraAltitude <= this.MaxAltitude &&
                         newCameraAltitude >= this.MinAltitude &&
                         previousCameraAltitude < this.MinAltitude)
                {
                    altEvent = VEPushPinAltitudeEvent.TransitionIntoLowerRange;
                }
                else if (newCameraAltitude > this.MaxAltitude &&
                         previousCameraAltitude <= this.MaxAltitude &&
                         previousCameraAltitude >= this.MinAltitude)
                {
                    altEvent = VEPushPinAltitudeEvent.TransitionAboveUpperRange;
                }
                else if (newCameraAltitude < this.MinAltitude &&
                         previousCameraAltitude <= this.MaxAltitude &&
                         previousCameraAltitude >= this.MinAltitude)
                {
                    altEvent = VEPushPinAltitudeEvent.TransitionBelowLowerRange;
                }

                if (ScalesWithMap)
                {
                    if ((newCameraAltitude != this.OriginalAltitude) && (newCameraAltitude > 1.0))
                    {
                        double scaleFactor = this.OriginalAltitude / newCameraAltitude;

                        this.Height = this.OriginalHeight * scaleFactor;
                        this.Width  = this.OriginalWidth * scaleFactor;

                        this.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                    }
                }

                previousCameraAltitude = newCameraAltitude;

                //Not visible if manual override
                if (PinVisible == false)
                {
                    isVisible = false;
                }
            }
            return(position);
        }