Skip to content

Creating a map

Timofei Pushkin edited this page May 30, 2026 · 3 revisions

This page describes how to create a new map for DepNav and add it into the app.

Prerequisites

You are expected to have these on your hands:

  1. A set of images with floor schemes comprising the map. For convenience the images should be in WebP format and have the same dimensions divisible on square tiles of some size (e.g. 256x256, this is configurable).
  2. An image to be used as a logo, preferably in a vector format.

Step 1: create map tiles

In DepNav maps consist of "floors" split on tiles with several zoom levels — so-called tile pyramids. The pyramids are stored in app/src/main/assets/tiles as $MAP_NAME/floor$FLOOR_NUM/$ZOOM_LEVEL/$ROW/$COLUMN.webp where $MAP_NAME can be arbitrary, $FLOOR_NUM starts from 1, $ZOOM_LEVEL, $ROW and $COLUMN start from 0.

The easiest way to obtain such pyramids is to use tools/create_tiles.sh — the usage instructions are written inside the file, on Windows you will need WSL to run it. The script will generate a pyramid for each floor, you need to place them in the assets directory as specified above (e.g. app/src/main/assets/tiles/test-map/floor1/$ZOOM_LEVEL/$ROW/$COLUMN.webp).

Step 2: add your map's logo

Use Android Studio's Resource Manager to import your map's logo. The resource must be named logo_$MAP_NAME with hyphens replaced with underscores (e.g. logo_test_map) and be of type drawable.

Step 3: add your map to app's database

DepNav uses an SQLite database to store map descriptions. It is auto-generated during build from the latest database schema (also auto-generated, from code) and map descriptions in JSON format.

To add a map to the database:

  1. Create a JSON file in app/maps/infos and fill it in accordance with app/maps/map-info-schema.json.
    • The schema provides descriptions for each field you need to fill, you can configure Android Studio to help you follow the schema
    • Existing JSONs can serve as examples
    • Internal map name you specify in the JSON must be $MAP_NAME you used in the previous steps (test-map in the examples above)
  2. Increment database version.
    • Without this the database will not update automatically on devices which already have DepNav installed.
  3. Re-build DepNav.
    • Besides the database, a new database schema will be generated in app/schemas — it should be included in version control

Clone this wiki locally