MikeC
MikeC

Reputation: 1

Removing GlobeBrowserBalloon controls

I am trying to remove the forward and back buttons from my GlobeBrowserBalloons, as I only want to keep the closing X.

I know that the method is balloon.removeBrowserControl(AbstractBrowserBalloon.BrowserControl browserControl); And the constructor arguments for BrowserControl are (String action, Offset offset, Object imageSource)

My question is, what do I put in the constructor for the BrowserControl? I am not familiar with what action and imageSource are.

Upvotes: 0

Views: 67

Answers (1)

忙进忙出
忙进忙出

Reputation: 13

I was able to remove the directional browser controls from a GlobeBrowserBalloon this way:

Iterable<AbstractBrowserBalloon.BrowserControl> bc = balloon.getBrowserControls();
        Iterator<AbstractBrowserBalloon.BrowserControl> br = bc.iterator();
        while (br.hasNext()) {
            if (!(br.next().getAction().equals("gov.nasa.worldwind.avkey.Close"))){
                br.remove();
            }
        }

The actions are Back, Forward, and Close. The imageSource can be a string locating an image file.

Upvotes: 1

Related Questions