Usage of TWebGMaps.GetElevation

i want to get the altitude/elevation of a given mappoint and came across the google elevation freature.
is there an example of how to use the GetElevation function with the VCL WebGMaps component?



You can find information on the usage of GetElevation in the WebGMaps PDF manual under the topic "Map elevations".
thanx for your reply, but there is no example in the PDF.
i am searching for the error in my code, because GetElevation(Latitude, Longitude: double) ALWAYS returns false!
even a simple call of GetElevation(5,5) returns false!
what am i doing wrong?

The call you mentioned is correct.

Can you please make sure you are using the latest version of TMS VCL WebGMaps and have a valid APIKey assigned?

If the problem persists you can use a tool like Fiddler (free download) to display the HTTP request details and find out if an error has occurred.
We'll consider improving error handling in a future version.
i'm using the latest available version ( - though after installation TWebGmaps.Version returns
when using Fiddler it seems as there is no HTTP request at all!
Other GOOGLE api requests are recorded by Fiddler, but when using GetElevation nothing happens!
Can you please confirm that GetElevation is working as expected?
We are not aware of any issues with the GetElevation call in TMS VCL WebGMaps v3.0.0.0.
I've retested the sample below and it is working as expected.

Please note that the minimum required Delphi version is Delphi XE. The GetElevation call is not supported in Delphi versions prior to Delphi XE.

procedure TForm1.FormCreate(Sender: TObject);
  WebGMaps1.APIKey := '<APIKey>';

procedure TForm1.Button1Click(Sender: TObject);
 OutputDebugString(pchar(BoolToStr(WebGMaps1.GetElevation(5,5), True)));
 if WebGMaps1.Elevations.Count > 0 then

well, that explains it. i'm using an older Delphi version.
where is it noticed, that this only works above XE? didn't find it in the developers guide PDF...
any chance to make it work with older Delphi versions?
  • The list of features unavailable in Delphi versions prior to Delphi XE can be found on the product page. (
    You are correct that this should also be mentioned in the PDF manual. We'll extend the manual with this info asap.

    - Unfortunately we can't include this feature in older Delphi versions because of a technical limitation in the Delphi framework.
hahaha. very funny. you just added the line to the product page!
i am 100% sure it wasn't mentioned there an hour ago.

The GetElevation feature was accidentally omitted from the list on the product page.

It was indeed added just now as I noticed it was missing.