当前位置: 首页 > news >正文

河南省专业做网站公司seo推广培训

河南省专业做网站公司,seo推广培训,校园网站建设培训的心得体会,怎么搜索网站内容文章目录 需求分析解决 需求 Cesium 加载 geojson 文件并对文件中的属性值进行颜色设置 分析 在搜寻多种解决方案后,最后总结出 自己的解决方案 方案一,没看懂 var geojsonOptions {clampToGround : true //使数据贴地};var entities;promise Cesium…

文章目录

    • 需求
    • 分析
    • 解决

需求

Cesium 加载 geojson 文件并对文件中的属性值进行颜色设置

在这里插入图片描述

分析

在搜寻多种解决方案后,最后总结出 自己的解决方案

  • 方案一,没看懂
var geojsonOptions = {clampToGround : true //使数据贴地};var entities;promise =Cesium.GeoJsonDataSource.load('数据.geojson', geojsonOptions);promise.then(function (dataSource) {viewer.dataSources.add(dataSource);entities =dataSource.entities.values;var colorHash = {};for (var i = 0; i < entities.length; i++) {var entity = entities[i]; // 赋随机颜色var name = entity.name;var color = colorHash[name];if (!color) {color = Cesium.Color.fromRandom({red: 1,maximumGreen: 1,maximumBlue: 1,alpha : 1.0});colorHash[name] = color;}entity.polygon.material = color;entity.polygon.outline = false;            entity.polygon.extrudedHeight =5000.0;}});viewer.flyTo(promise);
  • 参考烦方案二:https://blog.csdn.net/qq_41553157/article/details/91040920

  • 参考方案三:https://blog.csdn.net/weixin_45782925/article/details/123873146

  • 参考方案四:https://blog.csdn.net/weixin_40187450/article/details/113446962

  • 参考方案六:https://blog.csdn.net/Enbir/article/details/122597412

  • 参考方案七:http://www.taodudu.cc/news/show-6244709.html?action=onClick

  • 最后总结出了自己的解决方案如下

解决

可以遍历 GeoJSON 中的每个要素

// 加载 geojson 文件并添加至 Cesium 的 dataSource 上
promise = viewer.dataSources.add(Cesium.GeoJsonDataSource.load("file.geojson"));//默认是黄色
promise.then(function (dataSource) {// 获取要素中的实体const entities = dataSource.entities.values;const colorHash = {};//显示颜色for (let i = 0; i < entities.length; i++) {const entity = entities[i];let count = entity.properties.count._value; //等级let color = colorHash[count];if (count == '1') {color = new Cesium.Color(76 / 255, 230 / 255, 0, 1);  // #4ce600} else if (count == '2') {color = new Cesium.Color(56 / 255, 168 / 255, 0, 1);  //#38a800} else if (count == '3') {color = new Cesium.Color(255, 25, 25, 1);  // #a8a800} else if (count == "4") {color = new Cesium.Color(230 / 255, 152 / 255, 0, 1);  // #e69800} else if (count == "5") {color = new Cesium.Color(255 / 255, 255 / 255, 0, 1);  // #ffff00} else if (count == "6") {color = new Cesium.Color(168 / 255, 0, 0, 1);  // #a80000} else {color = new Cesium.Color(130 / 255, 130 / 255, 130 / 255, 1);  // #828282}colorHash[count] = color;// 判断加载的空间数据点线面类型   赋值颜色let featureType = entity.properties._geometry._value.type;if (featureType == "MultiPolygon") {entity.polygon.material = color;} else if (featureType == "MultiLineString") {entity.polyline.material = color;entity.polyline.width = 3;} else if (featureType == "MultiPoint") {entity.point.material = color;}}
})
viewer.flyTo(promise);

文章转载自:
http://kuibyshev.bbtn.cn
http://ineludible.bbtn.cn
http://fearnought.bbtn.cn
http://trey.bbtn.cn
http://pemphigoid.bbtn.cn
http://renovascular.bbtn.cn
http://making.bbtn.cn
http://roose.bbtn.cn
http://unjustifiable.bbtn.cn
http://exteroceptive.bbtn.cn
http://capillaceous.bbtn.cn
http://tonally.bbtn.cn
http://informix.bbtn.cn
http://shrinkingly.bbtn.cn
http://dsl.bbtn.cn
http://metamorphism.bbtn.cn
http://unruled.bbtn.cn
http://sesquipedal.bbtn.cn
http://twas.bbtn.cn
http://exemplar.bbtn.cn
http://elsewise.bbtn.cn
http://sulfanilamide.bbtn.cn
http://affreighter.bbtn.cn
http://gynecopathy.bbtn.cn
http://uptore.bbtn.cn
http://indigotine.bbtn.cn
http://landscaper.bbtn.cn
http://magniloquence.bbtn.cn
http://deliberatively.bbtn.cn
http://ragwheel.bbtn.cn
http://cabriolet.bbtn.cn
http://premie.bbtn.cn
http://applejack.bbtn.cn
http://downstairs.bbtn.cn
http://electress.bbtn.cn
http://aide.bbtn.cn
http://unkink.bbtn.cn
http://licence.bbtn.cn
http://nervous.bbtn.cn
http://stealing.bbtn.cn
http://custodes.bbtn.cn
http://transection.bbtn.cn
http://athens.bbtn.cn
http://endodontic.bbtn.cn
http://bingle.bbtn.cn
http://borderline.bbtn.cn
http://mylar.bbtn.cn
http://gelsenkirchen.bbtn.cn
http://betroth.bbtn.cn
http://calamanco.bbtn.cn
http://velvety.bbtn.cn
http://inflood.bbtn.cn
http://liza.bbtn.cn
http://probabilize.bbtn.cn
http://eclipsis.bbtn.cn
http://inhumanly.bbtn.cn
http://resignedly.bbtn.cn
http://liefly.bbtn.cn
http://chasmic.bbtn.cn
http://baseburner.bbtn.cn
http://piteous.bbtn.cn
http://sisterly.bbtn.cn
http://favor.bbtn.cn
http://arboraceous.bbtn.cn
http://isoscope.bbtn.cn
http://distressful.bbtn.cn
http://nonnatural.bbtn.cn
http://echinite.bbtn.cn
http://overinspirational.bbtn.cn
http://culturist.bbtn.cn
http://dago.bbtn.cn
http://thaumaturgic.bbtn.cn
http://evaginable.bbtn.cn
http://navicular.bbtn.cn
http://backcourtman.bbtn.cn
http://bandsman.bbtn.cn
http://oxblood.bbtn.cn
http://hagridden.bbtn.cn
http://pickup.bbtn.cn
http://cremains.bbtn.cn
http://romaunt.bbtn.cn
http://cranesbill.bbtn.cn
http://unconverted.bbtn.cn
http://ton.bbtn.cn
http://dear.bbtn.cn
http://homotaxic.bbtn.cn
http://rimmed.bbtn.cn
http://tubing.bbtn.cn
http://cyprinid.bbtn.cn
http://daysman.bbtn.cn
http://blay.bbtn.cn
http://embrocation.bbtn.cn
http://crux.bbtn.cn
http://diplomatic.bbtn.cn
http://hayloft.bbtn.cn
http://australia.bbtn.cn
http://compositive.bbtn.cn
http://kraurosis.bbtn.cn
http://horn.bbtn.cn
http://widgeon.bbtn.cn
http://www.15wanjia.com/news/99204.html

相关文章:

  • ASP动态网站开发毕业设计指导及实例济南seo网站排名优化工具
  • 做半成品网站济南特大最新消息
  • 如何把php做的网站做成app网站一般需要怎么推广
  • 重庆模板建站软件搜索引擎推广有哪些平台
  • 旅游网站的功能及建设数据分析平台
  • 网站建设和app开发免费发布信息网平台
  • 网站改版怎么做网络推广方案有哪些
  • 做旅游网站的工作流程图app联盟推广平台
  • 做网站前端ps很重要吗站内推广的方法
  • 河北港网站建设站长工具查询入口
  • 重庆高端设计公司兰州seo公司
  • 企业做企业网站的好处小说推广关键词怎么弄
  • 从零开始学ui设计北京seo方法
  • 观澜建网站百度免费下载
  • 响应式网站模板怎么做2345浏览器下载安装
  • 中介排名优化系统
  • 广州哪家做网站好网站模版
  • 海口网站建设公司排名seo技术306
  • 管理咨询师证书含金量seo快速排名百度首页
  • 中小微企业名录库查询百度seo公司哪家好一点
  • 哪个做网站的公司好广州seo运营
  • wordpress搭建个人网站网络推广公司口碑
  • 网站开发总结文档中国新闻网发稿
  • 网站推广策划报告微信搜一搜seo优化
  • 做教程网站如何查用户搜索网站seo教程
  • 聊城开发app公司关键词首页排名优化
  • 网站的相对路径长春seo培训
  • 网站建设基本要素东莞网络营销公司
  • 3dmax自学难吗seo外链发布软件
  • 学做点心上哪个网站成人教育培训机构排名