/// <summary>
        /// Initialize the Plot.
        /// </summary>
        public ShipTrackPlotViewModel()
            : base("Ship Track Plot")
        {
            IsUseGpsSpeedBackup = true;

            // Create the plot
            Plot = CreatePlot();

            // Color map
            ColorHM = new ColorHeatMap(0x80);      // 50% alpha

            Application.Current.Dispatcher.Invoke((Action) delegate
            {
                ColorMapCanvas = ColorHM.GetColorMapLegend(_MinValue, _MaxValue);       // Set the color map canvas
            });
        }
예제 #2
0
        /// <summary>
        /// Initialize the map.
        /// </summary>
        public ShipTrackGmapPlotViewModel()
            : base("Ship Track Plot")
        {
            ColorHM = new ColorHeatMap(0x80);      // 50% alpha

            // Create GMap
            GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerAndCache;

            MapProviderList = new ObservableCollection <GMap.NET.MapProviders.GMapProvider>();
            MapProviderList.Add(GMap.NET.MapProviders.GoogleMapProvider.Instance);
            MapProviderList.Add(GMap.NET.MapProviders.GoogleHybridMapProvider.Instance);
            MapProviderList.Add(GMap.NET.MapProviders.BingMapProvider.Instance);
            MapProviderList.Add(GMap.NET.MapProviders.OpenStreetMapProvider.Instance);
            MapProviderList.Add(GMap.NET.MapProviders.GoogleChinaMapProvider.Instance);
            MapProviderList.Add(GMap.NET.MapProviders.ArcGIS_World_Topo_MapProvider.Instance);
            MapProviderList.Add(GMap.NET.MapProviders.ArcGIS_World_Physical_MapProvider.Instance);
            MapProviderList.Add(GMap.NET.MapProviders.ArcGIS_World_Terrain_Base_MapProvider.Instance);
            MapProviderList.Add(GMap.NET.MapProviders.HereHybridMapProvider.Instance);
            MapProviderList.Add(GMap.NET.MapProviders.LithuaniaMapProvider.Instance);
            _SelectedMapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
            NotifyOfPropertyChange(() => SelectedMapProvider);

            PlotOptionList = new ObservableCollection <string>();
            PlotOptionList.Add(PLOT_OPTION_QUIVER);
            PlotOptionList.Add(PLOT_OPTION_VELOCITY_RECTANGLE);
            PlotOptionList.Add(PLOT_OPTION_BT_RANGE);
            _SelectedPlotOption = PLOT_OPTION_QUIVER;
            NotifyOfPropertyChange(() => SelectedPlotOption);


            _minIndex             = 0;
            _maxIndex             = 0;
            Markers               = new ObservableCollection <GMapMarker>();
            Position              = new PointLatLng();
            Zoom                  = 1;
            _IsPlotWaterLine      = true;
            _IsMarkBadBelowBottom = true;
            _IsUseGpsSpeedBackup  = true;
            _IsLastMarkerEllipse  = false;
            _MagScale             = 75;
            _MinValue             = 0.0;
            _MaxValue             = 2.0;
            _LastMarkerScale      = 10.0;
            NotifyOfPropertyChange(() => MagScale);
            NotifyOfPropertyChange(() => MinValue);
            NotifyOfPropertyChange(() => MaxValue);
            NotifyOfPropertyChange(() => IsPlotWaterLine);
            NotifyOfPropertyChange(() => IsMarkBadBelowBottom);
            NotifyOfPropertyChange(() => IsUseGpsSpeedBackup);
            NotifyOfPropertyChange(() => LastMarkerScale);
            NotifyOfPropertyChange(() => IsLastMarkerEllipse);

            System.Windows.Application.Current.Dispatcher.Invoke((Action) delegate
            {
                ColorMapCanvas = ColorHM.GetColorMapLegend(_MinValue, _MaxValue);       // Set the color map canvas
            });

            // To force shutdown of the GMAP
            //MapView.Manager.CancelTileCaching();

            // Take a Screen Shot
            this.TakeScreenShotCommand = ReactiveCommand.Create(() => TakeScreenShot());
        }