Compare commits
5 Commits
12fcb9fed7
...
a43c71d94e
Author | SHA1 | Date | |
---|---|---|---|
a43c71d94e | |||
f24a95ab32 | |||
c03cd63532 | |||
1b712424d8 | |||
51f7ef9864 |
@ -98,6 +98,7 @@ export default class Sunshine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (state) {
|
if (state) {
|
||||||
|
let _this = this
|
||||||
this._DialogObject = await new Dialog(this.sdk, this.originalOptions, {
|
this._DialogObject = await new Dialog(this.sdk, this.originalOptions, {
|
||||||
title: '光照属性', left: '180px', top: '100px',
|
title: '光照属性', left: '180px', top: '100px',
|
||||||
confirmCallBack: (options) => {
|
confirmCallBack: (options) => {
|
||||||
@ -106,6 +107,7 @@ export default class Sunshine {
|
|||||||
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(this.originalOptions)
|
this.Dialog.confirmCallBack && this.Dialog.confirmCallBack(this.originalOptions)
|
||||||
syncData(this.sdk, this.options.id)
|
syncData(this.sdk, this.options.id)
|
||||||
syncSplitData(this.sdk, this.options.id)
|
syncSplitData(this.sdk, this.options.id)
|
||||||
|
this.remove()
|
||||||
},
|
},
|
||||||
resetCallBack: () => {
|
resetCallBack: () => {
|
||||||
this.reset()
|
this.reset()
|
||||||
@ -116,6 +118,7 @@ export default class Sunshine {
|
|||||||
// },
|
// },
|
||||||
closeCallBack: () => {
|
closeCallBack: () => {
|
||||||
this.reset()
|
this.reset()
|
||||||
|
_this.remove()
|
||||||
// this.entity.style = new Cesium.Cesium3DTileStyle({
|
// this.entity.style = new Cesium.Cesium3DTileStyle({
|
||||||
// color: "color('rgba(255,255,255," + this.newData.transparency + ")')",
|
// color: "color('rgba(255,255,255," + this.newData.transparency + ")')",
|
||||||
// show: true,
|
// show: true,
|
||||||
|
@ -40,6 +40,7 @@ class FlowLine extends Base {
|
|||||||
this.options.duration = options.duration || 10.0
|
this.options.duration = options.duration || 10.0
|
||||||
this.options.color = options.color || "rgba(255,255,255,1)"
|
this.options.color = options.color || "rgba(255,255,255,1)"
|
||||||
this.options.lineBackAlpha = options.lineBackAlpha || 0.05
|
this.options.lineBackAlpha = options.lineBackAlpha || 0.05
|
||||||
|
this.options.positions = options.positions || []
|
||||||
this.options.show = (options.show || options.show === false) ? options.show : true
|
this.options.show = (options.show || options.show === false) ? options.show : true
|
||||||
this.Dialog = _Dialog
|
this.Dialog = _Dialog
|
||||||
this._EventBinding = new EventBinding()
|
this._EventBinding = new EventBinding()
|
||||||
@ -47,7 +48,8 @@ class FlowLine extends Base {
|
|||||||
this.positionArea = []
|
this.positionArea = []
|
||||||
this.positions = []
|
this.positions = []
|
||||||
this.sdk.addIncetance(this.options.id, this)
|
this.sdk.addIncetance(this.options.id, this)
|
||||||
FlowLine.create(this)
|
// FlowLine.create(this)
|
||||||
|
FlowLine.drawLine(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建水面
|
// 创建水面
|
||||||
@ -68,6 +70,13 @@ class FlowLine extends Base {
|
|||||||
that.edit(true)
|
that.edit(true)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
static drawLine(that) {
|
||||||
|
that.positionArea = that.options.positions
|
||||||
|
let posis = that.getRandomPointsInCesiumPolygon(that.options.positions, that.options.pointNumber)
|
||||||
|
that.positions = posis
|
||||||
|
that.getLine(that, posis)
|
||||||
|
// that.edit(true)
|
||||||
|
}
|
||||||
getRandomPointsInCesiumPolygon(positions, count) {
|
getRandomPointsInCesiumPolygon(positions, count) {
|
||||||
let lons = [], lats = [], posi = []
|
let lons = [], lats = [], posi = []
|
||||||
positions.forEach(item => {
|
positions.forEach(item => {
|
||||||
|
@ -58,8 +58,8 @@ class PolylineObject extends Base {
|
|||||||
this.options.smooth = options.smooth || false
|
this.options.smooth = options.smooth || false
|
||||||
this.options.extend = options.extend || false
|
this.options.extend = options.extend || false
|
||||||
this.options.rotate = options.rotate || true
|
this.options.rotate = options.rotate || true
|
||||||
this.options.space = options.space || 0.1
|
this.options.space = options.space || 1
|
||||||
this.options.speed = options.speed || 1
|
this.options.speed = options.speed || 10
|
||||||
this.options.dashSize = options.dashSize || 0.03
|
this.options.dashSize = options.dashSize || 0.03
|
||||||
this.options['length-unit'] = options['length-unit'] || '米'
|
this.options['length-unit'] = options['length-unit'] || '米'
|
||||||
this.options['fit-length-unit'] = options['fit-length-unit'] || '米'
|
this.options['fit-length-unit'] = options['fit-length-unit'] || '米'
|
||||||
@ -335,9 +335,13 @@ class PolylineObject extends Base {
|
|||||||
this._elms.lineWidth.forEach(item => {
|
this._elms.lineWidth.forEach(item => {
|
||||||
item.value = this.options.width
|
item.value = this.options.width
|
||||||
})
|
})
|
||||||
this.entity &&
|
if (this.entity && this.entity.polyline) {
|
||||||
this.entity.polyline &&
|
this.entity.polyline.width = this.entity.polyline.width + v - this.entity.polyline.oriWidth
|
||||||
(this.entity.polyline.width = this.options.width)
|
this.entity.polyline.oriWidth = this.options.width
|
||||||
|
}
|
||||||
|
// this.entity &&
|
||||||
|
// this.entity.polyline &&
|
||||||
|
// (this.entity.polyline.width = this.options.width) && (this.entity.polyline.oriWidth = this.options.width)
|
||||||
}
|
}
|
||||||
|
|
||||||
get lineType() {
|
get lineType() {
|
||||||
@ -1316,6 +1320,7 @@ class PolylineObject extends Base {
|
|||||||
zIndex: that.sdk._entityZIndex
|
zIndex: that.sdk._entityZIndex
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
that.entity.polyline.oriWidth = that.options.width
|
||||||
that.sdk._entityZIndex++
|
that.sdk._entityZIndex++
|
||||||
PolylineObject.createLabel(that)
|
PolylineObject.createLabel(that)
|
||||||
// that.entity.polyline.positionsLngLat = positions
|
// that.entity.polyline.positionsLngLat = positions
|
||||||
|
@ -12,7 +12,7 @@ function LineTexture() {
|
|||||||
this.image = options.image || "";
|
this.image = options.image || "";
|
||||||
this.color = new Cesium.Color.fromCssColorString(options.color || "rgba(255,255,255,1)");
|
this.color = new Cesium.Color.fromCssColorString(options.color || "rgba(255,255,255,1)");
|
||||||
this.speed = options.speed != undefined ? options.speed : 1.0;
|
this.speed = options.speed != undefined ? options.speed : 1.0;
|
||||||
this.repeat = options.repeat || 1.0;
|
this.repeat = options.repeat || new Cesium.Cartesian2(1.0, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
get isConstant() {
|
get isConstant() {
|
||||||
@ -52,7 +52,7 @@ function LineTexture() {
|
|||||||
result.repeat = Cesium.Property.getValueOrDefault(
|
result.repeat = Cesium.Property.getValueOrDefault(
|
||||||
this._repeat,
|
this._repeat,
|
||||||
time,
|
time,
|
||||||
1.0,
|
new Cesium.Cartesian2(1.0, 1.0),
|
||||||
result.repeat
|
result.repeat
|
||||||
);
|
);
|
||||||
result.frameNumber = Cesium.getTimestamp();
|
result.frameNumber = Cesium.getTimestamp();
|
||||||
@ -85,14 +85,14 @@ function LineTexture() {
|
|||||||
uniform vec4 color;
|
uniform vec4 color;
|
||||||
uniform sampler2D image;
|
uniform sampler2D image;
|
||||||
uniform float speed;
|
uniform float speed;
|
||||||
uniform float repeat;
|
// uniform float repeat;
|
||||||
czm_material czm_getMaterial(czm_materialInput materialInput)
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
||||||
{
|
{
|
||||||
czm_material material = czm_getDefaultMaterial(materialInput);
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
||||||
vec2 st = materialInput.st;
|
vec2 st = materialInput.st;
|
||||||
st.s *= repeat; // 关键:通过repeat控制纹理密度
|
st.s *= repeat.x; // 关键:通过repeat控制纹理密度
|
||||||
// vec4 colorImage = texture2D(image, vec2(fract(st.s + speed*czm_frameNumber* 0.01), st.t));
|
// vec4 colorImage = texture2D(image, vec2(fract(st.s + speed*czm_frameNumber* 0.01), st.t));
|
||||||
vec4 colorImage = speed==0.0?texture2D(image, vec2(fract(st.s), st.t)):texture2D(image, vec2(fract(st.s + frameNumber / 1000.0 / speed * repeat ), st.t));
|
vec4 colorImage = speed==0.0?texture2D(image, vec2(fract(st.s), st.t)):texture2D(image, vec2(fract(st.s + frameNumber / 1000.0 / speed * repeat.x / repeat.y ), st.t));
|
||||||
material.alpha = colorImage.a * color.a;
|
material.alpha = colorImage.a * color.a;
|
||||||
material.diffuse = color.rgb;
|
material.diffuse = color.rgb;
|
||||||
return material;
|
return material;
|
||||||
@ -106,7 +106,7 @@ function LineTexture() {
|
|||||||
uniforms: {
|
uniforms: {
|
||||||
color: new Cesium.Color(1.0, 1.0, 1.0, 1.0),
|
color: new Cesium.Color(1.0, 1.0, 1.0, 1.0),
|
||||||
image: '',
|
image: '',
|
||||||
repeat: 1.0,
|
repeat: new Cesium.Cartesian2(1.0, 1.0),
|
||||||
speed: 1.0,
|
speed: 1.0,
|
||||||
frameNumber: Cesium.getTimestamp(),
|
frameNumber: Cesium.getTimestamp(),
|
||||||
uTime: 1
|
uTime: 1
|
||||||
|
@ -587,8 +587,6 @@ class Tools {
|
|||||||
getMaterial(color = '#2ab0c2', type = 0, entity = null, newParam = {}) {
|
getMaterial(color = '#2ab0c2', type = 0, entity = null, newParam = {}) {
|
||||||
let material = ''
|
let material = ''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch (Number(type)) {
|
switch (Number(type)) {
|
||||||
|
|
||||||
case 1: //虚线
|
case 1: //虚线
|
||||||
@ -647,7 +645,18 @@ class Tools {
|
|||||||
space: newParam.space,
|
space: newParam.space,
|
||||||
speed: newParam.speed
|
speed: newParam.speed
|
||||||
}
|
}
|
||||||
|
let arr = {
|
||||||
|
'7': 10,
|
||||||
|
'8': 3,
|
||||||
|
'9': 4,
|
||||||
|
'10': 4,
|
||||||
|
'11': 4,
|
||||||
|
'12': 2
|
||||||
|
}
|
||||||
param.speed = newParam.rotate ? param.speed : 0 - param.speed
|
param.speed = newParam.rotate ? param.speed : 0 - param.speed
|
||||||
|
console.log(entity.polyline.oriWidth, arr[type + ''], type, 'oriWidth')
|
||||||
|
entity.polyline.width = entity.polyline.oriWidth + arr[type + '']
|
||||||
|
|
||||||
this.getFlowTexture(this, param, entity)
|
this.getFlowTexture(this, param, entity)
|
||||||
|
|
||||||
break
|
break
|
||||||
@ -684,6 +693,8 @@ class Tools {
|
|||||||
|
|
||||||
// let repeat = getRepeat()
|
// let repeat = getRepeat()
|
||||||
// }, false)
|
// }, false)
|
||||||
|
entity.polyline.material.oriRepeat = undefined
|
||||||
|
entity.polyline.material.oriSpeed = undefined
|
||||||
entity.polyline.material = new Cesium.LineTextureMaterialProperty(
|
entity.polyline.material = new Cesium.LineTextureMaterialProperty(
|
||||||
{
|
{
|
||||||
color: options.color,
|
color: options.color,
|
||||||
@ -697,8 +708,8 @@ class Tools {
|
|||||||
var positions = positionProperty.getValue(that.sdk.viewer.clock.currentTime);
|
var positions = positionProperty.getValue(that.sdk.viewer.clock.currentTime);
|
||||||
|
|
||||||
if (!Cesium.defined(positions)) {
|
if (!Cesium.defined(positions)) {
|
||||||
// return new Cesium.Cartesian2(1.0, 1.0);
|
return new Cesium.Cartesian2(1.0, 1.0);
|
||||||
return 1.0;
|
// return 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
var distance = 0;
|
var distance = 0;
|
||||||
@ -722,14 +733,21 @@ class Tools {
|
|||||||
var groundResolution = that.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
var groundResolution = that.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
||||||
// repeatX *= groundResolution / cameraHeight / ((myImg.width / myImg.height * 5) + 1);
|
// repeatX *= groundResolution / cameraHeight / ((myImg.width / myImg.height * 5) + 1);
|
||||||
repeatX *= groundResolution / cameraHeight / (options.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
repeatX *= groundResolution / cameraHeight / (options.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
||||||
|
let speed
|
||||||
|
if (entity.polyline.material.oriRepeat) {
|
||||||
|
speed = repeatX / entity.polyline.material.oriRepeat
|
||||||
|
} else {
|
||||||
|
entity.polyline.material.oriRepeat = repeatX
|
||||||
|
}
|
||||||
// if (repeatX < 3) {
|
// if (repeatX < 3) {
|
||||||
// repeatX = 3
|
// repeatX = 3
|
||||||
// }
|
// }
|
||||||
// return new Cesium.Cartesian2(repeatX, 1.0);
|
return new Cesium.Cartesian2(repeatX, speed || 1.0);
|
||||||
return repeatX;
|
// return repeatX;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
entity.polyline.material.oriSpeed = options.speed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 10 KiB |
BIN
static/img/arrow/11.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
static/img/arrow/222.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 12 KiB |
BIN
static/img/arrow/33.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 10 KiB |
BIN
static/img/arrow/44.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 5.2 KiB |
BIN
static/img/arrow/55.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 33 KiB |