miniearth-sdk

2.0.1 • Public • Published

BC-SDK

🇨🇳 中文 | 🇬🇧English

BC-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

Installation

NPM / YARN (Recommend)

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

yarn add miniearth/bc-sdk
-------------------------
npm install miniearth/bc-sdk
import BC from 'miniearth/bc-sdk/dist/bc.base.min'
import BcCore from 'miniearth/bc-sdk/dist/bc.core.min'
import BcChart from 'miniearth/bc-sdk/dist/bc.chart.min'
import BcMapv from 'miniearth/bc-sdk/dist/bc.mapv.min'
import 'miniearth/bc-sdk/dist/bc.core.min.css'

NPM / YARN (On-demand)

yarn add miniearth/bc-base
yarn add miniearth/bc-core
yarn add miniearth/bc-chart
yarn add miniearth/bc-mapv
-------------------------
npm install miniearth/bc-base
npm install miniearth/bc-core
npm install miniearth/bc-chart
npm install miniearth/bc-mapv
import BC from 'miniearth/bc-base'
import BcCore from 'miniearth/bc-core'
import BcChart from 'miniearth/bc-chart'
import BcMapv from 'miniearth/bc-mapv'
import 'miniearth/bc-core/dist/bc.core.min.css'

CDN

Resources

<script src="https://cdn.jsdelivr.net/npm/miniearth/bc-sdk/dist/bc.base.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/miniearth/bc-sdk/dist/bc.core.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/miniearth/bc-sdk/dist/bc.chart.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/miniearth/bc-sdk/dist/bc.mapv.min.js"></script>
<link
  href="https://cdn.jsdelivr.net/npm/miniearth/bc-sdk/dist/bc.core.min.css"
  rel="stylesheet"
  type="text/css"
/>
Please put the resources in the project root directory libs/bc-sdk, if you put it in other directory, the framework will not run properly.

Configuration

The configuration is mainly used in the NPM / YARN way

Since the BC framework sets CESIUM_BASE_URL to JSON.stringify('. /libs/bc-sdk/resources/'), you need to copy Cesium static resource files: Assets, Workers, ThirdParty to the libs/bc-sdk/resources directory of the project to ensure that the 3D scene can be rendered properly.

Webpack

Project Template

// webpack.config.js
const path = require('path')
const CopywebpackPlugin = require('copy-webpack-plugin')
const dvgisDist = './node_modules/miniearth'

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

Vue2.x

Project Template

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

Vue3.x

Project Template

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

Start

global.BC = BC
BC.use(BcCore) // node
BC.ready(() => {
  let viewer = new BC.Viewer(divId) // divId is the Id attribute value of a div node. If it is not passed in, the 3D scene cannot be initialized
})

Demo

picture picture picture picture
picture picture picture picture
picture picture picture picture

More>>

Ecosystem

Module Status Description
bc-chart bc chart module for adding ECharts functionality in 3d scenes
bc-mapv bc big-data module for adding MAPV functions in 3d scenes
bc-ui bc components for Vue2.x
bc-ui-next bc components for Vue3.x

Copyright

1. The framework is a basic platform, completely open source, which can be modified and reconstructed by any individual or institution without our authorization.
2. We are not responsible for any problems arising from the modification of the framework by individuals and organizations.
3. Some industrial plug-ins and tools will be added in the later stage, and the code will be open source appropriately.
4. The package released by us may be used permanently and free of charge by any person or organization subject to:
  1) complete package reference;
  2) reserve this copyright information in the console output
We reserve the right of final interpretation of this copyright information.

Support

if bc-sdk can bring benefits to you, please support it ~

Thanks

Dependents (0)

Package Sidebar

Install

npm i miniearth-sdk

Homepage

bcsw3d.cn

Weekly Downloads

0

Version

2.0.1

License

Apache 2.0

Unpacked Size

26 MB

Total Files

1078

Last publish

Collaborators

  • as2650260