Internal themes for LoMaps are tested/developed directly in Locus. Previously I used to manually copy the theme .xml via Total Commander to the device and restore the theme in the app. It's not bad, but it's not ideal. As you probably know, LoMaps will finally be in V4 and will use the default Mapsforge renderer. When we started working on LoMaps V4, I had two thoughts about how to improve the theme development process:
- usage of variables in the theme
- quick refresh the theme on a mobile device.
For this reason we prepared a simple python tool that solves mentioned issues. It basically copies and refresh the theme on the device in one click - available at https://github.com/asamm/lomaps-mapsforge
The process of generation of theme file is the following:
1. Base template
On the input is theme template that contains variables and definitions for custom actions. This is basically a mapsforge theme but some colors or widths are defined using variables
2. Template config
It assigns values to theme variables
3. Generation of result theme file
The theme generator combines template variables to generate the final theme file
4. Copy the theme to the device and refresh the theme
There are several requirements (intall adb, python and some other python modules) and it may be complicated to run the script at this moment. Moreover it also automatically generates a theme for POIs so it is quite focused on internal LoMaps themes and is not as configurable as it could be.
But if anybody would like to use it to develop alternative themes, it is possible to make the generator more generic. Maybe it would be enough to prepare the settings to generate also POI themes and maybe a better installation...
Please let me know if anyone is interested and I can tweak it a bit.
- usage of variables in the theme
- quick refresh the theme on a mobile device.
For this reason we prepared a simple python tool that solves mentioned issues. It basically copies and refresh the theme on the device in one click - available at https://github.com/asamm/lomaps-mapsforge
The process of generation of theme file is the following:
1. Base template
On the input is theme template that contains variables and definitions for custom actions. This is basically a mapsforge theme but some colors or widths are defined using variables
2. Template config
It assigns values to theme variables
3. Generation of result theme file
The theme generator combines template variables to generate the final theme file
4. Copy the theme to the device and refresh the theme
There are several requirements (intall adb, python and some other python modules) and it may be complicated to run the script at this moment. Moreover it also automatically generates a theme for POIs so it is quite focused on internal LoMaps themes and is not as configurable as it could be.
But if anybody would like to use it to develop alternative themes, it is possible to make the generator more generic. Maybe it would be enough to prepare the settings to generate also POI themes and maybe a better installation...
Please let me know if anyone is interested and I can tweak it a bit.
The following users thanked this post: Menion