Skip to content

Restore possibility to tilt 2D globe#52

Merged
wcmatthysen merged 2 commits intoWorldWindEarth:developfrom
lucgirardin:develop
Jun 19, 2019
Merged

Restore possibility to tilt 2D globe#52
wcmatthysen merged 2 commits intoWorldWindEarth:developfrom
lucgirardin:develop

Conversation

@lucgirardin
Copy link
Copy Markdown

Description of the Change

Restore the possibility to tilt the view when in "Flat" 2D mode, effectively creating a 2.5D view.

Why Should This Be In Core?

WorldWind v. 2.0.0 and earlier always allowed to pitch the view in 2D mode, which is a useful "core" functionality. For unknown reason, WorldWind v. 2.1.0 removed this possibility.

Benefits

The pitch buttons as well a mouse gestures (Shift-drag) are functional in all view modes.

Potential Drawbacks

This alter the default behavior compared to WorldView v. 2.1.0, which removed the possibility of any tilting by hard-coding it in BasicViewPropertyLimits#limitPitch(View, Angle). However, this behavior can easily be recreated by customizing the ViewPropertyLimits with setPitchLimits(Angle.ZERO, Angle.ZERO).

Applicable Issues

Tilting Globe no longer possible #51

@wcmatthysen
Copy link
Copy Markdown
Member

wcmatthysen commented Jun 16, 2019

@lucgirardin, I think we should control this behavior with a new property. Maybe something like gov.nasa.worldwind.avkey.Allow2DTilt. This way we can keep the default upstream behavior by setting the property's default value to false in worldwind.xml and allow for it to be changed when users want to be able to tilt in 2D mode.

Added a property called Allow2DPitch to worldwind.xml that controls
whether pitching forward or backwards for a 2D Globe is allowed or not.
The entry for this property was also added to the AVKey class to allow
for easy reference. Modified the BasicViewPropertyLimits class by adding
the is2DGlobe() check back as well as adding a new utility method called
allow2DPitch(). This method together with the is2DGlobe() method is
called to determine whether we allow the pitch to be set in the
limitPitch() method. The default value for the new property is "false"
to ensure that default upstream behavior is kept.
@wcmatthysen
Copy link
Copy Markdown
Member

@lucgirardin, I added a new property called gov.nasa.worldwind.avkey.Allow2DPitch instead of gov.nasa.worldwind.avkey.Allow2DTilt as it's name is a bit more clear in what it does ("pitch" better describes the functionality than just "tilt"). When you set this property to true in worldwind.xml it will allow for the view to be pitched forwards and backwards in 2D mode. The default value for this property is false which means that we keep the upstream behaviour in tact while allowing for it to be changed via a property.

@wcmatthysen wcmatthysen added the enhancement New feature or request label Jun 18, 2019
@wcmatthysen wcmatthysen merged commit 2a755a8 into WorldWindEarth:develop Jun 19, 2019
@wcmatthysen wcmatthysen added this to the WWJ-CE 2.2.0 milestone Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants