Build Your Custom Styleable Map Markers

Custom Markers

The result is an object which can be dynamically scaled and colored.

PTV xServer .NET comes with a bunch of predefined symbols which are styleable.

Styleable means that you can set the color and size at runtime. This is very useful to create thematic maps.

The following tutorial shows how to create your own styleable map elements and use it in the map.

 

If you need further information or support please contact the Support Team.

Advanced Line Styling to visualize the direction of Routes and Tours

We were asked how to indicate the direction for a route or a tour using the shape layer. We’ve built a sample for it which demonstrates two options:

1. Use a stroked MapPolyline and animate the StrokeDashOffset property. This technique is also used at the RoutingDemo of the demo center application.
2. Implement a custom MapShape which renders little arrows along the polyline. This technique is a little bit more complex, because you have to calculate the arrow coordinates by yourself. I’ve implemented an ArrowDashLine class which handles this.
AdvancedLineStyles Download application, x-zip-compressed::

To indicate the directions of transports, you can also take a look at MapArrowDemo explained here.

For any questions please contact the PTV xServer Support Team.

How to implement custom MapShapes

A sample which shows how to implement a custom shape type using the example of arrows between locations. We’ve adopted Charles Petzold’s WPF arrow sample  to work with geographic coordinates.

MapArrowDemo

Download application, x-zip-compressed:

For any questions please contact the PTV xServer Support Team.

Use your own xMap Rendering Styles with PTV xServer .NET

  • Create your own rendering configuration (e.g. myRender.ini). You find the description of the format in the PTV xMap Server documenation
  • Copy the xmap-ajax-bg.properties and rename it (e.g. xmap-ajax-bg-myprofile.properties)
  • Change the entry for the rendering profile in this file, (e.g. map.profile=myRender.ini)
  • In PTV xServer .NET right after initialization of the map you can set this profile as custom profile
((map.Layers["Background"] as TiledLayer).TiledProvider as 
XMapTiledProvider).CustomProfile = "ajax-bg-myprofile";

Currently you can set the custom configuration only once right after the initialization but you cannot change it afterwards because the profile name has to be considered for the tile cache then. We’ll change this behavior for the next release, so you can change the profiles at runtime like in the sample we provide here.

CustomBackgroundProfiles

 

Download :

For any questions please contact the PTV xServer Support Team.

[ratings]

Howto create your own webservice clients for PTV xServers

Gallery

Some time ago the PTV xServer development team was asked whether it was possible to create a web service client without our provided java clients and the bundled cxf framework.
The simple answer is: Yes! Those who would like to take the adventure and try it themselves should read on…

What you need for this

The prerequisites for this little sample are the following:

  • A JDK 6, or newer,
  • A Maven2 or Maven3 installation,
  • PTV xRoute Server (the sample runs with xRoute 1.16 but it should work with older versions too)

Create a Maven project

First of all we create a new directory and set up a Maven project file named pom.xmlRead more