Hi, been using the trial of WPF but am having trouble with Google Maps as an overlay. When I use our enterprise client id and private key I’m not seeing the map tiles - it mostly works when not using the key/clientid.
I looked at the web requests using the simplest code (see below). It looks like the url parameters are incorrectly formatted before its signature is created. Here’s what seems to be happening in the request url:
maps.googleapis.com/maps/api/staticmap?center=-40.84706,-45.175781&zoom=3&size=512x512&maptype=roadmap&format=jpg-baseline&sensor=falseclient=gme-cdcltd&&signature=yRDpGRbBNleZvOsJSCXmbJLlac4=
When the url is being constructed, the client parameter is incorrectly placed just after the sensor parameter value:
…sensor=falseclient=gme-cdcltd&&signature=…
trying to use this url will fail:
The Google Maps API server rejected your request. Unable to authenticate the request. Missing the ‘client’ parameter. Learn more: developers.google.com/maps/documentation/business/webservices/auth
Is there anything I can do override the url creation process or another way to fix this?
PrivateSubWpfMap_Loaded(ByValsenderAsSystem.Object,ByValeAsSystem.Windows.RoutedEventArgs)Map1.MapUnit = GeographyUnit.MeterMap1.CurrentExtent =NewRectangleShape(-13939426.6371, 6701997.4056, -7812401.86, 2626987.386962)
DimgmapAsNewGoogleMapsOverlay()gmap.Name =“GMAP”gmap.MapType = GoogleMapsMapType.RoadMapgmap.TileType = TileType.MultipleTilegmap.ClientId =“gme-cdcltd”gmap.PrivateKey =“my private key here<my><my>”
AddHandlergmap.SendingWebRequest,AddressOfreq
Map1.Overlays.Add(gmap)Map1.Refresh()EndSub
PrivateSubreq(senderAsObject, eAsThinkGeo.MapSuite.Core.SendingWebRequestEventArgs)Debug.Print(e.WebRequest.RequestUri.ToString())EndSub