Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a technical reason not to use a TWebBrowser in Delphi to view Google Earth?

I do hope that this is not deleted as subjective. The only subjective part might be that 1) my Delphi is better than my PHP and 2) I prefer compiled to interpreted programming languages.

However, the actual (non-subjective) question is - if I choose Delphi and use a TWebBrowser (or similar mechanism) to view/manipulate Google Earth, will I be restricting my available functionality in any way?

Are there some things that I can only do "in a browser" that I can't do "in a VCL browser component"?

[Update] I forgot to say that 1) I am comfortable with Windows only and, 2) the Google Earth functionality is only one part of a larger APP (for me, it is easier to implement that app as a Delphi program than something browser based, but that sounds subjective again, which is why I never mentioned it. I'll just stick with "if I choose Delphi and use a TWebBrowser will I be restricting my available functionality in any way?" as the question, since that can be answered.

like image 803
Mawg says reinstate Monica Avatar asked Jul 04 '12 07:07

Mawg says reinstate Monica


3 Answers

There is no technical reason why not to use the TWebBrowser to display maps, or anything for that matter. In fact, this is a matter of opinion, and most likely you have heard people's opinions telling you not to do so. Unfortunately, Stack Overflow is a Question/Answer site, so a question like this isn't necessarily feasible.

The TWebBrowser wraps an Internet Explorer browser window, and relies on whatever version of IE is installed. Anything which you can open in Internet Explorer can also be opened in the TWebBrowser, Google Earth included. It's a matter of pointing it to a page and loading it. As for technical reasons, there may be some glitches here and there, but I don't see why not.

like image 187
Jerry Dodge Avatar answered Nov 14 '22 23:11

Jerry Dodge


Are there some things that I can only do "in a browser" that I can't do "in a VCL browser component"?

The short answer is, that if you know the TWebBrowser (IE based) / DelphiChromiumEmbedded (Webkit) inside-out you are not limited.

Two major browsers I know of, are based on TWebBrowser/IE control - Avant Browser (written in Delphi) and Maxthon (I have used both, and they served me very well, until I completely switched to FF) - never had any compatibility issues with them (compared to IE application).

A good starting point will be the TEmbeddedWB - This package wraps the IWebBrowser interface and Control Library (SHDOCVW.DLL) to allow you to create a customized Web browsing application.

One very important issue, the Web Browser Control has, that it uses IE 7 rendering mode by default. so you will need to specify the IE rendering mode for your own application (see this article). There are other issues but most of them could be configured and customized via the registry FeatureControl keys:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl

like image 26
kobik Avatar answered Nov 14 '22 23:11

kobik


Yes, there is one - Chromium Embedded Framework (CEF) is much high performance than IE, especially in the case where your end user's using an earlier version of IE.

CEF is based on Google's open source project Chromium.

I'm using CEF in LIVEditor (my new live html editor) and the result is very very good!.

But note that you'll have to distribute an additional 20 MB files when compressed.

like image 2
Edwin Yip Avatar answered Nov 14 '22 21:11

Edwin Yip