public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ZonePoint zp = value as ZonePoint;
            if (zp == null)
            {
                if (!(parameter is string) || (string)parameter != "NoNull")
                {
                    return null;
                }
                else
                {
                    zp = new ZonePoint(0, 0, 0);
                }
            } 

            return zp.ToGeoCoordinate();
        }
Beispiel #2
0
 /// <summary>
 /// Constructs a CoordBounds that is the minimum bounding box
 /// of two ZonePoints.
 /// </summary>
 /// <param name="zp1"></param>
 /// <param name="zp2"></param>
 public CoordBounds(ZonePoint zp1, ZonePoint zp2)
     : this(zp1.Longitude, zp1.Latitude, zp2.Longitude, zp2.Latitude)
 {
 }
Beispiel #3
0
 /// <summary>
 /// Enlarges these bounds so that a ZonePoint can fit inside.
 /// </summary>
 /// <param name="zp"></param>
 public void Inflate(ZonePoint zp)
 {
     Inflate(zp.Latitude, zp.Longitude);
 }
Beispiel #4
0
 /// <summary>
 /// Constructs a CoordBounds that is completely enclosing
 /// a single ZonePoint.
 /// </summary>
 /// <param name="zp"></param>
 public CoordBounds(ZonePoint zp)
     : this(zp, zp)
 {
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="WF.Player.CartridgeDetailViewModel"/> class.
		/// </summary>
		/// <param name="tag">CartridgeTag to show.</param>
		public CartridgeDetailViewModel(CartridgeTag tag)
		{
			this.cartridgeTag = tag;

			this.geoMathHelper = new GeoMathHelper();
			this.target = new ZonePoint(cartridgeTag.Cartridge.StartingLocationLatitude, cartridgeTag.Cartridge.StartingLocationLongitude, 0);

			Direction = double.NegativeInfinity;
			Distance = double.NegativeInfinity;

			if (App.GPS.LastKnownPosition != null)
			{
				HandlePositionChanged(this, new PositionEventArgs(App.GPS.LastKnownPosition));
			}
		}
Beispiel #6
0
 /// <summary>
 /// Gets the location vector between this point and another one.
 /// </summary>
 /// <param name="zp">Target (end point of the vector).</param>
 /// <returns>A location vector whose start is this point and whose end is <paramref name="zp"/>.</returns>
 public LocationVector GetVectorTo(ZonePoint zp)
 {
     return new Utils.GeoMathHelper().VectorToPoint(this, zp);
 }
Beispiel #7
0
			public MapPoint(ZonePoint point, string name)
			{
				Point = point;
				Name = name;
			}
Beispiel #8
0
 /// <summary>
 /// Constructs a CoordBounds that is the minimum bounding box
 /// of two ZonePoints.
 /// </summary>
 /// <param name="zp1"></param>
 /// <param name="zp2"></param>
 public CoordBounds(ZonePoint zp1, ZonePoint zp2)
     : this(zp1.Longitude, zp1.Latitude, zp2.Longitude, zp2.Latitude)
 {
 }
Beispiel #9
0
        /// <summary>
        /// Enlarges these bounds so that a ZonePoint can fit inside.
        /// </summary>
        /// <param name="zp"></param>
        public void Inflate(ZonePoint zp)
		{
            Inflate(zp.Latitude, zp.Longitude);
		}
Beispiel #10
0
 /// <summary>
 /// Constructs a CoordBounds that is completely enclosing
 /// a single ZonePoint.
 /// </summary>
 /// <param name="zp"></param>
 public CoordBounds(ZonePoint zp)
     : this(zp, zp)
 {
 }
Beispiel #11
0
 /// <summary>
 /// Gets the location vector between this point and another one.
 /// </summary>
 /// <param name="zp">Target (end point of the vector).</param>
 /// <returns>A location vector whose start is this point and whose end is <paramref name="zp"/>.</returns>
 public LocationVector GetVectorTo(ZonePoint zp)
 {
     return(new Utils.GeoMathHelper().VectorToPoint(this, zp));
 }