How do I point WPF SfMap OSM imageryLayer to custom server

I have the following XAML in my WPF application:

            <TabItem x:Name="MapTab">
                <syncfusionM:SfMap x:Name="sfMap">
                    <syncfusionM:SfMap.Layers>
                        <syncfusionM:ImageryLayer LayerType="OSM"/>
                    </syncfusionM:SfMap.Layers>
                </syncfusionM:SfMap>
            </TabItem>

How would I point this to a custom map server? In the Xamarin version of the control I would use RequestTileUri

Thanks

2 Replies 1 reply marked as answer

PS Paul Smith July 24, 2020 01:47 PM UTC

I think I've answered my own question...

I created a new class derived from ImageryLayer, and overrode the GetUri function using X, Y and Scale to make my tile URL:

    public class ImageLayerExt:ImageryLayer
    {
        protected override string GetUri(int X, int Y, int Scale)
        {
            var link = "https://... HIDDEN MY ACTUAL URL
            return link;
        }
    }

Then in my XML, I replaced the ImageryLayer with my new class:

            <TabItem x:Name="MapTab">
                <syncfusionM:SfMap x:Name="sfMap">
                    <syncfusionM:SfMap.Layers>
                        <local:ImageLayerExt />
                    </syncfusionM:SfMap.Layers>
                </syncfusionM:SfMap>
            </TabItem>


Marked as answer

RS Ramya Soundar Rajan Syncfusion Team July 27, 2020 09:56 AM UTC

Hi Paul Smith, 
 
We are glad to hear that you have resolved the reported problem.  
  
Please get in touch with us if you would require any further assistance 
 
Regards, 
Ramya S 


Loader.
Up arrow icon