MeasurementOptionsFactory Class
Factory for create measurement options which are used to create a measurement. We need the measurement options object to create a measurement.
Namespace: StreetSmart.Common.FactoriesAssembly: StreetSmart.WinForms (in StreetSmart.WinForms.dll) Version: 24.7.0.0+cc0a01953d1235087ce28d3e921f5bb47d3c0460
public static class MeasurementOptionsFactory
- Inheritance
- Object MeasurementOptionsFactory
This sample uses the
MeasurementOptionsFactory, to show how you can start a line measurement in a cyclorama.
using System.Collections.Generic;
using StreetSmart.Common.Factories;
using StreetSmart.Common.Interfaces;
namespace Demo
{
public class Example
{
private IStreetSmartAPI _api;
// Todo: Add a function to initialize the api.
private async void OpenImageAndStartMeasurement()
{
// The open viewer options for open a new panorama viewer in EPSG:28992.
IViewerOptions viewerOpt = ViewerOptionsFactory.Create(new List<ViewerType> { ViewerType.Panorama }, "EPSG:28992");
// open a panorama viewer
IList<IViewer> viewers = await _api.Open("Boschdijk 7, Eindhoven", viewerOpt);
if (viewers.Count == 1)
{
// Get the panorama viewer object
IPanoramaViewer viewer = (IPanoramaViewer)viewers[0];
// The geometry type of the measurement
MeasurementGeometryType geometryType = MeasurementGeometryType.LineString;
// Create a measurement options object
IMeasurementOptions measurementOptions = MeasurementOptionsFactory.Create(geometryType);
// Start line measurement in the opened viewer
_api.StartMeasurementMode(viewer, measurementOptions);
}
}
}
}
Supported in: 18.7