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(); }
/// <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) { }
/// <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); }
/// <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)); } }
/// <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); }
public MapPoint(ZonePoint point, string name) { Point = point; Name = name; }
/// <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)); }