Compare commits
15 Commits
master
...
5f383f661f
Author | SHA1 | Date | |
---|---|---|---|
5f383f661f | |||
ee38db98fb | |||
d334518da7 | |||
8f41d5907a | |||
9866588986 | |||
5ab4a3b925 | |||
2604512f47 | |||
0bb1e5bd54 | |||
5d6679d919 | |||
41c132e506 | |||
09f760b10a | |||
b0619e1b31 | |||
43a4fca804 | |||
53e692f6ca | |||
dd1855002f |
@ -72,13 +72,267 @@ function openLeftClick(sdk, cb) {
|
||||
click = true
|
||||
}, 600);
|
||||
if (!YJ.Measure.GetMeasureStatus() && cartesian) {
|
||||
let flag = false
|
||||
const pick = sdk.viewer.scene.pick(movement.position)
|
||||
if (pick) {
|
||||
if (pick.id) {
|
||||
let entityId
|
||||
// 矢量
|
||||
if (pick.id.type && pick.id.type === 'vector' && pick.id.parentId) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.parentId)
|
||||
if (obj.that.picking && obj.that.geojson) {
|
||||
for (let i = 0; i < obj.that.geojson.features.length; i++) {
|
||||
if (obj.that.geojson.features[i].id === pick.id._id) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.geojson.features[i].id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (typeof pick.id.id == 'string') {
|
||||
let array = pick.id.id.split('-')
|
||||
array.splice(array.length - 1, 1)
|
||||
entityId = array.join('-')
|
||||
}
|
||||
|
||||
if (pick.id.properties && pick.id.properties.id && leftClickCallbackMap.has(pick.id.properties.id._value)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.properties.id._value)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.properties.id._value,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
else if (leftClickCallbackMap.has(pick.id.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.id)
|
||||
if (obj.that.type === 'PolygonObject') {
|
||||
// 是否可点击y
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let polyPos = []
|
||||
for (let i = 0; i < obj.that.options.positions.length; i++) {
|
||||
polyPos.push([
|
||||
obj.that.options.positions[i].lng,
|
||||
obj.that.options.positions[i].lat
|
||||
])
|
||||
}
|
||||
polyPos.push([
|
||||
obj.that.options.positions[0].lng,
|
||||
obj.that.options.positions[0].lat
|
||||
])
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 聚集地
|
||||
else if (obj.that.type === 'AssembleObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let positions = obj.that.computeAssemble(obj.that.options.positions, true)
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let polyPos = []
|
||||
for (let i = 0; i < positions.length; i += 2) {
|
||||
polyPos.push([
|
||||
positions[i],
|
||||
positions[i + 1]
|
||||
])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 单箭头
|
||||
else if (obj.that.type === 'AttackArrowObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let positions = obj.that.computeAttackArrow(obj.that.options.positions)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
let pos84 = cartesian3Towgs84(positions[m], sdk.viewer)
|
||||
polyPos.push([pos84.lng, pos84.lat])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 双箭头
|
||||
else if (obj.that.type === 'PincerArrowObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 5) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let positions = obj.that.computePincerArrow(obj.that.options.positions)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
let pos84 = cartesian3Towgs84(positions[m], sdk.viewer)
|
||||
polyPos.push([pos84.lng, pos84.lat])
|
||||
}
|
||||
let pos84_0 = cartesian3Towgs84(positions[0], sdk.viewer)
|
||||
polyPos.push([pos84_0.lng, pos84_0.lat])
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 圆
|
||||
else if (obj.that.type === 'CircleObject') {
|
||||
if (obj.that.picking) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
if (obj.that.options.center && obj.that.options.radius) {
|
||||
let center = [obj.that.options.center.lng, obj.that.options.center.lat];
|
||||
let radius = obj.that.options.radius / 1000;
|
||||
let options = { steps: 360, units: 'kilometers' };
|
||||
let circle = turf.circle(center, radius, options);
|
||||
let contain = turf.booleanPointInPolygon(pt, circle);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 扇形
|
||||
else if (obj.that.type === 'SectorObject') {
|
||||
if (obj.that.picking) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
if (obj.that.options.center && obj.that.options.radius && obj.that.options.startAngle && obj.that.options.endAngle) {
|
||||
let positions = obj.that.calSector(obj.that.options.center, obj.that.options.radius, obj.that.options.startAngle, obj.that.options.endAngle, undefined, true)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
polyPos.push([positions[m].lng, positions[m].lat])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
else if (entityId && leftClickCallbackMap.has(entityId)) {
|
||||
let obj = leftClickCallbackMap.get(entityId)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
entityId,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
else if (pick.primitive) {
|
||||
if (typeof pick.id == 'string' && leftClickCallbackMap.has(pick.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id)
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (pick.primitive && pick.primitive.id) {
|
||||
if (leftClickCallbackMap.has(pick.primitive.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.primitive.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pick.content && (!pick.primitive || !pick.primitive.id)) {
|
||||
if (leftClickCallbackMap.has(pick.content.tileset.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.content.tileset.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = leftClickCallbackMap.size - 1; i >= 0; i--) {
|
||||
let key = Array.from(leftClickCallbackMap.keys())[i]
|
||||
let obj = leftClickCallbackMap.get(key)
|
||||
if (obj) {
|
||||
|
||||
if (obj.that) {
|
||||
if (obj.that && obj.that.show && (obj.that.entity && obj.that.entity.show)) {
|
||||
// 是否为多边形
|
||||
if (obj.that.type === 'PolygonObject') {
|
||||
// 是否可点击y
|
||||
@ -103,7 +357,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -129,7 +382,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -153,7 +405,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -179,7 +430,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -200,7 +450,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -224,7 +473,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -234,114 +482,6 @@ function openLeftClick(sdk, cb) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
const pick = sdk.viewer.scene.pick(movement.position)
|
||||
if (pick) {
|
||||
if (pick.id) {
|
||||
let entityId
|
||||
// 矢量
|
||||
if (pick.id.type && pick.id.type === 'vector' && pick.id.parentId) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.parentId)
|
||||
if (obj.that.picking && obj.that.geojson) {
|
||||
for (let i = 0; i < obj.that.geojson.features.length; i++) {
|
||||
if (obj.that.geojson.features[i].id === pick.id._id) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.geojson.features[i].id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (typeof pick.id.id == 'string') {
|
||||
let array = pick.id.id.split('-')
|
||||
array.splice(array.length - 1, 1)
|
||||
entityId = array.join('-')
|
||||
}
|
||||
|
||||
if (pick.id.properties && pick.id.properties.id && leftClickCallbackMap.has(pick.id.properties.id._value)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.properties.id._value)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.properties.id._value,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (leftClickCallbackMap.has(pick.id.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.id)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (entityId && leftClickCallbackMap.has(entityId)) {
|
||||
let obj = leftClickCallbackMap.get(entityId)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
entityId,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (pick.primitive) {
|
||||
if (typeof pick.id == 'string' && leftClickCallbackMap.has(pick.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id)
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (pick.primitive && pick.primitive.id) {
|
||||
if (leftClickCallbackMap.has(pick.primitive.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.primitive.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pick.content && (!pick.primitive || !pick.primitive.id)) {
|
||||
if (leftClickCallbackMap.has(pick.content.tileset.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.content.tileset.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,13 +72,267 @@ function openLeftClick(sdk, cb) {
|
||||
click = true
|
||||
}, 600);
|
||||
if (!YJ.Measure.GetMeasureStatus() && cartesian) {
|
||||
let flag = false
|
||||
const pick = sdk.viewer.scene.pick(movement.position)
|
||||
if (pick) {
|
||||
if (pick.id) {
|
||||
let entityId
|
||||
// 矢量
|
||||
if (pick.id.type && pick.id.type === 'vector' && pick.id.parentId) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.parentId)
|
||||
if (obj.that.picking && obj.that.geojson) {
|
||||
for (let i = 0; i < obj.that.geojson.features.length; i++) {
|
||||
if (obj.that.geojson.features[i].id === pick.id._id) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.geojson.features[i].id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (typeof pick.id.id == 'string') {
|
||||
let array = pick.id.id.split('-')
|
||||
array.splice(array.length - 1, 1)
|
||||
entityId = array.join('-')
|
||||
}
|
||||
|
||||
if (pick.id.properties && pick.id.properties.id && leftClickCallbackMap.has(pick.id.properties.id._value)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.properties.id._value)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.properties.id._value,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
else if (leftClickCallbackMap.has(pick.id.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.id)
|
||||
if (obj.that.type === 'PolygonObject') {
|
||||
// 是否可点击y
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let polyPos = []
|
||||
for (let i = 0; i < obj.that.options.positions.length; i++) {
|
||||
polyPos.push([
|
||||
obj.that.options.positions[i].lng,
|
||||
obj.that.options.positions[i].lat
|
||||
])
|
||||
}
|
||||
polyPos.push([
|
||||
obj.that.options.positions[0].lng,
|
||||
obj.that.options.positions[0].lat
|
||||
])
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 聚集地
|
||||
else if (obj.that.type === 'AssembleObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let positions = obj.that.computeAssemble(obj.that.options.positions, true)
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let polyPos = []
|
||||
for (let i = 0; i < positions.length; i += 2) {
|
||||
polyPos.push([
|
||||
positions[i],
|
||||
positions[i + 1]
|
||||
])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 单箭头
|
||||
else if (obj.that.type === 'AttackArrowObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let positions = obj.that.computeAttackArrow(obj.that.options.positions)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
let pos84 = cartesian3Towgs84(positions[m], sdk.viewer)
|
||||
polyPos.push([pos84.lng, pos84.lat])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 双箭头
|
||||
else if (obj.that.type === 'PincerArrowObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 5) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let positions = obj.that.computePincerArrow(obj.that.options.positions)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
let pos84 = cartesian3Towgs84(positions[m], sdk.viewer)
|
||||
polyPos.push([pos84.lng, pos84.lat])
|
||||
}
|
||||
let pos84_0 = cartesian3Towgs84(positions[0], sdk.viewer)
|
||||
polyPos.push([pos84_0.lng, pos84_0.lat])
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 圆
|
||||
else if (obj.that.type === 'CircleObject') {
|
||||
if (obj.that.picking) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
if (obj.that.options.center && obj.that.options.radius) {
|
||||
let center = [obj.that.options.center.lng, obj.that.options.center.lat];
|
||||
let radius = obj.that.options.radius / 1000;
|
||||
let options = { steps: 360, units: 'kilometers' };
|
||||
let circle = turf.circle(center, radius, options);
|
||||
let contain = turf.booleanPointInPolygon(pt, circle);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 扇形
|
||||
else if (obj.that.type === 'SectorObject') {
|
||||
if (obj.that.picking) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
if (obj.that.options.center && obj.that.options.radius && obj.that.options.startAngle && obj.that.options.endAngle) {
|
||||
let positions = obj.that.calSector(obj.that.options.center, obj.that.options.radius, obj.that.options.startAngle, obj.that.options.endAngle, undefined, true)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
polyPos.push([positions[m].lng, positions[m].lat])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
else if (entityId && leftClickCallbackMap.has(entityId)) {
|
||||
let obj = leftClickCallbackMap.get(entityId)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
entityId,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
else if (pick.primitive) {
|
||||
if (typeof pick.id == 'string' && leftClickCallbackMap.has(pick.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id)
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (pick.primitive && pick.primitive.id) {
|
||||
if (leftClickCallbackMap.has(pick.primitive.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.primitive.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pick.content && (!pick.primitive || !pick.primitive.id)) {
|
||||
if (leftClickCallbackMap.has(pick.content.tileset.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.content.tileset.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = leftClickCallbackMap.size - 1; i >= 0; i--) {
|
||||
let key = Array.from(leftClickCallbackMap.keys())[i]
|
||||
let obj = leftClickCallbackMap.get(key)
|
||||
if (obj) {
|
||||
|
||||
if (obj.that) {
|
||||
if (obj.that && obj.that.show && (obj.that.entity && obj.that.entity.show)) {
|
||||
// 是否为多边形
|
||||
if (obj.that.type === 'PolygonObject') {
|
||||
// 是否可点击y
|
||||
@ -103,7 +357,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -129,7 +382,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -153,7 +405,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -179,7 +430,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -200,7 +450,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -224,7 +473,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -234,114 +482,6 @@ function openLeftClick(sdk, cb) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
const pick = sdk.viewer.scene.pick(movement.position)
|
||||
if (pick) {
|
||||
if (pick.id) {
|
||||
let entityId
|
||||
// 矢量
|
||||
if (pick.id.type && pick.id.type === 'vector' && pick.id.parentId) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.parentId)
|
||||
if (obj.that.picking && obj.that.geojson) {
|
||||
for (let i = 0; i < obj.that.geojson.features.length; i++) {
|
||||
if (obj.that.geojson.features[i].id === pick.id._id) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.geojson.features[i].id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (typeof pick.id.id == 'string') {
|
||||
let array = pick.id.id.split('-')
|
||||
array.splice(array.length - 1, 1)
|
||||
entityId = array.join('-')
|
||||
}
|
||||
|
||||
if (pick.id.properties && pick.id.properties.id && leftClickCallbackMap.has(pick.id.properties.id._value)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.properties.id._value)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.properties.id._value,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (leftClickCallbackMap.has(pick.id.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.id)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (entityId && leftClickCallbackMap.has(entityId)) {
|
||||
let obj = leftClickCallbackMap.get(entityId)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
entityId,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (pick.primitive) {
|
||||
if (typeof pick.id == 'string' && leftClickCallbackMap.has(pick.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id)
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (pick.primitive && pick.primitive.id) {
|
||||
if (leftClickCallbackMap.has(pick.primitive.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.primitive.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pick.content && (!pick.primitive || !pick.primitive.id)) {
|
||||
if (leftClickCallbackMap.has(pick.content.tileset.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.content.tileset.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,13 +72,267 @@ function openLeftClick(sdk, cb) {
|
||||
click = true
|
||||
}, 600);
|
||||
if (!YJ.Measure.GetMeasureStatus() && cartesian) {
|
||||
let flag = false
|
||||
const pick = sdk.viewer.scene.pick(movement.position)
|
||||
if (pick) {
|
||||
if (pick.id) {
|
||||
let entityId
|
||||
// 矢量
|
||||
if (pick.id.type && pick.id.type === 'vector' && pick.id.parentId) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.parentId)
|
||||
if (obj.that.picking && obj.that.geojson) {
|
||||
for (let i = 0; i < obj.that.geojson.features.length; i++) {
|
||||
if (obj.that.geojson.features[i].id === pick.id._id) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.geojson.features[i].id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (typeof pick.id.id == 'string') {
|
||||
let array = pick.id.id.split('-')
|
||||
array.splice(array.length - 1, 1)
|
||||
entityId = array.join('-')
|
||||
}
|
||||
|
||||
if (pick.id.properties && pick.id.properties.id && leftClickCallbackMap.has(pick.id.properties.id._value)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.properties.id._value)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.properties.id._value,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
else if (leftClickCallbackMap.has(pick.id.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.id)
|
||||
if (obj.that.type === 'PolygonObject') {
|
||||
// 是否可点击y
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let polyPos = []
|
||||
for (let i = 0; i < obj.that.options.positions.length; i++) {
|
||||
polyPos.push([
|
||||
obj.that.options.positions[i].lng,
|
||||
obj.that.options.positions[i].lat
|
||||
])
|
||||
}
|
||||
polyPos.push([
|
||||
obj.that.options.positions[0].lng,
|
||||
obj.that.options.positions[0].lat
|
||||
])
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 聚集地
|
||||
else if (obj.that.type === 'AssembleObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let positions = obj.that.computeAssemble(obj.that.options.positions, true)
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let polyPos = []
|
||||
for (let i = 0; i < positions.length; i += 2) {
|
||||
polyPos.push([
|
||||
positions[i],
|
||||
positions[i + 1]
|
||||
])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 单箭头
|
||||
else if (obj.that.type === 'AttackArrowObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 3) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let positions = obj.that.computeAttackArrow(obj.that.options.positions)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
let pos84 = cartesian3Towgs84(positions[m], sdk.viewer)
|
||||
polyPos.push([pos84.lng, pos84.lat])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 双箭头
|
||||
else if (obj.that.type === 'PincerArrowObject') {
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.options.positions && obj.that.options.positions.length >= 5) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
let positions = obj.that.computePincerArrow(obj.that.options.positions)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
let pos84 = cartesian3Towgs84(positions[m], sdk.viewer)
|
||||
polyPos.push([pos84.lng, pos84.lat])
|
||||
}
|
||||
let pos84_0 = cartesian3Towgs84(positions[0], sdk.viewer)
|
||||
polyPos.push([pos84_0.lng, pos84_0.lat])
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 圆
|
||||
else if (obj.that.type === 'CircleObject') {
|
||||
if (obj.that.picking) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
if (obj.that.options.center && obj.that.options.radius) {
|
||||
let center = [obj.that.options.center.lng, obj.that.options.center.lat];
|
||||
let radius = obj.that.options.radius / 1000;
|
||||
let options = { steps: 360, units: 'kilometers' };
|
||||
let circle = turf.circle(center, radius, options);
|
||||
let contain = turf.booleanPointInPolygon(pt, circle);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 扇形
|
||||
else if (obj.that.type === 'SectorObject') {
|
||||
if (obj.that.picking) {
|
||||
let pt = turf.point([pos84.lng, pos84.lat]);
|
||||
if (obj.that.options.center && obj.that.options.radius && obj.that.options.startAngle && obj.that.options.endAngle) {
|
||||
let positions = obj.that.calSector(obj.that.options.center, obj.that.options.radius, obj.that.options.startAngle, obj.that.options.endAngle, undefined, true)
|
||||
let polyPos = []
|
||||
for (let m = 0; m < positions.length; m++) {
|
||||
polyPos.push([positions[m].lng, positions[m].lat])
|
||||
}
|
||||
let poly = turf.polygon([polyPos]);
|
||||
let contain = turf.booleanPointInPolygon(pt, poly);
|
||||
if (contain) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
else if (entityId && leftClickCallbackMap.has(entityId)) {
|
||||
let obj = leftClickCallbackMap.get(entityId)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
entityId,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
else if (pick.primitive) {
|
||||
if (typeof pick.id == 'string' && leftClickCallbackMap.has(pick.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id)
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (pick.primitive && pick.primitive.id) {
|
||||
if (leftClickCallbackMap.has(pick.primitive.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.primitive.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pick.content && (!pick.primitive || !pick.primitive.id)) {
|
||||
if (leftClickCallbackMap.has(pick.content.tileset.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.content.tileset.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = leftClickCallbackMap.size - 1; i >= 0; i--) {
|
||||
let key = Array.from(leftClickCallbackMap.keys())[i]
|
||||
let obj = leftClickCallbackMap.get(key)
|
||||
if (obj) {
|
||||
|
||||
if (obj.that) {
|
||||
if (obj.that && obj.that.show && (obj.that.entity && obj.that.entity.show)) {
|
||||
// 是否为多边形
|
||||
if (obj.that.type === 'PolygonObject') {
|
||||
// 是否可点击y
|
||||
@ -103,7 +357,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -129,7 +382,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -153,7 +405,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -179,7 +430,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -200,7 +450,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -224,7 +473,6 @@ function openLeftClick(sdk, cb) {
|
||||
movement,
|
||||
obj.that.options.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -234,114 +482,6 @@ function openLeftClick(sdk, cb) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
const pick = sdk.viewer.scene.pick(movement.position)
|
||||
if (pick) {
|
||||
if (pick.id) {
|
||||
let entityId
|
||||
// 矢量
|
||||
if (pick.id.type && pick.id.type === 'vector' && pick.id.parentId) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.parentId)
|
||||
if (obj.that.picking && obj.that.geojson) {
|
||||
for (let i = 0; i < obj.that.geojson.features.length; i++) {
|
||||
if (obj.that.geojson.features[i].id === pick.id._id) {
|
||||
obj.callback(
|
||||
movement,
|
||||
obj.that.geojson.features[i].id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (typeof pick.id.id == 'string') {
|
||||
let array = pick.id.id.split('-')
|
||||
array.splice(array.length - 1, 1)
|
||||
entityId = array.join('-')
|
||||
}
|
||||
|
||||
if (pick.id.properties && pick.id.properties.id && leftClickCallbackMap.has(pick.id.properties.id._value)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.properties.id._value)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.properties.id._value,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (leftClickCallbackMap.has(pick.id.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id.id)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (entityId && leftClickCallbackMap.has(entityId)) {
|
||||
let obj = leftClickCallbackMap.get(entityId)
|
||||
if (obj.that.picking) {
|
||||
obj.callback(
|
||||
movement,
|
||||
entityId,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else if (pick.primitive) {
|
||||
if (typeof pick.id == 'string' && leftClickCallbackMap.has(pick.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.id)
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (pick.primitive && pick.primitive.id) {
|
||||
if (leftClickCallbackMap.has(pick.primitive.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.primitive.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.primitive.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pick.content && (!pick.primitive || !pick.primitive.id)) {
|
||||
if (leftClickCallbackMap.has(pick.content.tileset.id)) {
|
||||
let obj = leftClickCallbackMap.get(pick.content.tileset.id)
|
||||
if (obj.that.picking) {
|
||||
if (obj.that.type === 'bim') {
|
||||
if (YJ.Global.getBimPickStatus(sdk)) {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj.callback(
|
||||
movement,
|
||||
pick.content.tileset.id,
|
||||
cartesian3Towgs84(getcartesian(sdk, movement), sdk.viewer), obj.that)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ function getCurrentView(sdk) {
|
||||
// heading: viewer.camera.heading,
|
||||
// pitch: viewer.camera.pitch,
|
||||
// roll: viewer.camera.roll,
|
||||
position: tools.cartesian3Towgs84(viewer.camera.position, viewer),
|
||||
position: tools.cartesian3Towgs84(viewer.camera._positionWC, viewer),
|
||||
orientation: {
|
||||
heading: Cesium.Math.toDegrees(viewer.camera.heading),
|
||||
pitch: Cesium.Math.toDegrees(viewer.camera.pitch),
|
||||
|
@ -92,12 +92,12 @@ function MouseRightMenu(sdk, status, callBack) {
|
||||
entityId = entityId.parentId
|
||||
}
|
||||
let addedMenu = ''
|
||||
let that = sdk.entityMap.get(entityId)
|
||||
let that = sdk.entityMap.get(entityId+'')
|
||||
if (!that && entityId) {
|
||||
let array = entityId.split('-')
|
||||
let array = (entityId+'').split('-')
|
||||
array.splice(array.length - 1, 1)
|
||||
entityId = array.join('-')
|
||||
that = sdk.entityMap.get(entityId)
|
||||
that = sdk.entityMap.get(entityId+'')
|
||||
}
|
||||
|
||||
if (that && that.picking) {
|
||||
|
@ -22,53 +22,14 @@ class AssembleObject extends Base {
|
||||
* @param sdk
|
||||
* @description 集结地
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color='rgba(255, 0, 0, 0.5)' {string} 颜色
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -22,56 +22,14 @@ class AttackArrowObject extends Base {
|
||||
* @param sdk
|
||||
* @description 箭头面
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color='rgba(255, 0, 0, 0.5)' {string} 颜色
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.spreadState=false {boolean} 动画
|
||||
* @param options.loop=false {loop} 动画重复
|
||||
* @param options.spreadTime=3000 {number} 动画持续时长(毫秒)
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -17,62 +17,30 @@ import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../..
|
||||
class Model extends BaseModel {
|
||||
#timeoutEventObject = null
|
||||
/**
|
||||
* @constructor
|
||||
* @description 加载模型
|
||||
* @param sdk {object} sdk
|
||||
* @param options {object} 模型参数
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 模型显隐
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string} 资源地址
|
||||
* @param options.position {object} 模型位置
|
||||
* @param options.position.lng {number} 经度
|
||||
* @param options.position.lat {number} 纬度
|
||||
* @param options.position.alt {number} 高度
|
||||
* @param options.scale {object} 比例
|
||||
* @param options.scale.x=1 {number} x轴比例
|
||||
* @param options.scale.y=1 {number} y轴比例
|
||||
* @param options.scale.z=1 {number} z轴比例
|
||||
* @param options.maximumScale=100 {number} 最大比例
|
||||
* @param options.minimumPixelSize=60 {number} 最小像素
|
||||
* @param options.scaleByDistance=true {boolean} 随视野缩放
|
||||
* @param options.rotate {object} 旋转角度
|
||||
* @param options.rotate.x {number} x轴旋转度数
|
||||
* @param options.rotate.y {number} y轴旋转度数
|
||||
* @param options.rotate.z {number} z轴旋转度数
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @constructor
|
||||
* @description 加载模型
|
||||
* @param sdk {object} sdk
|
||||
* @param options {object} 模型参数
|
||||
* @param options.id {string} 对象id
|
||||
* @param options.show=true {boolean} 模型显隐
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string} 资源地址
|
||||
* @param options.position {object} 模型位置
|
||||
* @param options.position.lng {number} 经度
|
||||
* @param options.position.lat {number} 纬度
|
||||
* @param options.position.alt {number} 高度
|
||||
* @param options.scale {object} 比例
|
||||
* @param options.scale.x=1 {number} 比例
|
||||
* @param options.scale.y=1 {number} 比例
|
||||
* @param options.scale.z=1 {number} 比例
|
||||
* @param options.maximumScale=100 {number} 最大比例
|
||||
* @param options.minimumPixelSize=60 {number} 最小像素
|
||||
* @param options.scaleByDistance=true {boolean} 随视野缩放
|
||||
* @param options.rotate {object} 旋转角度
|
||||
* @param options.rotate.x {number} x轴旋转度数
|
||||
* @param options.rotate.y {number} y轴旋转度数
|
||||
* @param options.rotate.z {number} z轴旋转度数
|
||||
* @param options.img {string} 图片地址
|
||||
* */
|
||||
constructor(earth, options = {}, _Dialog = {}) {
|
||||
super(earth, options, _Dialog = {})
|
||||
|
@ -46,7 +46,7 @@ class BatchModel extends Base {
|
||||
this._EventBinding = new EventBinding()
|
||||
this._elms = {};
|
||||
this.pointArr = []
|
||||
this.sdk.addIncetance(this.options.id, this)
|
||||
// this.sdk.addIncetance(this.options.id, this)
|
||||
let tools = new Tools(sdk)
|
||||
// BatchModel.computeDis(this)
|
||||
// if (this.options.positions.length > 0 || this.options.positions.lng) {
|
||||
@ -58,6 +58,7 @@ class BatchModel extends Base {
|
||||
// BatchModel.computeDis(this)
|
||||
|
||||
let Draw
|
||||
console.log('kkkkk')
|
||||
switch (options.type) {
|
||||
case '点':
|
||||
Draw = new DrawPoint(this.sdk)
|
||||
@ -73,34 +74,37 @@ class BatchModel extends Base {
|
||||
}
|
||||
Draw && Draw.start((a, positions) => {
|
||||
this.options.positions = positions;
|
||||
console.log('uuuuuu')
|
||||
//判断范围是否过大
|
||||
if (options.type == '面') {
|
||||
let posi = positions.map(v => {
|
||||
return Cesium.Cartesian3.fromDegrees(v.lng, v.lat)
|
||||
})
|
||||
let dis1 = Cesium.Cartesian3.distance(posi[0], posi[1])
|
||||
let dis2 = Cesium.Cartesian3.distance(posi[1], posi[2])
|
||||
let num1 = dis1 / this.options.spacing
|
||||
let num2 = dis2 / this.options.spacing
|
||||
if (num1 * num2 > 100) {
|
||||
tools.message({ type: 'warning', text: '数量大于100,请重新绘制' })
|
||||
return;
|
||||
}
|
||||
} else if (options.type == '线') {
|
||||
let posi = positions.map(v => {
|
||||
return Cesium.Cartesian3.fromDegrees(v.lng, v.lat)
|
||||
})
|
||||
let dis = 0
|
||||
for (let i = 0; i < posi.length - 2; i++) {
|
||||
dis += Cesium.Cartesian3.distance(posi[i], posi[i + 1])
|
||||
}
|
||||
if (dis / this.options.spacing > 100) {
|
||||
tools.message({ type: 'warning', text: '数量大于100,请重新绘制' })
|
||||
return;
|
||||
if (positions.length != 0 || positions.lng) {
|
||||
if (options.type == '面') {
|
||||
let posi = positions.map(v => {
|
||||
return Cesium.Cartesian3.fromDegrees(v.lng, v.lat)
|
||||
})
|
||||
let dis1 = Cesium.Cartesian3.distance(posi[0], posi[1])
|
||||
let dis2 = Cesium.Cartesian3.distance(posi[1], posi[2])
|
||||
let num1 = dis1 / this.options.spacing
|
||||
let num2 = dis2 / this.options.spacing
|
||||
if (num1 * num2 > 100) {
|
||||
tools.message({ type: 'warning', text: '数量大于100,请重新绘制' })
|
||||
return;
|
||||
}
|
||||
} else if (options.type == '线') {
|
||||
let posi = positions.map(v => {
|
||||
return Cesium.Cartesian3.fromDegrees(v.lng, v.lat)
|
||||
})
|
||||
let dis = 0
|
||||
for (let i = 0; i < posi.length - 2; i++) {
|
||||
dis += Cesium.Cartesian3.distance(posi[i], posi[i + 1])
|
||||
}
|
||||
if (dis / this.options.spacing > 100) {
|
||||
tools.message({ type: 'warning', text: '数量大于100,请重新绘制' })
|
||||
return;
|
||||
}
|
||||
}
|
||||
// this.callback(this.options);
|
||||
(this.options.positions.length || this.options.positions.lng) && BatchModel.computeDis(this)
|
||||
}
|
||||
// this.callback(this.options);
|
||||
(this.options.positions.length || this.options.positions.lng) && BatchModel.computeDis(this)
|
||||
})
|
||||
|
||||
} else {
|
||||
@ -115,51 +119,59 @@ class BatchModel extends Base {
|
||||
let posiArr = []
|
||||
let array = []
|
||||
if (that.options.type == '面') {
|
||||
that.options.positions.forEach(item => {
|
||||
fromDegreesArray.push(item.lng, item.lat)
|
||||
})
|
||||
// arr = that.generateInterpolatedPoints(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
|
||||
arr = await that.computedArea(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
|
||||
array[0] = arr
|
||||
array[1] = that.calculateRoadAngle(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)[0], Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)[3])
|
||||
arr.forEach((item, index) => {
|
||||
const cartographic = Cesium.Cartographic.fromCartesian(
|
||||
item // Cartesian3对象 {x, y, z}
|
||||
);
|
||||
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
||||
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
||||
const height = cartographic.height;
|
||||
posiArr.push({
|
||||
lng: longitude,
|
||||
lat: latitude,
|
||||
alt: height
|
||||
if (that.options.positions.length != 0) {
|
||||
that.options.positions.forEach(item => {
|
||||
fromDegreesArray.push(item.lng, item.lat)
|
||||
})
|
||||
})
|
||||
// arr = that.generateInterpolatedPoints(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
|
||||
arr = await that.computedArea(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
|
||||
array[0] = arr
|
||||
array[1] = that.calculateRoadAngle(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)[0], Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)[3])
|
||||
arr.forEach((item, index) => {
|
||||
const cartographic = Cesium.Cartographic.fromCartesian(
|
||||
item // Cartesian3对象 {x, y, z}
|
||||
);
|
||||
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
||||
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
||||
const height = cartographic.height;
|
||||
posiArr.push({
|
||||
lng: longitude,
|
||||
lat: latitude,
|
||||
alt: height
|
||||
})
|
||||
})
|
||||
}
|
||||
} else if (that.options.type == '线') {
|
||||
that.options.positions.forEach(item => {
|
||||
fromDegreesArray.push(item.lng, item.lat)
|
||||
})
|
||||
array = await that.linePoint(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
|
||||
arr = array[0]
|
||||
that.pointArr = arr
|
||||
arr.forEach((item, index) => {
|
||||
const cartographic = Cesium.Cartographic.fromCartesian(
|
||||
item // Cartesian3对象 {x, y, z}
|
||||
);
|
||||
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
||||
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
||||
const height = cartographic.height;
|
||||
posiArr.push({
|
||||
lng: longitude,
|
||||
lat: latitude,
|
||||
alt: height
|
||||
if (that.options.positions.length != 0) {
|
||||
that.options.positions.forEach(item => {
|
||||
fromDegreesArray.push(item.lng, item.lat)
|
||||
})
|
||||
})
|
||||
array = await that.linePoint(Cesium.Cartesian3.fromDegreesArray(fromDegreesArray), that.options.spacing)
|
||||
arr = array[0]
|
||||
that.pointArr = arr
|
||||
arr.forEach((item, index) => {
|
||||
const cartographic = Cesium.Cartographic.fromCartesian(
|
||||
item // Cartesian3对象 {x, y, z}
|
||||
);
|
||||
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
||||
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
||||
const height = cartographic.height;
|
||||
posiArr.push({
|
||||
lng: longitude,
|
||||
lat: latitude,
|
||||
alt: height
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
} else if (that.options.type == '点') {
|
||||
let height = await that.getClampToHeight({ lng: that.options.positions.lng, lat: that.options.positions.lat })
|
||||
posiArr = [{ lng: that.options.positions.lng, lat: that.options.positions.lat, alt: height }]
|
||||
// posiArr = [that.options.positions]
|
||||
that.pointArr = posiArr
|
||||
if (that.options.positions.lng) {
|
||||
let height = await that.getClampToHeight({ lng: that.options.positions.lng, lat: that.options.positions.lat })
|
||||
posiArr = [{ lng: that.options.positions.lng, lat: that.options.positions.lat, alt: height }]
|
||||
// posiArr = [that.options.positions]
|
||||
that.pointArr = posiArr
|
||||
}
|
||||
|
||||
}
|
||||
let params = {
|
||||
type: that.options.type,
|
||||
|
@ -48,64 +48,30 @@ class BillboardObject extends Base {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @description 点标注
|
||||
* @param options {object} 属性
|
||||
* @description 创建点标注
|
||||
* @param sdk {object} sdk
|
||||
* @param options {object} 标注参数
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 标注整体的显隐
|
||||
* @param options.name {string} 名称
|
||||
* @param {object} options.position={} 必填,位置
|
||||
* @param {number} options.position.lng 经度
|
||||
* @param {number} options.position.lat 纬度
|
||||
* @param {number} options.position.alt 高度
|
||||
* @param {object} options.positions 位置
|
||||
* @param {number} options.positions.lng 经度
|
||||
* @param {number} options.positions.lat 纬度
|
||||
* @param {number} options.positions.alt 高度
|
||||
* @param {number} options.heightMode=3 高度模式(0:海拔高度;1:相对地表;2:依附地表; 3:依附模型)
|
||||
* @param [options.scaleByDistance=true] {boolean} 是否开启跟随视野缩放
|
||||
* @param [options.near=2000] {number} 视野缩放最近距离
|
||||
* @param [options.far=100000] {number} 视野缩放最远距离
|
||||
* @param options.billboard {object} 图标参数
|
||||
* @param [options.billboard.show=true] {boolean} 图标显隐
|
||||
* @param [options.scaleByDistance=true] {boolean} 图标是否跟随视角变化进行字段缩放
|
||||
* @param [options.show=true] {boolean} 标注整体的显示/隐藏
|
||||
* @param [options.near=2000] {number} 近端可视距离 scaleByDistance为true时生效
|
||||
* @param [options.far=100000] {number} 远端可视距离 scaleByDistance为true时生效
|
||||
* @param options.billboard {object} 标注中图标的参数
|
||||
* @param [options.billboard.show=true] {boolean} 标注中图标的显示与隐藏
|
||||
* @param options.billboard.image {string} 图标路径
|
||||
* @param options.billboard.defaultImage {string} 默认图标的唯一标识
|
||||
* @param [options.billboard.scale=3] {number} 图标放大倍数
|
||||
* @param options.label {object} 文字参数
|
||||
* @param [options.label.text] {string} 文字内容
|
||||
* @param [options.label.show=true] {boolean} 文字显隐
|
||||
* @param [options.label.fontFamily=0] {number} 文字字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param [options.label.fontSize=39] {number} 文字大小, 单位px
|
||||
* @param [options.label.color=#00ffff] {string} 文字颜色
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param {object} options.attribute.vr={} 全景图
|
||||
* @param options.attribute.vr.content=[]] {array} 全景图内容
|
||||
* @param options.attribute.vr.content[].name {string} 名称
|
||||
* @param options.attribute.vr.content[].url {string} 地址
|
||||
* @param {object} ptions.attribute.camera={} 摄像头
|
||||
* @param options.attribute.camera.content=[]] {array} 摄像头内容
|
||||
* @param {object} options.attribute.ISC={} ISC
|
||||
* @param options.attribute.ISC.content=[]] {array} ISC内容
|
||||
* @param {object} options.attribute.goods={} 物资
|
||||
* @param options.attribute.goods.content=[]] {array} 物资内容
|
||||
* @param options.attribute.goods.content[].ID {string} ID
|
||||
* @param options.attribute.goods.content[].name {string} 名称
|
||||
* @param options.attribute.goods.content[].cnt {string} 数量
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* @param [options.billboard.scale=3] {number} 图标倍数
|
||||
*@param options.label {object} 标注文字的参数
|
||||
*@param [options.label.text] {string} 标注中文字
|
||||
*@param [options.label.show=true] {boolean} 标注文字显示/隐藏
|
||||
*@param [options.label.fontFamily=0] {number} 标注文字字体 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
*@param [options.label.fontSize=39] {number} 标注文字大小 单位px,微软雅黑
|
||||
*@param [options.label.color=#00ffff] {string} 标注文字颜色
|
||||
*@param _Dialog {object} 弹框事件
|
||||
*@param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
*@param _Dialog.instructSubmit(id,name,instruct) {function} 提交指令(ID, 名称,指令内容)
|
||||
|
@ -21,53 +21,23 @@ class CircleDiffuse extends Base {
|
||||
* @param sdk
|
||||
* @param options {object} 圆属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param [options.show=true] {boolean} 显示/隐藏
|
||||
* @param options.lng {number} 经度
|
||||
* @param options.lat {number} 维度
|
||||
* @param options.color=#1FA8E3 {string} 基础颜色
|
||||
* @param options.colors=[] {string} 范围颜色
|
||||
* @param options.speed=5 {number} 速度
|
||||
* @param options.count=3 {number} 波纹数量
|
||||
* @param options.circle=[]] {array} 圆属性
|
||||
* @param options.circle[].radius {number} 半径
|
||||
* @param options.circle[].color {string} 颜色
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param options.circle=[{radius, color}] {object} 圆属性;radius:半径,color:颜色
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
*/
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
this.options.lng = options.lng
|
||||
this.options.lat = options.lat
|
||||
this.options.color = options.color || '#1FA8E3'
|
||||
this.options.colors = options.colors || []
|
||||
this.options.transparency = (options.transparency || options.transparency === 0) ? options.transparency : 1
|
||||
if (this.options.transparency > 1) {
|
||||
this.options.transparency = 1
|
||||
@ -460,6 +430,15 @@ class CircleDiffuse extends Base {
|
||||
})
|
||||
}
|
||||
|
||||
get colors() {
|
||||
return this.options.colors
|
||||
}
|
||||
|
||||
set colors(v) {
|
||||
this.options.colors = v
|
||||
CircleDiffuse.create(this)
|
||||
}
|
||||
|
||||
get labelShow() {
|
||||
return this.options.label.show
|
||||
}
|
||||
|
@ -18,63 +18,22 @@ import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Gl
|
||||
class CircleObject extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @param sdk
|
||||
* @description 创建圆
|
||||
* @param options {object} 圆属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.name {string} 名称
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.center {object} 中心位置
|
||||
* @param options.center.lng {number} 经度
|
||||
* @param options.center.lat {number} 纬度
|
||||
* @param options.center.alt {number} 高度
|
||||
* @param options.radius=10 {number}半径
|
||||
* @param options.center {object} 位置
|
||||
* @param options.center.lng {object} 经度
|
||||
* @param options.center.lat {object} 纬度
|
||||
* @param options.center.alt {object} 高度
|
||||
* @param options.radius=10 {object}半径
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=3 {number} 边框宽
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="#ff000080" {string} 边框颜色
|
||||
* @param options.label {object} 标注
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*/
|
||||
constructor(sdk, options = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -21,57 +21,30 @@ class CurvelineObject extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @param sdk
|
||||
* @description 曲线
|
||||
* @description 折线
|
||||
* @param options {object} 线属性
|
||||
* @param options.name{string} 名称
|
||||
* @param options.width=3{number} 线宽
|
||||
* @param options.color=#ff0000 {string} 颜色
|
||||
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光...
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式)
|
||||
* @param options.noseToTail=false {boolean} 首尾相连
|
||||
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光
|
||||
* @param options.heightMode{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式)
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
* @param options.extend=false {boolean} 线缓冲
|
||||
* @param options.extendWidth=10 {number} 线缓冲宽度
|
||||
* @param options.extendColor=rgba(255,255,80,0.3) {number} 线缓冲颜色
|
||||
* @param options['extend-width']=10 {number} 线缓冲宽度
|
||||
* @param options['extend-color']=#ffde00 {number} 线缓冲颜色
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {string} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*
|
||||
*
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lng,lat},...]
|
||||
* @param options.label {object} 标注
|
||||
* @param options.label.show=false {boolean} 标注显隐
|
||||
* @param options.label.fontSize=20 {number} 标注字体大小
|
||||
* @param options.label.color=#ffffff {string} 标注字体颜色
|
||||
* @param options.label.lineWidth=1 {number} 标注引线宽
|
||||
* @param options.label.pixelOffset=20 {string} 标注引线长度
|
||||
* @param options.label.backgroundColor=['#42c6ef', '#42c6ef'] {Array} 标注背景
|
||||
* @param options.label.lineColor=#fff000 {string} 标注引线颜色
|
||||
* @param options.label.scaleByDistance=false {boolean} 标注是否随视野缩放
|
||||
* @param options.label.near=2000 {boolean} 标注随视野缩放最近距离
|
||||
* @param options.label.far=100000 {boolean} 标注随视野缩放最远距离
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
@ -375,9 +348,10 @@ class CurvelineObject extends Base {
|
||||
this._elms.lineWidth.forEach(item => {
|
||||
item.value = this.options.width
|
||||
})
|
||||
this.entity &&
|
||||
this.entity.polyline &&
|
||||
(this.entity.polyline.width = this.options.width)
|
||||
if (this.entity && this.entity.polyline) {
|
||||
this.entity.polyline.width = this.entity.polyline.width + v - this.entity.polyline.oriWidth
|
||||
this.entity.polyline.oriWidth = this.options.width
|
||||
}
|
||||
}
|
||||
|
||||
get lineType() {
|
||||
|
@ -18,13 +18,12 @@ import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Gl
|
||||
class EllipseObject extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @param sdk
|
||||
* @description 创建椭圆
|
||||
* @param options {object} 圆属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.name {string} 名称
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.center {object} 中心位置
|
||||
* @param options.center {object} 位置
|
||||
* @param options.color="rgba(255, 0, 0, 0.5)" {string} 颜色
|
||||
* @param options.center.lng {object} 经度
|
||||
* @param options.center.lat {object} 维度
|
||||
@ -34,41 +33,8 @@ class EllipseObject extends Base {
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(255, 0, 0, 1)" {string} 边框颜色
|
||||
* @param options.label {object} 标注
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*/
|
||||
constructor(sdk, options = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -13,15 +13,6 @@ class Explosion extends Base {
|
||||
* @description 爆炸
|
||||
* @param sdk
|
||||
* @param options {object} 爆炸属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param options.name {string} 名称
|
||||
* @param {object} options.position={} 位置
|
||||
* @param {number} options.position.lng 经度
|
||||
* @param {number} options.position.lat 纬度
|
||||
* @param {number} options.position.alt 高度
|
||||
* @param options.scaleByDistance=true {boolean} 是否开启跟随视野缩放
|
||||
* @param options.size=80 {number} 大小(爆炸范围)
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -9,25 +9,6 @@ import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../Glo
|
||||
|
||||
class FlyRoam extends Base {
|
||||
#clickHandler = undefined
|
||||
/**
|
||||
* @constructor
|
||||
* @param sdk
|
||||
* @description 飞行漫游
|
||||
* @param options {object}
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.name {string} 名称
|
||||
* @param options.repeat=0 {number} 重复次数
|
||||
* @param options.points=[]] {array} 视点列表
|
||||
* @param options.points[].position {object} 视点位置
|
||||
* @param options.points[].position.lng {number} 经度
|
||||
* @param options.points[].position.lat {number} 纬度
|
||||
* @param options.points[].position.alt {number} 高度
|
||||
* @param options.points[].orientation {object} 视点方向
|
||||
* @param options.points[].orientation.heading=0 {number} 视点航向角
|
||||
* @param options.points[].orientation.pitch=0 {number} 视点俯仰角
|
||||
* @param options.points[].orientation.roll=0 {number} 视点翻滚角
|
||||
* @param options.points[].duration=0 {number} 持续时间
|
||||
**/
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options)
|
||||
this.options.id = options.id || this.randomString()
|
||||
|
@ -26,7 +26,7 @@ class GroundSvg extends Base {
|
||||
* @param options.scale {object} 比例
|
||||
* @param options.scale.x=1 {number} x轴比例
|
||||
* @param options.scale.y=1 {number} y轴比例
|
||||
* @param options.url {string} 资源地址
|
||||
* @param options.url {string} svg图片地址
|
||||
* @param options.flipe {object} 翻转
|
||||
* @param options.flipe.x=false {boolean} 绕X轴翻转
|
||||
* @param options.flipe.y=false {boolean} 绕Y轴翻转
|
||||
@ -34,31 +34,8 @@ class GroundSvg extends Base {
|
||||
* @param options.position.lng {number} 经度
|
||||
* @param options.position.lat {number} 纬度
|
||||
* @param options.color {string} 颜色
|
||||
* @param options.text {object} 文字
|
||||
* @param options.text.show=true {boolean} 文字
|
||||
* @param options.text.position.lng {number} 经度
|
||||
* @param options.text.position.lat {number} 纬度
|
||||
* @param options.text.position.alt {number} 高度
|
||||
* @param options.text.fontSize=20 {number} 字体大小
|
||||
* @param options.text.color=#ffffff {string} 字体大小
|
||||
* @param options.text.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.text.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.text.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
#loadEvent = void 0
|
||||
#loaded = false
|
||||
@ -1238,9 +1215,12 @@ class GroundSvg extends Base {
|
||||
* @param {boolean} status=false 状态
|
||||
*/
|
||||
drag(status, cd) {
|
||||
if (!this.#loaded || !this.sdk || !this.sdk.viewer) {
|
||||
if (!this.#loaded || !this.sdk || !this.sdk.viewer || !this.entity || !this.entity.values || this.entity.values.length == 0) {
|
||||
return
|
||||
}
|
||||
let greenImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA+0lEQVR4AZSTPQ7CMAyFk0jAFYCRCbgEbHAKBqRyKCoYOAVs5RLAQseKKxQkwntWVCltJdzK+bO/59ZW6kztGX6mi/F7dhiV0ydWzxH2B8ZquIkSAN47bzNAW2vtBKtY2G8ZIyPOMFUJxuX8DF+C8c+SwAonCSSr9SvxaCawogHrQl2aNwOPLKHWoa5N5O5woNZ575cdNBFKrQsdjgLaA7XSRK2gjWMJeVtA40MJOUvgxdHwDQYlZO5r/akRUTqoda/e4wo+xehqKbXSxKJ/3xlvL+oMYEUDgSTAaorBbY1V8yVpYIGb+G9kVtTFi3Vkh4XAFPZHxsjAVdkPAAD//0PYov0AAAAGSURBVAMA5pZjby819WUAAAAASUVORK5CYII='
|
||||
let redImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA1klEQVR4AZST0Q2CQBBEF0qhEfjDKvgwwaIk+kEV8oeFSCs4D4+gB4l7ZIfszc7OLXDkFl2zWSnchJcwB5DDlZHcfgwkvkowCmehENYghxuDZuU3AxUeYlvhX7RBu+iWCUSwc70wvlsdeixXwnN5do6tmaRkgiauJKwbDKqEhlhaYcAbjgvedYGBV3yow2A6rPjICQMOjk++V40Y9HvezfR5ZvaUvBNSo6OXCUzJRd2D4I0h9Gz/goiTuj2TsDNayW0zYJWZMQkH667199chh6uCRuVPvAEAAP//mBlPPAAAAAZJREFUAwAzdy+JgzpBHQAAAABJRU5ErkJggg=='
|
||||
let yellowImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA8ElEQVR4AZyQMY7CQAxFbbe7W7IH2GrJJaCDU1AgwaFAUHAK6OASQAM9UAJtzLxRBikUKMwo1jjf//0oNnk518t/534uZtdTcbidC6fooxZmL3apBdwv7Ym6rV1kqCp/yUwftTDDk3TuZ0D40tJdR4jvCg/e5IkBVWoviQ3uXsWI8c+kNoBqFhhYM7dBbfLBC6yVLl3JPLDGhjN5gY1LzA2AM3c50uQUrJnKWjIPrJVaLjJ5gbWf1n6j6tNPQ2Bg4xK/WrtxCFiFavqsKkZiANT377ZPKv27woM3eZ4BCKS6ll0VmbNhNIo+amGGBy3VAwAA//9///lSAAAABklEQVQDAADzbcvdBag1AAAAAElFTkSuQmCC'
|
||||
this.ismove = false
|
||||
this._isdrag = status
|
||||
if (this.ScreenSpaceEventHandler) {
|
||||
@ -1321,44 +1301,67 @@ class GroundSvg extends Base {
|
||||
angleH = bearing2 - bearingH
|
||||
if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) {
|
||||
angleW = angleW + 180
|
||||
flag=true
|
||||
flag = true
|
||||
}
|
||||
if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) {
|
||||
angleH = angleH + 180
|
||||
flag2=true
|
||||
flag2 = true
|
||||
}
|
||||
if(flag && flag2) {
|
||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
}
|
||||
else {
|
||||
if(flag) {
|
||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
}
|
||||
else if(flag2) {
|
||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
}
|
||||
else {
|
||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
radiansW = (Math.PI / 180) * angleW
|
||||
radiansH = (Math.PI / 180) * angleH
|
||||
// 矩形高度
|
||||
w = (Math.cos(radiansW) * distance) * 2
|
||||
h = (Math.cos(radiansH) * distance) * 2
|
||||
|
||||
if(h<0) {
|
||||
flag2 = !flag2
|
||||
}
|
||||
if(w<0) {
|
||||
flag = !flag
|
||||
}
|
||||
if (flag && flag2) {
|
||||
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[1].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[3].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[7].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[9].billboard.image = redImg
|
||||
}
|
||||
else {
|
||||
if (flag) {
|
||||
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[1].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[3].billboard.image = redImg
|
||||
this.pointEntityCollection.values[7].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[9].billboard.image = greenImg
|
||||
}
|
||||
else if (flag2) {
|
||||
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[1].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[3].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[7].billboard.image = redImg
|
||||
this.pointEntityCollection.values[9].billboard.image = greenImg
|
||||
}
|
||||
else {
|
||||
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[1].billboard.image = redImg
|
||||
this.pointEntityCollection.values[3].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[7].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[9].billboard.image = greenImg
|
||||
}
|
||||
}
|
||||
// scaleY值
|
||||
this.scale.x = Math.abs(w) / 3.5
|
||||
this.scale.y = Math.abs(h) / 3.5
|
||||
@ -1370,12 +1373,16 @@ class GroundSvg extends Base {
|
||||
|
||||
if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) {
|
||||
angleH = angleH + 180
|
||||
this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[2].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[8].billboard.image = redImg
|
||||
}
|
||||
else {
|
||||
this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[2].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[8].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[2].billboard.image = redImg
|
||||
this.pointEntityCollection.values[8].billboard.image = greenImg
|
||||
}
|
||||
|
||||
radiansH = (Math.PI / 180) * angleH
|
||||
@ -1393,37 +1400,11 @@ class GroundSvg extends Base {
|
||||
|
||||
if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) {
|
||||
angleW = angleW + 180
|
||||
flag=true
|
||||
flag = true
|
||||
}
|
||||
if ((angleH > -360 && angleH < -90) || (angleH < 360 && angleH > 90)) {
|
||||
angleH = angleH + 180
|
||||
flag2=true
|
||||
}
|
||||
if(flag && flag2) {
|
||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
}
|
||||
else {
|
||||
if(flag) {
|
||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
}
|
||||
else if(flag2) {
|
||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
}
|
||||
else {
|
||||
this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
}
|
||||
flag2 = true
|
||||
}
|
||||
|
||||
radiansW = (Math.PI / 180) * angleW
|
||||
@ -1431,6 +1412,56 @@ class GroundSvg extends Base {
|
||||
// 矩形高度
|
||||
w = (Math.cos(radiansW) * distance) * 2
|
||||
h = (Math.cos(radiansH) * distance) * 2
|
||||
|
||||
if(h<0) {
|
||||
flag2 = !flag2
|
||||
}
|
||||
if(w<0) {
|
||||
flag = !flag
|
||||
}
|
||||
|
||||
if (flag && flag2) {
|
||||
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[1].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[3].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[7].billboard.image = redImg
|
||||
this.pointEntityCollection.values[9].billboard.image = greenImg
|
||||
}
|
||||
else {
|
||||
if (flag) {
|
||||
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[1].billboard.image = redImg
|
||||
this.pointEntityCollection.values[3].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[7].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[9].billboard.image = greenImg
|
||||
}
|
||||
else if (flag2) {
|
||||
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[1].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[3].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[7].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[9].billboard.image = redImg
|
||||
}
|
||||
else {
|
||||
// this.pointEntityCollection.values[1].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[3].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[7].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[9].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[1].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[3].billboard.image = redImg
|
||||
this.pointEntityCollection.values[7].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[9].billboard.image = greenImg
|
||||
}
|
||||
}
|
||||
// scaleY值
|
||||
this.scale.x = Math.abs(w) / 3.5
|
||||
this.scale.y = Math.abs(h) / 3.5
|
||||
@ -1441,12 +1472,16 @@ class GroundSvg extends Base {
|
||||
|
||||
if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) {
|
||||
angleW = angleW + 180
|
||||
this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[4].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[6].billboard.image = redImg
|
||||
}
|
||||
else {
|
||||
this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[6].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[4].billboard.image = redImg
|
||||
}
|
||||
|
||||
radiansW = (Math.PI / 180) * angleW
|
||||
@ -1477,12 +1512,16 @@ class GroundSvg extends Base {
|
||||
|
||||
if ((angleW > -360 && angleW < -90) || (angleW < 360 && angleW > 90)) {
|
||||
angleW = angleW + 180
|
||||
this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[6].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[4].billboard.image = redImg
|
||||
}
|
||||
else {
|
||||
this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[4].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[6].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[4].billboard.image = greenImg
|
||||
this.pointEntityCollection.values[6].billboard.image = redImg
|
||||
}
|
||||
|
||||
radiansW = (Math.PI / 180) * angleW
|
||||
@ -1547,18 +1586,22 @@ class GroundSvg extends Base {
|
||||
}
|
||||
for (let i = 0; i < this.pointEntityCollection.values.length; i++) {
|
||||
if (pickPoint && this.pointEntityCollection.values[i].id === pickPoint.id) {
|
||||
pickPoint.point.color = Cesium.Color.fromCssColorString('#ffff00')
|
||||
// pickPoint.point.color = Cesium.Color.fromCssColorString('#ffff00')
|
||||
pickPoint.billboard.image = yellowImg
|
||||
}
|
||||
else {
|
||||
switch (this.pointEntityCollection.values[i].id) {
|
||||
case 'svg-control-points_5':
|
||||
this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#ffff00')
|
||||
// this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#ffff00')
|
||||
this.pointEntityCollection.values[i].billboard.image = yellowImg
|
||||
break
|
||||
case 'svg-control-points_0':
|
||||
this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pointEntityCollection.values[i].billboard.image = redImg
|
||||
break
|
||||
default:
|
||||
this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pointEntityCollection.values[i].point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pointEntityCollection.values[i].billboard.image = greenImg
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1573,7 +1616,8 @@ class GroundSvg extends Base {
|
||||
) {
|
||||
YJ.Global.CameraController(this.sdk, false)
|
||||
this.pickPoint = pickedObject.primitive._id
|
||||
this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pickPoint.billboard.image = redImg
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -1583,13 +1627,16 @@ class GroundSvg extends Base {
|
||||
YJ.Global.CameraController(this.sdk, true)
|
||||
switch (this.pickPoint.id) {
|
||||
case 'svg-control-points_4':
|
||||
this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ffff00')
|
||||
// this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ffff00')
|
||||
this.pickPoint.billboard.image = yellowImg
|
||||
break
|
||||
case 'svg-control-points_9':
|
||||
this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
// this.pickPoint.point.color = Cesium.Color.fromCssColorString('#ff0000')
|
||||
this.pickPoint.billboard.image = redImg
|
||||
break
|
||||
default:
|
||||
this.pickPoint.point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
// this.pickPoint.point.color = Cesium.Color.fromCssColorString('#00ff0a')
|
||||
this.pickPoint.billboard.image = greenImg
|
||||
}
|
||||
this.pickPoint = null
|
||||
}
|
||||
@ -1628,16 +1675,19 @@ class GroundSvg extends Base {
|
||||
controlPoints[9] = turf.destination(point, wh, 0 + angle, options).geometry.coordinates
|
||||
|
||||
this.controlPoints = controlPoints
|
||||
if(!this.sdk || !this.sdk.viewer) {
|
||||
if (!this.sdk || !this.sdk.viewer) {
|
||||
return
|
||||
}
|
||||
for (let i = 0; i < this.controlPoints.length; i++) {
|
||||
let color = '#00ff0a'
|
||||
let img = greenImg
|
||||
if (i === 5) {
|
||||
color = '#ffff00'
|
||||
img = yellowImg
|
||||
}
|
||||
if (i === 0) {
|
||||
color = '#ff0000'
|
||||
img = redImg
|
||||
}
|
||||
let entity = this.sdk.viewer.entities.getOrCreateEntity('svg-control-points_' + i)
|
||||
entity.show = true
|
||||
@ -1645,11 +1695,18 @@ class GroundSvg extends Base {
|
||||
entity.position = new Cesium.CallbackProperty(() => {
|
||||
return Cesium.Cartesian3.fromDegrees(...this.controlPoints[i])
|
||||
})
|
||||
entity.point = new Cesium.PointGraphics({
|
||||
color: Cesium.Color.fromCssColorString(color), // 点的颜色
|
||||
pixelSize: 10, // 点的大小
|
||||
// entity.point = new Cesium.PointGraphics({
|
||||
// color: Cesium.Color.fromCssColorString(color), // 点的颜色
|
||||
// pixelSize: 10, // 点的大小
|
||||
// heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
||||
// scaleByDistance: new Cesium.NearFarScalar(0.0, 1.0, 1.0e10, 1.0),
|
||||
// disableDepthTestDistance: Number.POSITIVE_INFINITY // 不应用深度测试
|
||||
// })
|
||||
entity.billboard = new Cesium.BillboardGraphics({
|
||||
image: img,
|
||||
width: 10,
|
||||
height: 10,
|
||||
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
||||
scaleByDistance: new Cesium.NearFarScalar(0.0, 1.0, 1.0e10, 1.0),
|
||||
disableDepthTestDistance: Number.POSITIVE_INFINITY // 不应用深度测试
|
||||
})
|
||||
this.pointEntityCollection.add(entity)
|
||||
@ -1871,7 +1928,7 @@ class GroundSvg extends Base {
|
||||
})
|
||||
this.hierarchys = [...hierarchys]
|
||||
|
||||
if (!this.entity) {
|
||||
if (!this.entity || !this.entity.values || this.entity.values.length == 0) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -18,10 +18,9 @@ class Flame extends Base {
|
||||
* @description 火焰特效
|
||||
* @param sdk
|
||||
* @param options {object} 粒子属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string} 贴图地址
|
||||
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
|
||||
* @param options.startColor="#ff0000" {string} 起始颜色
|
||||
* @param options.endColor="#fff000" {string} 结束颜色
|
||||
* @param options.startScale=0.5 {number} 初始比例
|
||||
@ -35,15 +34,8 @@ class Flame extends Base {
|
||||
* @param options.lng 经度
|
||||
* @param options.lat 纬度
|
||||
* @param options.alt 高度
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -17,10 +17,9 @@ class Fountain extends Base {
|
||||
* @description 喷泉特效
|
||||
* @param sdk
|
||||
* @param options {object} 粒子属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string} 贴图地址
|
||||
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
|
||||
* @param options.startColor="#c1f7f24d" {string} 起始颜色
|
||||
* @param options.endColor="#ffffff00" {string} 结束颜色
|
||||
* @param options.startScale=1 {number} 初始比例
|
||||
@ -31,18 +30,12 @@ class Fountain extends Base {
|
||||
* @param options.maximumParticleLife=7 {number} 最大存在时间(秒)
|
||||
* @param options.emissionRate=20 {number} 发射速率(个/每秒)
|
||||
* @param options.particleSize=0.5{number} 粒子尺大小
|
||||
* @param options.gravity=-3.5{number} 重力值
|
||||
* @param options.lng 经度
|
||||
* @param options.lat 纬度
|
||||
* @param options.alt 高度
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
@ -57,7 +50,7 @@ class Fountain extends Base {
|
||||
this.options.maximumSpeed = options.maximumSpeed || 9.5
|
||||
this.options.emissionRate = options.emissionRate || 20
|
||||
this.options.particleSize = options.particleSize || 0.5
|
||||
// this.options.gravity = (options.gravity || options.gravity === 0) ? options.gravity : -3.5
|
||||
this.options.gravity = (options.gravity || options.gravity === 0) ? options.gravity : -3.5
|
||||
this.options.show = options.show === false ? false : true
|
||||
this._elms = {};
|
||||
this.positionCallBack = null
|
||||
|
@ -17,10 +17,9 @@ class Smoke extends Base {
|
||||
* @description 烟雾特效
|
||||
* @param sdk
|
||||
* @param options {object} 粒子属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string} 贴图地址
|
||||
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
|
||||
* @param options.startColor="#00000000" {string} 起始颜色
|
||||
* @param options.endColor="#0000001a" {string} 结束颜色
|
||||
* @param options.startScale=0.1 {number} 初始比例
|
||||
@ -34,15 +33,8 @@ class Smoke extends Base {
|
||||
* @param options.lng 经度
|
||||
* @param options.lat 纬度
|
||||
* @param options.alt 高度
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -16,10 +16,9 @@ class Spout extends Base {
|
||||
* @description 水柱
|
||||
* @param sdk
|
||||
* @param options {object} 粒子属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.url {string} 贴图地址
|
||||
* @param options.url {string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement} 指定 Image、URL或Canvas 的属性
|
||||
* @param options.startColor="#c1f7f2" {string} 起始颜色
|
||||
* @param options.endColor="#ffffff00" {string} 结束颜色
|
||||
* @param options.startScale=0.2 {number} 初始比例
|
||||
@ -29,8 +28,8 @@ class Spout extends Base {
|
||||
* @param options.maximumParticleLife=12 {number} 最大存在时间(秒)
|
||||
* @param options.emissionRate=100 {number} 发射速率(个/每秒)
|
||||
* @param options.particleSize=1 {number} 粒子尺大小
|
||||
* @param options.heading 航向角
|
||||
* @param options.pitch 俯仰角
|
||||
* @param options.heading 朝向
|
||||
* @param options.pitch 俯仰角度
|
||||
* @param options.start {object} 开始位置
|
||||
* @param options.start.lng 经度
|
||||
* @param options.start.lat 纬度
|
||||
@ -39,15 +38,8 @@ class Spout extends Base {
|
||||
* @param options.end.lng 经度
|
||||
* @param options.end.lat 纬度
|
||||
* @param options.end.alt 高度
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -22,56 +22,14 @@ class PincerArrowObject extends Base {
|
||||
* @param sdk
|
||||
* @description 双箭头
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color='rgba(255, 0, 0, 0.5)' {string} 颜色
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.spreadState=false {boolean} 动画
|
||||
* @param options.loop=false {loop} 动画重复
|
||||
* @param options.spreadTime=3000 {number} 动画持续时长(毫秒)
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -19,8 +19,8 @@ import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Gl
|
||||
class PolygonObject extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @description 多边形
|
||||
* @param sdk
|
||||
* @description 多边形
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
@ -28,51 +28,11 @@ class PolygonObject extends Base {
|
||||
* @param options.color='rgba(255, 0, 0, 0.5)' {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*
|
||||
|
||||
|
||||
*
|
||||
* @param {Array.<object>} options.positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
|
@ -26,44 +26,9 @@ class PolyhedronObject extends Base {
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color="#ff0000" {string} 颜色
|
||||
* @param options.height=10 {number} 高
|
||||
* @param options.areaUnit='平方米' {string} 投影面积单位
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param {Array.<object>} options.positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -25,46 +25,28 @@ class PolylineObject extends Base {
|
||||
* @description 折线
|
||||
* @param options {object} 线属性
|
||||
* @param options.name{string} 名称
|
||||
* @param options.width=3{number} 线宽
|
||||
* @param options.width * @param options.width=3{number} 线宽
|
||||
* @param options.color=#ff0000 {string} 颜色
|
||||
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光...
|
||||
* @param options.type=0 {number} 材质类型 0-实线 1-虚线 2-泛光
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对高度;2:依附模式)
|
||||
* @param options.noseToTail=false {boolean} 首尾相连
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
* @param options.smooth=false {boolean} 线段圆滑
|
||||
* @param options.extend=false {boolean} 线缓冲
|
||||
* @param options.extendWidth=10 {number} 线缓冲宽度
|
||||
* @param options.extendColor=rgba(255,255,80,0.3) {number} 线缓冲颜色
|
||||
* @param options['extend-width']=10 {number} 线缓冲宽度
|
||||
* @param options['extend-color']=rgba(255,255,80,0.3) {number} 线缓冲颜色
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {string} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
*
|
||||
*
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lng,lat},...]
|
||||
* @param options.label {object} 标注
|
||||
* @param options.label.show=false {boolean} 标注显隐
|
||||
* @param options.label.fontSize=20 {number} 标注字体大小
|
||||
* @param options.label.color=#ffffff {string} 标注字体颜色
|
||||
* @param options.label.lineWidth=1 {number} 标注引线宽
|
||||
* @param options.label.pixelOffset=20 {string} 标注引线长度
|
||||
* @param options.label.backgroundColor=['#42c6ef', '#42c6ef'] {Array} 标注背景
|
||||
* @param options.label.lineColor=#fff000 {string} 标注引线颜色
|
||||
* @param options.label.scaleByDistance=false {boolean} 标注是否随视野缩放
|
||||
* @param options.label.near=2000 {boolean} 标注随视野缩放最近距离
|
||||
* @param options.label.far=100000 {boolean} 标注随视野缩放最远距离
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
|
@ -20,44 +20,14 @@ class RadarScan extends Base {
|
||||
* @param sdk
|
||||
* @param options {object} 圆属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param [options.show=true] {boolean} 显示/隐藏
|
||||
* @param options.lng {number} 经度
|
||||
* @param options.lat {number} 维度
|
||||
* @param options.color=#FFEB3B {string} 颜色
|
||||
* @param options.color=#1FA8E3 {string} 颜色
|
||||
* @param options.radius=10 {number} 半径
|
||||
* @param options.speed=20 {number} 速度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
*/
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -23,46 +23,16 @@ class RadarScanStereoscopic extends Base {
|
||||
* @param sdk
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param [options.show=true] {boolean} 显示/隐藏
|
||||
* @param options.lng {number} 经度
|
||||
* @param options.lat {number} 纬度
|
||||
* @param options.alt {number} 高度
|
||||
* @param options.colorOut=rgba(255,255,0,0.3){string} 范围颜色
|
||||
* @param options.colorIn=rgba(255,0,0,0.3){string} 扫描颜色
|
||||
* @param options.colorOut=#ff0000 {string} 范围颜色
|
||||
* @param options.colorIn=#ff0000 {string} 扫描颜色
|
||||
* @param options.radius=10 {number} 半径
|
||||
* @param options.duration=2000 {number} 持续时间
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
*/
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -19,56 +19,22 @@ class SectorObject extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @description 创建扇形
|
||||
* @param sdk
|
||||
* @param options {object} 扇形属性
|
||||
* @param options.id {string} 标注id
|
||||
* @param options.name {string} 名称
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.color="rgba(255, 0, 0, 0.5)" {string} 颜色
|
||||
* @param options.center {object} 位置
|
||||
* @param options.center.lng {number} 经度
|
||||
* @param options.center.lat {number} 纬度
|
||||
* @param options.center.alt {number} 高度
|
||||
* @param options.center.lng {object} 经度
|
||||
* @param options.center.lat {object} 维度
|
||||
* @param options.radius=10 {number} 半径
|
||||
* @param options.startAngle=10 {number} 起始方向
|
||||
* @param options.endAngle=0 {number} 结束方向
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=3 {number} 边框宽
|
||||
* @param options.line.width=3 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param options.label {object} 标注
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
*/
|
||||
constructor(sdk, options = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -22,56 +22,14 @@ class StraightArrowObject extends Base {
|
||||
* @param sdk
|
||||
* @description 直线箭头
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.name {string} 名称
|
||||
* @param options.color='rgba(255, 0, 0, 0.5)' {string} 颜色
|
||||
* @param options.color="#ff000080" {string} 颜色
|
||||
* @param options.height {number} 高度
|
||||
* @param options.heightMode=2{number} 高度模式(0:海拔高度;1:相对地表;2:依附模式)
|
||||
* @param options.areaUnit='平方米' {string} 面积单位
|
||||
* @param options.line {object} 边框
|
||||
* @param options.line.width=2 {string} 边框宽
|
||||
* @param options.line.color="rgba(155, 155, 124, 0.89)" {string} 边框颜色
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.spreadState=false {boolean} 动画
|
||||
* @param options.loop=false {loop} 动画重复
|
||||
* @param options.spreadTime=3000 {number} 动画持续时长(毫秒)
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param options.attribute.link={} {object} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param {Array.<object>} options.positions 坐标数组 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -33,7 +33,7 @@ class TextBox extends Base {
|
||||
|
||||
this.callback = callback
|
||||
|
||||
// syncData(this.sdk, this.options.id)
|
||||
syncData(this.sdk, this.options.id)
|
||||
|
||||
}
|
||||
|
||||
@ -134,15 +134,17 @@ class TextBox extends Base {
|
||||
}
|
||||
async getwords(words) {
|
||||
this.options.text = words
|
||||
this.callback(this.options)
|
||||
|
||||
let { sdkP } = getSdk()
|
||||
if (this.sdk === sdkP && sdkP) {//三维
|
||||
this.callback(this.options)
|
||||
syncData(this.sdk, this.options.id)
|
||||
}
|
||||
else if (sdkP) {//二维
|
||||
sdkP.entityMap.get(this.options.id).text = words
|
||||
sdkP.entityMap.get(this.options.id).twoToThree(this.options.position)
|
||||
} else if (!sdkP) {
|
||||
this.callback(this.options)
|
||||
syncData(this.sdk, this.options.id)
|
||||
}
|
||||
}
|
||||
@ -283,6 +285,7 @@ class TextBox extends Base {
|
||||
this.sdk.viewer.cesiumWidget.container.removeChild(this.textDom);
|
||||
}
|
||||
await this.sdk.removeIncetance(this.options.id)
|
||||
syncData(this.sdk, this.options.id)
|
||||
}
|
||||
|
||||
flicker() { }
|
||||
|
@ -14,27 +14,14 @@ class GroundText extends Base {
|
||||
* @param sdk
|
||||
* @description 贴地文字
|
||||
* @param options {object} 属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显示/隐藏
|
||||
* @param options.text {string} 文字
|
||||
* @param options.angle=0 {number} 旋转角度
|
||||
* @param options.scale=1 {number} 缩放比例
|
||||
* @param options.speed=1 {number} 文字滚动速度
|
||||
* @param {object} options.position 位置
|
||||
* @param {number} options.position.lng 经度
|
||||
* @param {number} options.position.lat 纬度
|
||||
* @param {object} options.positions 坐标集[{lon,lat}]仅在未定义 position 时有效
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param options.scale=1 {number} 比例
|
||||
* @param {object} options.position 经纬度{lon,lat}
|
||||
* @param {object} options.positions 经纬度集[{lon,lat}]仅在未定义 position 时有效
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options)
|
||||
|
@ -16,23 +16,12 @@ class StandText extends Base {
|
||||
* @param sdk
|
||||
* @description 立体文字
|
||||
* @param options {object}
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.text {string} 文字
|
||||
* @param options.color="#FFC107" {string} 颜色
|
||||
* @param options.speed=1 {number} 文字移动速度
|
||||
* @param {Array.<object>} positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -187,7 +187,7 @@ function html() {
|
||||
<div class="col">
|
||||
<span class="label">油耗</span>
|
||||
<div class="input-number input-number-unit-6" style="width: 170px;">
|
||||
<input class="input" type="number" title="" min="1" max="99999999" @model="unitFuelConsumption">
|
||||
<input class="input" type="number" title="" min="0" max="99999999" @model="unitFuelConsumption">
|
||||
<span class="unit">L/100km</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
|
@ -23,9 +23,7 @@ class TrajectoryMotion extends Base {
|
||||
/**
|
||||
* @constructor
|
||||
* @description 轨迹运动
|
||||
* @param sdk
|
||||
* @param options {object}
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.name {string} 名称
|
||||
* @param options.speed=1 {number} 运行速度
|
||||
* @param options.delay=0 {number} 运动延迟时间(毫秒)
|
||||
@ -35,41 +33,22 @@ class TrajectoryMotion extends Base {
|
||||
* @param options.state=true {boolean} 模型运动
|
||||
* @param options.routeDirection=true {boolean} 路径方向
|
||||
* @param options.viewFollow=false {boolean} 视角跟随
|
||||
* @param options.realTimeRoute=false {boolean} 实时路径
|
||||
* @param options.model {object} 模型参数
|
||||
* @param options.model.show=true {boolean} 模型显隐
|
||||
* @param options.model.url {string} 模型地址
|
||||
* @param options.model.url {url} 模型地址
|
||||
* @param options.model.pixelSize=70 {number} 模型像素大小
|
||||
* @param options.model.heading=0 {number} 模型航向角
|
||||
* @param options.model.pitch=0 {number} 模型俯仰角
|
||||
* @param options.model.roll=0 {number} 模型翻滚角
|
||||
* @param options.model.heading=0 {number}
|
||||
* @param options.model.pitch=0 {number}
|
||||
* @param options.model.roll=0 {number}
|
||||
* @param options.model.scale=1 {number} 模型比例
|
||||
* @param options.model.animate {string} 模型动画
|
||||
* @param options.line {object} 路径参数
|
||||
* @param options.line.show=true {boolean} 路径显隐
|
||||
* @param options.line.smooth=false {boolean} 路径圆滑
|
||||
* @param options.line.noseToTail=false {boolean} 路径首尾相联
|
||||
* @param options.line.noseToTail=false {boolean} 路径收尾相联
|
||||
* @param {Array.<object>} options.line.positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
@ -2345,7 +2324,7 @@ class TrajectoryMotion extends Base {
|
||||
this.model && (this.model.show = false)
|
||||
}
|
||||
this.labelShow = this.originalOptions.label.show
|
||||
this.fuelLabelShow = this.originalOptions.fuelShow
|
||||
this.fuelShow = this.originalOptions.fuelShow
|
||||
this.labelColor = this.originalOptions.label.color
|
||||
this.labelFontSize = this.originalOptions.label.fontSize
|
||||
this.labelFontFamily = this.originalOptions.label.fontFamily
|
||||
|
@ -29,47 +29,13 @@ class WallRealStereoscopic extends Base {
|
||||
* @param options.color="#ffffff" {string} 颜色
|
||||
* @param options.width=0.24 {number} 宽
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param options.noseToTail=false {boolean} 首尾相连
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
* @param options.extrudedHeight=2.4 {number} 拉伸高度
|
||||
* @param options.cornerType=0 {string} 拐角类型;0:直角;1:斜角;2:圆角
|
||||
* @param options.material=0 {number} 材质,0:纯色墙;1:红砖;2:黄砖;3:灰瓷
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param {Array.<object>} positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -23,46 +23,12 @@ class WallStereoscopic extends Base {
|
||||
* @param options.color="#00d9ff" {string} 颜色
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param options.extrudedHeight=2.4 {number} 拉伸高度
|
||||
* @param options.noseToTail=false {boolean} 首尾相连
|
||||
* @param options['nose-to-tail']=false {boolean} 首尾相连
|
||||
* @param options.material=0 {number} 材质,0:纯色墙;1:上升墙;2:箭头墙;3:警戒墙
|
||||
* @param options.duration=1000 {number} 持续时间
|
||||
* @param {Array.<object>} options.positions 必填,经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.label {object} 标签对象
|
||||
* @param options.label.text {string} 标签文本
|
||||
* @param options.label.show {string} 标签显隐
|
||||
* @param options.label.position {string} 标签位置
|
||||
* @param options.label.position {object} 标签位置
|
||||
* @param options.label.position.lng {number} 经度
|
||||
* @param options.label.position.lat {number} 纬度
|
||||
* @param options.label.position.alt {number} 高度
|
||||
* @param options.label.fontSize=20 {number} 字体大小
|
||||
* @param options.label.fontFamily=0 {number} 字体项 0:黑体;1:思源黑体;2:庞门正道标题体;3:数黑体
|
||||
* @param options.label.color=#ffffff {string} 字体颜色
|
||||
* @param options.label.lineWidth=4 {number} 引线宽
|
||||
* @param options.label.lineColor=#00ffff80 {string} 引线颜色
|
||||
* @param options.label.pixelOffset=20 {number} 字体偏移(引线长度)
|
||||
* @param options.label.backgroundColor=['#00ffff80', '#00ffff80'] {array} 背景颜色
|
||||
* @param options.label.scaleByDistance {boolean} 距离缩放
|
||||
* @param options.label.near=2000 {number} 视野缩放最近距离
|
||||
* @param options.label.far=100000 {number} 视野缩放最远距离
|
||||
* @param options.attribute {object} 属性内容
|
||||
* @param {object} options.attribute.link={} 链接
|
||||
* @param options.attribute.link.content=[]] {array} 链接内容
|
||||
* @param options.attribute.link.content[].name {string} 链接名称
|
||||
* @param options.attribute.link.content[].url {string} 链接地址
|
||||
* @param options.richTextContent {string} 富文本内容
|
||||
* @param options.customView {object} 默认视角
|
||||
* @param options.customView.orientation {object} 默认视角方位
|
||||
* @param options.customView.orientation.heading {number} 航向角
|
||||
* @param options.customView.orientation.pitch {number} 俯仰角
|
||||
* @param options.customView.orientation.roll {number} 翻滚角
|
||||
* @param options.customView.relativePosition {object} 视角相对位置
|
||||
* @param options.customView.relativePosition.lng {number} 经度
|
||||
* @param options.customView.relativePosition.lat {number} 纬度
|
||||
* @param options.customView.relativePosition.alt {number} 高度
|
||||
* @param {Array.<object>} positions 经纬度和高度的列表,值交替 [{lon,lat,alt},...]
|
||||
* @param _Dialog {object} 弹框事件
|
||||
* @param _Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -15,17 +15,14 @@ class WaterSurface extends Base {
|
||||
* @param sdk
|
||||
* @description 水面
|
||||
* @param options {object} 面属性
|
||||
* @param options.id {string} 唯一标识
|
||||
* @param options.show=true {boolean} 显隐
|
||||
* @param options.name=未命名对象 {string} 名称
|
||||
* @param {Array.<object>} options.positions 坐标列表
|
||||
* @param options.positions[].lng {number} 经度
|
||||
* @param options.positions[].lat {number} 纬度
|
||||
* @param options.positions[].alt {number} 高度
|
||||
* @param options.positions {Array.<{lng:number, lat:number, alt:number}>} 坐标数组
|
||||
* @param options.color=rgba(32,67,135,0.5) {string} 颜色
|
||||
* @param options.frequency=10 {number} 频率
|
||||
* @param options.animationSpeed=1 {number} 动画速度
|
||||
* @param options.frequency=100 {number} 频率
|
||||
* @param options.animationSpeed=0.02 {number} 动画速度
|
||||
* @param options.amplitude=10 {number} 振幅
|
||||
* @param Dialog {object} 弹框对象
|
||||
* @param Dialog.confirmCallBack {function} 弹框确认时的回调
|
||||
* */
|
||||
constructor(sdk, options = {}, _Dialog = {}) {
|
||||
super(sdk, options);
|
||||
|
@ -441,10 +441,14 @@ class YJEarth {
|
||||
textList[i].querySelector('textarea').focus()
|
||||
_this.isLeftClick = true
|
||||
_this.entityMap.get(_this.clickTextDom.id).isClick(movement.position, _this.clickTextDom.id)
|
||||
|
||||
_this.blurFun = () => {
|
||||
_this.entityMap.get(_this.clickTextDom.id).isClick((movement && movement.position) || null, _this.clickTextDom.id)
|
||||
// let { sdkP } = getSdk()
|
||||
// if (_this == sdkP && sdkP) {//二维
|
||||
// _this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
||||
// } else if (!sdkP) {
|
||||
_this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
||||
// }
|
||||
_this.clickTextDom.querySelector('textarea').removeEventListener('blur', _this.blurFun)
|
||||
}
|
||||
_this.clickTextDom.querySelector('textarea').addEventListener('blur', _this.blurFun)
|
||||
break;
|
||||
@ -468,7 +472,7 @@ class YJEarth {
|
||||
click = true
|
||||
}
|
||||
mousemove = function (e) {
|
||||
if (!click) {
|
||||
if (!click || !_this.clickTextDom) {
|
||||
return
|
||||
}
|
||||
let width = _this.clickTextDom.clientWidth * 1
|
||||
@ -501,7 +505,7 @@ class YJEarth {
|
||||
_this.clickTextDom.removeEventListener('mousedown', mousedown);
|
||||
_this.viewer._element.removeEventListener('mousemove', mousemove);
|
||||
_this.viewer._element.removeEventListener('mouseup', mouseup);
|
||||
_this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
||||
// _this.entityMap.get(_this.clickTextDom.id).getwords(_this.clickTextDom.getElementsByTagName('textarea')[0].value)
|
||||
|
||||
_this.clickTextDom.style['pointer-events'] = 'none'
|
||||
_this.clickTextDom = undefined
|
||||
|
Reference in New Issue
Block a user