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