The technique behind this approach is to add a new WMS Layer for TruckAttributes, so the layer can be switched ON/OFF independently. To achieve this, we have to add a new rendering profile to the xMap conf-directory and extend the WMS.properties file by a xmap-truckattributes layer. Here are the required files:

Here the xServer is requested directly and the response contains the image plus object information. The object information is used to create clickable regions on the client. You can also apply this to your on-premise xServer installation, if you copy the attached rendering profiles.

Important: If you want to use the PTVLayer js-code with your xMapServer directly, you to have configure CORS at your .\webapps\xmap\WEB-INF\web.xml file and add the authorization and accept header: