question

AliNoshahi avatar image
0 Votes"
AliNoshahi asked ·

Using Google Maps vector tiles in UWP MapControl

Hi there everyone. I'm trying to create a Google Maps client for Windows 10. I know that I can use Google Maps tiles using like this http://mt1.google.com/vt/lyrs=r&hl=x-local&z={zoomlevel}&x={x}&y={y} but using this way tiles are not in a vector style. Isn't there any way to use vector google maps in MapControl for UWP? Thank you. Have a good year.

uwp
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichardZhang-MSFT avatar image
1 Vote"
RichardZhang-MSFT answered ·

Hello,​

Welcome to our Microsoft Q&A platform!

In UWP, MapControl provides HttpMapTileDataSource to customize the map tile service.

Here is the document about MapTileSource.

For using Google Map service, you can consider using this method:

 public static void UseGoogleMaps(MapControl Map, string mapUri)
 {
     if (Map == null) return;
     Map.Style = MapStyle.None;
     Map.TileSources.Clear();
     Map.TileSources.Add(
         new MapTileSource(
             new HttpMapTileDataSource(mapUri)
             {
                 AllowCaching = true
             }
         )
     );
 }

You can also try to search related content in Github, there should be similar functions implemented in the community

Thanks.

· 2 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi there and thanks for your reply. Yes, I know this code and it works perfectly with the URL below. http://mt1.google.com/vt/lyrs=r&hl=x-local&z=%7Bzoomlevel%7D&x=%7Bx%7D&y=%7By But it is not vector I need the actual URL I should use for vector google maps tiles. As there's no UWP SDK for GMaps I also don't know where can I find it too. �� Thanks.

0 Votes 0 · ·

Hi, MapControl obtains the map tile image through a network request. At this time, the request is usually an image instead of a vector file. Tile images have great advantages in rendering, which is a common practice.

0 Votes 0 · ·
rbrundritt avatar image
0 Votes"
rbrundritt answered ·

Google Maps doesn't use the same type of vector tiles as the UWP map controls. Also, Google Maps uses a close schema, so no other map controls, other than their own can use them. I believe they also have a restriction on using the tiles outside of their controls as well.

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.