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?
Private
Sub
WpfMap_Loaded(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.Windows.RoutedEventArgs)
Map1.MapUnit = GeographyUnit.Meter
Map1.CurrentExtent =
New
RectangleShape(-13939426.6371, 6701997.4056, -7812401.86, 2626987.386962)
Dim
gmap
As
New
GoogleMapsOverlay()
gmap.Name =
“GMAP”
gmap.MapType = GoogleMapsMapType.RoadMap
gmap.TileType = TileType.MultipleTile
gmap.ClientId =
“gme-cdcltd”
gmap.PrivateKey =
“my private key here<my><my>”
AddHandler
gmap.SendingWebRequest,
AddressOf
req
Map1.Overlays.Add(gmap)
Map1.Refresh()
End
Sub
Private
Sub
req(sender
As
Object
, e
As
ThinkGeo.MapSuite.Core.SendingWebRequestEventArgs)
Debug.Print(e.WebRequest.RequestUri.ToString())
End
Sub