Skip to content

GeoMapIndicator JSON

roosit edited this page Oct 16, 2026 · 2 revisions

GeoMapIndicator JSON

Up | Code | Русский

Purpose

This page describes the persisted format of the geoMap indicator in a project, a Mixel, and templates, including the nested map figures. For the user guide to hand-written .vttp, see Map JSON.

Two save modes

The indicator is saved in two modes:

  • toJSON(false) — the real Mixel state: contains the selected geo sensor (sourceId, sensorId), the current property values, and the size and position of the layer.
  • toJSON(true) — the template state: contains template values that can be carried between projects. For the Geo property, the source and sensor are not written (the object is empty); the runtime picks them when the indicator is added to a project.

Common indicator wrapper

The layer identifier is built from the plugin uid and the indicator name:

{
  "name": "com.velitask.plagin.official.geoMap",
  "data": {
    "properties": {},
    "figures": []
  }
}

Stable parts:

Part Value
plugin uid com.velitask.plagin.official
indicator name geoMap

Inside data there are two blocks side by side: properties (the properties of the indicator itself, the key is the property's getName()) and figures (the array of map figures). toJSON always writes the figures block — both in a project and in a template.

Real mixel state

In a real Mixel, the runtime stores the layer geometry next to properties and figures: size, position, and the binding to the parent. The exact shape of these State fields depends on the current runtime, so an abbreviated structure is shown.

{
  "name": "com.velitask.plagin.official.geoMap",
  "data": {
    "size": { "...": "layer size state" },
    "positionInParent": { "...": "layer position state" },
    "properties": {
      "Geo": { "sourceId": { "value": 1 }, "sensorId": { "value": 3 } },
      "visible": { "value": true },
      "fitTrack": { "value": false },
      "geoZoom": { "value": 14 }
    },
    "figures": [
      { "type": "track", "props": { "Geo": { "sourceId": { "value": 1 }, "sensorId": { "value": 3 } } } }
    ]
  }
}

Only some of the properties are shown here; the rest are written the same way as in the full template below. The values sourceId and sensorId are numeric identifiers of the source and sensor in the project; take the exact shape of the other State fields from the current runtime.

Template state

A template uses maket, and Geo stays empty — the runtime picks a suitable geo sensor. If the figures block is absent from a template, the runtime adds the default figures (track and position). If the block is set, only the figures listed in it are created; an empty array means "no figures".

{
  "name": "com.velitask.plagin.official.geoMap",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "Geo": {},
      "visible": {"value":true},
      "fitTrack": {"value":false},
      "geoZoom": {},
      "transparency": {},
      "border": {"lineColor":{"r":255,"g":255,"b":255,"a":255},"thickness":{},"style":{"value":0},"dashPattern":{"value":""},"cornerRadius":{}},
      "view3D": {"value":false},
      "tilt": {},
      "rotation": {"value":0},
      "manualBearing": {},
      "minSpeedKmh": {},
      "vehicleAnchor": {"value":0}
    },
    "figures": [
      {
        "type": "track",
        "props": {
          "Geo": {},
          "line": {"lineColor":{"r":200,"g":0,"b":0,"a":255},"thickness":{"value":5},"style":{"value":0},"dashPattern":{"value":""}},
          "passedOnly": {"value":false}
        }
      },
      {
        "type": "position",
        "props": {
          "Geo": {},
          "fillColor": {"r":0,"g":0,"b":200,"a":255},
          "borderColor": {"r":255,"g":255,"b":255,"a":255},
          "size": {}
        }
      }
    ]
  }
}

Properties

The properties are listed in the order of defineProperties(). The MapTilesProperty property (name mapTiles) is not a Property and does not end up in the JSON.

JSON key Java property SDK type Meaning for the user Default Range / values
Geo mGeoSensor GeoSensorProperty Geo sensor ("Geo"). Empty selection in a template. sourceId, sensorId
visible mShowMap VisibleProperty Tile visibility ("Visible"). true true / false
fitTrack mFitTrack FitTrackProperty "Fit track". false true / false
geoZoom mGeoZoom GeoZoomProperty "Map zoom". 14 8..19
transparency mMapTransparency TransparencyProperty Tile "Transparency". 0 0..100
border mBorder BorderProperty "Border". white, 1, solid, radius 0 see below
view3D mView3D VisibleProperty "3D view". false true / false
tilt mTilt IntegerProperty "Tilt angle". 50 0..85
rotation mRotation EnumArrayProperty<RotationMode> "Rotation". 0 0 NORTH_UP, 1 HEADING_UP, 2 MANUAL
manualBearing mManualBearing IntegerProperty "Manual bearing". 0 0..359
minSpeedKmh mMinSpeedKmh IntegerProperty "Min speed to rotate (km/h)". 2 0..50
vehicleAnchor mVehicleAnchor EnumArrayProperty<VehicleAnchor> "Vehicle anchor". 0 0 CENTER, 1 BOTTOM_THIRD

State format (an integer property whose value has not been changed yet is written as an empty object {}: this is the default value; this applies to geoZoom, transparency, tilt, manualBearing, minSpeedKmh, border.thickness, border.cornerRadius, and, for figures, size, …Zoom, …Delta, and the highlight transparency; for track.line.thickness and placeBoundary.line.thickness the value is set in the code and is written as {"value":N}):

  • VisibleProperty, FitTrackProperty — {"value": true|false}.
  • IntegerProperty, GeoZoomProperty, TransparencyProperty — {"value": number}; the value is clamped to the range. If the value key is absent, the default value applies.
  • EnumArrayProperty — {"value": index}; the index is the ordinal number of the enum constant, and the default value is the first constant.
  • BorderProperty (composite) — one object per child parameter: lineColor ({"r","g","b","a"}, 0..255), thickness ({"value"}, 0..50, default 1), style ({"value"}, LineStyle index: 0 solid, 1 dash, 2 dot, 3 dash-dot, 4 dash-dot-dot, 5 long dash, 6 short dash, 7 custom), dashPattern ({"value": "string"}; a pattern like "12,6", meaningful for style 7), cornerRadius ({"value"}, 0..500, default 0).
  • Geo — {"sourceId": {"value": N}, "sensorId": {"value": N}} in a project, {} in a template.

Dependencies on load: fitTrack = true locks geoZoom, view3D = false locks tilt, and rotation unlocks manualBearing (mode 2) or minSpeedKmh (mode 1). Locking affects only the settings panel; the values are still saved and read.

Figures

Each figure is an object {"type": <name>, "props": {...}}, where props holds the figure's properties by their getName(). An unknown type is silently skipped on load; properties absent from props keep their default values. The order of the array elements is the drawing order (the first figure is drawn at the very bottom). GeoMapIndicator supports four types; track and position are created by default.

type Class Name for the user Default
track GeoTrackFigure Track yes
position GeoPositionFigure Position marker yes
placeBoundary GeoPlaceBoundaryFigure Place boundaries no
placeLabels GeoPlaceLabelsFigure Place labels no

track

JSON key SDK type Meaning Default Range
Geo GeoSensorProperty The figure's geo sensor. empty —
line LineProperty "Line": lineColor, thickness, style, dashPattern. color (200, 0, 0, 255), thickness 5, solid thickness 1..30
passedOnly VisibleProperty "Passed only". false true / false

position

JSON key SDK type Meaning Default Range
Geo GeoSensorProperty The figure's geo sensor. empty —
fillColor ColorProperty "Fill color". (0, 0, 200, 255) 0..255 per channel
borderColor ColorProperty "Stroke color". (255, 255, 255, 255) 0..255 per channel
size SizeProperty "Size", diameter in pixels. 30 4..100

placeBoundary

The figure has no Geo property.

JSON key SDK type Meaning Default Range
mode EnumArrayProperty<DisplayMode> "Display mode". 0 0 active, 1 nearest, 2 all
line LineProperty "Line" of the outline. color (180, 80, 0, 255), thickness 2, solid thickness 1..20
fillColor ColorProperty "Fill color". (255, 160, 60, 60) 0..255 per channel
showFill VisibleProperty "Show fill". false true / false
showHighlight VisibleProperty "Highlight current". true true / false
highlightColor ColorProperty "Highlight color". (255, 210, 70, 255) 0..255 per channel
transparency TransparencyProperty Highlight "Transparency". 55 0..100
cityShow / cityZoom VisibleProperty / SizeProperty Cities: show / from zoom. true / 8 zoom 1..19
townShow / townZoom same Towns. true / 10 zoom 1..19
villageShow / villageZoom same Villages. true / 12 zoom 1..19
hamletShow / hamletZoom same Hamlets. true / 14 zoom 1..19
{
  "type": "placeBoundary",
  "props": {
    "mode": {"value":0},
    "line": {"lineColor":{"r":180,"g":80,"b":0,"a":255},"thickness":{"value":2},"style":{"value":0},"dashPattern":{"value":""}},
    "fillColor": {"r":255,"g":160,"b":60,"a":60},
    "showFill": {"value":false},
    "showHighlight": {"value":true},
    "highlightColor": {"r":255,"g":210,"b":70,"a":255},
    "transparency": {},
    "cityShow": {"value":true},
    "cityZoom": {},
    "townShow": {"value":true},
    "townZoom": {},
    "villageShow": {"value":true},
    "villageZoom": {},
    "hamletShow": {"value":true},
    "hamletZoom": {}
  }
}

placeLabels

The figure has no Geo property.

JSON key SDK type Meaning Default Range
textColor ColorProperty "Text color". (30, 30, 30, 255) 0..255 per channel
haloColor ColorProperty "Halo color". (255, 255, 255, 255) 0..255 per channel
size SizeProperty "Size" of the base font. 16 8..72
showMarker VisibleProperty "Show marker". false true / false
cityShow / cityZoom / cityDelta VisibleProperty / SizeProperty / SizeProperty Cities: show / from zoom / size in percent. true / 8 / 100 zoom 1..19, size 10..300
townShow / townZoom / townDelta same Towns. true / 10 / 85 same
villageShow / villageZoom / villageDelta same Villages. true / 12 / 72 same
hamletShow / hamletZoom / hamletDelta same Hamlets. true / 14 / 62 same
{
  "type": "placeLabels",
  "props": {
    "textColor": {"r":30,"g":30,"b":30,"a":255},
    "haloColor": {"r":255,"g":255,"b":255,"a":255},
    "size": {},
    "showMarker": {"value":false},
    "cityShow": {"value":true},
    "cityZoom": {},
    "cityDelta": {},
    "townShow": {"value":true},
    "townZoom": {},
    "townDelta": {},
    "villageShow": {"value":true},
    "villageZoom": {},
    "villageDelta": {},
    "hamletShow": {"value":true},
    "hamletZoom": {},
    "hamletDelta": {}
  }
}

Examples

A map rotated to the heading, with a 3D tilt and the vehicle anchored in the bottom third, plus city labels:

{
  "name": "com.velitask.plagin.official.geoMap",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "Geo": {},
      "visible": {"value":true},
      "fitTrack": {"value":false},
      "geoZoom": {"value":15},
      "transparency": {},
      "border": {"lineColor":{"r":255,"g":255,"b":255,"a":255},"thickness":{},"style":{"value":0},"dashPattern":{"value":""},"cornerRadius":{"value":16}},
      "view3D": {"value":true},
      "tilt": {"value":60},
      "rotation": {"value":1},
      "manualBearing": {},
      "minSpeedKmh": {"value":5},
      "vehicleAnchor": {"value":1}
    },
    "figures": [
      { "type": "track", "props": { "passedOnly": {"value":true} } },
      { "type": "position", "props": { "size": {"value":24} } },
      { "type": "placeLabels", "props": { "villageShow": {"value":false}, "hamletShow": {"value":false} } }
    ]
  }
}

For figures, it is enough to list only the properties you change: the rest take their default values.

Compatibility

  • VelitaskPlagin.getUID() (com.velitask.plagin.official) must not be changed without migrating saved projects.
  • Indicator.getName() (geoMap) must not be changed without a migration.
  • The indicator's property names (Geo, visible, fitTrack, geoZoom, transparency, border, view3D, tilt, rotation, manualBearing, minSpeedKmh, vehicleAnchor) must not be renamed without a migration.
  • Figure names (track, position, placeBoundary, placeLabels) and the names of their properties are the same part of the format: loading goes by name, and unknown type values are skipped.
  • Enum indexes (rotation, vehicleAnchor, mode) are stored as ordinal numbers: the order of the RotationMode, VehicleAnchor, and DisplayMode constants must not be changed.
  • The order of properties mostly affects the UI; renaming is more dangerous than reordering.

Clone this wiki locally