You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 7.7KB

4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. # DC-SDK
  2. <p>
  3. <img src="https://img.shields.io/github/workflow/status/dvgis/dc-sdk/build"/>
  4. <img src="https://img.shields.io/badge/license-Apache%202-blue"/>
  5. <a href="https://www.npmjs.com/package/@dvgis/dc-sdk" target="_blank">
  6. <img src="https://img.shields.io/npm/v/@dvgis/dc-sdk?color=orange&logo=npm" />
  7. </a>
  8. <a href="https://www.npmjs.com/package/@dvgis/dc-sdk" target="_blank">
  9. <img src="https://img.shields.io/npm/dt/@dvgis/dc-sdk?logo=npm"/>
  10. </a>
  11. <a href="https://resource.dvgis.cn/dc-docs/v2.x" target="_blank">
  12. <img src="https://img.shields.io/badge/docs-online-yellow.svg"/>
  13. </a>
  14. <a href="http://dc.dvgis.cn" target="_blank">
  15. <img src="https://img.shields.io/badge/demo-online-red.svg"/>
  16. </a>
  17. </p>
  18. [**🇨🇳 中文**](./README_zh.md) | [**🇬🇧English**](./README.md)
  19. **_`DC-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.
  20. ```warning
  21. Tips:This SDK is JS+GIS framework package. Developers need to have some front-end technology and GIS related technology
  22. ```
  23. ## Installation
  24. `NPM / YARN` **_`(Recommend)`_**
  25. Installing with NPM or YARN is recommended and it works seamlessly with webpack.
  26. ```shell
  27. yarn add @dvgis/dc-sdk
  28. -------------------------
  29. npm install @dvgis/dc-sdk
  30. ```
  31. ```js
  32. import DC from '@dvgis/dc-sdk/dist/dc.base.min'
  33. import DcCore from '@dvgis/dc-sdk/dist/dc.core.min'
  34. import DcChart from '@dvgis/dc-sdk/dist/dc.chart.min'
  35. import DcMapv from '@dvgis/dc-sdk/dist/dc.mapv.min'
  36. import '@dvgis/dc-sdk/dist/dc.core.min.css'
  37. ```
  38. `NPM / YARN` **_`(On-demand)`_**
  39. ```shell
  40. yarn add @dvgis/dc-base
  41. yarn add @dvgis/dc-core
  42. yarn add @dvgis/dc-chart
  43. yarn add @dvgis/dc-mapv
  44. -------------------------
  45. npm install @dvgis/dc-base
  46. npm install @dvgis/dc-core
  47. npm install @dvgis/dc-chart
  48. npm install @dvgis/dc-mapv
  49. ```
  50. ```js
  51. import DC from '@dvgis/dc-base'
  52. import DcCore from '@dvgis/dc-core'
  53. import DcChart from '@dvgis/dc-chart'
  54. import DcMapv from '@dvgis/dc-mapv'
  55. import '@dvgis/dc-core/dist/dc.core.min.css'
  56. ```
  57. `CDN`
  58. [Resources](https://github.com/dvgis/dc-sdk/releases)
  59. ```html
  60. <script src="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.base.min.js"></script>
  61. <script src="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.core.min.js"></script>
  62. <script src="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.chart.min.js"></script>
  63. <script src="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.mapv.min.js"></script>
  64. <link
  65. href="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.core.min.css"
  66. rel="stylesheet"
  67. type="text/css"
  68. />
  69. ```
  70. ```
  71. Please put the resources in the project root directory libs/dc-sdk, if you put it in other directory, the framework will not run properly.
  72. ```
  73. ## Configuration
  74. > The configuration is mainly used in the `NPM / YARN` way
  75. Since the DC framework sets `CESIUM_BASE_URL` to `JSON.stringify('. /libs/dc-sdk/resources/')`, you need to copy `Cesium` static resource files: `Assets`, `Workers`, `ThirdParty` to the `libs/dc-sdk/resources` directory of the project to ensure that the 3D scene can be rendered properly.
  76. `Webpack`
  77. [Project Template](https://github.com/cavencj/dc-vue-app)
  78. ```js
  79. // webpack.config.js
  80. const path = require('path')
  81. const CopywebpackPlugin = require('copy-webpack-plugin')
  82. const dvgisDist = './node_modules/@dvgis'
  83. module.exports = {
  84. plugins: [
  85. new CopyWebpackPlugin([
  86. {
  87. from: path.join(dvgisDist, 'dc-sdk/dist/resources'),
  88. to: 'libs/dc-sdk/resources',
  89. },
  90. ]),
  91. ],
  92. }
  93. ```
  94. `Vue2.x`
  95. [Project Template](https://github.com/dvgis/dc-vue)
  96. ```js
  97. // vue.config.js
  98. const path = require('path')
  99. const CopywebpackPlugin = require('copy-webpack-plugin')
  100. const dvgisDist = './node_modules/@dvgis'
  101. module.exports = {
  102. chainWebpack: (config) => {
  103. config.plugin('copy').use(CopywebpackPlugin, [
  104. [
  105. {
  106. from: path.join(dvgisDist, 'dc-sdk/dist/resources'),
  107. to: 'libs/dc-sdk/resources',
  108. },
  109. ],
  110. ])
  111. },
  112. }
  113. ```
  114. `Vue3.x`
  115. [Project Template](https://github.com/dvgis/dc-vue-next)
  116. ```js
  117. // vue.config.js
  118. const path = require('path')
  119. const CopywebpackPlugin = require('copy-webpack-plugin')
  120. const dvgisDist = './node_modules/@dvgis'
  121. module.exports = {
  122. chainWebpack: (config) => {
  123. config.plugin('copy').use(CopywebpackPlugin, [
  124. {
  125. patterns: [
  126. {
  127. from: path.join(dvgisDist, 'dc-sdk/dist/resources'),
  128. to: path.join(__dirname, 'dist', 'libs/dc-sdk/resources'),
  129. },
  130. ],
  131. },
  132. ])
  133. },
  134. }
  135. ```
  136. ## Start
  137. ```js
  138. global.DC = DC
  139. DC.use(DcCore) // node
  140. DC.ready(() => {
  141. let viewer = new DC.Viewer(divId) // divId is the Id attribute value of a div node. If it is not passed in, the 3D scene cannot be initialized
  142. })
  143. ```
  144. ## Demo
  145. | ![picture](http://dc.dvgis.cn/examples/images/baselayer/baidu.png?v=3) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/tdt.png?v=2) | ![picture](http://dc.dvgis.cn/examples/images/baselayer/arcgis.png?v=3) | ![picture](http://dc.dvgis.cn/examples/images/mini-scene/china.gif) |
  146. | :-----------------------------------------------------------: | :-----------------------------------------------------------: | :------------------------------------------------------------------: | :--------------------------------------------------------------: |
  147. | ![picture](http://dc.dvgis.cn/examples/images/mini-scene/dfmz.gif) | ![picture](http://dc.dvgis.cn/examples/images/mini-scene/factory.gif?v=1) | ![picture](http://dc.dvgis.cn/examples/images/layer/cluster_circle.gif) | ![picture](http://dc.dvgis.cn/examples/images/model/shp_custom_shader.gif) |
  148. | ![picture](http://dc.dvgis.cn/examples/images/overlay/polyline_image_trail.gif) | ![picture](http://dc.dvgis.cn/examples/images/overlay/wall_trail.gif?v=1) | ![picture](http://dc.dvgis.cn/examples/images/overlay/water.gif?v=2) | ![picture](http://dc.dvgis.cn/examples/images/overlay/plot-overlay.png?v=3) |
  149. [More>>](http://dc.dvgis.cn/#/examples)
  150. ## Ecosystem
  151. | Module | Status | Description |
  152. | :------ | :------: | :------ |
  153. | [dc-chart](https://github.com/dvgis/dc-chart) | <img src="https://img.shields.io/npm/v/@dvgis/dc-chart?logo=npm" /> | dc chart module for adding ECharts functionality in 3d scenes |
  154. | [dc-mapv](https://github.com/dvgis/dc-mapv) | <img src="https://img.shields.io/npm/v/@dvgis/dc-mapv?logo=npm" /> | dc big-data module for adding MAPV functions in 3d scenes |
  155. | [dc-ui](https://github.com/dvgis/dc-ui) | <img src="https://img.shields.io/npm/v/@dvgis/dc-ui?logo=npm" /> | dc components for Vue2.x |
  156. | dc-ui-next | <img src="https://img.shields.io/npm/v/@dvgis/dc-ui-next?logo=npm" /> | dc components for Vue3.x |
  157. ## Copyright
  158. ```warning
  159. 1. The framework is a basic platform, completely open source, which can be modified and reconstructed by any individual or institution without our authorization.
  160. 2. We are not responsible for any problems arising from the modification of the framework by individuals and organizations.
  161. 3. Some industrial plug-ins and tools will be added in the later stage, and the code will be open source appropriately.
  162. 4. The package released by us may be used permanently and free of charge by any person or organization subject to:
  163. 1) complete package reference;
  164. 2) reserve this copyright information in the console output
  165. We reserve the right of final interpretation of this copyright information.
  166. ```
  167. ## Support
  168. > if dc-sdk can bring benefits to you, please support it ~
  169. <p>
  170. <a href="https://www.paypal.com/paypalme/cavencj" target="_blank">
  171. <img src="https://www.paypalobjects.com/images/shared/paypal-logo-129x32.svg" style="margin-top:10px" />
  172. </a>
  173. </p>
  174. ## Thanks