Articles in this section
Category / Section

How to show google map in WPF Map (SfMap)

1 min read

This article explains how to use google maps API to show that in Syncfusion WPF SfMap as shown in the following image.




Display the Google Maps


Step 1


Extend the ImageryLayer class and overriding the GetUri method and pass the google map tile Uri on it with their X, Y and Scale values as shown in the following code sample.



    public class ImageryLayerExt : ImageryLayer
        protected override string GetUri(int X, int Y, int Scale)
            var link = "" + X.ToString() + "&y=" + Y.ToString() + "&z=" + Scale.ToString();
            return link;


Step 2


Added the extended ImageryLayer (ImageryLayerExt) to its layers collection of maps to render the map control OSM layer as shown in the following code sample.





View the sample in GitHub.


See also

How to view bing map using WPF SfMap

How to open street map in WPF SfMap

How to add a multiple layers in OSM map

How to show the markers in WPF SfMap

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied