I want to use a raster tile server for the maps. I have already succeeded in setting up mapbox/tileserver-ng as a tileserver, but I have a couple of questions about its practical use.
How do you configure the mapsettings.json, telling the manager console app to use the raster API calls?
If I want to add GeoJSON features to the map, can I still add them to the mapsettings.json of the manager? Or do I need to configure a new map style on the tileserver?
What is the status of raster tiles in the project? The profile/dev-maps.yml is not working. The openremote/tileserver-ng-Dockerfile is not building. The test org.openremote.test.map.MapResourceTest has a TODO indicating the interest to migrate to a standalone tile server. The issues mentioned are easy to fix, but is there currently an actual use of raster maps?
We’ve not used the raster implementation in quite some time (was only needed on a specific project), vector should be preferred where possible.
The environment variables that control how the map tiles are served are defined in MapService; the mapsettings.json file needs to be exposed to the tileserver container as it then loads the vector data and generates raster images from it, from what I remember you might want a varnish (or similar) cache in front of the tile server to help with performance.
Thank you for replying anyhow. These are an answer on your questions.
I am active in two IoT companies in Africa. Road maps are not detailed enough. Satellite images are a better option. I want to draw custom geojson features on top of a raster map.
We’ve not used the raster implementation in quite some time (was only needed on a specific project), vector should be preferred where possible.
That explains why the raster-maps deployment needs some changes to get it working. Of course vector maps are preferred, but they need to be accurate.
The environment variables that control how the map tiles are served are defined in MapService; the mapsettings.json file needs to be exposed to the tileserver container as it then loads the vector data and generates raster images from it, from what I remember you might want a varnish (or similar) cache in front of the tile server to help with performance.
I have investigated and done all of that. The tile server is working and shows images on the local port. The proxy through openremote is working. But, the frontend needs to download its raster data from the openremote_instance/map/js API path instead of the path for vector data /map/tile (see: Map API swagger specification )
I do not find how to configure the frontend on how to use the raster API path. It should be done via the
mapsettings.json. I you could find an example of such mapsetting.json, should be appreciated.
Thanks for the background and that makes sense; I was hoping we could retire the raster mapping but maybe it makes sense to keep it around longer.
To tell the manager UI to use raster maps you need to set this in your manager_config.json; this file location is described in this wiki page:
As described there, this file is loaded from the web root which is controlled by the OR_CUSTOM_DOCROOT environment variable (Default path can be found in profile/deploy.yml
You can volume map a custom file into this location (should just be able to set the values you want to overrid), the schema of this file is defined in ManagerAppConfig.java and the map type is in the ManagerConfig object, so something like:
Thank you for your reply. This is precisely what I needed. However, there is now a reference error in the or-map typescript module if you use RASTER instead of VECTOR
This issue is simple to reproduce on the openremote repository. It occurs before connecting to the tileserver, so you do not need a server to reproduce. These are the steps for the Demo on the openremote repository.
Configure a manager_config.json with a RASTER as mapType
Make sure the following environment variables are filled out:
Login with any user, and you will see the issue popping up.
A second thing, the tileserver of openremote is so outdated that you cannot build it anymore. It is due to the deprecation of the used Debian image. No packages can be installed anymore. So I updated it to the official maptiler/tileserver-gl image. The fork can be found here: tileserver-fork
Do not shoot me, as I kicked out all mapsettings for now. I want to have a working tileserver to test with. But sadly, at the moment, openremote and the tileserver are not talking to each other…
One important remark: the current configuration for the time-to-live of the varnish is so big it triggers an overflow in varnish itself. It is an issue that has been there for a while. If you put the time-to-live to a reasonable period, like in my case, a day, the varnish is stable. The hard-to-explain and reproducible issues with the varnish are gone.
There have been a lot of changes in Mapbox (open source version forked off as MapLibre project) and the raster code is way out of date and clearly broken.
I can see from Maplibre docs that they now support raster tile sources in the one codebase; we had to use two separate libraries previously.
I need to try and find some time to look at this and it should also clean up our code somewhat.
I can only imagine how out of date the map tileserver is at this point as not used in several year; great work in getting it working again and addressing the overflow issue.