I have embedded a lot of Google maps and most of them displays fine.
But – always when I embed a map with buttons (like the ‘Dusk to Dawn’ example) it
only displays "Installed Plugin Version: Loading...".
The Google plugin is correctly installed.
The map code that give this result looks like this –
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<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=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q"></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");
function init()
{ google.earth.createInstance('map3d', initCallback, failureCallback);
addSampleButton('Show Sun (Dusk/Dawn)', showSun);
addSampleButton('Hide Sun', hideSun); }
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 showSun() {
ge.getSun().setVisibility(true); }
function hideSun() {
ge.getSun().setVisibility(false); }
</script>
</head>
<body onload="init()" style="font-family: arial, sans-serif; font-size: 13px; border: 0;">
<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 has suggestion?