Offline maps

Offline maps are map layers installed in CyberTracker and SMART Mobile. They are used on the Map page and, with the exception of WMS layers, do not require a network connection.

A map package is a zip file holding one or more layers. A package may also carry a place lookup — geometry plus content that answers the question “the user tapped at (x, y) — what content applies here?”.

Table of Contents

1. Map packages

A map package is a zip file with all files at the archive root — there is no enclosing directory inside the archive.

Map layers are used from the Map Layers page. The Zoom to will zoom to the entire extent of a layer:

1.1 Simple: layers in a zip file

In its simplest form, a package is just a zip of layer files. The runtime discovers and installs every layer it recognizes — no manifest required. See this sample.

Many layer formats use multiple files sharing a basename (for example, a shapefile uses .shp, .shx, .dbf and .prj). All companion files must be at the root of the zip.

Supported layer formats:

  • ESRI: shapefile (.shp), tile package (.tpk), vector tiles package (.vtpk)
  • ASRP/USRP
  • CIB1, 5, 10
  • DTED0, 1, 2
  • GeoTIFF, HFA, HRE, IMG
  • JPEG, JPEG 2000
  • NITF
  • PNG
  • RPF
  • SRTM1, 2
  • Mosaic Dataset in SQLite (read-only)
  • MapBox: .mbtiles
  • Google: .kml
  • GeoJSON

WMS layers

Web Map Service layers are added to a package by dropping a JSON file with extension .wms into the zip. Although these layers are online, they are configured through the offline map system. They are drawn live from the server, so they need a network connection and nothing is stored for offline use.

{
  "layer": "0",
  "service": "https://basemap.nationalmap.gov/arcgis/services/USGSHydroCached/MapServer/WMSServer"
}
Field Type Purpose
layer string Required. The layer’s <Name> exactly as the service publishes it.
service string Required. The WMS endpoint URL, without a query string or trailing ?.

Rules for a .wms file:

  • The file is a single JSON object. It is not wrapped in an array (unlike layers.json, which is an array).
  • Each file describes one layer. To add several WMS layers, add several .wms files with different names and list each in layers.json.
  • A file that is not a JSON object, or that is missing layer or service, is not loaded.

Finding the layer name. Open the service’s capabilities document by adding ?SERVICE=WMS&REQUEST=GetCapabilities to the service URL, and copy the <Name> of the layer you want. Use the <Name>, not the <Title>: names are often short codes such as 0 or by_dtk25, and they differ from one service to the next. A name the service does not publish loads without error but draws nothing.

Coordinate system. The map uses Web Mercator, so the service should list EPSG:3857 among its coordinate systems in the same document.

Scale limits. Many services only draw a layer within a range of map scales, published as MinScaleDenominator and MaxScaleDenominator (or ScaleHint) in the capabilities document. Outside that range the server returns an empty image and the layer appears blank. For example, the Bavarian 1:25,000 topographic map below is only drawn between 1:500 and 1:75,000, so it is invisible until the map is zoomed in to about town level:

{
  "layer": "by_dtk25",
  "service": "https://geoservices.bayern.de/od/wms/dtk/v1/dtk25"
}

If a WMS layer shows nothing, check in this order: the device is online, the layer is switched on in the Map Layers page, the map is inside the area the service covers, and the map is zoomed in far enough to be within the service’s scale limits.

1.2 Adding a layers.json

When draw order, opacity, layer names or place-lookup participation matter, add a top-level JSON array of layer objects to the zip:

[
  {
    "filename": "Gabon.mbtiles",
    "names": { "default": "Gabon", "fr": "Gabon", "pt-BR": "Gabão" },
    "active": true,
    "opacity": 1.0
  },
  {
    "filename": "Country.shp",
    "name": "World countries",
    "active": true,
    "opacity": 0.5
  }
]
Field Type Purpose
filename string A filename in the zip belonging to the layer — typically the primary display file (.geojson, .shp, .mbtiles, .tif, .kml, .wms, etc.). The runtime takes the basename to locate companion files.
name string Human-readable layer name shown in the UI. Not needed when names is present.
names object Layer name per language, keyed by BCP 47 tag (en, fr, pt-BR), with an optional default entry. Use either name or names.
active boolean Whether the layer is visible when the package is first loaded.
opacity number Optional layer opacity from 0.0 (transparent) to 1.0 (opaque).
lookup boolean Whether the layer participates in place lookup.
symbol object Optional symbol description for vector layers (see §1.3).

The app shows the names entry for its current language. When there is no exact match it takes the closest language (pt-PT finds pt-BR, fr-CA finds fr), then default, then the first entry. Keys are matched case-insensitively. If both name and names are given, name is only used when names is empty. Changing the app language updates layer names without reinstalling the package.

If layers.json is absent, the runtime discovers layers from the archive files directly.

1.3 Symbols for shape files

A symbol field on a layers.json entry styles a shape file layer. It describes the point, line or area symbol, and can carry a nested label that draws text from an attribute field.

Point

marker-style is one of circle, cross, diamond, square, triangle, x:

{
  "marker-style": "circle",
  "marker-size": 5.5,
  "marker-color": "#ffff00",
  "outline-color": "#ff0000"
}

Line

stroke-style is one of solid, dash, dashdot, dashdotdot, dot:

{
  "stroke-style": "dashdot",
  "stroke-size": 4.4,
  "stroke-color": "#ffff00"
}

Area

outline-symbol is optional.
fill-style is one of none, solid, horizontal, vertical, forwardDiagonal, backwardDiagonal, cross, diagonalCross:

{
  "fill-style": "solid",
  "fill-color": "#ff00ff",
  "outline-symbol": {
    "stroke-style": "dashdot",
    "stroke-size": 1.0,
    "stroke-color": "#ffff00"
  }  
}

Label

A label object nested inside symbol draws a text label from one of the shape file’s attribute fields. It is additive — it renders in addition to the point, line or area symbol, so a single symbol can both draw a marker and label it. Labelling works for point, line and area shape files; the runtime places the text automatically (near points, along lines, centered in polygons).

{
  "marker-style": "circle",
  "marker-color": "#ff0000",
  "label": {
    "field": "CAPITAL",
    "color": "#000000",
    "size": 10,
    "halo-color": "#ffffff",
    "halo-size": 1,
    "placement": "above-center"
  }
}
Field Type Purpose
field string Required. Name of the attribute (.dbf) field whose value is drawn. If empty or missing, no label is drawn.
color string Text color. Default #000000.
size number Base text size. Default 10. Scaled by the app’s global font-size setting, so it stays consistent with the rest of the UI.
halo-color string Color of the outline drawn around the text for legibility. Default #ffffff.
halo-size number Halo thickness. Default 1.
placement string Position relative to a point feature: center, center-left, center-right, above-center, above-left, above-right, below-center, below-left, below-right. Default above-center. Ignored for lines and areas.
xoffset number Horizontal text offset. Default 0.
yoffset number Vertical text offset. Default 0.

2. Adding a package.json

package.json identifies the package as a whole. This ensures that new packages properly replace old packages during update.

{
  "id": "org.my.package.id",
  "name": "Maps of the world",
  "version": "2026.04.21",
  "language": "en"
}
Field Type Purpose
id string Stable package identifier. The runtime uses it for deduplication.
name string [Optional] Human-readable package name.
version string [Optional] Package version. Versions are compared lexically — choose values whose string ordering gives the intended semantic ordering (e.g. ISO-style 2026.04.21, or zero-padded numeric).
language string [Optional] Language the package’s own strings are written in, such as en or mn. Other languages ship in the same package as translation catalogs (§3.3).

When package.json is present, the runtime uses id to decide whether an installed package should be replaced.

3. Place lookup

A place lookup answers:

the user selected or tapped at (x, y) — what content applies here?

A layer participates by setting lookup: true in its layers.json entry and shipping companion files with the same basename in the same zip:

  • Lookup geometry — polygons and multi-polygons, from one of two sources:
    • Shapefile: <basename>.shp, <basename>.shx, <basename>.dbf and optionally <basename>.prj
    • GeoJSON: <basename>.geojson
  • <basename>.json — renderable content
  • strings.<locale>.json at the zip root — optional translation catalog shared by all lookup layers (§3.3)

Pick the geometry source that fits the layer:

Source Drawn on the map Typical use
Shapefile Yes — the same file is the display layer and the lookup geometry, styled with symbol like any other shapefile. Boundaries the user should see: protected areas, zones, administrative regions.
GeoJSON No — GeoJSON polygons are not rendered, so the layer is invisible. Lookup geometry that has no need to be visible: a world polygon, a hemisphere split.

A shapefile lookup bundle is shape.shp, shape.shx, shape.dbf, shape.prj and shape.json; a GeoJSON lookup bundle is shape.geojson and shape.json. There is no need to ship both. If both are present, the shapefile is used.

Triggering a lookup

Once a package with lookup: true layers is loaded, there are three ways to trigger a lookup:

  1. Long press on the map — A magnifying glass appears, allowing a precise location.
  2. Menu button — Tap the ... button in the lower right corner of the map page. This uses the current location.
  3. SMART patrol or survey — During a patrol or survey, the control popup includes a lookup button. This uses the last known location.

After triggering, a navigation page appears for browsing the matched content:

The top-left back button returns to the prior page; the title-bar back button returns to the prior lookup page.

Lookup geometry — the join key

The lookup geometry is the file the point-in-polygon test runs against. Each polygon that contains the point contributes its featureId, and the content file’s filter.featureIds (§3.1) is evaluated against the matched ids. The content file is written the same way for either source.

Scenario A: shapefile geometry

The shapefile must have an attribute field named featureId (a fid field is accepted if there is no featureId). Field names are matched case-insensitively. Text fields are recommended; numeric fields work and are matched as their string form, so 12 is the id "12". A .prj is honored if present; without one the shapefile is assumed to be WGS84.

Scenario B: GeoJSON geometry

Each feature used for matching must carry a property named featureId inside properties:

{
  "type": "Feature",
  "properties": {
    "featureId": "country:MN",
    "name": "Mongolia"
  },
  "geometry": { "type": "Polygon", "coordinates": [[ ... ]] }
}

The property name is matched case-insensitively (a fid property is accepted if there is no featureId), and a numeric value is treated as its string form. The standard top-level GeoJSON id field is not used. Only Polygon and MultiPolygon geometries are tested.

featureId is an opaque string; conventional namespacing (country:MN, region:MN-073, world) keeps ids legible across packages but is not required.

Content JSON structure

The companion <basename>.json looks like this:

{
  "content": {
    "id": "Seasons",
    "language": "en",
    "defaultLocale": "en-US"
  },
  "datasets": [ ... ]
}

content fields:

Field Type Purpose
id string Stable identifier for this content file.
language string Language identifier such as en or mn.
defaultLocale string Optional locale identifier such as en-US or mn-MN.

datasets is an ordered array. Each dataset has:

  • id — stable identifier.
  • filter — when this dataset applies (see §3.1 and §3.2).
  • rows — non-empty ordered array of renderable rows.

Datasets render in declaration order; multiple matching datasets in the same content file all contribute their rows.

A row has:

  • path — full browse path shown in the UI (array of strings, parent-to-child). The path strings define the navigation hierarchy; translations (§3.3) change only the labels shown.
  • view — renderable content (see Views below).
  • optional filter to override the dataset-level filter at row scope.

Views

A view is the renderable content of a row:

Field Required Notes
title yes Short heading.
subtitle no Optional secondary heading.
name no Optional short label used in browse lists when distinct from title.
blocks yes Non-empty ordered array of render blocks.

Six block types are defined; consumers should silently skip blocks of unknown types. Every block accepts an optional label; for attributes blocks the label is required.

Block type Purpose
body Large text content (format: text, html, or markdown).
attributes Labelled list of label/value pairs.
web Embedded web view; the runtime substitutes <latitude> and <longitude> tokens in value.
image Embedded image (source URL).
link Clickable link (link target, text visible).
notice Highlighted callout (tone: note, important, caution, restriction).

Block samples:

{ 
  "type": "body", 
  "label": "Details", 
  "format": "html",
  "value": "<p>The purpose of this law is to regulate ...</p>" 
}

Format should be html for rich text and html. For plain text, leave blank.

{ 
  "type": "attributes", 
  "label": "Penalties",
  "items": [
    { "label": "Fine Min", "format": "text", "value": "900000" },
    { "label": "Fine Max", "format": "text", "value": "10800000" },
    { "label": "Currency", "format": "text", "value": "Tugrik-MNT" }
  ]
}
{ 
  "type": "web", 
  "label": "More info",
  "url": "https://wttr.in/<latitude>,<longitude>?0",
  "orientation": "landscape" 
}
{ 
  "type": "image", 
  "label": "Photo", 
  "source": "https://example.org/image.jpg" 
}
{ 
  "type": "link", 
  "label": "Reference",
  "url": "https://example.org/regulation",
  "text": "View full regulation" 
}
{ 
  "type": "notice", 
  "label": "Important", 
  "tone": "restriction",
  "text": "Hunting is prohibited in this zone." 
}

Tone can be note, important, caution, restriction.

Runtime lookup flow

  1. Identify layers whose layers.json entries have lookup: true
  2. For each such layer, locate the lookup geometry (<basename>.shp if present, otherwise <basename>.geojson) and <basename>.json
  3. Run the point-in-polygon test against the geometry
  4. Collect each selected feature’s featureId (the .dbf column or the GeoJSON property)
  5. Load the companion content JSON and, if present, the translation catalogs for the current language (§3.3)
  6. Evaluate every dataset’s filter.featureIds against the selected ids (§3.1)
  7. If the runtime has an active date/time filter, evaluate filter.when (§3.2)
  8. Render the matching rows in declaration order, translating display strings through the catalogs

3.1 Filter by feature

filter.featureIds is an array of strings matched against the featureId of the selected feature(s) in the lookup geometry. The dataset applies if any element matches. The wildcard ["*"] matches any selected feature.

{ "featureIds": ["country:MN", "region:MN-073"] }

If neither the wildcard nor the matched feature’s id appears in featureIds, the dataset is skipped.

Sample

A minimal one-feature world weather package. The companion weather.geojson:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": { "featureId": "world" },
      "geometry": {
        "type": "Polygon",
        "coordinates": [[
          [-180.0, -90.0], [180.0, -90.0], [180.0, 90.0], [-180.0, 90.0], [-180.0, -90.0]
        ]]
      }
    }
  ]
}

The companion weather.json:

{
  "content": {
    "id": "weather-en",
    "language": "en",
    "defaultLocale": "en-US"
  },
  "datasets": [
    {
      "id": "world-weather",
      "filter": { "featureIds": ["world"] },
      "rows": [
        {
          "path": ["Weather"],
          "view": {
            "title": "Local weather",
            "subtitle": "wttr.in",
            "blocks": [
              { "type": "notice", "label": "Note", "tone": "note",
                "text": "Open the embedded view for live conditions at the tapped location." },
              { "type": "web",
                "value": "https://wttr.in/<latitude>,<longitude>?0",
                "orientation": "portrait" }
            ]
          }
        }
      ]
    }
  ]
}

3.2 Filter by time range

filter.when is optional. When present, both start and end are required RFC 3339 date-times:

Field Required Notes
start yes RFC 3339 date-time.
end yes RFC 3339 date-time.

Default time behavior:

  • If the runtime has no active date/time, datasets are not filtered by time.
  • If the runtime has an active date/time, filter.when decides whether the dataset overlaps the selected range.

To express disjoint windows (e.g. winter as Dec–Feb of every year), emit multiple datasets that share the same featureIds. Datasets without when are always eligible from a time perspective.

Sample

A spring-in-the-northern-hemisphere dataset:

{
  "id": "northern-spring",
  "filter": {
    "featureIds": ["hemisphere:north"],
    "when": {
      "start": "2026-03-01T00:00:00Z",
      "end":   "2026-05-31T23:59:59Z"
    }
  },
  "rows": [
    {
      "path": ["Northern Hemisphere", "Spring"],
      "view": {
        "title": "Spring in the Northern Hemisphere",
        "subtitle": "March – May",
        "blocks": [
          { "type": "body", "label": "Description", "format": "text",
            "value": "Days lengthen, temperatures rise, plants leaf out." }
        ]
      }
    }
  ]
}

A localized example with a fixed event window:

{
  "filter": {
    "featureIds": ["country:MN"],
    "when": {
      "start":    "2026-07-11T00:00:00+08:00",
      "end":      "2026-07-15T23:59:59+08:00"
    }
  }
}

3.3 Translations

A content file is written once, in one language, and stays the single source of truth for structure and logic. Other languages are supplied as translation catalogs: flat JSON files that map each original display string to its translation. The original string is both the lookup key and the fallback text, so nothing is added to the content file and no per-language copies exist.

Catalog files

A package carries one catalog per locale, strings.<locale>.json, in the zip root. It covers every content file in the package:

  • regions.json, zones.json — canonical content, including all logic and the default strings
  • strings.fr.json — French
  • strings.fr-CA.json — Canadian French
  • strings.mn.json — Mongolian

<locale> is a BCP 47 language tag: a lowercase language subtag, optionally followed by - and an uppercase region subtag (en, fr, fr-CA, mn, pt-BR). Filenames are matched exactly, so use this casing. No catalog is needed for the language the canonical files are written in. Catalogs apply to lookup content only and do not translate layers.json or package.json; layer names are translated with the names map in layers.json (§1.2). strings is a reserved basename: a lookup layer must not be named strings.

Catalog format

A catalog is a single JSON object. Keys are original strings and values are their translations:

{
  "Hunting": "Chasse",
  "Restrictions": "Restrictions",
  "Hunting restrictions": "Restrictions de chasse",
  "Hunting is prohibited in this zone.": "La chasse est interdite dans cette zone."
}
  • Keys are the exact original strings: case-sensitive, untrimmed, including any HTML markup in a body value.
  • Values are strings. An empty value is treated as missing.
  • A string that appears in several places, or in several content files, such as the block label About on every row, needs one entry. One string has one translation across the whole package.
  • Keys that do not occur in the content are ignored.
  • A catalog carries no structure or logic. It cannot add, remove, reorder or reconfigure content.

Lookup and fallback

For the current app language L, the runtime loads strings.<L>.json if present and, when L has a region subtag, also strings.<language>.json (fr-CA → fr). Each translatable string shows the first non-empty value found in those catalogs in that order, otherwise the original string.

Missing catalogs, missing keys, empty values and malformed catalog files never stop a package from loading or a lookup from succeeding. A malformed catalog is logged and skipped. Catalogs are read once per lookup, so changing the app language takes effect on the next lookup without reinstalling the package.

Translatable strings

Where Translated
row each element of path (display label only)
view name, title, subtitle
every block label
body block value, as one string, whether text or html
attributes each item’s label, and its value when it is a string
link block text
notice block text

Never translated: content.id, content.language, dataset ids, filter (feature ids and when), type, format, tone, orientation, url, source, numbers, booleans, JSON keys, and anything in layers.json or package.json (layer names use the names map in layers.json instead, §1.2). Translations affect presentation only; filtering, feature matching and dataset evaluation run on the canonical content.

Preparing a catalog for translation

The extract_strings.py script in the offlinemaps repository lists every translatable string in a package and writes strings.<locale>.json with empty values for the translator to fill. Run it again with --merge on an existing catalog to keep finished translations and add only the strings that are new. A catalog with empty values is valid to ship: those strings show the original text.

Changing the canonical text

The original string is the key, so editing a string in a content file disconnects it from its translation. Nothing fails: the app shows the new text in the canonical language and keeps translating everything else, so a correction never has to wait for translation. To catch the catalog up:

  1. Edit the content file and rebuild the package.
  2. Run the extraction script with --merge and the current catalog. Unchanged strings keep their translations. An edited string appears as a new key: if a dropped entry closely resembles it (a typo fix or a small rewording), its translation is carried over and the old/new pair is listed in the report for confirmation; otherwise the value is empty and the old entry is listed as dropped.
  3. Have the translator fill the empty values and confirm the carried-over pairs.
  4. Ship the returned file as strings.<locale>.json in the next package version.

A rewrite of the canonical text costs one re-translation, while a small correction only costs a confirmation. Batch canonical edits ahead of a translation round.

The canonical path strings define navigation identity. Rows are grouped into nodes by their original path elements, and translations are applied only to the labels shown. Two different original nodes stay distinct even when their translated labels are identical, and a partial catalog never splits or merges nodes.

Example

holidays.json (English, abridged):

{
  "path": ["Mongolia", "July"],
  "view": {
    "title": "Naadam Festival",
    "subtitle": "July 11–15",
    "blocks": [
      { "type": "body", "label": "About", "format": "text",
        "value": "Mongolia's largest national holiday." }
    ]
  }
}

strings.mn.json:

{
  "Mongolia": "Монгол Улс",
  "July": "7-р сар",
  "Naadam Festival": "Үндэсний их баяр наадам",
  "July 11–15": "7-р сарын 11–15",
  "About": "Тухай",
  "Mongolia's largest national holiday.": "Монголын хамгийн том үндэсний баяр."
}

The full demo is the holidays sample package in §5.

Legal Atlas® is one deployment of the place-lookup feature. Its packages contain polygons and metadata used to identify which laws may apply at a tapped location. The dataset currently available is limited to Mongolia and was developed in partnership with Legal Atlas®, Wildlife Conservation Society, and the SMART Partnership.

Download Mongolia package (English)
Download Mongolia package (Mongolian)

Disclaimer: Legal Atlas® content is provided for informational purposes only and does not constitute legal advice. Always consult official government sources or qualified legal counsel for definitive legal guidance.

The same legal data is also accessible on the Legal Atlas® platform (a free account is required). Contact info@legal-atlas.net for assistance.

4. Distribution

4.1 Local install of a zip file

On desktop, install with Install package from the File menu.

On mobile, open the Offline maps page via Settings (or the gear icon on the Map Layers page) and add the zip:

The same Settings page is used to re-order layers, share the package with other devices, or delete it. Sharing transfers the entire original package, not just the selected layer.

4.2 SMART Packages

In SMART Desktop, you can add an offline map package to a regular SMART Mobile package. This is done by adding the offline map package under Basemap Settings, Custom Files, select + and add the package:

A package can also be installed by giving users an applink that opens CyberTracker (or SMART Mobile) and downloads it. The applink shape is https://cybertrackerwiki.org/applink/?x=<payload>, where <payload> is the base64 encoding of a small JSON object:

{ "webUpdateUrl": "https://ctwiki.blob.core.windows.net/bin/LegalAtlasMongoliaTest.zip" }

To build one:

python -c '
import base64, json
payload = {"webUpdateUrl": "https://ctwiki.blob.core.windows.net/bin/LegalAtlasMongoliaTest.zip"}
print("https://cybertrackerwiki.org/applink/?x=" + base64.b64encode(json.dumps(payload).encode()).decode())
'

The CyberTracker app intercepts cybertrackerwiki.org/applink/ URLs, decodes the x parameter, fetches webUpdateUrl, and installs the package. Anything that hands a user a clickable URL works (chat, email, QR codes, NFC).

For SMART Mobile, use the applink-smart prefix instead — https://cybertrackerwiki.org/applink-smart/?x=<payload>.

Encoding the applink as a QR code also works: CyberTracker and SMART Mobile will read the QR code and install the package the same way.

5. Sample packages

Applinks for CyberTracker:

Applinks for SMART Mobile:

Applinks for the Legal Atlas® Mongolia packages. Scan a QR code or tap a link to install the package in the app.

Applinks for CyberTracker:

Applinks for SMART Mobile: