I am working on a project related with nasa worldwind.
Can anybody explain how can I remove the compass ,which is
located at the top right of screen.
On
Since you've tagged the question with swing and java tags I assume you are referring to WorldWindJava and the solution in the other answer related to WebWorldWind will not work. To remove the compass layer from WorldWind you can do it either programmatically or via the worldwind.layers.xml file.
For a programmatic approach you can look at this question:
How to Hide(or remove the) Standard layer (like star,atmosphere,earth at night) in World wind java
and then call that method there as: removeLayerWithName("Compass").
The XML configuration file approach is the easiest and you can see a full example of the worldwind.layers.xml file here. So, basically you copy that file, remove the:
<Layer className="gov.nasa.worldwind.layers.CompassLayer"/>
entry there at the bottom. You then need to place this file in a folder that is located in your application's current-working-directory. I suggest you give it a unique name to differentiate it from the default worldwind.layers.xml file for example worldwind.custom.layers.xml. You then need to specify that WorldWind should use this custom file by modifying the worldwind.xml file. You can get a template of this file here. Copy this file to the same folder in your application's current-working-directory. Also give it a different name like worldwind.custom.xml. You then need to modify this entry:
<LayerList href="config/worldwind.layers.xml"/>
in worldwind.custom.xml to point to your file like so:
<LayerList href="some-folder/worldwind.custom.layers.xml"/>
Lastly, you need to specify that WorldWind should use your custom configuration file via the gov.nasa.worldwind.app.config.document system property. So, if you have a script to launch your app you add the following in your run.sh file:
java -cp "...classpath-stuff" -Dgov.nasa.worldwind.app.config.document="some-folder/worldwind.custom.xml" com.example.MainClass
simply remove the following code from your Javascript file:
wwd.addLayer(new WorldWind.CompassLayer());Good luck !