Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8433637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:26:31+00:00 2026-06-10T06:26:31+00:00

I am trying to get the Google Earth callbacks to work, but they don’t

  • 0

I am trying to get the Google Earth callbacks to work, but they don’t seem to be firing for me. I’ve used the View Change Example at the Google Earth API site as a reference, and see no difference between it and my code… yet mine doesn’t work!

Here are the important bits of my code:

<script type="text/javascript">
var ge;

google.load("earth", "1");

function init() {
  document.getElementById('map3d').innerHTML = '';
  google.earth.createInstance('map3d', initCallback, failureCallback);
}

function initCallback(pluginInstance) {
  ge = pluginInstance;
  ge.getWindow().setVisibility(true);

  // add a navigation control
  ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);

  // Set the FlyTo speed.
  ge.getOptions().setFlyToSpeed(ge.SPEED_TELEPORT);

  // add some layers
  //ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
  //ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);

  throw (new Error("InitCallback!"));

  google.earth.addEventListener(ge.getView(), 'viewchange', function () {
      throw (new Error("EVENT!"));
  });

}

function failureCallback(errorCode) {
}
</script>

The “InitCallback!” error is thrown properly, but I never see the “EVENT!” error thrown — no matter how much I move the globe around.

Does anyone see what I’m doing wrong? Any help is greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:26:33+00:00Added an answer on June 10, 2026 at 6:26 am

    I’m no expert on javascript stuff, but if you replace:

           throw (new Error("EVENT!"));
    

    with an alert instead eg:

           alert('EVENT!');
    

    I bet you will find it will work. ie the eventListener IS working, it just doesn’t seem to like the ‘throw’ command

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get google glog to work with windows, but I get these
I've been trying to get a certain Google API to work for two days
I have been trying since yesterday to get google like paging, but each time
I'm trying to get an auto-suggest like Google has but without the dropdown. By
I'm trying to get the django-cms to work on google-app-engine. Did anyone succeed in
I've been trying to get Google Analytics to work in PhoneGap 1.2.0 over Android
I am trying to get google maps api v3 to work, and well, it
i'm trying to get google steetview tiles and save them. But file_get_contents doesn't like
I am trying to get Google Closure Compiler to work to compile my javascript
I'm trying to get google analytics up and running on a monotouch app but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.