google.load does not work - help!!!!

Oct 12, 2010 at 5:01 PM
Edited Oct 12, 2010 at 10:23 PM

Hi all,

I would like to use this very beautiful library for a Google Earth application.

The problem  is that tha basic function to initialize google ( google.load("earth",1) ) stays in a wait state forever.

Here you are two samples. In the first sample I try to use PageManager including google.load in onReady() function and it does not work.

In the second sample I simply removed PageManager and I extracted google.load from onReady(): in this case it works.

Any idea?...

HERE IT DOES NOT WORK

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test1.aspx.cs" Inherits="ExtAspNetTest.test1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title><link href="../css/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <ext:PageManager ID="PageManager1" runat="server" />   
    </form>

    <script type="text/javascript" src="http://www.google.com/jsapi?hl=en&amp;key=ABQIAAAAC3h5_2Y3eXJZ_w7Z_HV98hSQV5QCvDsPYUd-DehhS0aUUGqyiRRA8zmqDPg67F5ImLuncx0RhC8piQ"></script>
    <script type="text/javascript">

 function onReady() {
     alert("1");
     google.load("earth", "1");
     alert("2");
 }

    </script>

</body>
</html>

 

HERE NOT WORKS:


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test1.aspx.cs" Inherits="ExtAspNetTest.test1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title><link href="../css/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
   
    </form>

    <script type="text/javascript" src="http://www.google.com/jsapi?hl=en&amp;key=ABQIAAAAC3h5_2Y3eXJZ_w7Z_HV98hSQV5QCvDsPYUd-DehhS0aUUGqyiRRA8zmqDPg67F5ImLuncx0RhC8piQ"></script>
    <script type="text/javascript">

        alert("1");
        google.load("earth", "1");
        alert("2");
   
    </script>

</body>
</html>