Page 1 of 1

Getting detailed information about truck restrictions

Posted: Fri Jun 03, 2016 1:25 pm
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.

Re: Getting detailed information about trcuk restrictions

Posted: Fri Jun 03, 2016 4:11 pm
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>

Re: Getting detailed information about truck restrictions

Posted: Tue Jun 07, 2016 1:29 pm
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?

Re: Getting detailed information about truck restrictions

Posted: Wed Jun 08, 2016 8:00 am
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

Re: Getting detailed information about truck restrictions

Posted: Thu Jun 09, 2016 3:36 pm
by Bernd Welter
just found this:
http://xserver.ptvgroup.com/fileadmin/f ... .htm#truck

Is this also helpful?