Skip to content
The Road to Delphi — Delphi, VCL, VCL Styles, UxTheme and WinAPI

Important Note about using the Google Maps API from Desktop Apps

,

If you are experimenting some strange issues (maps goes blank, some elements of the maps are not displayed) using the Google Maps API from a desktop application.

GoogleMapsError

This is because the JavaScript API v3 no longer supports the IE7 and IE8 rendering mode, as is stated on this document https://developers.google.com/maps/documentation/javascript/browsersupport.

 

The workaround is very simple just add the V=3 parameter to the script tag, So if you script looks like this

[sourcecode language=”jscript”]
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script&gt;
[/sourcecode]

Change to

[sourcecode language=”jscript”]
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3&sensor=true"></script&gt;
[/sourcecode]

 

Note  :   If you do not explicitly specify a version in your JavaScript API bootstrap request, you will receive the experimental version by default (3.22) which not longer supports the IE8.

 

GoogleMapsOK

Another option is tweak the Windows registry how is shown here.

By the way I just updated all the Google Maps related code of this blog (Check the updated code on Github).

Some additional references

 

Regards
Rodrigo.

7 responses

  1. Warren Glimpse Avatar
    Warren Glimpse

    Thank you. I have a problem …

    I downloaded the 5 files from here: https://github.com/RRUZ/blog/tree/master/Google/Maps/Google%20Maps%20Basic%20Sample

    I tried to open the project using Delphi XE2.

    This error occurs: [image: Inline image 1]

    How to fix?

    Thank you.

    1. Which is the error?

  2. It also help to add

  3. Steve Faleiro Avatar
    Steve Faleiro

    Thank you.

  4. Reblogged this on burningrump.

  5. Adding ?v=3 will buy you a few months as you’re pinning to the ‘release’ version instead of the ‘experimental’ one [1], but in 3-6 months the last version (3.21) which supports IE8 will be no longer available once it’s time as the ‘frozen’ version winds down.

    The registry tweak or figuring out how to get a more updated rendering engine in the web control is your best bet for a long term solution.

    [1] https://developers.google.com/maps/documentation/javascript/versions

    1. Thanks for the info.

Leave a Reply