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.

4 年之前
2 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
2 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
3 年之前
4 年之前
3 年之前
3 年之前
3 年之前
3 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
4 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. # DC-SDK
  2. <p>
  3. <img src="https://img.shields.io/github/actions/workflow/status/dvgis/dc-sdk/build.yml"/>
  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. ## Run examples
  24. ```shell
  25. yarn run build
  26. yarn run server
  27. ```
  28. ## Installation
  29. `NPM / YARN` **_`(Recommend)`_**
  30. Installing with NPM or YARN is recommended and it works seamlessly with webpack.
  31. ```shell
  32. yarn add @dvgis/dc-sdk
  33. -------------------------
  34. npm install @dvgis/dc-sdk
  35. ```
  36. ```js
  37. import DC from '@dvgis/dc-sdk/dist/dc.base.min'
  38. import DcCore from '@dvgis/dc-sdk/dist/dc.core.min'
  39. import DcChart from '@dvgis/dc-sdk/dist/dc.chart.min'
  40. import DcMapv from '@dvgis/dc-sdk/dist/dc.mapv.min'
  41. import DcS3M from '@dvgis/dc-sdk/dist/dc.s3m.min'
  42. import '@dvgis/dc-sdk/dist/dc.core.min.css'
  43. ```
  44. `NPM / YARN` **_`(On-demand)`_**
  45. ```shell
  46. yarn add @dvgis/dc-base
  47. yarn add @dvgis/dc-core
  48. yarn add @dvgis/dc-chart
  49. yarn add @dvgis/dc-mapv
  50. yarn add @dvgis/dc-s3m
  51. -------------------------
  52. npm install @dvgis/dc-base
  53. npm install @dvgis/dc-core
  54. npm install @dvgis/dc-chart
  55. npm install @dvgis/dc-mapv
  56. npm install @dvgis/dc-s3m
  57. ```
  58. ```js
  59. import DC from '@dvgis/dc-base'
  60. import DcCore from '@dvgis/dc-core'
  61. import DcChart from '@dvgis/dc-chart'
  62. import DcMapv from '@dvgis/dc-mapv'
  63. import DcS3M from '@dvgis/dc-s3m'
  64. import '@dvgis/dc-core/dist/dc.core.min.css'
  65. ```
  66. `CDN`
  67. [Resources](https://github.com/dvgis/dc-sdk/releases)
  68. ```html
  69. <script src="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.base.min.js"></script>
  70. <script src="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.core.min.js"></script>
  71. <script src="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.chart.min.js"></script>
  72. <script src="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.mapv.min.js"></script>
  73. <script src="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.s3m.min.js"></script>
  74. <link
  75. href="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.core.min.css"
  76. rel="stylesheet"
  77. type="text/css"
  78. />
  79. ```
  80. ```
  81. 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.
  82. ```
  83. ## Configuration
  84. > The configuration is mainly used in the `NPM / YARN` way
  85. Since the `DC` framework sets `CESIUM_BASE_URL` to `./libs/dc-sdk/resources/` , you need to copy `Cesium` related static resources files: `Assets` , `Workers` , `ThirdParty `to `libs/dc-sdk/resources` directory of the project to ensure that the 3D scene can be rendered properly. You can also use `DC.baseUrl` to set the static resource base related to `Cesium` .
  86. `Webpack`
  87. [Project Template](https://github.com/cavencj/dc-vue-app)
  88. ```js
  89. // webpack.config.js
  90. const path = require('path')
  91. const CopywebpackPlugin = require('copy-webpack-plugin')
  92. const dvgisDist = './node_modules/@dvgis'
  93. module.exports = {
  94. plugins: [
  95. new CopyWebpackPlugin([
  96. {
  97. from: path.join(dvgisDist, 'dc-sdk/dist/resources'),
  98. to: 'libs/dc-sdk/resources',
  99. },
  100. ]),
  101. ],
  102. }
  103. ```
  104. `Vue2.x`
  105. [Project Template](https://github.com/dvgis/dc-vue)
  106. ```js
  107. // vue.config.js
  108. const path = require('path')
  109. const CopywebpackPlugin = require('copy-webpack-plugin')
  110. const dvgisDist = './node_modules/@dvgis'
  111. module.exports = {
  112. chainWebpack: (config) => {
  113. config.plugin('copy').use(CopywebpackPlugin, [
  114. [
  115. {
  116. from: path.join(dvgisDist, 'dc-sdk/dist/resources'),
  117. to: 'libs/dc-sdk/resources',
  118. },
  119. ],
  120. ])
  121. },
  122. }
  123. ```
  124. `Vue3.x`
  125. [Project Template](https://github.com/dvgis/dc-vue-next)
  126. ```js
  127. // vue.config.js
  128. const path = require('path')
  129. const CopywebpackPlugin = require('copy-webpack-plugin')
  130. const dvgisDist = './node_modules/@dvgis'
  131. module.exports = {
  132. chainWebpack: (config) => {
  133. config.plugin('copy').use(CopywebpackPlugin, [
  134. {
  135. patterns: [
  136. {
  137. from: path.join(dvgisDist, 'dc-sdk/dist/resources'),
  138. to: path.join(__dirname, 'dist', 'libs/dc-sdk/resources'),
  139. },
  140. ],
  141. },
  142. ])
  143. },
  144. }
  145. ```
  146. ## Start
  147. ```js
  148. global.DC = DC
  149. DC.use(DcCore) // node
  150. DC.ready(() => {
  151. 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
  152. })
  153. ```
  154. ## Demo
  155. | ![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) |
  156. | :-----------------------------------------------------------: | :-----------------------------------------------------------: | :------------------------------------------------------------------: | :--------------------------------------------------------------: |
  157. | ![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) |
  158. | ![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=4) | ![picture](http://dc.dvgis.cn/examples/images/overlay/plot-overlay.png?v=4) |
  159. [More>>](http://dc.dvgis.cn/#/examples)
  160. ## Copyright
  161. ```warning
  162. 1. The framework is a basic platform, completely open source, which can be modified and reconstructed by any individual or institution without our authorization.
  163. 2. We are not responsible for any problems arising from the modification of the framework by individuals and organizations.
  164. 3. Some industrial plug-ins and tools will be added in the later stage, and the code will be open source appropriately.
  165. 4. The package released by us may be used permanently and free of charge by any person or organization subject to:
  166. 1) complete package reference;
  167. 2) reserve this copyright information in the console output
  168. We reserve the right of final interpretation of this copyright information.
  169. ```
  170. ## Support
  171. > if dc-sdk can bring benefits to you, please support it ~
  172. <p>
  173. <a href="https://www.paypal.com/paypalme/cavencj" target="_blank">
  174. <img src="https://www.paypalobjects.com/images/shared/paypal-logo-129x32.svg" style="margin-top:10px" />
  175. </a>
  176. </p>
  177. ## Thanks