Browse Source

修改文档

tags/1.13.2
Caven Chen 4 years ago
parent
commit
73b24fae56
6 changed files with 86 additions and 12 deletions
  1. 27
    0
      README.md
  2. 27
    0
      README_zh.md
  3. 1
    1
      dist/dc.base.min.js
  4. 1
    1
      dist/dc.core.min.js
  5. 28
    4
      src/core/widget/ContextMenu.js
  6. 2
    6
      webpack.base.conf.js

+ 27
- 0
README.md View File



## Setting ## Setting


`Webpack`

```js
// webpack.config.js

const path = require('path')
const CopywebpackPlugin = require('copy-webpack-plugin')
const dvgisDist = './node_modules/@dvgis'

module.exports = {
// other settings
resolve: {
alias: {
dvgis: path.resolve(__dirname, dvgisDist)
}
},
plugins:[
new CopyWebpackPlugin([
{
from: path.join(dvgisDist, 'dc-sdk/dist/resources'),
to: 'libs/dc-sdk/resources'
}
])
]
}
```

`Vue2.x` `Vue2.x`


```js ```js

+ 27
- 0
README_zh.md View File



## 配置 ## 配置


`Webpack`

```js
// webpack.config.js

const path = require('path')
const CopywebpackPlugin = require('copy-webpack-plugin')
const dvgisDist = './node_modules/@dvgis'

module.exports = {
// 其他配置
resolve: {
alias: {
dvgis: path.resolve(__dirname, dvgisDist)
}
},
plugins:[
new CopyWebpackPlugin([
{
from: path.join(dvgisDist, 'dc-sdk/dist/resources'),
to: 'libs/dc-sdk/resources'
}
])
]
}
```

`Vue2.x` `Vue2.x`


```js ```js

+ 1
- 1
dist/dc.base.min.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/dc.core.min.js
File diff suppressed because it is too large
View File


+ 28
- 4
src/core/widget/ContextMenu.js View File

this._ulEl = undefined this._ulEl = undefined
this._handler = undefined this._handler = undefined
this._overlay = undefined this._overlay = undefined
this._position = undefined
this._surfacePosition = undefined
this._windowPosition = undefined
this._config = {} this._config = {}
this._defaultMenu = [ this._defaultMenu = [
{ {
* @private * @private
*/ */
_onRightClick(movement) { _onRightClick(movement) {
this._enable && this._updateWindowCoord(movement.position)
this._overlay = undefined
let target = this._viewer.scene.pick(movement.position)
if (!this._enable) {
return
}
let scene = this._viewer.scene
this._windowPosition = movement.position
this._updateWindowCoord(movement.position)
let target = scene.pick(movement.position)
if (scene.pickPositionSupported) {
this._position = scene.pickPosition(movement.position)
}
if (scene.mode === Cesium.SceneMode.SCENE3D) {
let ray = scene.camera.getPickRay(movement.position)
this._surfacePosition = scene.globe.pick(ray, scene)
} else {
this._surfacePosition = scene.camera.pickEllipsoid(
movement.position,
Cesium.Ellipsoid.WGS84
)
}
// for Entity // for Entity
if (target && target.id && target.id instanceof Cesium.Entity) { if (target && target.id && target.id instanceof Cesium.Entity) {
let layer = this._viewer let layer = this._viewer
let self = this let self = this
if (method) { if (method) {
a.onclick = () => { a.onclick = () => {
method.call(context, self._viewer, self._overlay)
method.call(context, {
position: self._position,
windowPosition: self._windowPosition,
surfacePosition: self._surfacePosition,
overlay: self._overlay
})
self.hide() self.hide()
} }
} }

+ 2
- 6
webpack.base.conf.js View File



let cesiumCopyPlugin = [ let cesiumCopyPlugin = [
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{ from: path.join(cesiumBuild, 'Assets'), to: 'resources/Assets' }
]),
new CopyWebpackPlugin([
{ from: path.join(cesiumBuild, 'Workers'), to: 'resources/Workers' }
]),
new CopyWebpackPlugin([
{ from: path.join(cesiumBuild, 'Assets'), to: 'resources/Assets' },
{ from: path.join(cesiumBuild, 'Workers'), to: 'resources/Workers' },
{ from: path.join(cesiumBuild, 'ThirdParty'), to: 'resources/ThirdParty' } { from: path.join(cesiumBuild, 'ThirdParty'), to: 'resources/ThirdParty' }
]) ])
] ]

Loading…
Cancel
Save