Im trying to add an altitude to a marker in WebGLEarth but i cant figure out how to do it. I cannot find anything in documentation either. The idea is that my markers act as satellites so i need the altitude from the earth.

//this doesnt work
var satellite_marker1 = WE.marker([0, 0], {elevation: 260.0}).addTo(earth);

If a marker is the wrong thing to use for this i have no issue using something that will work.

  • This is lacking context. What libraries are you using? What exactly is WE? Mar 15 '19 at 16:18
  • I couldnt add a tag but this is using WebGL, "WE" replaces "L" from the leaflet maps. examples.webglearth.com
    – Owen
    Mar 15 '19 at 16:37
  • Note that WebGL and WebGLEarth are two very different things, and you didn't refer to WebGLEarth in your original question. Mar 15 '19 at 20:26

This is simply not doable in WebGLEarth (with its current API as of early 2019). As noted in the project webpages, WebGLEarth is a wrapper which simplifyes the CesiumJS API in order to create something that looks like the Leaflet API. One of those simplifications is the height of markers.

For this particular task, I'd suggest using the CesiumJS API directly, without the WebGLEarth wrapper. This would be done using a billboard, and using the height parameter of the Cesium.Cartesian3.fromDegrees() method when defining the position of the entity associated with the billboard.

The alternative to using CesiumJS directly would be to actually modify the WebGLEarth API to implement this as a feature.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.