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.

../_images/map-control-menu.png

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.

../_images/map-control-default-locations.png

To save a map location:

  1. In the Kanzi Maps main menu, select Map Control.

  2. In the Map Control on the Location tab, click Save/Edit Location.

    ../_images/map-control-save-location.png
  3. 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:

      1. 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.

      2. In the location popup, click From Map.

        ../_images/location-from-map.png
      3. 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.

        ../_images/bing-maps-search.png
      4. Close the Bing Maps dialog.

    Click Save.

    ../_images/map-control-save-san-diego.png

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:

  1. In the Kanzi Maps main menu, select Settings.

    ../_images/kanzi-maps-settings-menu.png
  2. 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.

    ../_images/settings-offline-tile-manager.png
  3. 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.

    ../_images/kanzi-maps-user-preferences-menu.png ../_images/user-preferences-bing-map-key.png
  4. In the Kanzi Maps main menu, select Map Control.

    ../_images/map-control-menu.png
  5. Go the Offline Tiles tab and click From Map.

    ../_images/map-control-offline-tiles-from-map.png
  6. 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.

    ../_images/bing-map-select-currently-visible-area.png
  7. In the Map Control, set the maximum zoom level and name for the offline tile package and click Save.

    ../_images/map-control-save-offline-tiles.png
  8. 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:

  1. 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.

  2. 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.

    ../_images/settings-offline-tile-manager-enabled.png
  3. To enable the use of the offline tiles, set the Offline mode to enabled in either:

    • The Settings > Advanced tab.

      ../_images/settings-offline-mode-enabled.png
    • The Map Control > Control tab.

      In the Map Control, you can enable and disable the use of offline tiles while the Preview is running.

      ../_images/map-control-enable-offline-mode.png
  4. (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.

    ../_images/map-control-enable-offline-bounds.png

Using offline routes

You can use the Map Control to generate offline routes for demonstration purposes.

Generating offline routes

To generate offline routes:

  1. In the Kanzi Maps main menu, select Settings.

    ../_images/kanzi-maps-settings-menu.png
  2. 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.

    ../_images/settings-offline-route-manager.png
  3. 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.

    ../_images/kanzi-maps-user-preferences-menu.png ../_images/user-preferences-bing-map-key.png
  4. In the Kanzi Maps main menu, select Map Control and go to the Navigation tab.

    ../_images/map-control-menu.png
  5. On the Navigation tab, click Add/Edit to open the offline route editing dialog.

    ../_images/map-control-add-offline-route.png
  6. Click From Map.

    ../_images/map-control-offline-route-from-map.png
  7. Double-click the map to drop a pin for the start point of the route and click Set Start Point.

    ../_images/offline-route-set-start-point.png
  8. Double-click the map to drop a pin for the end point of the route and click Set End Point.

    ../_images/offline-route-set-end-point.png
  9. Close the map window.

  10. 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.

    ../_images/map-control-name-offline-route.png
  11. In the Map Control, click Save Offline.

    ../_images/map-control-save-offline-route.png

Using offline routes

To use offline routes:

  1. 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.

    ../_images/settings-offline-route-manager.png
  2. In the Kanzi Maps main menu, select Map Control and go to the Navigation tab.

    ../_images/map-control-menu.png
  3. On the Navigation tab, select the offline route for which you want to simulate navigation, and click Start/Continue.

    ../_images/map-control-offline-route-start.png

See also

Using offline maps in demos