World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 06-18-2012, 06:06 PM   #1
mkozak
Junior Member
 
Join Date: Jan 2009
Posts: 26
mkozak is on a distinguished road
Default Custom zoom controls not working

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?
mkozak is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Custom Elevation Data RAM357 Development Help 11 02-22-2012 03:26 PM
View controls not working... adanecito Development Help 1 06-15-2011 12:19 AM
FlyToViewStateIterator.PanToIterator erratic behavior with zoom maemigh Development Help 1 02-19-2008 10:52 PM
Zoom in not working for real! S.W.A.T. Technical Support 4 07-13-2005 11:19 PM
Zoom not working? hykkhgkg666 Technical Support 6 02-23-2005 02:44 PM


All times are GMT +1. The time now is 01:09 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.