Setting up Kanzi Maps

Installing Kanzi Maps

To install Kanzi Maps:

  1. Extract the content of the Kanzi Maps package to the <KanziWorkspace>/Engine/plugins/maps directory.

    If the plugins directory does not exist in <KanziWorkspace>/Engine, create it.

    This way, you install the Kanzi Maps Kanzi Engine plugin that provides the main Kanzi Maps functionality for Kanzi applications.

  2. In the Kanzi Command Prompt, in the <KanziWorkspace>/Engine/plugins/maps/templates directory, run the install_template.bat script:

    install_template.bat
    

    The script installs the Kanzi Maps application template in the <KanziWorkspace>/Templates directory. The Kanzi Maps application template enables you to create a Kanzi Studio project where you use the functionality provided by Kanzi Maps.

  3. Copy all dll files from the <KanziWorkspace>/Engine/plugins/maps/studio_plugin/artifacts/Release directory to the %ProgramData%\Rightware\<KanziVersion>\plugins directory.

    If the plugins directory does not exist in %ProgramData%\Rightware\<KanziVersion>, create it.

    This way, you install the Kanzi Maps Kanzi Studio plugin that provides additional Kanzi Studio tools for Kanzi Maps.

    _images/studio-plugin-dlls.png

Setting up your Kanzi Studio project

To set up your Kanzi Studio project:

  1. Install Kanzi Maps. See Installing Kanzi Maps.

  2. In Kanzi Studio, create a project and in the New Project window, set the Template to Kanzi Maps Application.

    _images/kanzi-maps-application-template.png

    Tip

    To add Kanzi Maps to an existing Kanzi Studio project, in the Kanzi Studio main menu, select Kanzi Maps > Set Up Kanzi Maps.

    _images/set-up-kanzi-maps.png

    Kanzi Studio creates a project that contains:

    • In the Library > Kanzi Engine Plugins, the kzmaps plugin that provides the main Kanzi Maps functionality.

      _images/kzmaps-plugin.png
    • In the main menu, the Kanzi Maps Kanzi Studio plugin menu.

      _images/kanzi-maps-studio-plugin-menu.png

      Tip

      When you download a Kanzi Studio plugin from the internet, Windows can block access to the plugin files, which prevents Kanzi Studio from loading the plugin.

      If the Kanzi Maps Kanzi Studio plugin does not load in Kanzi Studio:

      1. Open the Kanzi Studio log file

        %USERPROFILE%/AppData/Local/Temp/KanziStudioLogs/KanziStudio.log
        
      2. If the log contains this error message:

        Plugin loading failed for: <PathToPlugin>. Error "Unable to load one or more of the requested types."

        Open Windows PowerShell in the plugin directory, and execute this command:

        Get-ChildItem . -Recurse | Unblock-File
        

        This way you unblock all the files in the directory.

      3. Restart Kanzi Studio.

    • In the Node Tree, a Map View node. See Using the Map View node.

      A Map View node is the root of a Kanzi Maps map. For example, the Map View node defines the size, geographic location, and zoom level of a map.

      _images/map-view-node.png
  3. When Kanzi Studio asks if you want to set credentials for the map backend, click Yes. In Kanzi Maps settings on the General tab in Access token, click Add, and paste your access token to the Key field.

    For example, create a Mapbox access token at https://www.mapbox.com/ and paste that token.

    _images/access-token-key1.png
  4. Select Kanzi Maps > User Preferences, and set:

    _images/kanzi-maps-user-preferences-menu.png _images/user-preferences-installation-directory.png

See also

Tutorial: Getting started with Kanzi Maps

Working with …

Using the Map View node

Using the Map Control