Sorry! Something went wrong error

I'm using the component, and shortly after startup I get the error :


Sorry! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details.

Anyone had this and resolved the error ? I've obtained and set an API Key, but it still doesn't work.

Hi , I have the same problem , device  SM-T230  Andorid version 4.4.2  thanks

IOS 9.3.4 same error

We've indeed seen intermittent issues from Google with their Google Maps service in the past days.
We could also see the problem here last week at specific times only but today we do not see the issue.
When we saw the issue, it was resolved by specifying a Google  Maps Javascript API key to TMSFMXWebGMaps.APIKey before launching the map, so I'd recommend as a precaution to request such (free) key and assign it.

Hi,


Same problem here.

Galaxy S7 - Android 6.0.1

We create the map in runtime and supply the API key, but same error message
after two seconds after showing. Our code :

    web3              := TTMSFMXWebGMaps.Create(self);
    Web3.Parent  :=  TabItem1;
    web3.OnDownloadFinish := fix3;
    Web3.Name    := 'FT' + IntToStr(icmap);
    Web3.APIKey  := 'our_api_key';
    Web3.MapOptions.DefaultLatitude  := xlat;
    Web3.MapOptions.DefaultLongitude := xlon;
    web3.Align   := TAlignLayout.Client;

(Before we didn't supllied an API key, but still worked, using one makes no difference.)

Please a solution as our app is useless now.

Thanks,

Paul

Bruno replied to my direct support request and told me that you need to put the API Key in the constructor of the Tform (or the Tframe in my case). I did that and it made no difference. I'm not sure this is a TMS problem, because sometimes it happens and sometimes it doesn't. The problem is that we have no visibility of the actual error that would be posted in the Developer's Console so we don't know what the problem is.

Bruno replied to myself regarding this issue too in regards to a support ticket. His fix was to set the WebGMaps.APIKey to out own API key. This is something that we are already doing and it's still not working for us. 


The maps goes down in the middle of the day and comes back up around the same time that Google resets it's API limit count. 

This makes me to believe that somewhere there is a hard coded API key which is being used by TMS which may be going over quota (which would explain why at a certain time of the day the map software stops working and then continues to work early in the morning in the UK) I believe the daily request pool resets at 12:00am PST. 

Could TMS please list the entire Google APIs which should be enabled to have full use of the software please? Such as maps javascript, directions API and so on. Just so we can ensure our API key has everything enabled that it should have. 



This is something very similar to how we do things here and we are having the same problem. 

And it's down again! We are setting the APIKey both hard coded as the property and coding it in before initialization. 

We also see the issue at this time when no API Key is assigned.

After assigning the API Key, the issue goes away.

Can you please make sure you have correctly assigned the API Key value?
Enabling only the "Google Maps JavaScript API" in the Google Developers Console should be sufficient. If you are using the directions functionality, also enable the "Google Maps Directions API".
If the API Key is assigned correctly, you should be able to see the stats (In Google Developers Console) increase every time the map is loaded.

We have a Javascript API key, we're assigning it in the Constructor and if we read the key back during runtime we get the correct key returned. However, we get this error in the log :


"You have exceeded your daily request quota for this API. To request more than 25,000 map loads per day, you must use an API key and enable billing: https://developers.google.com/maps/documentation/javascript/get-api-key", source: http://maps.google.com/maps/api/js?sensor=false&libraries=panoramio,weather (33)

Unfortunately the error message doesn't tell us what the API key is, but we're only testing on a single device with one call every couple of minutes.

Peter could be onto something with maybe a hard coded API key, because we're not even using a couple of hundred calls in a day.

We changed '%apikey%','apikey=' 


to 

'%apikey%','key='

Thoughout the project

I can't find '%apikey%','apikey=' in the source code, only '%apikey%','key='.
Can you please make sure you are using the latest version of TMS FMX WebGMaps?

I have set the APIKey in my TFrame constructor, and again when I interact with the map. But in :


function TTMSFMXWebGMaps.ReplaceHTML(HTML: string): string;

If I add a Log.d at this line :

Result  := ReplaceText(Result,'%apikey%','&key=' + APIKey)

The value of APIKey is always blank. If I then set the value of APIKey to my GMaps Javascript API Key, the map loads correctly.

This is indeed an issue on Android.

As a workaround you can call Reinitialize after assigning the APIKey property.

Example:
procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFMXWebGMaps1.APIKey := 'ABC';
  TMSFMXWebGMaps1.Reinitialize;
end;

The next update of the TMS FMX WebGMaps will address this issue internally.

Great. That seems to work.

Hi,


Doesn't work for me when creating in runtime :

    web3              := TTMSFMXWebGMaps.Create(self);
    Web3.Parent  :=  TabItem1;
    web3.OnDownloadFinish := fix3;
    Web3.Name    := 'FT' + IntToStr(icmap);
    Web3.APIKey  := 'our_api_key';
    Web3.MapOptions.DefaultLatitude  := xlat;
    Web3.MapOptions.DefaultLongitude := xlon;
    web3.Reinitialize;
    web3.Align   := TAlignLayout.Client;

As a matter of fact, this makes it worse. Without the Reinitialize, it shows
the map for 2 seconds before going to error. Now it instantly goes to error.

Am i missing something, or won't the "solution" work when creating in runtime ?

Thanks,

Paul

The sample code you provided is working as expected here.
If the error message is displayed instantly this indicates that most likely the provided API Key is invalid or incorrect.
Can you please make sure you have assigned the correct API Key and the Google Maps JavaScript API is enabled on the Google Developers Console?

Bart Holvoet2017-03-15 09:20:30

The next release of the TMS FMX WebGMaps will include an option to display any Developer Console messages.

Hi Bart,


Got it working now, with correct key.

Thanks.