svg转geojson,ceisum 加载geojson,webgl 加载geojson数据没有贴地

 2023-09-28 阅读 22 评论 0

摘要:我有一份geojson数据:const smc={"type":"FeatureCollection", "features": [svg转geojson,{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[119.66253898412081,30.

我有一份geojson数据:

const smc={"type":"FeatureCollection", "features": [

svg转geojson,{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[119.66253898412081,30.368448359079963],[119.66243188888996,30.368413407509607],[119.66239524553978,30.368497829777414],[119.662502340849,30.36853278137794],[119.66253898412081,30.368448359079963]]]},"properties":{"OBJECTID":1,"Shape_Leng":42.0000000005,"Shape_Area":110.000000003,"FWMC":"混","FWCS":"3","YSDM":"141161","X":119.662467115,"Y":30.3684730944}}

]}

使用Cesium.GeoJsonDataSource加载并且想使数据在地形之上,但是我加载之后数据在地形影像下面,按照官网设置了clampToGround为true也没生效,请问有遇到过这个问题吗?要怎么解决呢?

我的代码如下:

const smcPromise = Cesium.GeoJsonDataSource.load(smc,

{

clampToGround: true

}

);

smcPromise.then(dataSource => {

viewer.dataSources.add(dataSource);

const entities = dataSource.entities.values;

for (var i = 0; i < entities.length; i++) {

var entity = entities[i];

entity.$name = "smc";

var color = (color = Cesium.Color.fromRandom({

alpha: 1.0

}));

entity.polygon.material = color;

entity.polygon.outline = false;

entity.polygon.extrudedHeight = 10.0;

}

viewer.flyTo(smcPromise);

});

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/3/100960.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息