WebGL Earth Map是2D而不是3D?

时间:2019-02-22 03:02:35

标签: 3d 2d cesium map-projections webgl-earth

有没有一种简单的方法可以将WebGL Earth地球显示为2D地图?我有一个使用WebGL Earth的功能用户界面,但似乎开始看来2D在一般使用情况下会更好,因此我希望有一种简单的方法来使地图以2D而不是3D的方式显示。 / p>

我在Cesium中看到您可以在3D或2D(甚至是“ 2.5D”)之间切换地球显示,但是到目前为止,我还没有看到如何使WebGL Earth发挥这种能力(我的理解是WebGL Earth在Cesium上运行),而我从在线搜索中找不到很多。如果可能的话,我想避免使用诸如Leaflet之类的2D地图系统重写用户界面代码。

任何帮助将不胜感激!

编辑(更多信息):

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

该代码用于绘制世界地图,用户可以在其中放置图标(小的2d平面)并向其中添加无线电。然后将其用于模拟不同距离上飞机之间的无线电交互(用户可以向飞机上添加速度,或通过这些无线电发送特定数据)。

代码示例

创建地图对象:

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);

创建/放置/旋转平面图标:

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)");

0 个答案:

没有答案