0

Is there a simple way to display a WebGL Earth globe as a 2D map? I have a functional user interface that uses WebGL Earth, but it is starting to seem like 2D would function better for general use cases, so I was hoping there was a simple way to get the map to display in 2D rather than in 3D.

I've seen in Cesium that you can switch the globe display between 3D or 2D (or even "2.5D"), but so far I don't see how to get WebGL Earth to leverage that ability (my understanding is that WebGL Earth runs on Cesium), and I couldn't find much from searching online. I would like to avoid rewriting the user interface code using a 2D map system like Leaflet, if it is reasonably possible.

Any help would be greatly appreciated!

EDIT (more info):

WebGL Earth 2.4.2: github.com/webglearth/webglearth2/tree/v2.4.2

The code is being used to general a map of the world, where the user places icons (little 2d planes) and adds radios to them. This is then used to model radio interactions between planes over varying distances (the user can add velocities to the planes, or specific data to transmit over these radios).

code examples

creating the map object:

var options = { zoom: 0, position: [30,-130] };
earth = new WE.map('earthDiv', options);
WE.tileLayer(window.location.origin + '/map/bluemarble/{z}/{x}/{y}.png',
{
  tileSize: 256,
  bounds: [[-85, -180], [85, 180]],
  minZoom: 0,
  maxZoom: 8,
  tms: true
}).addTo(earth);

creating/placing/rotating a plane icon:

var myMarker = new WE.marker([this.latitude, this.longitude], img, width, height);
myMarker.addTo(earth);
.
.
.
var child = myMarker.element.getElementsByClassName("we-pm-icon");
$(child).css("transform", "rotate("+headingAngle+"deg)");
4

0 回答 0