Using the Map Control¶
Use the Map Control to control your map in the Preview. For example, you can zoom and rotate the map, set the map center, control navigation simulation, and save offline map areas and routes.
To open the Map Control, in the Kanzi Studio main menu, select Kanzi Maps > Map Control.
Saving a map location¶
In the Map Control on the Location tab, you can save map locations. By default, the saved locations include New York and San Francisco.
To save a map location:
In the Kanzi Maps main menu, select Map Control.
In the Map Control on the Location tab, click Save/Edit Location.
In the popup window, set:
Name to the name that you want to use for the location
Latitude and Longitude to the latitude-longitude coordinates of the location
Tip
To select the location from a map:
In the Kanzi Maps main menu, select User Preferences, and make sure that the Bing Maps Key is set to your Bing Maps key.
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.
In the location popup, click From Map.
In the Bing Maps dialog either:
Search and select a location from the dropdown.
Double-click anywhere on the map.
Kanzi Maps updates the Latitude and Longitude to the coordinates of the location that you selected.
Close the Bing Maps dialog.
Click Save.
Using offline map tiles¶
You can use the Map Control to generate offline map tiles for demonstration purposes.
Note
The generation of offline map tiles and routes for demos is supported by the Mapbox and TomTom backends. Using offline map data in production is not supported.
Generating offline tiles¶
To generate offline tiles:
In the Kanzi Maps main menu, select Settings.
Go to the Advanced tab and in Offline Tile manager, set:
Folder to the path to the directory where you want to store the offline map tiles
You can use an absolute path or a path relative to the
Application/bin/
directory of your project.Enabled to enabled
Click OK.
The Preview restarts and Kanzi Studio creates a directory for the offline map tiles in the location that you set in the Folder. The directory contains a subdirectory for your backend.
For example,
Application/bin/offlineTiles/Maps.MapboxBackend/
.Make sure that you leave the Preview running.
In the Kanzi Maps main menu, select User Preferences, and make sure that the Bing Maps Key is set to your Bing Maps key.
In Kanzi Studio, you select the offline map area from a Bing Maps map.
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.
In the Kanzi Maps main menu, select Map Control.
Go the Offline Tiles tab and click From Map.
In the Select Area dialog, pan and zoom the map to the area for which you want to store offline map tiles. Click Select Currently Visible Area and close the dialog.
In the Map Control, set the maximum zoom level and name for the offline tile package and click Save.
If the number of tiles to fetch is acceptable, click Yes to accept the tile fetch. Your map account can have a limitation on the the number of tiles to fetch.
Kanzi Maps fetches the tiles and stores them in the directory that you set in the Offline Tile manager Folder.
For example, if you use the default offline tiles directory, use Mapbox, and named you offline tile package LowerManhattan, Kanzi Maps stores the tiles in the Application/bin/offlineTiles/Maps.MapboxBackend/LowerManhattan
directory.
Using offline tiles¶
To use offline tiles:
Delete the cache folder of your map backend.
For example, delete the
Application/bin/mapbox_cache
directory.This way, you make sure that Kanzi Maps does not fetch from the cache any tiles that you did not save as offline tiles.
In the Kanzi Maps main menu, select Settings and on the Advanced tab, enable the Offline Tile manager.
The offline tile manager goes through all packages in the directory that you set in the Offline Tile manager Folder and generates map areas for the available tiles.
To enable the use of the offline tiles, set the Offline mode to enabled in either:
The Settings > Advanced tab.
The Map Control > Control tab.
In the Map Control, you can enable and disable the use of offline tiles while the Preview is running.
(Optional) To restrict the scrolling of the map to the offline map areas, in the Settings or Map Control, set the Offline bounds to enabled.
Using offline routes¶
You can use the Map Control to generate offline routes for demonstration purposes.
Generating offline routes¶
To generate offline routes:
In the Kanzi Maps main menu, select Settings.
Go to the Advanced tab and in Offline Route manager, set:
Folder to the path to the directory where you want to store the offline routes
You can use an absolute path or a path relative to the
Application/bin/
directory of your project.Enabled to enabled
Click OK.
The Preview restarts and Kanzi Studio creates a directory for the offline routes in the location that you set in the Folder. The directory contains a subdirectory for your backend.
For example,
Application/bin/offlineRoutes/Maps.MapboxBackend/
.Make sure that you leave the Preview running.
In the Kanzi Maps main menu, select User Preferences, and make sure that the Bing Maps Key is set to your Bing Maps key.
In Kanzi Studio, you select the offline route from a Bing Maps map.
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.
In the Kanzi Maps main menu, select Map Control and go to the Navigation tab.
On the Navigation tab, click Add/Edit to open the offline route editing dialog.
Click From Map.
Double-click the map to drop a pin for the start point of the route and click Set Start Point.
Double-click the map to drop a pin for the end point of the route and click Set End Point.
Close the map window.
In the Add/Edit dialog, set:
Package to the offline route package in which you want to store this route.
Route to the name that you want to use for this route.
Click Save.
In the Map Control, click Save Offline.
Using offline routes¶
To use offline routes:
In the Kanzi Maps main menu, select Settings and on the Advanced tab, enable Offline Route manager.
The offline route manager goes through all packages in the directory that you set in the Offline Route manager Folder and generates the offline routes.
In the Kanzi Maps main menu, select Map Control and go to the Navigation tab.
On the Navigation tab, select the offline route for which you want to simulate navigation, and click Start/Continue.