vis-core 0.12.38 → 0.13.1

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.12.38";
1
+ declare const _default: "0.13.1";
2
2
  export default _default;
@@ -1,5 +1,4 @@
1
1
  export { default as Map } from './map';
2
- export { default as World } from './map/world';
3
2
  export { default as City } from './city';
4
3
  export { default as Earth } from './earth';
5
4
  export { default as Earth2 } from './earth2';
@@ -2,6 +2,7 @@ import { BaseObject } from 'gl-draw';
2
2
  import Base from "../Base";
3
3
  import { getProjection } from 'gl-draw/dist/utils';
4
4
  import type { FeatureCollection, Polygon, MultiPolygon } from 'geojson';
5
+ import { MeshLineMaterial } from 'gl-draw/dist/objects';
5
6
  import * as THREE from 'three';
6
7
  import { PlaneMap, Group, ContinentsBg } from "./objects";
7
8
  import { LevelArr } from 'geojson-cn';
@@ -38,6 +39,7 @@ export interface MapOptions {
38
39
  curvatureResolution?: number;
39
40
  showOneLevel?: boolean;
40
41
  handleBackKeepCamvasState?: boolean;
42
+ worldPacificCentre?: boolean;
41
43
  }
42
44
  export default class extends Base {
43
45
  static VisName: string;
@@ -51,6 +53,7 @@ export default class extends Base {
51
53
  Group: typeof Group;
52
54
  Light: typeof import("./objects").Light;
53
55
  PlaneShadow: typeof import("./objects/PlaneShadow").default;
56
+ ConicPolygon: typeof import("gl-draw/dist/objects").ConicPolygon;
54
57
  }>;
55
58
  options: Required<MapOptions>;
56
59
  mapHistory: {
@@ -76,6 +79,7 @@ export default class extends Base {
76
79
  get map(): PlaneMap | undefined;
77
80
  get mapInfo(): any;
78
81
  get mapArea(): import("gl-draw/dist/objects").ExtrudePolygon[] | undefined;
82
+ get mapLine(): import("gl-draw/dist/objects").Line[] | undefined;
79
83
  get adcodes(): any[];
80
84
  activePlaneMap: PlaneMap | null;
81
85
  isAnimating: boolean;
@@ -100,6 +104,11 @@ export default class extends Base {
100
104
  loaderAdd(adcode: number): void;
101
105
  initMaterial(adcode: number): Promise<void>;
102
106
  setAreaColor(adcode: number, color: string): void;
107
+ addAreaPlaneByProperty(key: string, value: string, options?: {
108
+ material?: THREE.Material;
109
+ lineMaterial?: MeshLineMaterial;
110
+ curvatureResolution?: number;
111
+ }): Promise<Group | undefined>;
103
112
  show(): Promise<void>;
104
113
  hide(): Promise<void>;
105
114
  shadowMapLight?: BaseObject;
@@ -0,0 +1,2 @@
1
+ import Map from './index';
2
+ export declare const changeMapWorldMaterial: (map: Map) => void;
@@ -1,7 +1,7 @@
1
1
  import { BaseObject } from 'gl-draw';
2
2
  import * as THREE from 'three';
3
3
  import { Line, ExtrudePolygon, MeshLineMaterial, Group } from 'gl-draw/dist/objects';
4
- import type { FeatureCollection, Polygon, MultiPolygon, Position } from 'geojson';
4
+ import type { FeatureCollection, Polygon, MultiPolygon, Position, Feature, GeoJsonProperties } from 'geojson';
5
5
  type GeoJSON = FeatureCollection<Polygon | MultiPolygon>;
6
6
  interface Options {
7
7
  areaGroup?: boolean;
@@ -32,7 +32,7 @@ interface Options {
32
32
  bloom?: boolean;
33
33
  }
34
34
  export default class PlaneMap extends BaseObject {
35
- options: Required<Omit<Options, 'bbox' | 'bboxOffset' | 'extrudeLineGeojson' | 'onTop'>> & Pick<Options, 'bbox' | 'bboxOffset' | 'extrudeLineGeojson' | 'onTop'>;
35
+ options: Required<Omit<Options, 'bbox' | 'bboxOffset' | 'extrudeLineGeojson'>> & Pick<Options, 'bbox' | 'bboxOffset' | 'extrudeLineGeojson'>;
36
36
  isActive: boolean;
37
37
  groupArr: Group[];
38
38
  areaArr: ExtrudePolygon[];
@@ -49,6 +49,12 @@ export default class PlaneMap extends BaseObject {
49
49
  hasSide?: boolean;
50
50
  onTop?: number;
51
51
  }): Promise<ExtrudePolygon[]>;
52
+ getPropertiesKey(properties: Record<string, any>): any;
53
+ addPlane(geojson: Feature<Polygon | MultiPolygon, GeoJsonProperties>, options: {
54
+ material: THREE.Material | THREE.Material[];
55
+ lineMaterial: MeshLineMaterial;
56
+ curvatureResolution?: number;
57
+ }): Promise<Group>;
52
58
  addLine(geojson: GeoJSON, options: {
53
59
  material?: MeshLineMaterial;
54
60
  onTop?: number;
@@ -56,7 +62,7 @@ export default class PlaneMap extends BaseObject {
56
62
  }): Promise<Line[]>;
57
63
  geojson2Meta(geojson: GeoJSON): {
58
64
  coords: Position[][];
59
- properties: import("geojson").GeoJsonProperties;
65
+ properties: GeoJsonProperties;
60
66
  }[];
61
67
  pickArea(e: MouseEvent): import("gl-draw/dist/core/BaseObject").IBaseObject | undefined;
62
68
  update(delta: number, elapsed: number): void;
@@ -1,5 +1,5 @@
1
1
  import { Draw as DrawController } from 'gl-draw/dist/plugins';
2
- import { Node, Image, Line, ExtrudePolygon, Group } from 'gl-draw/dist/objects';
2
+ import { Node, Image, Line, ExtrudePolygon, Group, ConicPolygon } from 'gl-draw/dist/objects';
3
3
  import PlaneMap from './PlaneMap';
4
4
  import ContinentsBg from './ContinentsBg';
5
5
  import Light from "../../all/objects/Light";
@@ -15,5 +15,6 @@ declare const _default: DrawController<{
15
15
  Group: typeof Group;
16
16
  Light: typeof Light;
17
17
  PlaneShadow: typeof PlaneShadow;
18
+ ConicPolygon: typeof ConicPolygon;
18
19
  }>;
19
20
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.12.38",
3
+ "version": "0.13.1",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version &&PUBLIC_EXCLUDE=public/city bundler",
@@ -1,53 +0,0 @@
1
- import { BaseObject } from 'gl-draw';
2
- import Base from "../Base";
3
- import { getProjection } from 'gl-draw/dist/utils';
4
- import { PlaneMap, Group } from "./objects";
5
- interface MapOptions {
6
- mapDepth?: number;
7
- mapPadding?: number[];
8
- bboxOffset?: number[];
9
- lineWidth?: number;
10
- assetsPrefix?: string;
11
- equirectangular?: boolean;
12
- }
13
- export default class extends Base {
14
- static VisName: string;
15
- drawController: import("gl-draw/dist/plugins").Draw<{
16
- Node: typeof import("gl-draw/dist/objects").Node;
17
- Image: typeof import("gl-draw/dist/objects").Image;
18
- Line: typeof import("gl-draw/dist/objects").Line;
19
- PlaneMap: typeof PlaneMap;
20
- ContinentsBg: typeof import("./objects").ContinentsBg;
21
- ExtrudePolygon: typeof import("gl-draw/dist/objects").ExtrudePolygon;
22
- Group: typeof Group;
23
- Light: typeof import("./objects").Light;
24
- PlaneShadow: typeof import("./objects/PlaneShadow").default;
25
- }>;
26
- options: Required<MapOptions>;
27
- isAnimating: boolean;
28
- world?: PlaneMap;
29
- group: Group;
30
- projection: ReturnType<typeof getProjection>;
31
- pcenter: [number, number];
32
- pscale: number;
33
- meters: number;
34
- extendsOptions: Record<string, any>;
35
- constructor(container: HTMLElement, options?: MapOptions);
36
- initSettingsObj: {
37
- label: boolean;
38
- };
39
- handleSetting(key: string, value: any): Promise<any>;
40
- drawLabels(): Promise<void>;
41
- init(): Promise<void>;
42
- initMap(): Promise<void>;
43
- loaderAdd(): void;
44
- initMaterial(): Promise<void>;
45
- eraseLabels(): void;
46
- fitTo(obj?: BaseObject, { polarAngle, enableTransition }?: {
47
- polarAngle?: number | undefined;
48
- enableTransition?: boolean | undefined;
49
- }): Promise<void>;
50
- paddingInCssPixel(obj: BaseObject, top: number, right: number, bottom: number, left: number, enableTransition: boolean): Promise<void[]>;
51
- dispose(): void;
52
- }
53
- export {};