HTMLViewer not Load Google Maps html

The last days I have found out that my htmlViewer is no longer displaying google maps.
I stopped my code and took the html I create for Google maps and i used it on w3schools test environment and everything worked fine.

Does anyone has a suggestion to make in order to make HTMLViewer display maps again?

I have tested both native and webkit. The difference is that on native i get a grey screen and on webkit it looks like it load the google labels and navigation cursors
but the map is grey too.

There’s a couple of possibilities, but my instinct (since you’re able to get partial content) is that you need a Google Maps API Key. A few years ago they decided to start charging developers for use of their maps based on application usage.

https://developers.google.com/maps/pricing-and-plans/

Greg,

I create a html on my App. This one i pass it to the htmlViewer and it cannot be displayed in Xojo App.
The same html is working on every browser both on my Windows and Mac.
I don’t think it is a problem with the key.

Keep in mind that HTMLViewer is not the same as a browser. For instance, the User-Agent string is probably not set at all. Try this:

On Mac, try this:

HTMLViewer1.UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8"

https://documentation.xojo.com/index.php/HTMLViewer.UserAgent

My App is for Windows only.
Even if it works on Mac i must fix it for Windows. :frowning:

You can always get a user agent string for windows later. This will just tell you if it’s a user-agent problem.

That in mind though…

Have you set the registry key for the browser version used in the HTMLViewer on Windows? By default, it is the minimum version provided by the OS, so it could be that Google has dropped support for whatever version the HTMLViewer is presenting.

I Have set the registry Key as it is proposed on Xojo Docs using the above code:

Dim reg As New RegistryItem(“HKEY_CURRENT_USER\SOFTWARE\Microsoft”)
reg = reg.AddFolder(“Internet Explorer”)
reg = reg.AddFolder(“Main”)
reg = reg.AddFolder(“FeatureControl”)
reg = reg.AddFolder(“FEATURE_BROWSER_EMULATION”)
reg.Value(App.ExecutableFile.Name) = &h2af9 ’ IE 11 renderer

I tried to take the UserAgent string but it is empty.

Right. You’ll have to set it.

Here’s the one for IE11:

Mozilla/5.0 (Windows NT 6.3; Win64, x64; Trident/7.0; rv:11.0) like Gecko

Greg,

I used

Mozilla/5.0 (Windows NT 6.3; Win64, x64; Trident/7.0; rv:11.0) like Gecko

but it is still not working. :confused:

If you could create a simple sample app that shows the problem, I could take a look at it. If the project requires any private data, please create private message to send me a link. You can do that by clicking on my name and then select “Start a private conversation…”

I will try to create a new project and go step by step. Because we use a subwindow of Xojo window and rubber views.
If I do not find any solution i will contact you.

Thank you very much for your help.