Click here to Skip to main content
15,116,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
A bit of an aside before I get to my actual question:

A few months ago, I faced a problem where I needed to resize the Google Earth Balloon dynamically through javascript as I received AJAX calls (about twice a minute). Sometimes each call would only require increasing the balloon by one or two pixels, which was not a huge issue. The main problem was that some (a lot) of the time, the data I was getting back would require the balloon to be much larger which caused scrollbars to appear (an undesirable effect for the company I work for). Eventually after throwing code at it for days, I found a pretty hacky way to get the balloon to resize just the way I wanted it. After getting my data and refilling the balloon with the new data, I would call this:

setTimeout(window.location.reload, 250);

I had a theory that this would work since within the Google Earth application (Client and Plugin versions), I could right-click the balloon and click "Reload" and the balloon resized it the way I wanted it to. Obviously there is something a bit fishy about this hack considering if I use the same code in a normal browser, the page would just reload infinitely, so I also had to figure out a way to determine if I was in Google Bubble or in a browser version of this webpage (which I found a way, but it's not important or relevant to my question that I am eventually getting to). Now that things are a little less chaotic around the office, I want to find out EXACTLY why this works.

Finally, my question is: does the Google Earth API redefine the Window or Location Objects, or does it just redefine how window.location.reload works?

I am using Google Earth Client v6.1.0.5001 and Google Earth Plugin v6.2.2.6613
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900