How to connect PTV xServer.NET with PTV Developer?

Within this forum we want to offer discussions all around our .NET based Map control including all .Net-language specific questions concerning calls of the xServer-API. Attention: xServer-relevant concepts can be found in further forums such as xRoute or xTour.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2863
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to connect PTV xServer.NET with PTV Developer?

Post by Bernd Welter »

HI there,

recently I've been asked by partners about how to access PTV Developer raster maps through the well known PTV xServer.NET control.
Some of you are probably used to set the following properties in a formsMap:
Initially implemented "features" for access to xServer1 and xServer2. They haven't been migrated to PTV Developer Maps.
Initially implemented "features" for access to xServer1 and xServer2. They haven't been migrated to PTV Developer Maps.
formsMap.png (10.99 KiB) Viewed 1236 times
This does not work with PTV Developer - you have to switch to the generic approach for REST based tiled layers (which by the way also enables you to use and other tiled based service such as weather maps or satellite images from other sources).

Sensei Oliver created a sample project for you: https://github.com/oliverheilig/PtvDeveloperForms
Most obvious difference between "xMap" and "Developer" is the usage via a RemoteTiledProvider:

Code: Select all

new TiledLayer("Raster")
{
    TiledProvider = new RemoteTiledProvider
    {
        MinZoom = 0,
        MaxZoom = 22,
        RequestBuilderDelegate = (x, y, z) =>
        $"https://api.myptv.com/rastermaps/v1/image-tiles/{z}/{x}/{y}?style=silica&apiKey={apiKey}",
    },
    IsBaseMapLayer = true,
    Copyright = "© 2022 PTV Group, HERE",
    Caption = MapLocalizer.GetString(MapStringId.Background),
    Icon = ResourceHelper.LoadBitmapFromResource("Ptv.XServer.Controls.Map;component/Resources/Background.png")
}
(Source taken from Form1.cs)

Best regards,
Bernd
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:
Post Reply