Map Business Online SDK
Getting Started
Map Business Online SDK > Getting Started

What is Map Business Online SDK

Map Business Online SDK features .NET Server API. With Server API you can plot and update data in MBO from any source. The API doesn't require an application window to work with MBO and therefore can be used on a server. Create an instance of Server class to access the API's various methods.

Download and install Map Business Online SDK

Download Map Business Online SDK install package from this page: Download SDK. Run the installer and select a folder where you want to put SDK files. SDK folder has the following structure:

Note that you need a Map Business Online account to download the SDK install package. If you don't have an account yet, please follow this link for registration: Registration

Getting Started with Server API

Here are the steps required to start using Map Business Online Server API.

  1. Create a new Console Application in Visual Studio. Note that you can use this API from server types of projects, for example, in ASP.NET Web Application.
  2. Add reference to the MBO.dll assembly. Choose one that corresponds to the .NET framework you use:
    • .NET Framework 4.0+: <SDK install folder>\Bin\DotNet40\MBO.dll

    MBO.dll depends on other assemblies from Bin folder. When you build the project they will be automatically copied to the output folder.

  3. Add <SDK install folder>\Config\MBO.dll.config file to the root of the project. In the file's Properties window set "Copy to Output Directory" to "Copy Always".
    Note that by default MBO.dll searches for MBO.dll.config file in the same folder where the assembly is located. If you want to change that, you would need to specify the path to the config file in Config.Path property.
  4. For C#. Add the following lines to the using section. Most of the API types are defined in MBO namespace, whereas main Server class is defined in MBO.Server namespace.       
    using MBO;
    using MBO.Server;
    For Visual Basic. In the project's Properties window, on References tab find and check MBO and MBO.Server namespaces in Imported namespaces section.
  5. Add the following code to the Main method:
    '' Create server connection.
    Dim server As Server = New Server(New Credentials("<Your MBO account e-mail>", "<Your MBO account password>"))
    // Create server connection.
    Server server = new Server(new Credentials("<Your MBO account e-mail>", "<Your MBO account password>"));
  6. In the code above replace "<Your MBO account e-mail>" and "<Your MBO account password>" with your real MBO user account credentials.
  7. Now you are ready to call Server methods. For example, you can plot some data on existing map:
    Dim fieldMapping As DatasetFieldMapping = New DatasetFieldMapping()
    With fieldMapping
        .AddressFieldName = "<Address field name>"
        .CityFieldName = "<City field name>"
        .StateProvinceFieldName = "<State field name>"
        .PostalCodeFieldName = "<Postal code field name>"
        .NameFieldName = "<Name field name>"
    End With
    
    server.PlotData("<Map Name>", "<Data file path>", fieldMapping)
    DatasetFieldMapping fieldMapping = new DatasetFieldMapping();
    fieldMapping.AddressFieldName = "<Address field name>";
    fieldMapping.CityFieldName = "<City field name>";
    fieldMapping.StateProvinceFieldName = "<State field name>";
    fieldMapping.PostalCodeFieldName = "<Postal code field name>";
    fieldMapping.NameFieldName = "<Name field name>";
    
    server.PlotData("<Map Name>", @"<Data file path>", fieldMapping);
    Replace <placeholders> with real data. Note that map with specified name must exist in your account in My maps folder.   
  8. Finally build and start the application. After the application has completed its work, open the map in MBO. You will see new dataset on the map! In order to update plotted dataset you can call corresponding UpdateData method.

Samples

Check out samples installed with the SDK by the following paths:

They have a lot of good stuff and demonstrate how to load application, plot data, add a circle shape, run a query of records inside the circle and finally add queried records to route.

Don't forget to replace "<Your MBO account e-mail>" and "<Your MBO account password>" in the samples' code with your real MBO user account credentials.
See Also