vis-core 0.29.13 → 0.30.0-beta.10

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/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.29.13";
1
+ declare const _default: "0.30.0-beta.10";
2
2
  export default _default;
@@ -1,7 +1,8 @@
1
- import Pencil, { BaseObject } from 'gl-draw';
2
- import { Group, Line } from 'gl-draw/dist/objects';
1
+ import type Pencil from 'gl-draw';
2
+ import { BaseObject } from 'gl-draw';
3
+ import type { Line } from 'gl-draw/dist/objects';
3
4
  import * as THREE from 'three';
4
- import Tube from '../Tube';
5
+ import type Tube from '../Tube';
5
6
  interface Options {
6
7
  from: number[];
7
8
  to: number[];
@@ -15,7 +16,6 @@ interface Options {
15
16
  export default class extends BaseObject {
16
17
  options: Options;
17
18
  line: Line;
18
- helperMesh?: Group[];
19
19
  helperMeshPosition?: THREE.Vector3[];
20
20
  constructor(options: Options);
21
21
  static getInitOptions(pencil: Pencil, options: Options): {
@@ -1,8 +1,8 @@
1
1
  import leadObjs from "../all/objects";
2
- import Arc from "../all/objects/Arc";
3
- import Pencil, { BaseObject, Lead } from 'gl-draw';
2
+ import type Arc from "../all/objects/Arc";
3
+ import Pencil, { type BaseObject, type Lead } from 'gl-draw';
4
4
  import type { PickFunctionsItem } from 'gl-draw/dist/core/Lead/Pick';
5
- import { Line, Node } from 'gl-draw/dist/objects';
5
+ import type { Line, Node } from 'gl-draw/dist/objects';
6
6
  import { Wk } from 'gl-draw/dist/plugins';
7
7
  import * as THREE from 'three';
8
8
  import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment';
@@ -12,7 +12,6 @@ export interface BaseOptions {
12
12
  container: HTMLElement;
13
13
  assetsPrefix?: string;
14
14
  css2DContainer?: HTMLElement;
15
- workerOnce?: boolean;
16
15
  pencil?: any;
17
16
  pencil2?: any;
18
17
  pencilConfig?: Record<string, any>;
@@ -66,7 +65,6 @@ export default class Base extends Camera {
66
65
  mList: Pencil['mList'];
67
66
  get loader(): import("gl-draw/dist/core/Loader/Loader").default;
68
67
  get worker(): Wk;
69
- workerOnce: boolean;
70
68
  tier0: boolean;
71
69
  pmremGenerator: THREE.PMREMGenerator | null;
72
70
  re: RoomEnvironment | null;
@@ -106,14 +104,17 @@ export default class Base extends Camera {
106
104
  show(): void;
107
105
  showAction(): void;
108
106
  hide(): void;
107
+ addGroup(): Promise<import("gl-draw/dist/objects").Group>;
109
108
  addCSS2D(dom: HTMLElement, options?: {
110
109
  display?: string;
111
110
  onTop?: number;
111
+ target?: BaseObject;
112
112
  }): Promise<Node>;
113
113
  addCSS3D(dom: HTMLElement, options?: {
114
114
  display?: string;
115
115
  onTop?: number;
116
116
  type?: '3d' | '3dSprite';
117
+ target?: BaseObject;
117
118
  }): Promise<Node>;
118
119
  getRoomEnvMap(): THREE.Texture<unknown>;
119
120
  handlePick(objArr: PickFunctionsItem['objArr'], type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): void;
@@ -1,11 +1,11 @@
1
- import Base, { BaseOptions } from "../base";
1
+ import Base, { type BaseOptions } from "../base";
2
2
  import leadObjs from "./objects";
3
- import { BaseObject, Lead } from 'gl-draw';
4
- import { Group } from 'gl-draw/dist/objects';
3
+ import { type BaseObject, type Lead } from 'gl-draw';
4
+ import { type Group } from 'gl-draw/dist/objects';
5
5
  import { getProjection } from 'gl-draw/dist/utils';
6
6
  import * as THREE from 'three';
7
- import Building from './objects/building';
8
- import Road from './objects/road';
7
+ import type Building from './objects/building';
8
+ import type Road from './objects/road';
9
9
  interface CityOptions extends BaseOptions {
10
10
  adcode: number;
11
11
  jsonName: string;
@@ -18,14 +18,9 @@ interface CityOptions extends BaseOptions {
18
18
  };
19
19
  plane?: boolean;
20
20
  grey?: boolean;
21
- greyFull?: boolean;
22
- clip?: {
23
- features: any[];
24
- };
25
- clipOutShow?: boolean;
26
- planeOut?: boolean;
27
21
  showBuilding?: boolean;
28
22
  buildingSideGradient?: boolean;
23
+ buildingHasSide?: boolean;
29
24
  showRoad?: boolean;
30
25
  showGrassland?: boolean;
31
26
  showRiver?: boolean;
@@ -76,10 +71,9 @@ export default class extends Base {
76
71
  projection: ReturnType<typeof getProjection>;
77
72
  options: CityOptions;
78
73
  group: Group;
74
+ outAreaGroup: Group;
79
75
  building: Building;
80
76
  road: Road;
81
- innerAreaGroup: Group;
82
- outAreaGroup: Group;
83
77
  setOptions(options: CityOptions): void;
84
78
  multiplyScalar: number;
85
79
  loaderAdd(): void;
@@ -91,18 +85,14 @@ export default class extends Base {
91
85
  getInvert(vector3: THREE.Vector3): any;
92
86
  fitTo(obj: BaseObject, enableTransition?: boolean): Promise<void>;
93
87
  initVis(): Promise<void>;
94
- fitToTarget(adcode: number, lnglat?: [number, number]): Promise<void>;
95
88
  drawBuilding(options?: {
96
89
  json?: {
97
90
  features: any[];
98
91
  };
99
92
  meters?: number;
100
- clip?: {
101
- features: any[];
102
- };
103
93
  grey?: boolean;
104
94
  sideGradient?: boolean;
105
- group?: Group;
95
+ hasSide?: boolean;
106
96
  }): Promise<Building | undefined>;
107
97
  drawArea(options?: {
108
98
  json?: {
@@ -110,11 +100,7 @@ export default class extends Base {
110
100
  };
111
101
  type?: 'river' | 'grassland';
112
102
  oArr?: number[];
113
- clip?: {
114
- features: any[];
115
- };
116
103
  grey?: boolean;
117
- group?: Group;
118
104
  }): Promise<import("./objects/area").default | undefined>;
119
105
  drawRoad(options?: {
120
106
  json?: {
@@ -122,11 +108,7 @@ export default class extends Base {
122
108
  };
123
109
  meters?: number;
124
110
  z?: number;
125
- clip?: {
126
- features: any[];
127
- };
128
111
  grey?: boolean;
129
- group?: Group;
130
112
  }): Promise<Road | undefined>;
131
113
  getWorldPosition(longitude: number, latitude: number): {
132
114
  x: any;
@@ -1,6 +1,6 @@
1
1
  import { BaseObject } from 'gl-draw';
2
- import { ExtrudePolygon } from 'gl-draw/dist/objects';
3
- import * as THREE from 'three';
2
+ import type { ExtrudePolygon } from 'gl-draw/dist/objects';
3
+ import type * as THREE from 'three';
4
4
  interface Options {
5
5
  json: {
6
6
  features: any[];
@@ -13,16 +13,11 @@ interface Options {
13
13
  type: string;
14
14
  cacheKey?: string;
15
15
  oArr?: number[];
16
- clip?: {
17
- features: any[];
18
- };
19
16
  }
20
17
  export default class extends BaseObject {
21
18
  options: Options;
22
19
  area: ExtrudePolygon[];
23
20
  constructor(options: Options);
24
- outJson: Map<any, any>;
25
21
  create(): Promise<void>;
26
- dispose(): void;
27
22
  }
28
23
  export {};
@@ -1,5 +1,4 @@
1
1
  import { BaseObject } from 'gl-draw';
2
- import { ExtrudePolygon } from 'gl-draw/dist/objects';
3
2
  import * as THREE from 'three';
4
3
  interface Options {
5
4
  json: {
@@ -12,23 +11,18 @@ interface Options {
12
11
  cacheKey?: string;
13
12
  material?: THREE.Material | THREE.Material[];
14
13
  meters?: number;
14
+ hasSide?: boolean;
15
15
  sideGradient?: boolean;
16
16
  grey?: boolean;
17
- clip?: {
18
- features: any[];
19
- };
20
17
  }
21
18
  export default class extends BaseObject {
22
19
  options: Options;
23
20
  constructor(options: Options);
24
- building: Record<string, ExtrudePolygon[]>;
25
- outJson: Map<any, any>;
26
21
  create(): Promise<void>;
27
22
  worldPositionZ: {
28
23
  value: number;
29
24
  };
30
25
  sideGradient(color?: string, maxGradientHeight?: number): void;
31
26
  update(): void;
32
- dispose(): void;
33
27
  }
34
28
  export {};
@@ -1,5 +1,5 @@
1
1
  import { BaseObject } from 'gl-draw';
2
- import { Line } from 'gl-draw/dist/objects';
2
+ import type { Line } from 'gl-draw/dist/objects';
3
3
  interface Options {
4
4
  json: {
5
5
  features: any[];
@@ -11,14 +11,10 @@ interface Options {
11
11
  cacheKey?: string;
12
12
  meters?: number;
13
13
  grey?: boolean;
14
- clip?: {
15
- features: any[];
16
- };
17
14
  }
18
15
  export default class extends BaseObject {
19
16
  options: Options;
20
17
  constructor(options: Options);
21
- outJson: Map<any, any>;
22
18
  linePrimary: Line[];
23
19
  lineSecondary: Line[];
24
20
  create(): Promise<void>;
@@ -1,9 +1,9 @@
1
- import Base, { BaseOptions } from "../base";
1
+ import Base, { type BaseOptions } from "../base";
2
2
  import leadObjs from "./objects";
3
- import { BaseObject, Lead } from 'gl-draw';
3
+ import type { BaseObject, Lead } from 'gl-draw';
4
4
  import { MeshLineMaterial } from 'gl-draw/dist/objects';
5
5
  import * as THREE from 'three';
6
- import PlaneMap from '../map/objects/PlaneMap';
6
+ import type PlaneMap from '../map/objects/PlaneMap';
7
7
  interface EarthOptions extends BaseOptions {
8
8
  mapDepth?: number;
9
9
  otherMapDepth?: number;
@@ -74,5 +74,13 @@ export default class extends Base {
74
74
  }): Promise<PlaneMap | undefined>;
75
75
  getRadius(): number;
76
76
  checkBehindEarth(objArr: () => BaseObject[], cb: (obj: BaseObject[], res: boolean[]) => any): void;
77
+ /**
78
+ * 设置物体在球面上的位置和旋转,使其垂直于球面
79
+ * @param object - 要设置的物体
80
+ * @param location - 经纬度 [经度, 纬度]
81
+ * @param height - 距离球面的高度,默认为0
82
+ * @param upAxis - 物体的up轴方向,默认为Y轴 [0, 1, 0]
83
+ */
84
+ setObjectOnSphere(baseObject: BaseObject, location: [number, number], height?: number, upAxis?: [number, number, number]): void;
77
85
  }
78
86
  export {};
@@ -1,11 +1,11 @@
1
1
  import { findAdcodeInfo } from "../all/json";
2
- import Base, { BaseOptions } from "../base";
2
+ import Base, { type BaseOptions } from "../base";
3
3
  import leadObjs from "./objects";
4
- import ContinentsBg from "./objects/ContinentsBg";
5
- import PlaneMap from "./objects/PlaneMap";
4
+ import type ContinentsBg from "./objects/ContinentsBg";
5
+ import type PlaneMap from "./objects/PlaneMap";
6
6
  import type { FeatureCollection, MultiPolygon, Polygon } from 'geojson';
7
- import { BaseObject, Lead } from 'gl-draw';
8
- import { ExtrudePolygon, Group, Line, MeshLineMaterial } from 'gl-draw/dist/objects';
7
+ import { type BaseObject, type Lead } from 'gl-draw';
8
+ import { type ExtrudePolygon, type Group, Line, MeshLineMaterial } from 'gl-draw/dist/objects';
9
9
  import { getProjection } from 'gl-draw/dist/utils';
10
10
  import * as THREE from 'three';
11
11
  import City from './city';
@@ -54,10 +54,9 @@ export interface MapOptions extends BaseOptions {
54
54
  bottomPlaneWater?: boolean;
55
55
  }
56
56
  interface MapCityOptions extends MapOptions {
57
- clipOutShow?: boolean;
58
57
  jsonNameObj?: Record<number, string>;
59
58
  cacheCity?: boolean;
60
- greyFull?: boolean;
59
+ nearbyCities?: boolean | 'full';
61
60
  showBuilding?: boolean;
62
61
  buildingSideGradient?: boolean;
63
62
  showRoad?: boolean;
@@ -171,10 +170,7 @@ export default class extends Base {
171
170
  initSettingsObj: Record<string, any>;
172
171
  handleSetting(key: string, value: any): Promise<any>;
173
172
  init(): Promise<void>;
174
- initCityVis(adcode: number, options?: {
175
- clip?: boolean;
176
- grey?: boolean;
177
- }): Promise<City>;
173
+ initCityVis(adcode: number, grey?: boolean): Promise<City>;
178
174
  initCityOnMap(adcode: number): Promise<void>;
179
175
  initVisBg(): Promise<void>;
180
176
  initVis(adcode: number): Promise<void>;
@@ -223,6 +219,14 @@ export default class extends Base {
223
219
  eraseLabels(): void;
224
220
  geAdcodePosition(adcode: number): [number, number, number] | undefined;
225
221
  getLocationPosition(location: [number, number]): [number, number, number];
222
+ /**
223
+ * 设置物体在平面地图上的位置
224
+ * @param object - 要设置的物体
225
+ * @param location - 经纬度 [经度, 纬度]
226
+ * @param height - 距离地图平面的高度,默认为0
227
+ */
228
+ setObjectOnMap(object: BaseObject, location: [number, number], height?: number): void;
229
+ setObjectOnMapAreaByProperty(object: BaseObject, key: string, value: any, height?: number): void;
226
230
  getAdcodeScreenPosition(adcode: number): {
227
231
  x: number;
228
232
  y: number;
@@ -1,6 +1,6 @@
1
1
  import type { FeatureCollection, GeoJsonProperties, MultiPolygon, Polygon, Position } from 'geojson';
2
2
  import { BaseObject } from 'gl-draw';
3
- import { ExtrudePolygon, Group, Line, MeshLineMaterial } from 'gl-draw/dist/objects';
3
+ import type { ExtrudePolygon, Group, Line, MeshLineMaterial } from 'gl-draw/dist/objects';
4
4
  import * as THREE from 'three';
5
5
  export type GeoJSON = FeatureCollection<Polygon | MultiPolygon>;
6
6
  interface Options {
@@ -1,2 +1,2 @@
1
- import Map from '../../index';
1
+ import type Map from '../../index';
2
2
  export declare const cityOnMap: (map: Map) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.29.13",
3
+ "version": "0.30.0-beta.10",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version && PUBLIC_EXCLUDE=true bundler",
@@ -9,9 +9,7 @@
9
9
  "preview": "bundler-preview",
10
10
  "version": "node ./scripts/generate-version",
11
11
  "gzip": "node ./scripts/gzip",
12
- "start:3dSite": "npm run version && VITE_SITE_3D=true bundler-dev",
13
- "build:3dSite": "npm run version && VITE_SITE_3D=true bundler",
14
- "pub": "npm publish"
12
+ "pub": "npm publish --tag beta"
15
13
  },
16
14
  "main": "dist/index.js",
17
15
  "module": "dist/index.module.js",
@@ -48,9 +46,9 @@
48
46
  "jszip": "^3.10.1",
49
47
  "pinia": "^2.2.4",
50
48
  "primeicons": "^7.0.0",
51
- "primevue": "^4.3.9",
49
+ "primevue": "^4.4.1",
52
50
  "tailwind-config-bundler": "^0.4.6",
53
- "three": "^0.181.0",
51
+ "three": "^0.182.0",
54
52
  "vite-plugin-javascript-obfuscator": "^3.1.0",
55
53
  "vite-plugin-markdown": "^2.2.0",
56
54
  "vite-plugin-static-copy": "^2.2.0",
@@ -61,12 +59,12 @@
61
59
  "dependencies": {
62
60
  "@turf/turf": "^6.5.0",
63
61
  "@types/crypto-js": "^4.2.2",
64
- "@types/three": "^0.181.0",
62
+ "@types/three": "^0.182.0",
65
63
  "crypto-js": "^4.2.0",
66
64
  "esus-lite": "^0.2.8",
67
65
  "events": "^3.3.0",
68
66
  "geojson-cn": "^0.2.5",
69
- "gl-draw": "0.16.8",
67
+ "gl-draw": "0.17.0-beta.15",
70
68
  "jsrsasign": "^11.1.0",
71
69
  "lodash-es": "^4.17.21"
72
70
  },
@@ -1,5 +0,0 @@
1
- export declare function clipGeojson(clipping_geojson: any, input_geojson: any): {
2
- type: string;
3
- features: any[];
4
- };
5
- export declare const getBoxMultiPoly: (json: any) => import("@turf/turf").Feature<import("@turf/turf").Polygon, import("@turf/turf").Properties>[];
@@ -1,3 +0,0 @@
1
- import { union } from '@turf/turf';
2
- declare const _default: (allGeometries: Parameters<typeof union>[0][]) => import("@turf/turf").Polygon | import("@turf/turf").MultiPolygon | import("@turf/turf").Feature<import("@turf/turf").Polygon | import("@turf/turf").MultiPolygon, import("@turf/turf").Properties> | null;
3
- export default _default;