Setting up Kanzi Maps¶
Installing Kanzi Maps¶
To install Kanzi Maps:
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.
In the Kanzi Command Prompt, in the
<KanziWorkspace>/Engine/plugins/maps/templates
directory, run theinstall_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.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.
Setting up your Kanzi Studio project¶
To set up your Kanzi Studio project:
Install Kanzi Maps. See Installing Kanzi Maps.
In Kanzi Studio, create a project and in the New Project window, set the Template to Kanzi Maps Application.
Tip
To add Kanzi Maps to an existing Kanzi Studio project, in the Kanzi Studio main menu, select Kanzi Maps > Set Up Kanzi Maps.
Kanzi Studio creates a project that contains:
In the Library > Kanzi Engine Plugins, the kzmaps plugin that provides the main Kanzi Maps functionality.
In the main menu, the Kanzi Maps Kanzi Studio plugin menu.
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:
Open the Kanzi Studio log file
%USERPROFILE%/AppData/Local/Temp/KanziStudioLogs/KanziStudio.log
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.
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.
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.
Select Kanzi Maps > User Preferences, and set:
Kanzi Maps Installation Directory to the
<KanziWorkspace>/Engine/plugins/maps
directory(Optional) Bing Maps Key to your Bing Maps key
The Map Control Kanzi Studio tool uses Bing Maps to enable you to pick locations and areas from a map. See Using the Map Control.
To learn how to create a Bing Maps key, see https://docs.microsoft.com/en-us/bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key.