We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use Custom map provider with Xamarin.Android to use google api

Thread ID:





147095 Sep 1,2019 12:23 PM UTC Sep 9,2019 05:12 AM UTC Xamarin.Android 3
Tags: SfMaps
Asked On September 1, 2019 12:23 PM UTC

I am trying to use Sfmaps within Xamarin.Android project and want to use Custom Map providers to refer google api. 
But cannot find any documentation for doing same. (only for Xamarin.Forms is found)

Rachel A [Syncfusion]
Replied On September 3, 2019 03:43 AM UTC

Hi Rohit, 
Greetings from Syncfusion. 
We can achieve the requirement by overriding the GetUri method in imagery layer as in the code snippet below. 
public class MainActivity : AppCompatActivity 
        protected override void OnCreate(Bundle savedInstanceState) 
            Xamarin.Essentials.Platform.Init(this, savedInstanceState); 
            SfMaps maps = new SfMaps(this); 
            ImagerLayerExt layer = new ImagerLayerExt(); 
public class ImagerLayerExt:ImageryLayer 
        protected override string GetUri(int X, int Y, int Scale) 
            var link = "http://mt1.google.com/vt/lyrs=y&x=" + X.ToString() 
        + "&y=" + Y.ToString() + "&z=" + Scale.ToString(); 
            return link; 
Please let us know if you have any concerns. 

Replied On September 7, 2019 10:36 AM UTC

Thanks  for response. It worked.

Rachel A [Syncfusion]
Replied On September 9, 2019 05:12 AM UTC

Hi Rohit, 
We are glad to know that your requirement is satisfied. 
Please let us know if you have any other queries. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon