| | |
| | | for (const key in LeftNavLayer) { |
| | | if (LeftNavLayer[key] != null) { |
| | | LeftNavLayer[key].eachOverlay((item) => { |
| | | item.position = new global.DC.Position(Number(item.position.lng), Number(item.position.lat), 0) |
| | | if (item.attr.params.x && item.attr.params.x != '') { |
| | | const position = this.coordinate(item.attr.params.x) |
| | | item.position = new global.DC.Position(Number(position.lng), Number(position.lat), 0) |
| | | } else { |
| | | item.position = new global.DC.Position(Number(item.position.lng), Number(item.position.lat), 0) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | for (const key in LeftNavLayer) { |
| | | if (LeftNavLayer[key] != null) { |
| | | LeftNavLayer[key].eachOverlay((item) => { |
| | | item.position = new global.DC.Position(Number(item.position.lng), Number(item.position.lat), 150) |
| | | item.position = new global.DC.Position(Number(item.attr.params.jd), Number(item.attr.params.wd), 0) |
| | | }) |
| | | } |
| | | } |
| | |
| | | if (LeftNavLayer.leftTagLayer) { |
| | | LeftNavLayer.leftTagLayer.clear() |
| | | } |
| | | |
| | | getTagList().then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | const divIcon = new global.DC.DivIcon( |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | coordinate (item) { |
| | | const arr = item.split(',') |
| | | |
| | | return { |
| | | lng: arr[0], |
| | | lat: arr[1] |
| | | } |
| | | }, |
| | | |
| | | addIcons () { |
| | | if (this.closeMapClick) { |
| | | // 若正在加标签,退出 |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | generatePosition (num) { |
| | | const list = [] |
| | | for (let i = 0; i < num; i++) { |
| | |
| | | } |
| | | return list |
| | | }, |
| | | |
| | | leftNavClick (item) { |
| | | item.flag = !item.flag |
| | | if (item.flag == true) { |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | initialize () { |
| | | var that = this |
| | | global.viewer.scene.globe.depthTestAgainstTerrain = false |
| | |
| | | |
| | | getTagList().then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | let obj = {} |
| | | if (item.x && item.x != '') { |
| | | const position = that.coordinate(item.x) |
| | | obj = { |
| | | lng: position.lng, lat: position.lat |
| | | } |
| | | } else { |
| | | obj = { |
| | | lng: item.jd, lat: item.wd |
| | | } |
| | | } |
| | | |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), 0), |
| | | ` |
| | | <div class="tag-entitys-box"> |
| | | <div class="tag-content"> |
| | | ${item.mechanismname} |
| | | </div> |
| | | <div class="tag-angle-content"> |
| | | <img src="/img/icon/tarrow_xq.png"> |
| | | </div> |
| | | </div> |
| | | ` |
| | | <div class="tag-entitys-box"> |
| | | <div class="tag-content"> |
| | | ${item.mechanismname} |
| | | </div> |
| | | <div class="tag-angle-content"> |
| | | <img src="/img/icon/tarrow_xq.png"> |
| | | </div> |
| | | </div> |
| | | ` |
| | | ) |
| | | |
| | | divIcon.attr.params = item |
| | | |
| | | // 订阅事件 |
| | | divIcon.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | if (that.closeMapClick) { |
| | |
| | | } |
| | | // console.log(item, "see11111"); |
| | | that.openPopups({ |
| | | lng: e.overlay.position.lng, |
| | | lat: e.overlay.position.lat, |
| | | lng: Number(obj.lng), |
| | | lat: Number(obj.lat), |
| | | item: item |
| | | }) |
| | | }) |
| | |
| | | |
| | | getWayList().then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | let obj = {} |
| | | if (item.x && item.x != '') { |
| | | const position = that.coordinate(item.x) |
| | | obj = { |
| | | lng: position.lng, lat: position.lat |
| | | } |
| | | } else { |
| | | obj = { |
| | | lng: item.jd, lat: item.wd |
| | | } |
| | | } |
| | | |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), 0), |
| | | ` |
| | | <div class="way-entitys-box"> |
| | | <div class="way-title" style="border: white 1px solid; font-size: 0.875rem; background: #0066ff; width: 18px; line-height: 14px; padding: 6px 2px 6px 2px; color: white; text-align: center;"> |
| | | ${item.roadname} |
| | | </div> |
| | | <div class="way-sign-box"> |
| | | <img src="/img/icon/roadsign3.png"> |
| | | </div> |
| | | </div> |
| | | ` |
| | | <div class="way-entitys-box"> |
| | | <div class="way-title" style="border: white 1px solid; font-size: 0.875rem; background: #0066ff; width: 18px; line-height: 14px; padding: 6px 2px 6px 2px; color: white; text-align: center;"> |
| | | ${item.roadname} |
| | | </div> |
| | | <div class="way-sign-box"> |
| | | <img src="/img/icon/roadsign3.png"> |
| | | </div> |
| | | </div> |
| | | ` |
| | | ) |
| | | |
| | | divIcon.attr.params = item |
| | | |
| | | LeftNavLayer.leftWayLayer.addOverlay(divIcon) |
| | | }) |
| | | LeftNavLayer.leftWayLayer.show = false |
| | |
| | | |
| | | getMonitorList().then((res) => { |
| | | res.data.data.records.forEach((item) => { |
| | | let obj = {} |
| | | if (item.x && item.x != '') { |
| | | const position = that.coordinate(item.x) |
| | | obj = { |
| | | lng: position.lng, lat: position.lat |
| | | } |
| | | } else { |
| | | obj = { |
| | | lng: item.jd, lat: item.wd |
| | | } |
| | | } |
| | | |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), 0), |
| | | ` |
| | | <div class="monitor-entitys-box"> |
| | | <div>${item.vrname}</div> |
| | |
| | | </div> |
| | | ` |
| | | ) |
| | | |
| | | divIcon.attr.params = item |
| | | |
| | | divIcon.attrParams = item |
| | | LeftNavLayer.leftMonitorLayer.addOverlay(divIcon) |
| | | |
| | |
| | | |
| | | getSceneList().then((res) => { |
| | | res.data.data.records.forEach((item) => { |
| | | let obj = {} |
| | | if (item.x && item.x != '') { |
| | | const position = that.coordinate(item.x) |
| | | obj = { |
| | | lng: position.lng, lat: position.lat |
| | | } |
| | | } else { |
| | | obj = { |
| | | lng: item.jd, lat: item.wd |
| | | } |
| | | } |
| | | |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), 0), |
| | | ` |
| | | <div class="scene-entitys-box"> |
| | | <div>${item.vrname}</div> |
| | |
| | | </div> |
| | | ` |
| | | ) |
| | | |
| | | divIcon.attr.params = item |
| | | |
| | | divIcon.attrParams = item |
| | | LeftNavLayer.leftSceneLayer.addOverlay(divIcon) |
| | | |
| | |
| | | |
| | | getLifeList({ lifetype: 9 }).then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | let obj = {} |
| | | if (item.x && item.x != '') { |
| | | const position = that.coordinate(item.x) |
| | | obj = { |
| | | lng: position.lng, lat: position.lat |
| | | } |
| | | } else { |
| | | obj = { |
| | | lng: item.jd, lat: item.wd |
| | | } |
| | | } |
| | | |
| | | const label = new global.DC.Label( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), 0), |
| | | item.mechanismname |
| | | ) |
| | | |
| | | label.setStyle({ |
| | | fillColor: global.DC.Color.CRIMSON, |
| | | style: global.DC.Namespace.Cesium.LabelStyle.FILL_AND_OUTLINE, |
| | |
| | | font: '14px sans-serif', |
| | | pixelOffset: { x: 0, y: -24 } |
| | | }) |
| | | |
| | | label.attr.params = item |
| | | |
| | | LeftNavLayer.leftAedLayer.addOverlay(label) |
| | | |
| | | const billboard = new global.DC.Billboard( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), 0), |
| | | '/img/leftnav/map-aed.png' |
| | | ) |
| | | billboard.size = [20, 20] |
| | | |
| | | billboard.attr.params = item |
| | | |
| | | LeftNavLayer.leftAedLayer.addOverlay(billboard) |
| | | }) |
| | |
| | | |
| | | getLifeList({ lifetype: 11 }).then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | let obj = {} |
| | | if (item.x && item.x != '') { |
| | | const position = that.coordinate(item.x) |
| | | obj = { |
| | | lng: position.lng, lat: position.lat |
| | | } |
| | | } else { |
| | | obj = { |
| | | lng: item.jd, lat: item.wd |
| | | } |
| | | } |
| | | |
| | | const divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), 0), |
| | | ` |
| | | <div class="park-entitys-box"> |
| | | <div class="park-title" alt="${item.mechanismname}"> |
| | |
| | | </div> |
| | | ` |
| | | ) |
| | | |
| | | divIcon.attr.params = item |
| | | |
| | | LeftNavLayer.leftParkLayer.addOverlay(divIcon) |
| | | }) |
| | | LeftNavLayer.leftParkLayer.show = false |
| | |
| | | |
| | | getLifeList({ lifetype: 12 }).then((res) => { |
| | | res.data.data.forEach((item) => { |
| | | let obj = {} |
| | | if (item.x && item.x != '') { |
| | | const position = that.coordinate(item.x) |
| | | obj = { |
| | | lng: position.lng, lat: position.lat |
| | | } |
| | | } else { |
| | | obj = { |
| | | lng: item.jd, lat: item.wd |
| | | } |
| | | } |
| | | |
| | | const label = new global.DC.Label( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), 0), |
| | | item.mechanismname |
| | | ) |
| | | label.setStyle({ |
| | |
| | | font: '14px sans-serif', |
| | | pixelOffset: { x: 0, y: -40 } |
| | | }) |
| | | |
| | | label.attr.params = item |
| | | |
| | | LeftNavLayer.leftComeLayer.addOverlay(label) |
| | | |
| | | const billboard = new global.DC.Billboard( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), 0), |
| | | '/img/leftnav/map-activity.png' |
| | | ) |
| | | billboard.size = [20, 20] |
| | |
| | | pixelOffset: { x: 0, y: -16 } |
| | | }) |
| | | |
| | | billboard.attr.params = item |
| | | |
| | | LeftNavLayer.leftComeLayer.addOverlay(billboard) |
| | | }) |
| | | LeftNavLayer.leftComeLayer.show = false |
| | | }) |
| | | }, |
| | | |
| | | openPopups (value) { |
| | | var popup = new global.DC.DivForms(global.viewer, { |
| | | domId: 'divFormsDomBox', |