Re: Display TruckAttributes with Leaflet and OpenLayers
Posted: Mon Apr 09, 2018 2:54 pm
Hello Sebastian,
i've verified the sample with a stock xMapServer 1.24.0 and the Luxemburg demo map. I've simplified the initialization, so in the index.html you can set:
POIs and TruckAttributes should work out-of-the box without custom profiles. The TrafficInformation configuration depends on the configuration of the TrafficInfo-Loader. If this doesn't work you should check the CORS configration in \webapps\xmap\WEB-INF\web.xml. It should contain:
Some notes about this sample and the JavaScript samples in general (versus productive applications).
i've verified the sample with a stock xMapServer 1.24.0 and the Luxemburg demo map. I've simplified the initialization, so in the index.html you can set:
Code: Select all
// setting the urls
var onPremiseUrl = "http://127.0.0.1:50010"; // local xServer Url
var cluster = ''; // when using xServer-internet, set empty for local xServer
POIs and TruckAttributes should work out-of-the box without custom profiles. The TrafficInformation configuration depends on the configuration of the TrafficInfo-Loader. If this doesn't work you should check the CORS configration in \webapps\xmap\WEB-INF\web.xml. It should contain:
Code: Select all
<!-- comment out the following element to deactivate CORS support: -->
<filter-mapping>
<filter-name>CORS</filter-name>
<url-pattern>/rs/*</url-pattern>
</filter-mapping>
- We don't recommend using 'SMOLayer' for traffic incidents and 'RoadEditorLayer' for truck attributes, since this technology is deprecated. You should use PTV FeatureLayer instead. FeatureLayer is a universal technology for both mapping and routing. And it's supported both for xServer-1 https://ptv-logistics.github.io/fl-labs/ and xServer-2 https://ptv-logistics.github.io/xserver ... xserver-2/
- Most samples can be started directly by opening the file in a browser (but since last week not with Chrome anymore). We don't recommend this for productive environments. You should run you code as page hosted within a web server.
- While it is possible to access xServer directly from a web client (if you get Tomcat CORS configration right), we don't recommend this for a productive environment. You should either access it via a middleware or use a proxy line NGINX https://docs.nginx.com/nginx/admin-guid ... rse-proxy/ and supply SSL, CORS, Auth, ... there.
- You don't have all these problems if you use xServer internet .