private Draw buildTreeDrawSphere(Geometry geometry) {
MapTileTree mtt = new MapTileTree();
mtt.addMapTreeChangeListener(this);
MapTileTreeNode rootNode = mtt.getRootNode();
GeometryMapTree gmt = (GeometryMapTree) geometry;
URL source = gmt.getSource();
MapTileTreeNodeCore newCore;
String url;
HeightfieldTree htree = null;
try {
newCore = new TextureTreeNodeCore(mtt);
url = ((ConnectionURL) gmt.getTextureConnections().getConnections().get(0)).getUrl();
newCore.setRequestID(new URL(source, url).toString());
rootNode.setCore(0, newCore);
} catch (MalformedURLException e2) {
e2.printStackTrace();
}
try {
Geometry2D3D gSphere = Geometry2D3DFactory.getFactory().getGeometry("sphere");
url = ((ConnectionURL) gmt.getHeightfieldConnections().getConnections().get(0)).getUrl();
/* create HeightfieldTree, it automatically downloads the root node */
htree = new HeightfieldTree(new URL(source, url).toString(), gSphere, 6378140. / Global.heightfieldmultiplier);
htree.addHeightfieldTreeChangeListener(this);
newCore = new HeightfieldTreeNodeCore(gSphere, (float) (6378140. / Global.heightfieldmultiplier), htree);;
newCore.setRequestID(new URL(source, url).toString());
rootNode.setCore(1, newCore);
} catch (MalformedURLException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}