2

Possible Duplicate:
Google Maps: How to create a custom InfoWindow?

I just came across one question related to google maps in stackoverflow.

Google Maps: How to create a custom InfoWindow?

I really like the popup that they mentioned in the question and the image is as follows.

Question: How to create or use same popup(InfoWindow) in google Earth.Is there any way to achieve this?

IMAGE:
enter image description here

Help wolud be appreciated.

Community
  • 1
  • 1
Kiran
  • 20,167
  • 11
  • 67
  • 99
  • You want to do this within the Google Earth application? – Sparky Feb 22 '12 at 07:41
  • no i just need this in google earth plug-in for web pages. – Kiran Feb 22 '12 at 07:48
  • 1
    Not to be picky or anything, but Google Earth is different to Google Maps and while I haven't tested the answer in the linked question I wouldn't be surprised if it doesn't work – lifeIsGood Feb 22 '12 at 17:50
  • @lifeIsGood: yes i agree with you google earth is entirely different to google maps but i am trying to get the style of popup in both cases(google maps and google earth) – Kiran Feb 23 '12 at 02:35

1 Answers1

1

As far as I know you can't control the look of the balloons in the stand alone Google Earth application. If you are referring to the Google Earth plug-in for web pages, then you can do some slight modifications (like setting the width and height).

I have made a website where instead of a balloon opening, I prevent that event, get the contents of the balloon and show them in a dialog. You can see my page here http://www.3dwhistler.com/

A basic example of what I am doing is this:

 google.earth.addEventListener(ge, 'balloonopening', function(event) {
event.preventDefault();
// sometimes event.preventDefault() doesn't work so use the following line instead (uncomment it obviously)
// ge.setBalloon(null);

// find out which placemark's balloon tried to open
var placemark = event.getBalloon().getFeature();
var placemark_desc = placemark.getDescription();
var placemark_name = placemark.getName();
// use this if you have 'unsafe' stuff in the balloon - eg javascript
var placemark_desc_active = placemark.getBalloonHtmlUnsafe();

// Do something with the info

    });
lifeIsGood
  • 1,229
  • 1
  • 15
  • 22
  • yes i tried same thing we can display data on popup.But as per client we need to show only on balloon with above mentioned style. – Kiran Feb 22 '12 at 07:33
  • Are you wanting to do a custom overlay??? That "rounded-box" doesn't appear to be part of the standard "balloon" interface... and is probably either a custom-placemark icon or a custom overlay. Seems a bit hack-ish... and probably more difficult to implement... but I guess it would work. – TheCompWiz Feb 22 '12 at 14:17
  • Actually... asked/answered: http://stackoverflow.com/questions/3860277/google-maps-how-to-create-a-custom-infowindow – TheCompWiz Feb 22 '12 at 14:20
  • @TheCompWiz: url mentioned by you is related to google maps and i am trying to achieve same thing in google earth – Kiran Feb 23 '12 at 02:36