• 给要素渲染不同的显示色彩


    在城市规划中,用色彩强调感兴趣的房屋十分重要。

    var map = new WebMap({

      portalItem:{id:"03a9607d96244883af64c7f8c7e5de1b"}

    });

    var view = new SceneView({

      container:"viewDiv",

      map:map

    });

    var layer = new SceneLayer({

      portalItem:{id:"5ecba5273b2d41ff9f6f1eb33f238d18"}

    });

    map.add(layer);

    ==============================================

    function setSymbol(){

      return {

        type:"unique-value",

        field:"usage",

        defaultSymbol:{

          type:"mesh-3d",

          symbol:{

            type:"fill",

            material:{

              color:[230, 230, 230, 0.7],

              colorMixMode:"replace"

            }

          }

        },

        uniqueValueInfos:[{

          value:"general or commerial",

          label:"commerial building",

          symbol:{

            type:"mesh-3d",

            symbolLayers:[{

              type:"fill",

              material:{

                color:color,

                colorMixMode:colorMixMode

              }

            }]

          }

        }]

      }

    }

    function setRenderer(type){

      if(type === "origin"){

        layer.renderer = null;

      }

      else if (type === "select"){

        layer.renderer = setSymbol(null,null);

      }

      else if(type === "emphasize"){

        layer.renderer = setSymbol("skyblue","tint");

      }

      else{

        var colorMixMode = (type === "desaturate")?"tint":"replace";

        layer.renderer = {

          type:"simple",

          symbol:{

            type:"mesh-3d",

            symbolLayers:{

              type:"fill",

              material:{color:"white",colorMixMode:colorMixMode}

            }

          }

        }

      }

    }

    document.getElementById("colorMixMode").addEventListener("change",function(event){

       setRenderer(event.target.id);

    });

  • 相关阅读:
    继续致歉
    向大家致歉!!
    访问速度调查
    致歉
    [功能改进]通过Blog客户端直接发随笔至网站分类
    带宽升级公告
    创业团队的类型
    [讨论]基于.NET的开源论坛软件的选择
    调整一下工作的节奏
    公告
  • 原文地址:https://www.cnblogs.com/GIS-Yangol/p/10419107.html
Copyright © 2020-2023  润新知