The new Code Sample Browser takes it to a new level

Far more than just examples – develop applications in no time

The new PTV xServer Code Sample Browser has arrived, with a lot more features and brand new code samples.



Backed by excellent HTML 5 and JavaScript libraries (Bootstrap, Backbone and Codemirror to name a few), the sample browser has a gorgeous look and feel.



For instance, you can now create your own samples from a template to quickly test out ideas.



Our goal was to make the Code Sample Browser even simpler, more useful and more enjoyable, but keep the familiar structure.

You can also use shortcuts to speed up your workflow while changing or creating your own sample. For example you can switch between presentation mode and the normal view mode simply by pressing CTRL + Shift + P or you can save the changes of the sample code by pressing CTRL + S.


PTV xServer 1.17 ships with an extended sample map that also includes Rhode Island / USA. The new code sample browser lets you explore your favorite samples in the American theatre with one click.


We are constantly adding new samples for existing and new features. For 1.17, we demonstrate exciting new features such as overnight tours and freight incompatibilities for PTV xTour, and the fully customizable Feature Layers and XML Profiles for PTV xRoute.

Some additional sample variants demonstrate the use of the new Leaflet plugin, a lightweight alternative to PTV xServer add-on AJAX Maps. PTV’s Leaflet plugin requires PTV xMap 1.17 to work.



This time, we are also introducing expert-level samples; these samples demonstrate several features at once, and the associated client code can be quite involved.

The tour animation sample is a graphical goodie. It shows you how tours planned by PTV xTour would be carried out as a graphical animation. Play around with different random start scenarios to see the impact of depot locations. This sample is not heavily optimized, so be careful with the huge scenario.

The bulk request benchmark demonstrates the benefits of the bulk request variants. Should you have any doubt whether bulk requests are worth it, run the sample.

The drag and drop routing sample demonstrates more sophisticated input of your routes. This is a highly interactive use case and the expert level sample does some heavy duty client work.

The Code Sample Browser is included in the PTV xServer bundle, and available at the homepage.


Have fun with new Code Sample Browser, make your own code samples or just play with it 🙂 Go to Code Sample Browser



Play with PTV’s CodeSampleBrowser!

Dear all,

the PTV Code Sample Browser is an interactive tutorial based on JavaScript. Using this sample browser, you will easily develop your own web applications. Just select the preferred code sample and start to interact with the application by clicking the “Show Sample”-Button. How to test PTV xServer’ functionalities? See use case below.

Drag-and-drop routing

Read the short introduction to understand the usage of this sample.introduction codesamplebrowser

Click into the PTV map twice to calculate automatically a route. Via mouse events, you are able to move dynamically the start, destination or selected via point. Hereby, the last current address list will be shown automatically. This highly interactive code sample illustrates the combination of client and server activities.

Figure drap and drop

Are you interested how it works? Please check the source code which is also provided in a separated editor frame (right top corner: “edit source” button).You may edit the source code and revert to the original. So, don’t hesitate to use this opportunity to “play” with these interactive functions.

Code Sample Editor

Do you have some notes how to improve the tutorial? Please contact our PTV xServer Support!

Kind regards from Karlsruhe,

Dr. Michael Nutto

Product Manager PTV xServer