@ino-cesium/common 0.0.7 → 0.0.9

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/README.MD CHANGED
@@ -1,3 +1,20 @@
1
- # ino-cesium 公共方法
1
+ # @ino-cesium/common 公共方法
2
2
 
3
3
  公共方法
4
+
5
+ * 全局事件初始化
6
+ ```javascript
7
+ initCesiumEvent(viewer, {
8
+ LEFT_POSITION: (e) => {
9
+ },
10
+ LEFT_CLICK: (e) => {
11
+ },
12
+ PICK_FEATURE: (pickModel,e) => {
13
+ },
14
+ MOVE_PICK_FEATURE: (pickModel, e) => {
15
+ },
16
+ })
17
+ ```
18
+
19
+
20
+
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as Cesium from 'cesium';
2
- import { Cartesian3, Viewer, Cesium3DTileFeature, ImageryLayer, Cesium3DTileset, Cartesian2, Cartographic, SkyBox, Entity, SampledPositionProperty, JulianDate } from 'cesium';
2
+ import { Cartesian3, Viewer, ImageryLayer, Cesium3DTileset, Cartesian2, Cartographic, SkyBox, Entity, SampledPositionProperty, JulianDate } from 'cesium';
3
3
  import { FeatureCollection, Point, GeoJsonProperties, LineString, Polygon } from 'geojson';
4
4
 
5
5
  interface ISetViewByLngLatOptions {
@@ -24,8 +24,8 @@ interface ICesiumEventListener {
24
24
  LEFT_CLICK?: (e: any) => void;
25
25
  LEFT_POSITION?: (e: any) => void;
26
26
  MOVE_POSITION?: (e: any) => void;
27
- PICK_FEATURE?: (pickModel: Cesium3DTileFeature, feature: any) => void;
28
- MOVE_PICK_FEATURE?: (pickModel: Cesium3DTileFeature, feature: any) => void;
27
+ PICK_FEATURE?: (pickModel: any, feature: any) => void;
28
+ MOVE_PICK_FEATURE?: (pickModel: any, feature: any) => void;
29
29
  }
30
30
  type DeepPartial<T> = {
31
31
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
@@ -79,11 +79,10 @@ declare const initCesium: (eleId: string, options?: Viewer.ConstructorOptions &
79
79
  * @param value 0-1
80
80
  * @param viewer
81
81
  */
82
- declare const changeGlobeOpatity: (value: number, viewer: Viewer) => void;
83
- /**
84
- *修改地上 / 地下模式
85
- */
86
- declare const changeUndergroundModel: (isUnderground: boolean, viewer: Viewer) => void;
82
+ declare const setGlobeOpatity: (value: number, viewer: Viewer) => void;
83
+ declare const setCesiumForAutoFitScale: (value: number) => void;
84
+ declare const getCesiumForAutoFitScale: () => number;
85
+ declare const DefaultViewerOptions: Viewer.ConstructorOptions;
87
86
 
88
87
  /**
89
88
  * 设置中心点
@@ -178,14 +177,14 @@ declare const initCesiumEvent: (viewer: Viewer, eventListener: ICesiumEventListe
178
177
  declare const numberId: () => string;
179
178
 
180
179
  declare class Tooltip {
181
- static tootlip: Tooltip | null;
180
+ static tooltip: Tooltip | null;
182
181
  private _title;
183
182
  private _div;
184
183
  private _message;
185
- constructor(frameDiv: HTMLElement);
184
+ constructor(viewer: Viewer);
186
185
  showAt(position: Cartesian2, message: string): void;
187
186
  setVisible(visible: boolean): void;
188
- static createToolTip(): Tooltip;
187
+ static createToolTip(viewer: Viewer): Tooltip;
189
188
  destroy(): void;
190
189
  }
191
190
 
@@ -307,6 +306,16 @@ declare const calcCameraHeightFromZoom: (zoom: number) => number;
307
306
  * @returns Cartesian3[]
308
307
  */
309
308
  declare const calcLerpPosition: (positions: Cesium.Cartesian3[], number: number) => Cesium.Cartesian3[];
309
+ /**
310
+ * @deprecated 气泡无需自适应
311
+ * @param viewer
312
+ * @param position
313
+ * @param offSet
314
+ */
315
+ declare const calcScreenPositionFromPosition: (viewer: Cesium.Viewer, position: Cesium.Cartesian3, offSet?: Cartesian2) => {
316
+ x: string;
317
+ y: string;
318
+ };
310
319
 
311
320
  declare abstract class BasePrimitive<T> {
312
321
  protected _primitive: CusPrimitive;
@@ -384,6 +393,11 @@ declare const makeLnglatsToLineGeojson: (lnglats: Cesium.Cartographic[]) => GeoJ
384
393
  * @returns GeoJSON.FeatureCollection
385
394
  */
386
395
  declare const makeLnglatsToPolygonGeojson: (lnglats: Cesium.Cartographic[]) => GeoJSON.FeatureCollection;
396
+ /**
397
+ * 把yawPitchRoll转为headingPitchRoll
398
+ * 航空中的参数和cesium中的参数有区别 角度转弧度
399
+ * @param yawPitchRoll
400
+ */
387
401
  declare const makeYawPitchRollToHeadingPitchRoll: (yawPitchRoll: IYawPitchRoll) => {
388
402
  heading: number;
389
403
  pitch: number;
@@ -570,5 +584,36 @@ interface IOpenAnimOptions {
570
584
  };
571
585
  }
572
586
 
573
- export { BaseMaterialProperty, BasePrimitive, types as Common, FlyAttitude, Popup, RoamStatus, Tooltip, calcArea, calcCameraHeightFromZoom, calcGeodesicDistance, calcGeodesicDistances, calcLerpPosition, calcPoistionCenter, calcSpaceDistance, calcSpaceDistances, calcTerrainHeightFromPositions, calcTriangleArea, calcZoomFromCameraHeight, changeGlobeOpatity, changeUndergroundModel, clacPositionsForParabola, createBottomStatusBar, createEagleEye, createOpenAnim, createRoamHandler, createSkyBox, createSkyBoxOnGround, flyToCameraView, flyToCesium3DTile, flyToDataSource, flyToFromSphere, flyToImagery, flyToLnglat, flyToPosition, getCameraView, initCesium, initCesiumEvent, makeLnglatToPosition, makeLnglatsToLineGeojson, makeLnglatsToPointGeojson, makeLnglatsToPolygonGeojson, makeLnglatsToPositions, makePositionsClose, makePositionsForAntiClockwise, makePositionsForClockwise, makePositionsToLnglats, makePositiontoLnglat, makeYawPitchRollToHeadingPitchRoll, numberId, randomColor, randomPointToGeoJson, randomPolygonToGeoJson, randomPolylineToGeoJson, setViewToLnglat, twinkleModel };
587
+ /**
588
+ * 网格8个顶点生成盒子面
589
+ * @param cartesianVertices 8个顶点
590
+ * @param color 网格颜色
591
+ * @param gridId 网格id
592
+ */
593
+ declare const makeGridToInstanceForBox: (cartesianVertices: any, color: Cesium.Color, gridId: string) => Cesium.GeometryInstance;
594
+ /**
595
+ * 网格8个顶点生成盒子边线
596
+ * @param cartesianVertices 8个顶点
597
+ * @param color 网格颜色
598
+ * @param gridId 网格id
599
+ */
600
+ declare const makeGridToInstanceForLine: (cartesianVertices: any, color: Cesium.Color, gridId: string) => Cesium.GeometryInstance;
601
+ /**
602
+ * 使用顶点极值创建盒子的八个点
603
+ * @param maxPoint
604
+ * @param minPoint
605
+ */
606
+ declare const makeGridFromElevationExtrema: (maxPoint: Cartographic, minPoint: Cartographic) => Cartesian3[];
607
+ /**
608
+ * 使用底面和高度创建网格
609
+ * @param topLeft
610
+ * @param topRight
611
+ * @param bottomRight
612
+ * @param bottomLeft
613
+ * @param minHeight
614
+ * @param maxHeight
615
+ */
616
+ declare const mekeGridPolygonAndHeight: (topLeft: number, topRight: number, bottomRight: number, bottomLeft: number, minHeight: number, maxHeight: number) => Cartesian3[];
617
+
618
+ export { BaseMaterialProperty, BasePrimitive, types as Common, DefaultViewerOptions, FlyAttitude, Popup, RoamStatus, Tooltip, calcArea, calcCameraHeightFromZoom, calcGeodesicDistance, calcGeodesicDistances, calcLerpPosition, calcPoistionCenter, calcScreenPositionFromPosition, calcSpaceDistance, calcSpaceDistances, calcTerrainHeightFromPositions, calcTriangleArea, calcZoomFromCameraHeight, clacPositionsForParabola, createBottomStatusBar, createEagleEye, createOpenAnim, createRoamHandler, createSkyBox, createSkyBoxOnGround, flyToCameraView, flyToCesium3DTile, flyToDataSource, flyToFromSphere, flyToImagery, flyToLnglat, flyToPosition, getCameraView, getCesiumForAutoFitScale, initCesium, initCesiumEvent, makeGridFromElevationExtrema, makeGridToInstanceForBox, makeGridToInstanceForLine, makeLnglatToPosition, makeLnglatsToLineGeojson, makeLnglatsToPointGeojson, makeLnglatsToPolygonGeojson, makeLnglatsToPositions, makePositionsClose, makePositionsForAntiClockwise, makePositionsForClockwise, makePositionsToLnglats, makePositiontoLnglat, makeYawPitchRollToHeadingPitchRoll, mekeGridPolygonAndHeight, numberId, randomColor, randomPointToGeoJson, randomPolygonToGeoJson, randomPolylineToGeoJson, setCesiumForAutoFitScale, setGlobeOpatity, setViewToLnglat, twinkleModel };
574
619
  export type { IOpenAnimOptions, IRoamEvent, IRoamHandler, IRoamItem, IRoamItemHPR, IRoaming };