问题标签 [webgl-earth]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
461 浏览

webgl-earth - 如何使用 webgl earth 绘制折线

我正在尝试使用 webgl earth 在多个坐标之间绘制一条折线。有一个用于绘制多边形的API,但我似乎找不到任何与折线等效的东西。

谢谢你的帮助!

0 投票
0 回答
1361 浏览

javascript - 我正在尝试在 WEBGL 上绘制平面

我想创建一个地板,上面有一张桌子和一个立方体(主要是开始的地板)我试图用指定的颜色运行 drawFloor() 函数但没有响应。任何提示或建议?

我已将地板的坐标存储在 floorVertexPositionBuffer 中。

我已经在缓冲区内指定了立方体和索引的坐标。

此外,我们在 WebGL 中指定的数字是否以屏幕像素单位转换和存储缓冲区中的形状坐标?

0 投票
2 回答
108 浏览

javascript - 从外部 js api 文件构建 npm 模块

我正在尝试从这个 repo构建一个 npm 包,我有一个“缩小”的 js 文件,IntelliJ 在看到<script src="">标签时会下载该文件,该文件被称为http_www.webglearth.com_v2_api.js

因此,我按照npm 官方treehousenpm ERR! not a package的说明进行操作,但是每次我尝试在项目上执行时都会收到错误消息npm install,我已将我的尝试上传到我的 Git-hub 帐户,这就是 package.json 的外观喜欢:

我浏览过类似的错误,但没有一个案例场景真正符合我的问题,我不确定我是否以正确的方式尝试这种方法,或者它是否可行。

我的最终目标是能够将此存储库导入到 Angular 项目中,这现在完全不可能

0 投票
1 回答
288 浏览

javascript - 将 webglearth 画布的输出绘制到 2d 画布

我正在尝试将运行 webgearth ( http://www.webgearth.org/ ) 的画布的输出复制到标准的 2d 画布。我按照这个问题的答案,但我只能看到画布的背景颜色。

我的代码是:

0 投票
0 回答
209 浏览

3d - WebGL Earth map in 2D rather than 3D?

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:

creating/placing/rotating a plane icon:

0 投票
0 回答
99 浏览

javascript - WebGL-地球海拔/高度?

我一直在寻找在给定纬度、经度和海拔/海拔的情况下在空间中绘制点/标记的示例,但我在文档或任何其他问题上都找不到它。是否可以使用 WebGL-earth 在空间中绘制标记?

0 投票
0 回答
520 浏览

javascript - How to change position of the Earth in WebGL Earth

I am using this webgl earth for the project, but I can't seem to find a way to change the position of the planet on the canvas. My desired goal was to put the planet on the bottom of the page, but I can't find a way around it.
I am providing the simple working demo for the issue. Thank you in advance.

0 投票
0 回答
143 浏览

vue.js - 如何使用 vue 重新初始化 webglglobe

我在我的 vue 应用程序中使用http://www.webgearth.org/api作为地球仪。我有一条名为地球的路线,它用新的 WE.map 初始化地球。当我更改路线并返回时,它会重新初始化,但会在我的脑海中重新添加脚本,这些脚本会阻塞地球图块的加载。有没有办法保留和重新使用实例化的对象?或任何可以帮助解决此问题的提示

我尝试将创建的地球仪保存在商店中并重新使用它,尽管它不会在不执行 WE.map 的情况下重新加载,并且该方法会添加标题

这个方法在 vue create 上被调用

我希望地球在不重新添加标题的情况下重新启动。

0 投票
0 回答
128 浏览

javascript - Uncaught SyntaxError: Unexpected token '<' api.js:1 in webGL

我正在尝试整合 WebGL 链接:https ://sites.google.com/site/webgearth/

但是当我在浏览器中运行相同时,我收到了这个错误:

未捕获的语法错误:意外的令牌 '<'
api.js:1

高度赞赏解决此问题的 Aby 解决方案

0 投票
0 回答
51 浏览

javascript - WebGL 地球中的 CORS 问题

我在我的应用程序中使用 webGL earth,它正在工作,但现在当我尝试在本地 wamp 服务器或实时服务器上运行时遇到了 CORS 问题。

从源“https://mydomain.in”访问“https://www.webgearth.com/v2/SkyBox/mx.jpg”的图像已被 CORS 策略阻止:否“访问控制允许源” ' 请求的资源上存在标头。

我的 .htaccess 文件是

非常感谢任何解决此问题的解决方案。

谢谢