public GlobeSpotter()
        {
            InitializeComponent();
            _apiKey               = ApiKey.Instance;
            _settings             = FileSettings.Instance;
            _constants            = ConstantsViewer.Instance;
            _historicalRecordings = HistoricalRecordings.Instance;

            _login = FileLogin.Instance;
            _login.PropertyChanged += OnLoginPropertyChanged;

            _configuration = FileConfiguration.Instance;
            _configuration.PropertyChanged += OnConfigurationPropertyChanged;

            _openNearest          = new List <string>();
            _crossCheck           = null;
            _lastSpatialReference = null;
            _layers           = new List <CycloMediaLayer>();
            _startOpenNearest = false;

            GetVectorLayerListAsync();
            ModuleGlobeSpotter globeSpotterModule = ModuleGlobeSpotter.Current;

            _viewerList           = globeSpotterModule.ViewerList;
            _measurementList      = globeSpotterModule.MeasurementList;
            _cycloMediaGroupLayer = globeSpotterModule.CycloMediaGroupLayer;
            Initialize();
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string imageId = value as string;
            var    image   = new Bitmap(80, 20);

            if (parameter != null)
            {
                string strParameter = parameter.ToString();
                float  fontSize     = float.Parse(strParameter);

                ModuleGlobeSpotter globeSpotter = ModuleGlobeSpotter.Current;
                ViewerList         viewerList   = globeSpotter.ViewerList;
                Viewer             thisViewer   = viewerList.Get(imageId);
                Color color = thisViewer?.Color ?? Color.Gray;
                Brush brush = new SolidBrush(Color.FromArgb(255, color));

                using (var sf = new StringFormat())
                {
                    using (var ga = Graphics.FromImage(image))
                    {
                        ga.Clear(Color.Transparent);
                        Rectangle rectangle = new Rectangle(2, 2, 76, 16);
                        ga.DrawRectangle(new Pen(Brushes.Black, 1), rectangle);
                        ga.FillRectangle(brush, rectangle);
                        sf.Alignment = StringAlignment.Center;
                        Font font = new Font("Arial", fontSize);
                        ga.DrawString(imageId, font, Brushes.Black, rectangle, sf);
                    }
                }
            }

            return(image.ToBitmapSource());
        }
        protected StreetSmart()
        {
            ProjectClosedEvent.Subscribe(OnProjectClosed);
            _currentDispatcher = Dispatcher.CurrentDispatcher;
            _inRestart         = false;
            _inClose           = false;

            _apiKey    = ApiKey.Instance;
            _settings  = Settings.Instance;
            _constants = ConstantsViewer.Instance;

            _login = Login.Instance;
            _login.PropertyChanged += OnLoginPropertyChanged;

            _configuration = FileConfiguration.Instance;
            _configuration.PropertyChanged += OnConfigurationPropertyChanged;

            _openNearest                  = new List <string>();
            _crossCheck                   = null;
            _lastSpatialReference         = null;
            _configurationPropertyChanged = new List <string>();

            GetVectorLayerListAsync();

            ModulestreetSmart streetSmartModule = ModulestreetSmart.Current;

            _viewerList           = streetSmartModule.ViewerList;
            _measurementList      = streetSmartModule.MeasurementList;
            _cycloMediaGroupLayer = streetSmartModule.CycloMediaGroupLayer;

            Initialize();
        }
        public VectorLayer(FeatureLayer layer, VectorLayerList vectorLayerList)
        {
            _vectorLayerList    = vectorLayerList;
            Layer               = layer;
            _settings           = Settings.Instance;
            Overlay             = null;
            _selection          = null;
            _updateMeasurements = false;

            StreetSmartModule streetSmart = StreetSmartModule.Current;

            _viewerList      = streetSmart.ViewerList;
            _measurementList = streetSmart.MeasurementList;
            _ci = CultureInfo.InvariantCulture;
        }
Exemplo n.º 5
0
        public void Dispose()
        {
            _disposeInnerLine?.Dispose();
            _disposeOuterLine?.Dispose();
            Viewer = null;
            GlobeSpotter globeSpotter = GlobeSpotter.Current;
            ViewerList   viewerList   = globeSpotter.ViewerList;

            // event listeners
            MapViewCameraChangedEvent.Unsubscribe(OnMapViewCameraChanged);
            viewerList.ViewerAdded            -= OnViewerAdded;
            viewerList.ViewerRemoved          -= OnViewerRemoved;
            viewerList.ViewerMoved            -= OnViewerMoved;
            _measurementPoint.PropertyChanged -= OnPropertyMeasurementPointChanged;
            PropertyChanged -= OnPropertyMeasurementObservationChanged;
        }
        public VectorLayer(FeatureLayer layer, VectorLayerList vectorLayerList)
        {
            _vectorLayerList         = vectorLayerList;
            Layer                    = layer;
            _settings                = Settings.Instance;
            _storedLayerList         = StoredLayerList.Instance;
            _isVisibleInGlobespotter = _storedLayerList.Get(Layer?.Name ?? string.Empty);
            LayerId                  = null;
            _selection               = null;
            _updateMeasurements      = false;

            GlobeSpotter globeSpotter = GlobeSpotter.Current;

            _viewerList      = globeSpotter.ViewerList;
            _measurementList = globeSpotter.MeasurementList;
            _ci = CultureInfo.InvariantCulture;
        }
Exemplo n.º 7
0
        public MeasurementObservation(MeasurementPoint measurementPoint, string imageId, MapPoint observationPoint, Bitmap match, double xDir, double yDir)
        {
            XDir = xDir;
            YDir = yDir;
            _measurementPoint = measurementPoint;
            ImageId           = imageId;
            Point             = observationPoint;
            Match             = match;
            GlobeSpotter globeSpotter = GlobeSpotter.Current;
            ViewerList   viewerList   = globeSpotter.ViewerList;

            Viewer = viewerList.Get(imageId);

            // event listeners
            _measurementPoint.PropertyChanged += OnPropertyMeasurementPointChanged;
            PropertyChanged += OnPropertyMeasurementObservationChanged;
            MapViewCameraChangedEvent.Subscribe(OnMapViewCameraChanged);
            viewerList.ViewerAdded   += OnViewerAdded;
            viewerList.ViewerRemoved += OnViewerRemoved;
            viewerList.ViewerMoved   += OnViewerMoved;
        }
Exemplo n.º 8
0
        public StreetSmart()
        {
            InitializeComponent();
            _settings  = FileSettings.Instance;
            _constants = ConstantsViewer.Instance;

            _login = FileLogin.Instance;

            _configuration = FileConfiguration.Instance;

            _openNearest          = new List <string>();
            _crossCheck           = null;
            _lastSpatialReference = null;
            _layers           = new List <CycloMediaLayer>();
            _startOpenNearest = false;

            GetVectorLayerListAsync();
            ModulestreetSmart streetSmartModule = ModulestreetSmart.Current;

            _viewerList           = streetSmartModule.ViewerList;
            _measurementList      = streetSmartModule.MeasurementList;
            _cycloMediaGroupLayer = streetSmartModule.CycloMediaGroupLayer;
        }
Exemplo n.º 9
0
        public async Task CreateMeasurement(ArcGISGeometryType geometryType)
        {
            if (Api != null)
            {
                MeasurementGeometryType measurementGeometryType = MeasurementGeometryType.Unknown;

                switch (geometryType)
                {
                case ArcGISGeometryType.Point:
                    if (GlobeSpotterConfiguration.MeasurePoint)
                    {
                        measurementGeometryType = MeasurementGeometryType.Point;
                    }

                    break;

                case ArcGISGeometryType.Polyline:
                    if (GlobeSpotterConfiguration.MeasureLine)
                    {
                        measurementGeometryType = MeasurementGeometryType.LineString;
                    }

                    break;

                case ArcGISGeometryType.Polygon:
                    if (GlobeSpotterConfiguration.MeasurePolygon)
                    {
                        measurementGeometryType = MeasurementGeometryType.Polygon;
                    }

                    break;
                }

                if (measurementGeometryType != MeasurementGeometryType.Unknown)
                {
                    ModulestreetSmart streetSmartModule = ModulestreetSmart.Current;
                    ViewerList        viewerList        = streetSmartModule.ViewerList;
                    IPanoramaViewer   panoramaViewer    = viewerList.ActiveViewer;

                    if (panoramaViewer != null)
                    {
                        if (Count == 0)
                        {
                            Measurement measurement = new Measurement(null, null, DrawPoint, Api)
                            {
                                ObjectId    = _lastObjectId,
                                VectorLayer = _lastVectorLayer
                            };

                            Add(new Guid().ToString(), measurement);
                            measurement.Open();
                        }

                        //if (_lastSketch)
                        //{
                        Measurement measurement2 = this.ElementAt(0).Value;
                        measurement2.VectorLayer = _lastVectorLayer;
                        measurement2.SetSketch();
                        //}

                        IMeasurementOptions options = MeasurementOptionsFactory.Create(measurementGeometryType);
                        Api.StartMeasurementMode(panoramaViewer, options);
                    }
                }
            }
        }