@tcgis/gtc-common

1.0.0 • Public • Published

GTC-SDK

GTC-SDK is based on the open source project Cesium for the second development of two three-dimensional WebGIS application framework , the framework optimizes the use of Cesium and adds some additional features , designed for developers to quickly build WebGis application.

Tips:This SDK is JS+GIS framework package. Developers need to have some front-end technology and GIS related technology

Run examples

  yarn run build
  yarn run server

Installation

NPM / YARN (Recommend)

Installing with NPM or YARN is recommended and it works seamlessly with webpack.

yarn add @tcgis/gtc-sdk
-------------------------
npm install @tcgis/gtc-sdk
import * as GTC from '@tcgis/gtc-sdk'
import '@tcgis/gtc-sdk/dist/gtc.min.css'

Configuration

The configuration is mainly used in the NPM / YARN way

Since the GTC framework sets CESIUM_BASE_URL to ./libs/gtc-sdk/resources/ , you need to copy Cesium related static resources files: Assets , Workers , ThirdParty to libs/gtc-sdk/resources directory of the project to ensure that the 3D scene can be rendered properly. You can also use GTC.config.baseUrl to set the static resource base related to Cesium .

Webpack

// webpack.config.js
const path = require('path')
const CopywebpackPlugin = require('copy-webpack-plugin')
const tcgisDist = './node_modules/@tcgis'

module.exports = {
  plugins: [
    new CopyWebpackPlugin([
      {
        from: path.join(tcgisDist, 'gtc-sdk/dist/resources'),
        to: 'libs/gtc-sdk/resources',
      },
    ]),
  ],
}

Vue2.x

// vue.config.js
const path = require('path')
const CopywebpackPlugin = require('copy-webpack-plugin')
const tcgisDist = './node_modules/@tcgis'
module.exports = {
  chainWebpack: (config) => {
    config.plugin('copy').use(CopywebpackPlugin, [
      [
        {
          from: path.join(tcgisDist, 'gtc-sdk/dist/resources'),
          to: 'libs/gtc-sdk/resources',
        },
      ],
    ])
  },
}

Vue3.x

// vue.config.js
const path = require('path')
const CopywebpackPlugin = require('copy-webpack-plugin')
const tcgisDist = './node_modules/@tcgis'
module.exports = {
  chainWebpack: (config) => {
    config.plugin('copy').use(CopywebpackPlugin, [
      {
        patterns: [
          {
            from: path.join(tcgisDist, 'gtc-sdk/dist/resources'),
            to: path.join(__dirname, 'dist', 'libs/gtc-sdk/resources'),
          },
        ],
      },
    ])
  },
}

vite

// vite.config.js
import { defineConfig } from 'vite'
import GTC from '@tcgis/vite-plugin-gtc'

export default defineConfig({
  plugins: [GTC()],
})

Start

global.GTC = GTC
GTC.ready({}).then(()=>{
    let viewer = new GTC.Viewer()
})

Thanks

Readme

Keywords

none

Package Sidebar

Install

npm i @tcgis/gtc-common

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

11.9 MB

Total Files

317

Last publish

Collaborators

  • tcgis