rasterRenderers

AMD: require(["geoscene/rasterRenderers"], (rasterRenderers) => { /* code goes here */ });
ESM: import * as rasterRenderers from "@geoscene/core/rasterRenderers";
对象: geoscene/rasterRenderers
起始版本:GeoScene API for JavaScript 4.13

用于导入渲染器类的便捷模块,可用于在使用 TypeScript 开发时渲染 ImageryLayer。例如,不是像这样一次导入一个渲染器:

import FlowRenderer from "geoscene/renderers/FlowRenderer";
import ClassBreaksRenderer from "geoscene/renderers/ClassBreaksRenderer";
import UniqueValueRenderer from "geoscene/renderers/UniqueValueRenderer";
import RasterStretchRenderer from "geoscene/renderers/RasterStretchRenderer";
import RasterColormapRenderer from "geoscene/renderers/RasterColormapRenderer";
import RasterShadedReliefRenderer from "geoscene/renderers/RasterShadedReliefRenderer";
import VectorFieldRenderer from "geoscene/renderers/VectorFieldRenderer";

您可以使用此模块将它们导入到一行上:

import { FlowRenderer, ClassBreaksRenderer, UniqueValueRenderer, RasterColormapRenderer, RasterStretchRenderer, RasterShadedReliefRenderer, VectorFieldRenderer } from "geoscene/rasterRenderers";

此模块还允许您在呈现器上实现类型保护,从而使代码更加智能。

import { Renderer } from "geoscene/rasterRenderers";

function logRenderer(renderer: RasterStretchRenderer): void {
 if (renderer.type == "raster-stretch") {
   // the compiler knows the renderer must be a RasterStretchRenderer
   console.log("renderer color ramp: ", renderer.colorRamp);
 }
}

类型定义

ClassBreaksRenderer ClassBreaksRenderer

ClassBreaksRenderer。

FlowRenderer FlowRenderer

FlowRenderer。

RasterColormapRenderer RasterColormapRenderer

RasterColormapRenderer。

RasterShadedReliefRenderer RasterShadedReliefRenderer

RasterShadedReliefRenderer。

RasterStretchRenderer RasterStretchRenderer

RasterStretchRenderer。

UniqueValueRenderer UniqueValueRenderer

UniqueValueRenderer。

VectorFieldRenderer VectorFieldRenderer

VectorFieldRenderer。

您的浏览器已不再受支持。请升级您的浏览器以获得最佳体验。请参阅 浏览器弃用帖子以获取更多信息