This code works fine -

<p>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252" />
<meta content="Microsoft FrontPage 4.0" name="GENERATOR" />
<meta content="FrontPage.Editor.Document" name="ProgId" />
</p>
<table width="500" bordercolordark="#cc9900"
bordercolorlight="#ffff00" border="3" style="height: 380px;">
<tbody>
<tr>
<td><!--webbot bot="HTMLMarkup" startspan -->
<script src="http://www.google.com/jsapi?key=ABcde....";></script>
<script type="text/javascript"><!--

       var ge;
       google.load("earth", "1");
       function init()
       {         google.earth.createInstance('map3d', initCB,
failureCB);      }
       function initCB(instance)
       {         ge = instance;         ge.getWindow().setVisibility
(true);
       ge.getNavigationControl() .setVisibility(ge.VISIBILITY_AUTO);
       ge.getLayerRoot() .enableLayerById(ge.LAYER_BORDERS, true);
       ge.getLayerRoot() .enableLayerById(ge.LAYER_ROADS,
true);      }
       function failureCB(errorCode) {      }
google.setOnLoadCallback(init);
// --></script>
<div id="map3d" style="height: 380px; width: 500px;"></div>
<!--webbot
      bot="HTMLMarkup" endspan --></td>
</tr>
</tbody>
</table>

But not this -

<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Earth API Sample</title>
<script src="http://www.google.com/jsapi?key=ABcde...";></script>
<script type="text/javascript">
function addSampleButton(caption, clickHandler)
{ var btn = document.createElement('input');
  btn.type = 'button';
  btn.value = caption;
if (btn.attachEvent)
  btn.attachEvent('onclick', clickHandler);
else
 btn.addEventListener('click', clickHandler, false);
// add the button to the Sample UI
 document.getElementById('sample-ui').appendChild(btn);  }
 function addSampleUIHtml(html)
{ document.getElementById('sample-ui').innerHTML += html; }
</script>
<script type="text/javascript">
 var ge;
 google.load("earth", "1");
 google.load("maps", "2");
 function init()
{ google.earth.createInstance('map3d', initCallback, failureCallback);
 addSampleUIHtml(
'<input id="location" type="text" value="San Francisco, CA"/>' );
 addSampleButton('Fly Here!', buttonClick)  }
 function initCallback(instance) {
 ge = instance;
 ge.getWindow().setVisibility(true);
// add a navigation control
 ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
// add some layers
 ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
 ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
 document.getElementById('installed-plugin-version').innerHTML =
 ge.getPluginVersion().toString();  }
 function failureCallback(errorCode) {   }
 function buttonClick() {
 var geocodeLocation = document.getElementById('location').value;
 var geocoder = new google.maps.ClientGeocoder();
 geocoder.getLatLng(geocodeLocation, function(point)
 { if (point)
 { var lookAt = ge.createLookAt('');
   lookAt.set(point.y, point.x, 10, ge.ALTITUDE_RELATIVE_TO_GROUND, 0,
60, 20000);
   ge.getView().setAbstractView(lookAt);  }  });  }
</script>
</head>
<body onload="init()" style="font-family: arial, sans-serif; font-
size: 13px; border: 0;">
<table border="3" width="500" bordercolorlight="#FFFF00" height="380"
bordercolordark="#CC9900">
<tr>
<td><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
</table>
<div id="sample-ui"></div>
<div id="map3d" style="width: 500px; height: 380px;"></div>
<br>
<div>Installed Plugin Version: <span id="installed-plugin-version"
style="font-weight: bold;">Loading...</span></div>
</body>
</html>

Anyone who might give a hint why all Google Earth examples with
buttons only shows 'Loading...' and all other examples works fine?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-ajax-search-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to