@anov/gis 1.2.0 → 1.2.2

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.
Files changed (3) hide show
  1. package/README.md +92 -88
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,122 +1,126 @@
1
- # ANOV-GIS-SDK 三维GIS SDK
2
- **ANOV-GIS-SDK是一款构建三维 WebGIS 应用的二次开发API框架,该框架基于开源项目Cesium进行封装和优化,
3
- 可用于构建跨操作系统、 跨浏览器的三维 GIS 应用程序。可以实现在浏览器和移动端上美观、流畅的三维地图呈现与空间分析。**
1
+ # 介绍
2
+ @anov/gis核心是一个前端js库,代码主要基于WebGL和Cesium进行开发和封装,可用于构建在浏览器和移动端运行的三维WebGIS应用系统。
3
+ 使用ANOV-GIS二次开发SDK能够缩短开发周期。另外,提供ANOV-UI组件,使用户可以零代码开发GIS系统。
4
4
 
5
- ```
6
- ANOV-GIS-SDK的用途:
7
- 1、二三维场景可视化;
8
- 2、数据动画和特效;
9
- 3、空间分析
10
- 4、第三方库融合(turf、threejs等)
11
- 5、地图交互与工具(标绘、控件、弹框等)
12
- ```
13
-
14
- ## 二、功能结构
15
- ```
16
- SDK按照功能和特点,分成如下几个大的模块。
17
- 1、图层Layer,加载和管理基础图层,包括影像、地形、三维模型、矢量、dom图层、以及有多个覆盖物Grapic构成的图层。
18
- 2、材质Material,给点、线、面添加材质,比如圆扩散效果、流动线效果,流动水面材质,图片纹理等。
19
- 3、空间分析Analysis,结合影像、地形、模型等数据实现GIS相关的分析功能,呈现分析结果和效果。
20
- 4、场景Effect,包括三维特效,漫游,摄像机,天气特效雨雪雾等。
21
- 5、基础Core,静态工具函数库,事件,数据计算,坐标转换等。
22
- 6、实体元素Grapic,添加到三维球上的单个实体/图元,或者dom元素,多个Grapic构成图层Layer。
5
+ ## 1、功能结构
6
+ @anov/gis的用途包括二三维场景可视化、数据动画和特效、空间分析、地图交互和工具等。
23
7
 
8
+ 具体分成如下几个大的模块:
24
9
 
10
+ 1、图层Layer,加载和管理基础图层,包括影像、地形、三维模型、矢量、dom图层、以及有多个实体元素Grapic构成的要素图层。
25
11
 
26
- ```
27
- ![alt 效果](/static/images/gnjg.png "效果预览")
12
+ 2、材质Material,给点、线、面添加材质,比如圆扩散效果、流动线效果,流动水面材质,图片纹理等。
28
13
 
14
+ 3、空间分析Analysis,结合影像、地形、模型等数据实现GIS相关的分析功能,呈现分析结果和效果。
29
15
 
30
- ## 三、使用
16
+ 4、场景Effect,包括三维特效,漫游,摄像机,天气特效雨雪雾等。
31
17
 
32
- **使用方式1(原生html引入)**
18
+ 5、基础Core,静态工具函数库,事件,数据计算,坐标转换等。
33
19
 
34
- `<link rel="stylesheet" href="./anov-gis-sdk/index.css">
20
+ 6、实体元素Grapic,添加到三维球上的entity/primitive,或者dom元素,多个Grapic构成图层Layer。
21
+ <img src="http://123.56.67.147:8888/cesiumdemo/data/mytest/datas/anov-gis/gnjg.png" />
35
22
 
23
+ ## 2、SDK安装
24
+ ### 方式1
25
+ 下载SDK二次开发包,然后引入css和js文件即可。
26
+ ```html
27
+ <link rel="stylesheet" href="./anov-gis-sdk/index.css">
36
28
  <script src="./anov-gis-sdk/index.js"></script>
29
+ ```
30
+ ### 方式2
31
+ #### 1、安装
32
+ `NPM / YARN` 的方式安装,它能更好地和 webpack 打包工具配合使用。
33
+
34
+ ```shell
35
+ npm i @anov/gis
36
+ -------------------------
37
+ yarn add @anov/gis
38
+ ```
39
+ 安装后在相关使用文件中引入使用即可
40
+ ```js
41
+ import "@anov/gis/dist/index.css";
42
+ import ANOVGIS from "@anov/gis";
43
+ ```
44
+ #### 2、配置
37
45
 
38
- ANOVGIS.ready(() => {
39
- let viewer = new ANOVGIS.Viewer("cesiumContainer",{
40
- imageryProvider:undefined
41
- });
42
- });`
43
-
44
- **使用方式2(npm引入)**
46
+ 下面介绍常见的几种技术栈下配置方法。
45
47
 
46
- `npm install @anov/gis`
48
+ ##### 2.1 vue-cli 技术栈时 的项目配置修改
49
+ 工程模板下载: [anov-gis-vue](https://github.com/948033145/anov-gis-vue2)
47
50
 
48
- 打包配置
51
+ 工程模板压缩包:[anov-gis-vue2.x](http://123.56.67.147:8888/cesiumdemo/data/mytest/datas/anov-gis-vue2.zip)
49
52
  ```javascript
50
53
  const { defineConfig } = require('@vue/cli-service')
51
54
  const CopywebpackPlugin = require('copy-webpack-plugin');
52
- const path = require('path')
55
+ const cesiumSourcePath = 'node_modules/@anov/gis/dist/resources';
53
56
  module.exports = defineConfig({
54
57
  transpileDependencies: true,
55
58
  lintOnSave: false,
56
59
  configureWebpack: (config) => {
57
- const cesiumSourcePath = 'node_modules/@anov/gis/';
58
- const plugins = [
59
- new CopywebpackPlugin({
60
- patterns: [
61
- {
62
- from: path.join(cesiumSourcePath, '/resources'),
63
- to: 'anov-gis-sdk/resources',
64
- },
65
- ]
66
- })
67
- ]
68
60
  return {
69
- module: { unknownContextCritical: false },
61
+ plugins: [
62
+ new CopywebpackPlugin({
63
+ patterns: [
64
+ {
65
+ from: cesiumSourcePath,
66
+ to: 'anov-gis-sdk/resources',
67
+ },
68
+ ]
69
+ })
70
+ ],
71
+ module: { unknownContextCritical: false },
70
72
  }
71
73
  }
72
74
  })
73
-
74
75
  ```
76
+ ##### 2.2 vue-vite 技术栈时 的项目配置修改
77
+ 工程模板源码下载: [anov-gis-vite](https://github.com/948033145/anov-gis-vite)
75
78
 
76
- 使用
79
+ 工程模板压缩包:[anov-gis-vite](http://123.56.67.147:8888/cesiumdemo/data/mytest/datas/anov-gis-vite.zip)
77
80
  ```javascript
78
- <script>
79
- import "@anov/gis/index.css";
80
- import ANOVGIS from "@anov/gis/index.js";
81
- global.ANOVGIS = ANOVGIS;
82
- export default {
83
- name: "App",
84
- components: {},
85
- mounted() {
86
- ANOVGIS.ready(this.init3D);
87
- },
88
- methods: {
89
- init3D() {
90
- window.viewer = new ANOVGIS.Viewer("cesiumContainer", {
91
- vrButton: false,
92
- baseLayerPicker: true,
93
- fullscreenButton: true,
94
- homeButton: true,
95
- sceneModePicker: true,
96
- navigationHelpButton: true,
97
- });
98
- ANOVGIS.WidgetsControl.showAllControls({
99
- index: 4,
100
- });
101
- },
102
- },
103
- };
104
- </script>
81
+ import { fileURLToPath, URL } from 'node:url'
82
+ import { defineConfig } from 'vite'
83
+ import vue from '@vitejs/plugin-vue'
84
+ import { viteStaticCopy } from 'vite-plugin-static-copy'
85
+ export default defineConfig({
86
+ plugins: [
87
+ vue(),
88
+ viteStaticCopy({
89
+ targets: [
90
+ {
91
+ src: 'node_modules/@anov/gis/dist/resources',
92
+ dest: 'anov-gis-sdk'
93
+ }
94
+ ]
95
+ }),
96
+ ],
97
+ resolve: {
98
+ alias: {
99
+ '@': fileURLToPath(new URL('./src', import.meta.url))
100
+ }
101
+ }
102
+ })
105
103
  ```
104
+ ## 3、快速上手
105
+ ```javascript
106
+ // 初始化三维球
107
+ window.viewer = new ANOVGIS.Viewer("cesiumContainer", {
108
+ homeButton: true
109
+ });
110
+ //添加天地图底图
111
+ let imageryProvider = ANOVGIS.ImageryLayerFactory.createImageryLayer(ANOVGIS.ImageryType.TDT, {
112
+ style: "img",
113
+ key: 'b832b9764939cbb0919148c548b669ba'
114
+ });
115
+ viewer.imageryLayers.addImageryProvider(imageryProvider);
116
+ ```
117
+ <img src="http://123.56.67.147:8888/cesiumdemo/data/mytest/datas/anov-gis/ksss.png" />
106
118
 
119
+ ## 4、官网
107
120
 
121
+ ## 5、教程
108
122
 
109
- **3、官网**
110
-
111
- ----
112
-
113
- **4、教程**
114
-
115
- **5、功能示例**
123
+ ## 6、功能示例
116
124
 
117
125
  http://172.16.222.31:8866/
118
126
 
119
- **6、Api文档**
120
-
121
- **7、项目模板**
122
- ------