pointCloudRenderers

AMD: require(["geoscene/pointCloudRenderers"], (pointCloudRenderers) => { /* 代码 */ });
ESM: import * as pointCloudRenderers from "@geoscene/core/pointCloudRenderers";
对象: geoscene/pointCloudRenderers
起始版本: GeoScene API for JavaScript 4.22

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

import PointCloudClassBreaksRenderer from "geoscene/renderers/PointCloudClassBreaksRenderer";
import PointCloudRGBRenderer from "geoscene/renderers/PointCloudRGBRenderer";
import PointCloudStretchRenderer from "geoscene/renderers/PointCloudStretchRenderer";
import PointCloudUniqueValueRenderer from "geoscene/renderers/PointCloudUniqueValueRenderer";

您可以使用此模块在一行中导入它们:

import {
  PointCloudClassBreaksRenderer,
  PointCloudRGBRenderer,
  PointCloudStretchRenderer,
  PointCloudUniqueValueRenderer
} from "geoscene/pointCloudRenderers";

此模块还允许您在渲染器上实现 类型保护,使您的代码更智能。

import { PointCloudRenderer } from "geoscene/pointCloudRenderers";

function logInfos(renderer: PointCloudRenderer): void {
  if (renderer.type === "point-cloud-class-breaks") {
    // 4.22 的新功能,编译器知道渲染器是 PointCloudClassBreaksRenderer
console.log("renderer colorClassBreakInfos: ", renderer.colorClassBreakInfos); } }

类型定义

PointCloudClassBreaksRenderer PointCloudClassBreaksRenderer

点云类中断渲染器。

渲染器类型。

PointCloudRGBRenderer PointCloudRGBRenderer

点云RGB渲染器

PointCloudStretchRenderer PointCloudStretchRenderer

点云拉伸渲染器。

PointCloudUniqueValueRenderer PointCloudUniqueValueRenderer

点云唯一值渲染器。

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.