• 周一. 10 月 7th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

render的使用方法

admin

11 月 28, 2021
const seattleLayer = new FeatureLayer({
          url:
            "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Puget_Sound_BG_demographics/FeatureServer/0",
          title: "Seattle block groups",
          renderer: renderer,
          popupTemplate: {
            // autocast as esri/PopupTemplate
            title: "Block Group {FID_Block_Group}",
            content:
              "{COL_DEG} adults 25 years old and older in this block group have a college degree. " +
              "{NO_COL_DEG} adults do not have a college degree."
          },
          // show only block groups in Seattle
          definitionExpression: "City = 'Seattle' AND EDUCBASECY > 0",
          opacity: 0.9
        });

PopupTemplate是一个针对LayerGraphic的弹窗,它与Popup最大的不同的是作用对象不同(Popup主要是针对View)。它服务的对象是Layer中的要素类或者Graphic,它能从要素中获取字段,并用HTML的语法显示到弹窗的content属性中去。

发表回复