Ejemplo n.º 1
0
        public async void OnImageDistanceSliderChanged(IPanoramaViewer panoramaViewer, double distance)
        {
            double           e                   = 0.0;
            MapView          mapView             = MapView.Active;
            Map              map                 = mapView?.Map;
            SpatialReference spatRef             = map?.SpatialReference;
            Unit             unit                = spatRef?.Unit;
            double           factor              = unit?.ConversionFactor ?? 1;
            double           overlayDrawDistance = distance * factor;

            if (Math.Abs(overlayDrawDistance - _constants.OverlayDrawDistance) > e)
            {
                _constants.OverlayDrawDistance = overlayDrawDistance;
                _constants.Save();
            }

            await UpdateVectorLayerAsync();
        }
Ejemplo n.º 2
0
        public async void OnImagePreviewCompleted(IPanoramaViewer panoramaViewer)
        {
            Viewer viewer = _viewerList.GetViewer(panoramaViewer);

            if (viewer != null)
            {
                if (GlobeSpotterConfiguration.AddLayerWfs)
                {
                    await UpdateVectorLayerAsync();

                    MapView          mapView             = MapView.Active;
                    Map              map                 = mapView?.Map;
                    SpatialReference spatRef             = map?.SpatialReference;
                    Unit             unit                = spatRef?.Unit;
                    double           factor              = unit?.ConversionFactor ?? 1;
                    double           overlayDrawDistance = _constants.OverlayDrawDistance / factor;
                    // ToDo: set overlay draw distance to api
                }
            }
        }
Ejemplo n.º 3
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);
                    }
                }
            }
        }