How to change the rendering style / profile in the default?
Posted: Tue Apr 07, 2020 7:09 am
Hi there,
in the recent months I've been asked by several parties how they could "pimp" their xMap1 interface. Besides the migration from xMap1 to xMap2 (which causes some development efforts) I'd like to offer another quick and therefore cheap approach. Evaluate it - it is worth to give it a try. I start with the howto. Further details are explained below.
Approach #1: change the default profile (on premise)
The smartest way is to change the values in the xmap-default.properties. For excample you can set the "map.profile" in the default file to anyone of the existing rendering profiles such as silkysand.ini, gravelpit.ini...
Approach #2: change request profile (e.g. cloud services)
Sometimes you may not have access to the server (e.g. xServer Internet). In this case you use the CallerContextProperty to request one of those profiles. This requires no reconfiguration of a server but you need to act on application level.
Approach #3: AJAX maps (e.g. cloud)
Use the Map.profileGroup in the AJAX control to switch from the "default" to one of the named profiles. In the AJAX approach the map interface retrieves several map tiles through profiles which are named xmap-ajax-fg.properties, xmap-ajax-bg.properties, ...
Approach #4 reconfigure Ajax maps (e.g. OnPremise)
If you want to use Ajax on an OnPremise Server but you don't want to change program code you can redirect the AJAX map's server profile to use one of the rendering profiles: reconfigure map.profile in the xmap-ajax* files.
The idea behind this hint is this:
A map interface visualizes an image (PNG, GIF, JPG....) by retrieving data from a well known PTV map. Data such as
- roads (geometries, names, categories)
- cities and districts (town labels)
- rivers, seas, oceans, forrests and much more
During the rendering process the properties of this data is used to decide about
- colors and line widths of geometries
- label's fonts and their sizes
Now for all these rendering stuff there's some default scheme. This scheme hasn't been updated for years but the good news is that you can override it very easily:
In an xServer1's /conf folder you will find several files named like this (examples refer to xMap):
- xmap-default.properties
- xmap-PLACEHOLDER.properties
...
By referencing the CallerContext and it's property "Profile" you can tell the server to gather parameters from such a file which is based on Microsoft INI style (set of key-values split into distinct sections). Now in the namespace of xMap1 the properties file contains - among many others - the key "map.profile=" which is empty in the "xmap-default.properties". IN the other profiles shipped with the server the key links to some other INI files such as silkysand.ini, sandbox.ini, gravelpit.ini and so on. These ini files contain the parameter values for the rendering.
We provide several request profile files such as
- xmap-gravelpit.properties
- xmap-sandbox.properties
- xmap-greenzones.properties
- xmap-silkysand.properties
There you go,
Bernd
in the recent months I've been asked by several parties how they could "pimp" their xMap1 interface. Besides the migration from xMap1 to xMap2 (which causes some development efforts) I'd like to offer another quick and therefore cheap approach. Evaluate it - it is worth to give it a try. I start with the howto. Further details are explained below.
Approach #1: change the default profile (on premise)
The smartest way is to change the values in the xmap-default.properties. For excample you can set the "map.profile" in the default file to anyone of the existing rendering profiles such as silkysand.ini, gravelpit.ini...
Approach #2: change request profile (e.g. cloud services)
Sometimes you may not have access to the server (e.g. xServer Internet). In this case you use the CallerContextProperty to request one of those profiles. This requires no reconfiguration of a server but you need to act on application level.
Approach #3: AJAX maps (e.g. cloud)
Use the Map.profileGroup in the AJAX control to switch from the "default" to one of the named profiles. In the AJAX approach the map interface retrieves several map tiles through profiles which are named xmap-ajax-fg.properties, xmap-ajax-bg.properties, ...
Approach #4 reconfigure Ajax maps (e.g. OnPremise)
If you want to use Ajax on an OnPremise Server but you don't want to change program code you can redirect the AJAX map's server profile to use one of the rendering profiles: reconfigure map.profile in the xmap-ajax* files.
The idea behind this hint is this:
A map interface visualizes an image (PNG, GIF, JPG....) by retrieving data from a well known PTV map. Data such as
- roads (geometries, names, categories)
- cities and districts (town labels)
- rivers, seas, oceans, forrests and much more
During the rendering process the properties of this data is used to decide about
- colors and line widths of geometries
- label's fonts and their sizes
Now for all these rendering stuff there's some default scheme. This scheme hasn't been updated for years but the good news is that you can override it very easily:
In an xServer1's /conf folder you will find several files named like this (examples refer to xMap):
- xmap-default.properties
- xmap-PLACEHOLDER.properties
...
By referencing the CallerContext and it's property "Profile" you can tell the server to gather parameters from such a file which is based on Microsoft INI style (set of key-values split into distinct sections). Now in the namespace of xMap1 the properties file contains - among many others - the key "map.profile=" which is empty in the "xmap-default.properties". IN the other profiles shipped with the server the key links to some other INI files such as silkysand.ini, sandbox.ini, gravelpit.ini and so on. These ini files contain the parameter values for the rendering.
We provide several request profile files such as
- xmap-gravelpit.properties
- xmap-sandbox.properties
- xmap-greenzones.properties
- xmap-silkysand.properties
There you go,
Bernd