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 6022667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:53:25+00:00 2026-05-23T03:53:25+00:00

I am working on feeding Matlab’s simulation data to Google Earth Plug-in via COM.

  • 0

I am working on feeding Matlab’s simulation data to Google Earth Plug-in via COM.

My problem is that the command,which should be invoked after Google Earth finished loading, is invoked before that. That brings of course error.

I could use the pause command to pause the code waiting the Google Earth to load. But, this solution is not that efficient, as I don’t know exactly how fast or how slow Google Earth will load on different machines.

I’ve also tried using the properties of the COM object. It was close, but no cigar. The code looks like this

waitfor(h.Document.parentWindow.document,'readyState','complete')

or also this one:

while strcmp(h.Document.parentWindow.document.readyState,'complete')== 0
    pause(1);

end  

Is there any object properties that could be used? Thanks!

  • 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-05-23T03:53:26+00:00Added an answer on May 23, 2026 at 3:53 am

    Found the solution!

    Google Earth Plug-in will call the “initCallback” method when it finished loading.

    By adding a line on “initCallback” method, I change the title of my html document to other name, which indicates that the plugin is loaded.

    function initCallback(pluginInstance) {
          ge = pluginInstance;
          ge.getWindow().setVisibility(true);
    
          // tell the application the plugin is ready
          //(window.external.JSInitSuccessCallback_(pluginInstance);
          document.title = "Google Earth Plugin - Ready";
    
          // prevent mouse navigation in the plugin
          ge.getOptions().setMouseNavigationEnabled(false);
        }
    

    At MATLAB’s end, I just added the a while loop, comparing the html document title, pausing the executing until the plugin is finished loading.

    while strcmp(h.Document.title,'Google Earth Plugin - Ready')~=1
        pause(0.01)
    end
    

    Maybe there is other more elegant solution, love to hear your feedbacks

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

Sidebar

Related Questions

Working with a SqlCommand in C# I've created a query that contains a IN
Working on a project that parses a log of events, and then updates a
Working with python interactively, it's sometimes necessary to display a result which is some
I'm working on an ASP.NET application that uses VB. I'm using a SQLReader/SQLCommand/SQLConnection within
I'm working on a webpage that has a javascript image rotator, but it needs
I'm working on a web form which works in a following way. Read email
So I'm working on a Rails app to get the feeling for the whole
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
Working on a project at the moment and we have to implement soft deletion
Working on a somewhat complex page for configuring customers at work. The setup is

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.