当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


JavaScript ArcGIS ImageryLayer.renderingRule用法及代码示例


基本信息

以下是所在类或对象的基本信息。

AMD: require(["esri/layers/ImageryLayer"], (ImageryLayer) => { /* code goes here */ });

ESM: import ImageryLayer from "@arcgis/core/layers/ImageryLayer";

类: esri/layers/ImageryLayer

继承: ImageryLayer > Layer > Accessor

自从:用于 JavaScript 4.0 的 ArcGIS API

用法说明

ImageryLayer.renderingRule函数(或属性)的定义如下:

renderingRule RasterFunction autocast


指定应如何呈现所请求图像的规则。应用渲染规则时,服务器返回更新的服务信息,该信息反映了渲染规则定义的自定义处理。

例子:

const stretchFunction = new RasterFunction({
functionName: "Stretch",
  functionArguments: {
    StretchType: 5, // (0 = None, 3 = StandardDeviation, 4 = Histogram Equalization, 5 = MinMax, 6 = PercentClip, 9 = Sigmoid)
    Min: 0,
    Max: 255,
    Raster: "$$" // $$(default) refers to the entire image service, $2 refers to the second image of the image service
  },
  outputPixelType: "u8"
});

const colorFunction = new RasterFunction({
  functionName: "Colormap",
  functionArguments: {
    ColorrampName: "Temperature", // other examples: "Slope", "Surface", "Blue Bright"....
    Raster: stretchFunction // chaining multiple rasterfunctions
  }
});

const imageryLayer = new ImageryLayer({
  url:
    "https://sampleserver6.arcgisonline.com/arcgis/rest/services/ScientificData/SeaTemperature/ImageServer"
});

imageryLayer.renderingRule = colorFunction; // Set rendering rule to the raster function

相关用法


注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 ImageryLayer.renderingRule。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。