Can I check whether GoogleEarth is installed or not?

167 views
Skip to first unread message

Jeffrey.Zhao

unread,
Nov 6, 2008, 5:07:22 AM11/6/08
to KML Developer Support - Google Earth Browser Plugin
If GE application has been installed,I will call it.
If not, I'll call GE plugin.

fraser

unread,
Nov 6, 2008, 7:49:43 AM11/6/08
to KML Developer Support - Google Earth Browser Plugin
Hi Jeffery.Zhao,

I'm not totally sure what you mean, apologies if I'm off the mark...

If you are asking if you can detect if the full GE application has
been installed from a web page then no.
There is no way you can detect the application via javascript as it
has no access to the local file system or registry. Even if you could
detect if the full application was installed there is no way you can
'call' (launch?) it from a web-page.

I hope I understood what you were asking!

F.

Jeffrey.Zhao

unread,
Nov 6, 2008, 8:48:01 PM11/6/08
to KML Developer Support - Google Earth Browser Plugin
Hi,fraser,
Thank you very much for your answer and I'm sorry for my
poor english.

I want to detect whether the GE full application has been
installed from a web page, if true, browser can download and open a
kml file use it, and if false ,then I'll access the GE plugin in a web
browser.

Sorry for my poor english.
> > If not, I'll call GE plugin.- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Roman N

unread,
Nov 7, 2008, 2:38:30 AM11/7/08
to KML Developer Support - Google Earth Browser Plugin
Hi Jeffrey,

As Fraser mentioned, there is no way to detect the presence of the
Google Earth desktop client. However, you also don't want to rule out
the idea that the user may have some other KML viewer installed. For
this reason, it's usually best to offer both options: an embedded
Earth plugin view of the KML file, along with a KML download link
somewhere near it.

- Roman

Clyde

unread,
Nov 7, 2008, 9:04:38 AM11/7/08
to KML Developer Support - Google Earth Browser Plugin
Question, Guys,

This thread is about detecting whether the GE Desktop client is
installed. What's the easiest way to check if the GE Plugin is
installed. I understand that attempted to create an instance of GE
will bring up a "load the GE plugin" page, but I'd like to know
whether the plugin is there before I attempt to create an instance of
GE.

Much thanks,

Clyde

fraser

unread,
Nov 7, 2008, 11:27:23 AM11/7/08
to KML Developer Support - Google Earth Browser Plugin
Hi Clyde,

Simply use the isInstalled() method of the google.earth namespace.

----------------------------
//Whether or not the Google Earth Browser Plug-in
//is currently installed on the user's machine.
var isInstalled = google.earth.isInstalled();
----------------------------

For more information see: http://code.google.com/apis/earth/documentation/reference/google_earth_namespace.html

Regards,

F.

p.s. @Jeffrey - you could do this on windows machines usign IE by
using a activex object on your page - but it would be a bit of a hack
to say the least...
> > > > - 显示引用的文字 -- Hide quoted text -
>
> - Show quoted text -

Clyde

unread,
Nov 7, 2008, 1:43:04 PM11/7/08
to KML Developer Support - Google Earth Browser Plugin
Thanks, Fraser,

Works great in FF, "Object doesn't support this method" error in IE.
Am I missing something really simple? Code is below. When I examine
the google.earth object in FF debugger I do see the isInstalled
method. Don't see it in IE when I look with Dev Toolbar. Puzzled.

<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi?
key=ABQIAAAAsr2iuczFsI7h1QTeblwCAhT_QHZLu7nHX8D32wEMl2eU6Kx7PhS2Ypa7WH2AQbJiTNN80DJu0ZuPfQ"></
script>
<script>
google.load("earth","1");

function detectGEInstalled()
{
return google.earth.isInstalled();

}

alert( detectGEInstalled() ? "Installed":"Not installed");
</script>
</head>
</html>

On Nov 7, 8:27 am, fraser wrote:
> Hi Clyde,
>
> Simply use the isInstalled() method of the google.earth namespace.
>
> ----------------------------
> //Whether or not the Google Earth Browser Plug-in
> //is currently installed on the user's machine.
> var isInstalled = google.earth.isInstalled();
> ----------------------------
>
> For more information see:http://code.google.com/apis/earth/documentation/reference/google_eart...

Clyde

unread,
Nov 7, 2008, 2:04:43 PM11/7/08
to KML Developer Support - Google Earth Browser Plugin
Fraser,

Got it! I went ahead and simply attempted to create an ActiveXObject
from the GE Plugin wrapped in a try...catch. That works for IE. For
FF, I used the navigator's plugin array. This way I don't even have to
load the google.earth namespace.

Thanks, again.

Clyde
Reply all
Reply to author
Forward
0 new messages