AddressSettingsFactory Class

Factory for create address settings to use for address searches

Definition

Namespace: StreetSmart.Common.Factories
Assembly: StreetSmart.WinForms (in StreetSmart.WinForms.dll) Version: 24.7.0.0+cc0a01953d1235087ce28d3e921f5bb47d3c0460
C#
public static class AddressSettingsFactory
Inheritance
Object    AddressSettingsFactory

Example

This sample shows how to use the AddressSettingsFactory.
C#
using System;
using StreetSmart.Common.Factories;
using StreetSmart.Common.Interfaces;

namespace Demo
{
  public class Example
  {
    private IStreetSmartAPI _api;
    private System.Windows.Forms.Panel _plStreetSmart = new System.Windows.Forms.Panel();

    public void StartAPI()
    {
      _api = StreetSmartAPIFactory.Create();
      _api.APIReady += OnAPIReady;
      plStreetSmart.Controls.Add(_api.GUI);
    }

    private void OnAPIReady(object sender, EventArgs args)
    {
      // Create a address settings that are used in the application
      string locale = "nl";
      string database = "CMDatabase";
      IAddressSettings addressSettings = AddressSettingsFactory.Create(locale, database);

      // The dom element within the api must be rendered.
      IDomElement element = DomElementFactory.Create();

      // The initialisation options of the api
      // The address settings are used in the initialization of the api.
      IOptions options = OptionsFactory.Create("myUsername", "myPassword", "myAPIKey", "EPSG:28992", addressSettings, element, 1);

      // Initialize the api.
      await _api.Init(options);
    }
  }
}

Methods

Create(String) Create address settings to use for address searches, based on the current culture settings and the address database.
Create(String, String) Create address settings to use for address searches, based on the locale string and the address database.

Version Information

Supported in: 18.7

See Also