jgis 1.0.1 → 1.0.3
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 +119 -16
- package/dist/2d/index.d.ts +1 -1
- package/dist/2d/index.js +1 -1
- package/dist/2d/index.mjs +347 -286
- package/dist/2d/layer.d.ts +21 -2
- package/dist/2d/types.d.ts +16 -6
- package/dist/2d/utils.d.ts +5 -2
- package/dist/3d/core.d.ts +39 -8
- package/dist/3d/index.d.ts +20 -4
- package/dist/3d/index.js +1 -1
- package/dist/3d/index.mjs +251 -77
- package/dist/3d/interaction.d.ts +5 -0
- package/dist/3d/layer.d.ts +29 -0
- package/dist/3d/store.d.ts +16 -0
- package/dist/3d/types.d.ts +56 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +7 -3
- package/dist/utils/index.d.ts +0 -0
- package/package.json +1 -1
- package/dist/2d/index2.d.ts +0 -23
package/dist/3d/types.d.ts
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as Cesium from 'cesium';
|
|
2
|
+
export interface flyOptions {
|
|
3
|
+
heading?: number;
|
|
4
|
+
pitch?: number;
|
|
5
|
+
roll?: number;
|
|
6
|
+
duration?: number;
|
|
7
|
+
maxHeight?: number;
|
|
8
|
+
easing?: (t: number) => number;
|
|
9
|
+
}
|
|
10
|
+
export interface LayerOptions {
|
|
11
|
+
name?: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
data?: any;
|
|
14
|
+
style?: any;
|
|
15
|
+
visible?: boolean;
|
|
16
|
+
opacity?: number;
|
|
17
|
+
interactive?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface SelectResult {
|
|
20
|
+
billboard: Cesium.Billboard;
|
|
21
|
+
properties: any;
|
|
22
|
+
event: Cesium.Cartesian2;
|
|
23
|
+
pick: any;
|
|
24
|
+
}
|
|
25
|
+
export interface UseSelectResult {
|
|
26
|
+
onSelect: (result: (SelectResult: any) => void) => void;
|
|
27
|
+
clear: () => void;
|
|
28
|
+
destroy: () => void;
|
|
29
|
+
}
|
|
30
|
+
export type Coordinates = [number, number, number];
|
|
31
|
+
export interface MapContext {
|
|
32
|
+
targetId: string;
|
|
33
|
+
instance: Cesium.Viewer;
|
|
34
|
+
addMarker: (layerName: string, data: any, options?: LayerOptions) => void;
|
|
35
|
+
createLayer: (layerName: string, data: any, options?: LayerOptions) => Layer;
|
|
36
|
+
removeLayer: (layerName: string) => void;
|
|
37
|
+
visibleLayer: (layerName: string, visible: boolean) => Layer;
|
|
38
|
+
getLayerByName: (layerName: string) => Layer;
|
|
39
|
+
getSourceByName: (layerName: string) => Source;
|
|
40
|
+
getLonLat: (data: any) => [number, number];
|
|
41
|
+
createBlankLayer: (layerName: string, options: LayerOptions) => Layer;
|
|
42
|
+
lightFeature: (layerName: string, feature: FeatureLike, options: HighLightOptions, zoomFlag: boolean) => void;
|
|
43
|
+
flashFeature: (layerName: string, feature: FeatureLike & customFeature, options: FlashOptions) => void;
|
|
44
|
+
queryFeature: (layerName: string, properties: any) => FeatureLike;
|
|
45
|
+
useSelect: (options: any) => UseSelectResult;
|
|
46
|
+
useHover: (options: HoverOptions) => UseHoverResult;
|
|
47
|
+
flyTo: (coordinate: Coordinates, options: flyOptions) => Promise<boolean>;
|
|
48
|
+
flyHome: (duration?: number) => void;
|
|
49
|
+
flyToBoundingSphere: (boundingSphere: Cesium.BoundingSphere, options?: flyOptions) => Promise<boolean>;
|
|
50
|
+
getProjection: () => void;
|
|
51
|
+
getZoom: () => number;
|
|
52
|
+
setView: (coordinate: Coordinates, options?: flyOptions) => void;
|
|
53
|
+
getMapContext: (id: string) => Promise<MapContext>;
|
|
54
|
+
onMapReady: (id: string, callback: () => void) => void;
|
|
55
|
+
destroyMap: (id: string) => void;
|
|
56
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,25 @@
|
|
|
1
1
|
export declare const version = "1.0.0";
|
|
2
2
|
export declare const author = "zhangjianfeng";
|
|
3
|
+
type dataType = {
|
|
4
|
+
lttd?: number;
|
|
5
|
+
lgtd?: number;
|
|
6
|
+
} & {
|
|
7
|
+
jd?: number;
|
|
8
|
+
wd?: number;
|
|
9
|
+
} & {
|
|
10
|
+
latitude?: number;
|
|
11
|
+
longitude?: number;
|
|
12
|
+
} & {
|
|
13
|
+
lon?: number;
|
|
14
|
+
lat?: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 解析出数据中的经纬度
|
|
18
|
+
* @param data 数据
|
|
19
|
+
* @returns [经度, 纬度]
|
|
20
|
+
*/
|
|
21
|
+
export declare function getLonLat(data: dataType, options?: {
|
|
22
|
+
lonLabel: string;
|
|
23
|
+
latLabel: string;
|
|
24
|
+
}): [number, number];
|
|
25
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="1.0.0",u="zhangjianfeng";function n(e,l){return typeof e!="object"||e===null?null:l&&l.lonLabel&&l.latLabel?[Number(e[l.lonLabel]),Number(e[l.latLabel])]:e.lttd&&e.lgtd?[Number(e.lgtd),Number(e.lttd)]:e.jd&&e.wd?[Number(e.jd),Number(e.wd)]:e.latitude&&e.longitude?[Number(e.longitude),Number(e.latitude)]:e.lon&&e.lat?[Number(e.lon),Number(e.lat)]:null}exports.author=u;exports.getLonLat=n;exports.version=r;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const r = "1.0.0", u = "zhangjianfeng";
|
|
2
|
+
function n(e, l) {
|
|
3
|
+
return typeof e != "object" || e === null ? null : l && l.lonLabel && l.latLabel ? [Number(e[l.lonLabel]), Number(e[l.latLabel])] : e.lttd && e.lgtd ? [Number(e.lgtd), Number(e.lttd)] : e.jd && e.wd ? [Number(e.jd), Number(e.wd)] : e.latitude && e.longitude ? [Number(e.longitude), Number(e.latitude)] : e.lon && e.lat ? [Number(e.lon), Number(e.lat)] : null;
|
|
4
|
+
}
|
|
2
5
|
export {
|
|
3
|
-
|
|
4
|
-
n as
|
|
6
|
+
u as author,
|
|
7
|
+
n as getLonLat,
|
|
8
|
+
r as version
|
|
5
9
|
};
|
|
File without changes
|
package/package.json
CHANGED
package/dist/2d/index2.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Map } from 'ol';
|
|
2
|
-
import { JGisInstance, JGisConfig, JGisInitOptions } from './types';
|
|
3
|
-
export default class JGis implements JGisInstance {
|
|
4
|
-
protected Map: Map;
|
|
5
|
-
protected config: JGisConfig;
|
|
6
|
-
constructor(map: Map, options: JGisConfig);
|
|
7
|
-
init(options: JGisInitOptions): void;
|
|
8
|
-
/**
|
|
9
|
-
* 移动事件
|
|
10
|
-
* @param options
|
|
11
|
-
*/
|
|
12
|
-
private moveEvent;
|
|
13
|
-
/**
|
|
14
|
-
* 点击事件
|
|
15
|
-
* @param options
|
|
16
|
-
*/
|
|
17
|
-
private clickEvent;
|
|
18
|
-
private handleClick;
|
|
19
|
-
/**
|
|
20
|
-
* 清除选中要素
|
|
21
|
-
*/
|
|
22
|
-
clearSelectFeature(): void;
|
|
23
|
-
}
|