cesium

cesiumjs开发实践(五) 坐标变换

瘦欲@ 提交于 2020-03-01 00:27:06
cesium中常用的坐标有两种WGS84地理坐标系和笛卡尔空间坐标系。我们平时常用的以经纬度来指明一个地点就是用的 WGS84坐标, 笛卡尔空间坐标系常用来做一些空间位置变换如平移旋转缩放等等。二者的联系如下图 笛卡尔空间坐标的原点就是椭球的中心。 在实际应用中用的最多的操作就是(lng, lat, alt)<=>(x, y, z)之间的相互转换,cesiumjs为我们提供了这些转换 var ellipsoid = viewer.scene.globe.ellipsoid; var coord_wgs84 = Cesium.Cartographic.fromDegrees(lng, lat, alt);//单位:度,度,米 var coord_xyz = ellipsoid.cartographicToCartesian(coord_wgs84); console.log('x=' + coord_xyz.x + ',y=' + coord_xyz.y + ',z=' + coord_xyz.z);//单位:米,米,米 var xyz = new Cesium.Cartesian3(x, y, z); var wgs84 = ellipsoid.cartesianToCartographic(xyz); console.log('lng=' + Cesium.Math

Place an HTML element on a Cesium Entity's position

怎甘沉沦 提交于 2020-01-30 08:20:48
问题 I need to define the location of an html element based on the location of a Cesium entity. I've used the mouse position ( Cesium.Cartesian3.clone(movement.endPosition) ), which is in window coordinates, as a test and it works. So I need to get the entity position, transform it to the WGS84 coordinates, transform those to the window coordinates and use them for element.style.left = window_coord.x and element.style.top = window_coord.y . So I get the entity.position and the x, y and z values

CesiumJS - Entity / Graphics Hierarchie in relation to performance

 ̄綄美尐妖づ 提交于 2020-01-24 20:23:25
问题 I am working on a Wysiwyg Editor for CesiumJS content. The user will be able to create many points, lines and other graphics, connect them according to definable relations and group them in separate Groups. Now I am wondering what the best practises are in terms of performance. At the moment I create one PointPrimitiveCollection for each Group and then add points: group.points = scene.primitives.add(new Cesium.PointPrimitiveCollection()); and then group.points.add({ position : cartesian, ...

d3 GeoJSON geoCircle ellipse equivalent

元气小坏坏 提交于 2020-01-24 09:13:24
问题 The title pretty much says it all. I'm looking for a convenient way to generate a geoJSON polygon defining an ellipse similar to d3-geo's d3.geoCircle()(); I want to use this GeoJSON ellipse with d3-geo. To clarify with and example, Cesium has this capability with a simple function allowing you to create an ellipse like so: var ellipse = new Cesium.EllipseGeometry({ center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883), semiMajorAxis : 500000.0, semiMinorAxis : 300000.0, rotation :

Unable to determine Cesium base URL automatically (Typescript)

你离开我真会死。 提交于 2020-01-16 04:09:05
问题 I am trying to setup cesium and resium for react typescript and got stuck on the very initial steps. I am currently referencing steps from the following resium website, from here I have installed the packages and attempted to setup webpack based on the following steps. Based on the steps i installed the following package npm install copy-webpack-plugin html-webpack-plugin html-webpack-include-assets-plugin npm install cesium resium The following example was also presented so i attempted to

navigating on cesium terrain map , corrupts position of graphics

a 夏天 提交于 2020-01-14 14:35:04
问题 i am using cesium on my gwt project and i am using cesium-terrain-server for terrain. (Not cesium-gwt , devoloping my own code with jsni) My problem : i am creating graphic on terrain (polygon , polyline) , when i navigate on map , graphics are moving from its position. is there any way to immobilize them on the point(s) which i selected before ? example code : var polygon = new Cesium.PolygonGraphics({ fill : true; material : Cesium.Color.BLUE.withAlpha(0.5), outline : true, hierarchy :{

navigating on cesium terrain map , corrupts position of graphics

。_饼干妹妹 提交于 2020-01-14 14:34:22
问题 i am using cesium on my gwt project and i am using cesium-terrain-server for terrain. (Not cesium-gwt , devoloping my own code with jsni) My problem : i am creating graphic on terrain (polygon , polyline) , when i navigate on map , graphics are moving from its position. is there any way to immobilize them on the point(s) which i selected before ? example code : var polygon = new Cesium.PolygonGraphics({ fill : true; material : Cesium.Color.BLUE.withAlpha(0.5), outline : true, hierarchy :{

How to draw custom dynamic billboards in Cesium.js

大城市里の小女人 提交于 2020-01-02 10:21:50
问题 I'm currently using Cesium for a mapping application, and I have a requirement to have status indicators for each item I'm plotting (for example, if the item I'm plotting is an airplane, then I need to have a fuel status indicator). I can't use Cesium's drawing tools to do this because they are drawn using geographic locations, but I need my status indicators to simply be located near the billboard and not get farther away from the billboard as users zoom in and out. Cesium's CZML

How to draw custom dynamic billboards in Cesium.js

人走茶凉 提交于 2020-01-02 10:21:48
问题 I'm currently using Cesium for a mapping application, and I have a requirement to have status indicators for each item I'm plotting (for example, if the item I'm plotting is an airplane, then I need to have a fuel status indicator). I can't use Cesium's drawing tools to do this because they are drawn using geographic locations, but I need my status indicators to simply be located near the billboard and not get farther away from the billboard as users zoom in and out. Cesium's CZML

Cesium Earth: Show satellites in ECI coordinate system

爱⌒轻易说出口 提交于 2019-12-30 11:07:32
问题 I'm using Cesium Earth to develop an application for satellite tracking. Now, the satellite coordinates are in Earth Fixed system and it works OK. However, I need to show them also in ECI coordinate frame and for that I have to make the Earth rotate. How to do that? 回答1: I'll start by mentioning that Cesium often uses the name ICRF as a synonym or replacement for ECI, so if you're searching the documentation you'll have better luck looking for ICRF. The CZML Sandcastle Demo shows some