Friday, November 30, 2007

WorldWind Java Annotations Preview

Annotations are ready to roll and will be in the next WWJ SDK update 0.3.x or 0.4 - which should be ready 'soon'... Here are a couple screenshots showing different variants from the included example application.


Annotations are essentially text labels with a lot of style attributes. They will come in two flavors: globe annotations which are associated with a position on the planet, and screen annotations which are at a fixed position in the viewport.

In the above view all you see are annotations - from the simple 'Egypt', 'Libya' or arabic for 'Sahara desert' labels to the full blown 'billboards' or 'bubbles' with textured backgrounds and moderately wealthy text.

As you can see annotations come with a multi line text renderer and 'wrapper' with minimal html support, text picking and hyperlinks. The text about the Tibesti mountains is a cut-and-paste of a paragraph straight from a Wikipedia page source.


The example application will offer you no less than 39 controls to experiment with all the annotation attributes combinations. Text font, size, style and alignment, insets 'margin', background color and texture repeat options, dimensions, scaling, opacity, offset from position... Overall it should cover quite a range of applications from simple labels to moderately sophisticated 'popup balloons'.

In any case, if the SDK basic implementation is not enough, it is very easy to subclass annotations and override the drawing process to add your own code in place or on top of it. The example does also contain several override code bits - you'll have to read the source to find them.

This is just an 'avant goût' to get you salivating a bit. I will come back on the subject for more detailed explorations of this new feature of the SDK - like shared attribute sets and cascading defaults...

1 comment:

bullsworld said...

Nice, we really need to start porting some of this stuff back to .NET ;)