As part of a program I'm on I need to have a seperate toolbar for map controls to keep the map itself as clutter free as possible. I've got all the hooks in to control things, but I'm finding the zoom controls aren't doing anything at all. Here's where my ActionListener responds to the button press:
Code:
@Override
public void actionPerformed(ActionEvent e) {
if(e.getActionCommand().equals(ZOOM_IN_TEXT)) {
log.debug("Zooming in!");
Position pos = instance.getWorldWindow().getView().getEyePosition();
Position tmpPos = Position.fromRadians(pos.getLatitude().radians, pos.getLongitude().radians, pos.getElevation() - 100.0);
instance.getWorldWindow().getView().setEyePosition(tmpPos);
} else if(e.getActionCommand().equals(ZOOM_OUT_TEXT)) {
log.debug("Zooming out!");
Position pos = instance.getWorldWindow().getView().getEyePosition();
Position tmpPos = Position.fromRadians(pos.getLatitude().radians, pos.getLongitude().radians, pos.getElevation() + 100.0);
instance.getWorldWindow().getView().setEyePosition(tmpPos);
}
}
I would expect each press to either increase/decrease my camera altitude by 100 meters, but it doesn't do anything. What am I doing wrong here?