amay077 / Xamarin.Forms.GoogleMaps

Map library for Xamarin.Forms using Google maps API
https://www.nuget.org/packages/Xamarin.Forms.GoogleMaps/
MIT License
546 stars 346 forks source link

Show Google map in China #647

Closed galadril closed 4 years ago

galadril commented 5 years ago

I need to show the map also in China. The Google Maps APIs are served within China from the domain maps.google.cn. This domain does not support https. When making requests to the Google Maps APIs from China, please replace https://maps.googleapis.com with http://maps.google.cn.

For example: https://**maps.googleapis.com**/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA

would become: http://**maps.google.cn**/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA

Is this possible via this library (of the Xamarin Forms Maps library)??

galadril commented 5 years ago

Maybe it would be an idea for me to use custom TileLayer of Google when i detect that the user is based in China..


var objTile = TileLayer.FromTileUri((int x, int y, int zoom) => new Uri($"http://{"mt".Substring(new Random().Next(3), 1)}.google.cn/vt/src=app&x={x}&y={y}&z={zoom}"), 512);
objTile.Tag = "china";
map.TileLayers.Add(objTile);

Ill try this

galadril commented 4 years ago

neverminds.. ill use a different control for china