How to use "Integration Samples" in stand-alone page?

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
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to use "Integration Samples" in stand-alone page?

Post by Bernd Welter »

Hi there,

one of my partners is a fan of the built-in integration samples available through the standard xServer2. Now he wants to know how what surrounding, "invisible" code he needs to wrap around the given code blocks to make them work outside the xServer - also in combination with PTV xServer Internet 2.

Can we get some guidance?
integration samples xS2.png
Sample "Calculating A Route"

Bernd

PS: as I am not developing in JavaScript by myself, I assume he needs some
  • include statements
  • Token handling
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: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: How to use "Integration Samples" in stand-alone page?

Post by Bernd Welter »

Here's the feedback from DEV:
Please check the following content of the documentation: Furthermore you need
  • Leaflet (very mighty 3rd party mapping framework)
  • leaflet-xserver (PTV originated leaflet add on, download via github)
Some of the samples may use further third party components such as
  • proj4js : JavaScript library to transform coordinates from one coordinate system to another, including datum transformations
  • OpenLayers (instead of leaflet)
In any case you need to "speak" JavaScript fluently to build your own sample.
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: 58
Joined: Mon Jun 02, 2014 11:50 am

Re: How to use "Integration Samples" in stand-alone page?

Post by MISTERX »

Hello Bernd!

Your original question spontaneously triggered in me the desire to try out the described scenario myself.

Leaflet itself is a well-documented framework. You can use it to quickly create an HTML page that generates a map with POIs, routes, etc. As always with web development, knowledge of JS and HTML is helpful. With the information from https://leafletjs.com/reference.html it was easy to achieve the goal. :!: However, this solution uses the OSM map and no operations of an xServer.
In the second step, I wanted to replace the OSM map with the PTV, HERE map. This also worked, but with the restriction that the xServer did NOT require authentication. :idea: The attempt to address the xServer Internet with the usual construct

Code: Select all

https://xtok:[PASSCODE]@[xserverURL]/services/rest/XMap/tile/{z}/{x}/{y}
failed. I found the solution in the xS2-PTV-Developer's-Guide in a sub-item to a sub-item titled "Using xServer internet with JavaScript" - a link you had received from DEV.

If I could give up to five stars, you would get 4.5. I'm keeping the half star because I think that hardly anyone will find the reference to the JS required for authentication on their own in the depths of the developer thread. Since I "speak" JS fluently, this would prevent me from doing a deep search in the PTV-xS2-Developer's-Guide.

In my opinion, it would be better to put the instructions for using xServer Internet on the same level as using xServer OnPrem (hence the links in DEV's feedback):
  • Using xServer with Java
  • Using xServer Internet with Java
Mr. X
  • Integration PTV <> SAP
  • Senior Consultant

________________________________________________

Optimism is only a lack of data!
Post Reply