HTMLViewer not Load Google Maps html

  1. 2 months ago

    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.

  2. Greg O

    Sep 12 Xojo Inc Somewhere near Raleigh, NC

    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/

  3. 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.

  4. Greg O

    Sep 12 Xojo Inc Somewhere near Raleigh, NC
    Edited 2 months ago

    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://docs.xojo.com/index.php/HTMLViewer.UserAgent

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

  6. Greg O

    Sep 12 Xojo Inc Somewhere near Raleigh, NC

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

  7. Greg O

    Sep 12 Xojo Inc Somewhere near Raleigh, NC

    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.

  8. 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.

  9. Greg O

    Sep 12 Xojo Inc Somewhere near Raleigh, NC

    @SebastianKapellas 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
  10. 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. :/

  11. Greg O

    Sep 12 Xojo Inc Somewhere near Raleigh, NC

    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..."

  12. 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.

or Sign Up to reply!