zoukankan      html  css  js  c++  java
  • arcGis 4.11版本Graphic动态控制图层显隐

      因为项目需要使用,所以最近找了下Graphic图层的显隐控制。但是之前的很多博客所说的hide和show方法在api中并没有(可能是版本更新给干掉了吧)。然后就查了查arcGis For js 找了一个折中方法,供大家参考。如果大家有其他更好的方案可以提出来,共同进步。

      首先是创建Graphic对象

     1             var point = {
     2                 type : "point", // autocasts as new Polyline()
     3                 longitude : 114,
     4                 latitude:96
     5             };
     6             var markerSymbol = {
     7                 type : "simple-marker", // autocasts as SimpleLineSymbol() 9                 color : "rgba(255,0,0,1)"
    10             };
    11             var pointGraphicName="point"+areaArr[a].objectid;
    12             var graphic= new self.param.Graphic({
    13                 geometry : point, // Add the geometry created in step 4
    14                 symbol : markerSymbol,16                 visible:true
    17             })

      然后存入到graphics,然后控制显隐其实就是graphics添加和删除要素图层

    view.graphics.add(graphic);
    view.graphics.remove(graphic);
  • 相关阅读:
    the core or essence of a computer
    HEXADECIMAL NOTATION is Syntactic_sugar.
    Converting from Decimal Notation to Binary Notation for Fractions
    convert from base 10 to base 2
    MYSQL PASSWORD()
    Environment Variables
    Why Stored Procedures?
    delimiter
    page fault rate
    Segmentation
  • 原文地址:https://www.cnblogs.com/smlPig/p/10931649.html
Copyright © 2011-2022 走看看