0
votes

we are developing a tour with GEPlugin and I have some questions..

The tour is similar to Tour.

It starts and navigates to a Placemark where its stop and shows a balloon with a specific information for the Placemark.
I have defined the balloon using an iframe inside the description in kml, that points to a php script.
I can load the css and javascript if I click the placemark (via click event attached) however I can´t make it show up when the tour stops setting

<Change><Placemark><gx:balloonVisibility>1</gx:balloonVisibility></Placemark></Change>

in the kml file.

Is there a way to make It show up the way I want?

Thanks!

1

1 Answers

0
votes

Ok, I have found the solution.

I attached the event balloonopening (looked all over around the documentation) to the instance of the google earth plugin, get the feature and set the specific balloon.

Here goes some code example:

function showBalloon(placemark){
    var content = placemark.getBalloonHtmlUnsafe();
    var balloon = ge.createHtmlStringBalloon('');
    balloon.setFeature(placemark);
    balloon.setContentString(content);
    balloon.setCloseButtonEnabled(false);
    ge.setBalloon(balloon);
}

google.earth.addEventListener(ge, 'balloonopening', function(){
    var placemark = ge.getBalloon().getFeature();
    showBalloon(placemark);
});

Thanks!