deeptwins-engine-3d 0.1.71 → 0.1.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -73,11 +73,11 @@ DEEP_TWINS_BASE_URL && (window.CESIUM_BASE_URL = DEEP_TWINS_BASE_URL);
73
73
  // 全局加载css
74
74
  loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
75
75
  // 打印版本信息
76
- console.log('DeepTwinsEngine3D Version:', "0.1.71");
76
+ console.log('DeepTwinsEngine3D Version:', "0.1.72");
77
77
  export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
78
78
  _classCallCheck(this, DeepTwinsEngine3D);
79
79
  });
80
- _defineProperty(DeepTwinsEngine3D, "Version", "0.1.71");
80
+ _defineProperty(DeepTwinsEngine3D, "Version", "0.1.72");
81
81
  _defineProperty(DeepTwinsEngine3D, "Map", Map);
82
82
  _defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
83
83
  _defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
@@ -4,7 +4,7 @@ import ImageryLayer from './ImageryLayer';
4
4
  /**
5
5
  * CustomRasterLayer 是一个通用栅格瓦片图层:
6
6
  * - 使用 Cesium.UrlTemplateImageryProvider 加载任意 URL 模板瓦片。
7
- * - 使用 proj4 将瓦片范围和裁剪 GeoJSON dataCrs 转到 renderCrs。
7
+ * - 使用 proj4 将瓦片范围和裁剪 GeoJSON 从各自 CRS 转到 renderCrs。
8
8
  * - GCJ02 渲染时按 tileLayer/test 的瓦片坐标方案计算瓦片范围。
9
9
  * - 可选按 GeoJSON 面要素裁剪瓦片。
10
10
  * - 裁剪前先求瓦片 bbox 与裁剪面的交集,避免多面重叠时误裁。
@@ -46,7 +46,8 @@ import ImageryLayer from './ImageryLayer';
46
46
  * - `source`:必填,Cesium.UrlTemplateImageryProvider 原生配置。
47
47
  * - `layerOptions`:可选,Cesium.ImageryLayer 原生配置。
48
48
  * - `bounds`:可选,瓦片范围 `[minX, minY, maxX, maxY]`。
49
- * - `dataCrs`:可选,bounds 与 clipFeature 的原始坐标系,默认 `EPSG:4326`。
49
+ * - `dataCrs`:可选,bounds 的原始坐标系,默认 `EPSG:4326`。
50
+ * - `clipFeatureCrs`:可选,clipFeature 的原始坐标系,默认跟随 dataCrs。
50
51
  * - `renderCrs`:可选,bounds、clipFeature 和瓦片范围转换后的目标坐标系,默认 `EPSG:4326`。
51
52
  * - `projectionDefs`:可选,自定义 proj4 坐标系定义。
52
53
  * - `clipFeature`:可选,GeoJSON Polygon/MultiPolygon/Feature/FeatureCollection。
@@ -79,8 +80,10 @@ export type CustomRasterLayerDebugEvent = {
79
80
  clipBounds?: CustomRasterBounds;
80
81
  /** 最终用于瓦片调度的渲染范围。 */
81
82
  renderBounds?: CustomRasterBounds;
82
- /** 原始数据坐标系。 */
83
+ /** bounds 原始坐标系。 */
83
84
  dataCrs?: string;
85
+ /** clipFeature 原始坐标系。 */
86
+ clipFeatureCrs?: string;
84
87
  /** bounds、clipFeature 和瓦片范围转换后的目标坐标系。 */
85
88
  renderCrs?: string;
86
89
  /** 裁剪或丢弃原因。 */
@@ -114,8 +117,10 @@ export type CustomRasterLayerOptions = {
114
117
  layerOptions?: Cesium.ImageryLayer.ConstructorOptions;
115
118
  /** 瓦片范围,格式为 [minX, minY, maxX, maxY],坐标系跟随 dataCrs。 */
116
119
  bounds?: CustomRasterBounds;
117
- /** bounds 和 clipFeature 的原始坐标系,默认 EPSG:4326。 */
120
+ /** bounds 的原始坐标系,默认 EPSG:4326。 */
118
121
  dataCrs?: string;
122
+ /** clipFeature 的原始坐标系,默认跟随 dataCrs。 */
123
+ clipFeatureCrs?: string;
119
124
  /** bounds、clipFeature 和瓦片范围转换后的目标坐标系,默认 EPSG:4326。 */
120
125
  renderCrs?: string;
121
126
  /** 自定义 proj4 坐标系定义,key 可为 EPSG:xxxx 或其他 proj4 名称。 */
@@ -35,7 +35,7 @@ import ImageryLayer from "./ImageryLayer";
35
35
  /**
36
36
  * CustomRasterLayer 是一个通用栅格瓦片图层:
37
37
  * - 使用 Cesium.UrlTemplateImageryProvider 加载任意 URL 模板瓦片。
38
- * - 使用 proj4 将瓦片范围和裁剪 GeoJSON dataCrs 转到 renderCrs。
38
+ * - 使用 proj4 将瓦片范围和裁剪 GeoJSON 从各自 CRS 转到 renderCrs。
39
39
  * - GCJ02 渲染时按 tileLayer/test 的瓦片坐标方案计算瓦片范围。
40
40
  * - 可选按 GeoJSON 面要素裁剪瓦片。
41
41
  * - 裁剪前先求瓦片 bbox 与裁剪面的交集,避免多面重叠时误裁。
@@ -77,7 +77,8 @@ import ImageryLayer from "./ImageryLayer";
77
77
  * - `source`:必填,Cesium.UrlTemplateImageryProvider 原生配置。
78
78
  * - `layerOptions`:可选,Cesium.ImageryLayer 原生配置。
79
79
  * - `bounds`:可选,瓦片范围 `[minX, minY, maxX, maxY]`。
80
- * - `dataCrs`:可选,bounds 与 clipFeature 的原始坐标系,默认 `EPSG:4326`。
80
+ * - `dataCrs`:可选,bounds 的原始坐标系,默认 `EPSG:4326`。
81
+ * - `clipFeatureCrs`:可选,clipFeature 的原始坐标系,默认跟随 dataCrs。
81
82
  * - `renderCrs`:可选,bounds、clipFeature 和瓦片范围转换后的目标坐标系,默认 `EPSG:4326`。
82
83
  * - `projectionDefs`:可选,自定义 proj4 坐标系定义。
83
84
  * - `clipFeature`:可选,GeoJSON Polygon/MultiPolygon/Feature/FeatureCollection。
@@ -473,8 +474,9 @@ var CustomRasterLayer = /*#__PURE__*/function (_ImageryLayer) {
473
474
  }
474
475
  registerProjectionDefs(options.projectionDefs);
475
476
  var dataCrs = normalizeCrs(options.dataCrs || DEFAULT_CRS);
477
+ var clipFeatureCrs = normalizeCrs(options.clipFeatureCrs || dataCrs);
476
478
  var renderCrs = normalizeCrs(options.renderCrs || DEFAULT_CRS);
477
- var transformedClipFeature = transformGeoJson(options.clipFeature, dataCrs, renderCrs);
479
+ var transformedClipFeature = transformGeoJson(options.clipFeature, clipFeatureCrs, renderCrs);
478
480
  var clipFeatures = collectPolygonFeatures(transformedClipFeature);
479
481
  var _options$source = options.source,
480
482
  sourceTilingSchemeOption = _options$source.tilingScheme,
@@ -516,6 +518,7 @@ var CustomRasterLayer = /*#__PURE__*/function (_ImageryLayer) {
516
518
  clipBounds: clipBounds,
517
519
  renderBounds: renderBounds,
518
520
  dataCrs: dataCrs,
521
+ clipFeatureCrs: clipFeatureCrs,
519
522
  renderCrs: renderCrs
520
523
  });
521
524
  if (options.autoFitBounds && normalizeBounds(fitBounds)) {