How to change the rendering style / profile in the default?

This forum covers all questions dealing with visualization of data within the native PTV xMap interface. Please remember that additional plugins such as AJAX or Leaflet may be handeled in other forums.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to change the rendering style / profile in the default?

Post by Bernd Welter »

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
default
default
xmap-default.gif (42.3 KiB) Viewed 4935 times
gravelpit
gravelpit
xmap-gravelpit.gif (39.11 KiB) Viewed 4935 times
sandbox
sandbox
xmap-sandbox.gif (39.03 KiB) Viewed 4935 times
silkysand
silkysand
xmap-silkysand..gif (39.42 KiB) Viewed 4935 times
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
User avatar
MISTERX
Posts: 53
Joined: Mon Jun 02, 2014 11:50 am

Re: How to change the rendering style / profile in the defau

Post by MISTERX »

Hi Bernd,

seems that profile settings in xMap2 will be done in a different way.

Please advice!

Thx
Mr. X
  • Integration PTV <> SAP
  • Senior Consultant

________________________________________________

Optimism is only a lack of data!
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: How to change the rendering style / profile in the defau

Post by Bernd Welter »

definetly: in xMap2 you can switch to another profile by using the storedProfile through the REST API. Here's a sample from the Raw Request Runner

/services/rest/XMap/tile/13/4235/2792?storedProfile=silkysand
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
User avatar
MISTERX
Posts: 53
Joined: Mon Jun 02, 2014 11:50 am

Re: How to change the rendering style / profile in the default

Post by MISTERX »

Hi Bernd,

what a pity!

I was quite confident, that xMap2 allows profile setting by configuration as well. Now I have to do some coding . . .

Thx
Mr. X
  • Integration PTV <> SAP
  • Senior Consultant

________________________________________________

Optimism is only a lack of data!
Post Reply