Exemple #1
0
    protected void BindAirportServices(Control c, Controls_mfbGoogleMapMgr mapMgr, string szRoute)
    {
        if (!(c is Controls_mfbAirportServices aptsvc))
        {
            throw new ArgumentNullException(nameof(c));
        }
        if (mapMgr == null)
        {
            throw new ArgumentNullException(nameof(mapMgr));
        }
        if (szRoute == null)
        {
            throw new ArgumentNullException(nameof(szRoute));
        }

        aptsvc.GoogleMapID = mapMgr.MapID;
        aptsvc.AddZoomLink = (mapMgr.Mode == MyFlightbook.Mapping.GMap_Mode.Dynamic);
        aptsvc.SetAirports(RoutesList(szRoute).MasterList.GetNormalizedAirports());
    }
Exemple #2
0
    protected static void BindImages(Control c, LogbookEntry le, Controls_mfbGoogleMapMgr mapMgr)
    {
        if (!(c is Controls_mfbImageList mfbilFlight))
        {
            throw new ArgumentNullException(nameof(c));
        }
        if (le == null)
        {
            throw new ArgumentNullException(nameof(le));
        }
        if (mapMgr == null)
        {
            throw new ArgumentNullException(nameof(mapMgr));
        }

        mfbilFlight.Key = le.FlightID.ToString(CultureInfo.InvariantCulture);
        mfbilFlight.Refresh();
        mapMgr.Map.Images = mfbilFlight.Images.ImageArray;
    }
Exemple #3
0
    /// <summary>
    /// Sets up the specified map manager
    /// </summary>
    /// <param name="mapMgr"></param>
    /// <param name="szRoute"></param>
    /// <param name="PathLatLongArrayID"></param>
    /// <returns>True if the data has latlong info and more than one row of data (i.e., is dynamic and can be downloaded</returns>
    protected bool SetUpMapManager(Controls_mfbGoogleMapMgr mapMgr, string szRoute, string PathLatLongArrayID)
    {
        if (mapMgr == null)
        {
            throw new ArgumentNullException(nameof(mapMgr));
        }
        if (szRoute == null)
        {
            throw new ArgumentNullException(szRoute);
        }

        mapMgr.Map.Airports    = RoutesList(szRoute).Result;
        mapMgr.ShowMarkers     = true;
        mapMgr.Map.PathVarName = PathLatLongArrayID;
        mapMgr.Map.Path        = DataForFlight.GetPath();
        bool result = DataForFlight.HasLatLongInfo && DataForFlight.Data.Rows.Count > 1;

        mapMgr.Mode = result ? MyFlightbook.Mapping.GMap_Mode.Dynamic : MyFlightbook.Mapping.GMap_Mode.Static;
        return(result);
    }