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.4KB

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