![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Aug 2012
Posts: 19
![]() |
Hey all. Hopefully someone has some insight on accomplishing what I'm trying to do. Basically, I'm trying to create a custom Renderable class which is made up of multiple existing World Wind Renderables. In this example, a SurfaceIcon and a GlobeAnnotation.
I'm essentially trying to create a labelled icon, which I can further customize one I get the basics figured out. My methodology is as follows, but it's not working completely. Create a new MapItem class which implements Renderable and Movable. This MapItem class encapsulates both a SurfaceIcon and GlobeAnnotation. The MapItem is constructed with a Position, which is passes through to both the icon and annotation. As far as the methods of the Renderable and Movable interfaces go, I just pass the appropriate parameters through to both of the objects held withing (icon and annotation). When I do this, only the GlobeAnnotation is showing up on the map. Any ideas? Thanks. |
|
|
|
|
|
#2 |
|
WWJ Dev. Team
Join Date: May 2007
Posts: 449
![]() |
Are you forwarding the preRender call to SurfaceIcon?
|
|
|
|
|
|
#3 |
|
WW Dev. Team
Join Date: Sep 2010
Location: Boston, MA, USA
Posts: 325
![]() |
You're on the right track, but you also need to implement PreRenderable. Implement preRender to call preRender on the SurfaceIcon. (Things drawn on the surface of the globe need to be assembled before the scene is rendered. If you call render on the SurfaceIcon without calling preRender, it won't draw anything.)
|
|
|
|
|
|
#4 |
|
WWJ Technical Manager
Join Date: May 2007
Location: Seattle
Posts: 1,041
![]() |
Take a look at OSMWayShape in the new openstreetmap package of worldwindx.
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2012
Posts: 19
![]() |
Thank you all for your responses! The PreRenderable interface was the issue. I had no idea it existed. Once I implemented that in my custom class and forwarded calls to the SurfaceIcon, the icon started showing up.
Thanks again. |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| One-time init method with DrawContext for setting up VBO for Renderable? | expressoCoder | Development Help | 1 | 08-24-2010 08:11 AM |
| Icon as Renderable | tingspain | Development Help | 4 | 04-27-2009 05:01 PM |
| Suggestion for Renderable interface | remleduff | Development Help | 2 | 01-29-2008 05:01 PM |
| And Renderable for all... | asantiago | Development Help | 2 | 11-23-2007 05:06 PM |
| Renderable Icon: Go where I send thee | rideabike | Developers' Corner | 0 | 10-30-2007 06:22 PM |