Repository navigation
LatLonTextIndicator JSON
This page describes the persisted format of the latLonText indicator in a project, a Mixel, and templates. For the user guide to editing .vttp by hand, see Coordinates Text JSON.
The indicator layer is saved in two modes:
-
toJSON(false)— the real Mixel state: the sensor is written assourceIdandsensorId, and the layer hassizeandpositionInParent. -
toJSON(true)— the template state: the sensor does not write thesourceIdandsensorIdkeys (the object is empty), andmaketis written instead ofsizeandpositionInParent. When a template is loaded, a suitable geo sensor of the project is picked automatically for theGeoproperty.
The other properties are written the same way in both modes.
{
"name": "com.velitask.plagin.official.latLonText",
"data": {
"properties": {}
}
}| Part | Value |
|---|---|
| plugin uid | com.velitask.plagin.official |
| indicator name | latLonText |
Besides properties, data holds the common layer fields (visibility, transparency, nested layers, and so on); they do not belong to the indicator and are not described here.
The shape of size and positionInParent is defined by the current runtime, so it is shown in abbreviated form. The numbers sourceId and sensorId in the example are arbitrary.
{
"name": "com.velitask.plagin.official.latLonText",
"data": {
"size": { "...": "layer size state" },
"positionInParent": { "...": "layer position state" },
"properties": {
"Geo": {
"sourceId": { "value": 1 },
"sensorId": { "value": 4 }
},
"font": { "name": "Dialog", "style": 0, "size": 48, "color": { "r": 255, "g": 255, "b": 255, "a": 255 } },
"textAlign": { "value": 4 },
"displayType": { "value": 0 },
"precision": {}
}
}
}{
"name": "com.velitask.plagin.official.latLonText",
"data": {
"maket": { "preset": "auto" },
"properties": {
"Geo": {},
"font": { "name": "Dialog", "style": 0, "size": 48, "color": { "r": 255, "g": 255, "b": 255, "a": 255 } },
"textAlign": { "value": 4 },
"displayType": { "value": 0 },
"precision": {}
}
}
}The values are the initial values from the code. An untouched precision property has no saved value (it is returned by getDefault()), so it may be written as {}; when reading, a missing key yields the value 7. When a template is written, maket in toJSON(true) mode is the proportional preset with the fractions x, y, w, h; auto and fill are also accepted when reading.
The row order matches defineProperties().
| JSON key | Java property | SDK type | Meaning for the user | Default |
|---|---|---|---|---|
Geo |
mGeo |
GeoSensorProperty |
Geo sensor ("Geo"). | Empty selection: {} in the template. |
font |
mFont |
FontColorProperty |
Font and text color. | Dialog, plain, 48, white. |
textAlign |
mTextAlign |
TextAlignProperty |
Text alignment in the layer. |
{"value":4} (CENTER). |
displayType |
mDisplayType |
EnumArrayProperty<DisplayType> |
Coordinate format ("Format"). |
{"value":0} (DECIMAL). |
precision |
mPrecision |
IntegerProperty |
Number of decimal places ("Decimal places"). | 7. |
Value formats:
-
Geo—sourceIdandsensorId, each of the form{"value": <long>}; the object is empty in a template. -
font— a flat object:name(string),style(0plain,1bold,2italic),size(integer 1–999),color(r,g,b,ain the range 0–255). -
textAlign—{"value": 0..8}:0TOP_LEFT,1TOP_CENTER,2TOP_RIGHT,3CENTER_LEFT,4CENTER,5CENTER_RIGHT,6BOTTOM_LEFT,7BOTTOM_CENTER,8BOTTOM_RIGHT. A value out of range is treated asCENTER_LEFT. -
displayType— the format index:
value |
Format | Example |
|---|---|---|
0 |
DECIMAL |
55.7558000, 37.6173000 |
1 |
DECIMAL_NSEW |
55.7558000°N, 37.6173000°E |
2 |
DMS |
55°45'20.88"N, 37°37'02.28"E |
-
precision—{"value": 0..12}. The range 0–12 is applied when the property sets a value; a value read from JSON is not clamped to the range, and when drawing, a negative value is replaced with zero. It is not used in theDMSformat.
Coordinates with compass letters and four decimal places:
{
"displayType": { "value": 1 },
"precision": { "value": 4 }
}-
VelitaskPlagin.getUID()(com.velitask.plagin.official) must not be changed without migrating saved projects. -
Indicator.getName()(latLonText) must not be changed without a migration. - Property names (
Geo,font,textAlign,displayType,precision) must not be renamed without a migration: loading goes by name. - The order of the
DisplayTypeelements defines thedisplayType.valuevalue: reordering or inserting in the middle changes the meaning of already saved projects. - Renaming a property is more dangerous than changing the order: the order mostly affects the interface.