webMapViewer, web 2.0 problem : Missing the 'q' parameter

hi, i have a project on xojo 2019 … where i use the MapViewer web control (with my valid google api key) and it always worked.
I’m porting it to web 2.0 xojo 2021 …, then using the new webMapViever with my google apiKey, and it doesn’t work and constantly returns the message "Google Maps Platform rejected your request. Invalid request. Missing the ‘q’ parameter. ".
The beauty is that the creation of a webMapLocation object works, in fact I set an address to it (and always through my api key) and it gives me back latitude and longitude , then add this WepMapLocation to the webMapViewer control, then call the goToLocation method and the control show error “… missing the ‘q’ parameter ’ …”.

The strange thing is that with xojo 2019 it works …

this is the code that work in X2019 and not work on X2020/21
i put this in a button

wMap.APIKey = “XXX____XXX____XXXX”
dim loc as new WebMapLocation
loc.APIKey=“XXX____XXX____XXXX”
loc.Address= "via napoli 38 Prato 59100 "
loc.Visible=True
'…here loc has valid data in lat and long
wMap.Zoom=20
wMap.AddLocation(LOC)
wMap.GoToLocation(loc)

does anyone have any information about it?

ps. even the example that comes with xojo 2021 does not work (even by entering a valid google api key)

This is what Greg answered, haven’t test that:

Edit: sorry this was not helpful.

1 Like

the position search is done with the webMapLocation and then this position is added to the position collection of the webMapViewer, what Greg indicates is not documented and it is not clear how to use it, also if I try to use the webMapViever.search (" way, cap, street etc ") an error is reported anyway. Also, the same controls and code… in the 2019 r 3.2 release work. I have no idea what Greg is pointing to.

@Greg_O_Lone

can you detail and show a piece of code tested and working of what you answered in another post regarding the problem of the webMapViever control and the query error?

thanks

update…

technical support suggested me to use an app on secure connection, i also made this attempt … using my valid google api key (totally working in xojo 2019r3.2), initializing the webMapViewer api properties in the event open, and then using the webMapViewer.search (“valid address”) method without then passing by adding webMapLocation points to the webMapViewer, and now the result is that the webMapViewer control no longer shows the message of the missing parameter q but this "Google Maps Platform rejected your request. This API project is not authorized to use this API. " , it therefore seems that the api key that went with the xojo2019R3.2 (with the bees activated at that time) is not valid for the queries made by the new control, does anyone know which sub functions of the google api should be activated ??

ok the operating problems are related to:

  1. the new webMapViewer must have a google key with the Map Embed active
  2. the restrictions on the key must be able to allow the use of Map embed
  3. Everything works even without a secure protocol
  4. the xojo documentation does not give any indication of this and I hope they update it as soon as possible as it still refers to the control of the 2019 rel

(HOWEVER THANKS TO THE TECHNICAL SUPPORT THAT DUE TO CROSS TESTS ALLOWED ME TO GET TO MAKE THE OBJECT WORK)

2 Likes
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.