# giscore

> A funtional encapsulation package for 3H GIS applications.

Latest version **1.1.3** (published 2024-06-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install giscore
pnpm add giscore
yarn add giscore
bun add giscore
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2024-06-24 |
| First published | 2024-01-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 4.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 3hljk |

## Links

- npm: https://www.npmjs.com/package/giscore
- npm.io page: https://npm.io/package/giscore

## Dependencies (4)

- [path](https://npm.io/package/path.md) 0.12.7
- [cesium](https://npm.io/package/cesium.md) 1.112.0
- [copy-webpack-plugin](https://npm.io/package/copy-webpack-plugin.md) 11.0.0
- [node-polyfill-webpack-plugin](https://npm.io/package/node-polyfill-webpack-plugin.md) 3.0.0

## Recent versions

- 1.1.3 (latest) — 2024-06-24
- 1.1.2 — 2024-06-21
- 1.1.1 — 2024-06-20
- 1.1.0 — 2024-06-18
- 1.0.9 — 2024-06-13
- 1.0.8 — 2024-04-23
- 1.0.7 — 2024-04-22
- 1.0.6 — 2024-01-11
- 1.0.5 — 2024-01-09
- 1.0.4 — 2024-01-09
- 1.0.3 — 2024-01-09
- 1.0.2 — 2024-01-09
- 1.0.1 — 2024-01-09
- 1.0.0 — 2024-01-09

## README

![Static Badge](https://img.shields.io/badge/giscore-1.1.3-blue)
![Static Badge](https://img.shields.io/badge/license-ISC-green)
![Static Badge](https://img.shields.io/badge/cesium-1.112.0-red)
![Static Badge](https://img.shields.io/badge/contributor-3hljk-yellow)


# 使用手册

使用NPM命令获取giscore：
```js
npm install giscore
```

以Vue2.0框架为例，搭建框架后，在vue.config.js添加如下配置：
``` js
const { defineConfig } = require('@vue/cli-service')
const path = require("path")
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
const CopyWebpackPlugin = require("copy-webpack-plugin")
const cesiumSource = 'node_modules/cesium/Source';
const cesiumWorkers = '../Build/Cesium/Workers';

module.exports = defineConfig({
  transpileDependencies: true,

  configureWebpack: {
    plugins: [new NodePolyfillPlugin()],
    resolve: {
      fallback: {
        "url": false,
        "http": false,
        "https": false,
        "zlib": false
      }
    },
    plugins: [
      // Copy Cesium Assets, Widgets, and Workers to a static directory
      new CopyWebpackPlugin({
        patterns: [
          { from: path.join(cesiumSource, cesiumWorkers), to: 'Workers' },
          { from: path.join(cesiumSource, 'Assets'), to: 'Assets' },
          { from: path.join(cesiumSource, 'Widgets'), to: 'Widgets' },
          { from: path.join(cesiumSource, 'ThirdParty'), to: 'ThirdParty' }
        ]
      }),
    ],
    module: {
      unknownContextRegExp: /^('|')\.\/.*?\1$/,
      unknownContextCritical: false
    }

  }
})
```

在Vue入口文件引入GisCore SDK及GisCore配置文件：
```js
import { GisCore } from 'giscore'
import { config } from 'giscore/giscore.config'
```

在初始化方法调用（accessToken可联系开发者获取Token获取方法）：
```js
测试Token：eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhZjNjZjBlNC03NmFiLTQ2YjgtYmZhZC0wY2QwY2IxNmUxYWMiLCJpZCI6MTc1NzkyLCJpYXQiOjE3MDQ0MzU4OTB9.wphDRUr7J7LRUHRxsYaPk7mbz-0Ct9czww9lsbRGi_E
```

```js
// 初始化giscore
let gisCore = new GisCore(config, accessToken);
gisCore.init("giscoreContainer");
let viewer = window.viewer;
```

在前端界面新增一段用于存放GIS显示区域的div（通过css样式修改可以将GIS显示区域调整为全屏，这里展示未作修改的样式）：
```html
<div id="giscoreContainer"></div>
```

运行命令npm run serve，即可看到GisCore SDK已初始化完毕。关于SDK相关开发文档稍后整理。

---
_Source: https://npm.io/package/giscore · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
