Getting detailed information about truck restrictions

This forum deals with any kind of web based client technology, whether it is the well known java script based Ajax servlet or the upcoming approaches such as Leaflet, OpenLayers and so on.
Post Reply
kgrudzinski
Posts: 12
Joined: Fri Feb 19, 2016 10:56 am

Getting detailed information about truck restrictions

Post by kgrudzinski »

Hello,

When Truck Attributes layer is displayed on Ajax Maps, it shows generic icons for truck restrictions, same for each type of restriction (e.g. two different weight limits will be displayed with same icon). Is it possible to get and display detailed information, for each restriction? (e.g. that one weight limit is 2tons and second 7 tons)

Regards,

K.
Last edited by kgrudzinski on Tue Jun 07, 2016 12:56 pm, edited 1 time in total.
User avatar
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Getting detailed information about trcuk restrictions

Post by Bernd Welter »

Hello Krzysztof,

are you using this sample from the tutorial ?
(on premise link - please adapt the IP)
http://127.0.0.1:50010/ajaxmaps/tutoria ... e%20Layers
FeatureLayer based example of truck attributes. <br />TThe tooltip demonstrates the access to the segment properties.
FeatureLayer based example of truck attributes.
TThe tooltip demonstrates the access to the segment properties.
Best regards Bernd

Code: Select all

<html>
  <head>
    <!--[if IE]><script type="text/javascript" src="webcomponent/script/excanvas.js"></script><![endif]-->
    <script type="text/javascript" src="webcomponent/script/qooxdoo/script/qx-transport.js"></script>
    <script type="text/javascript" src=".qxrpc"></script>
    <script type="text/javascript" src="webcomponent/script/map.js"></script>

    <script type="text/javascript">
      function init() {
        var container =
          document.getElementById("mapContainer");
        var map =
          new com.ptvag.webcomponent.map.Map(container);
        window.onresize = function() {
          map.updateSize();
        };
        map.setCenter({x:4303250, y:5486500});
        map.setZoom(8);

        var manager = map.getServerDrawnObjectManager();
        manager.addPOICategory("featurelayer", "PTV_TruckAttributes");
        manager.setReferenceTime("2014-11-05T16:30:00+01:00");

        // example for reacting when new data is available
        manager.addEventListener("staticPOIsAvailable", function(evt) {
          var pois = evt.getData();
          if (pois.length > 0) {
            alert("First incident data: " +
              qxp.io.Json.stringify(pois[0]));
          }
        });
      }

      qxp.dev.log.Logger.ROOT_LOGGER.setMinLevel(qxp.dev.log.Logger.LEVEL_INFO);
      qxp.dev.log.Logger.getClassLogger(qxp.core.Init).setMinLevel(qxp.dev.log.Logger.LEVEL_ERROR);
    </script>
  </head>

  <body onload="init()">
    <div id="mapContainer"
      style="width:100%;height:100%">
    </div>
  </body>
</html>
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:
kgrudzinski
Posts: 12
Joined: Fri Feb 19, 2016 10:56 am

Re: Getting detailed information about truck restrictions

Post by kgrudzinski »

After some investigation, I found out that the lack of tooltips was caused by error in my onMouseMove event handler for vector layer. The handler did not have a return statement. After adding return false (true also works), tooltips appeared on the map.

I do have some additional questions:
1. Where can I find information about meaning of data returned in poi description? Some of it is obvious like maxHeight and maxWeight, but there are parameters like driverType=0 or freeForDelivery=1, which meaning is unclear to me.

2. Is there a way to get description (or message part of description) in different language than english for Traffic Incidents pois?
User avatar
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Getting detailed information about truck restrictions

Post by Bernd Welter »

Hello Krzsyztof,

here is some info about the questions you asked:
Where can I find information about meaning of data returned in poi description? Some of it is obvious like maxHeight and maxWeight, but there are parameters like driverType=0 or freeForDelivery=1, which meaning is unclear to me.
Here you can take a look at the Unified Profile Mechanism:
http://xserver.ptvgroup.com/fileadmin/f ... =driveType
Is there a way to get description (or message part of description) in different language than english for Traffic Incidents pois?
A quick search for driveType in the documentation will lead you to the property and the meaning of the values.

This depends on the mechanism how you consume the traffic data from our services:
  • Via FeatreLayer: use the profile snippet mechanism and add the following node:

    Code: Select all

    <Common language="de" majorVersion="1" minorVersion="0"/>
    (check http://xserver.ptvgroup.com/fileadmin/f ... n%7C_____0)
  • Via TrafficInfoLoader: the definition of the tooltips is part of the GEODATASOURCE layer which is configured via XML files (in /conf):
    • traffic-geodatasource.xml: defines the connection to the traffic info loader database table (which refers to various C_DESCRIPTION_* columns). One of these columns is assigned to a field called text which is C_DESCRIPTION_DE (default). If you just want to translate the traffic tooltips into EN you have to edit the TEXT value: C_DESCRIPTION_EN will do fine.
    • geodata-ptv-traffic.xml: contains the generic definition of the tooltips in the DESCRIPTION node (feature of the GEODATASOURCE layer). If you want you can combine various columns to one single DESCRIPTION text by applying something like this:

      Code: Select all

      <Description>
                     <TextField attributeName="ID" separator="<BR>C_DELAY="/>
                      <TextField attributeName="C_DELAY" separator="<BR>C_DESCRIPTION_EN='"/>
                      <TextField attributeName="C_DESCRIPTION_EN" separator="<BR>;C_DESCRIPTION_DE='"/>
                  </Description>
      Another approach is to use the DESCRIPTION field just for the primary key of a database object and retrieve the required data of the objects in the visual section via SQL on your own.
Best regards
Bernd
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
Bernd Welter
Site Admin
Posts: 2703
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Getting detailed information about truck restrictions

Post by Bernd Welter »

just found this:
http://xserver.ptvgroup.com/fileadmin/f ... .htm#truck

Is this also helpful?
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:
Post Reply