| | |
| | | backgroundIcon: VITE_APP_BASE + 'img/mapicon/fxy.png', |
| | | showPanel: false, |
| | | layerName: 'fxyOrdinary', |
| | | incident: (e) => { |
| | | const { attrParams } = e.overlay |
| | | // 删除 |
| | | destroy() |
| | | addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPupoLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <li>${attrParams.firmName || ''}</li> |
| | | <li>${attrParams.riskLevelName || ''}</li> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, 64), |
| | | `<div class="public-map-popup-three"> |
| | | ${iconEl} |
| | | </div>` |
| | | ) |
| | | let incident = () => { |
| | | destroy() |
| | | } |
| | | divIcon.on(DC.MouseEventType.CLICK, incident) |
| | | addPupoLayers[attrParams.name].addOverlay(divIcon) |
| | | } |
| | | }, |
| | | { |
| | | id: '4-2', |
| | |
| | | backgroundIcon: VITE_APP_BASE + 'img/mapicon/fxy.png', |
| | | showPanel: false, |
| | | layerName: 'fxyLarger', |
| | | incident: (e) => { |
| | | const { attrParams } = e.overlay |
| | | // 删除 |
| | | destroy() |
| | | // if (!attrParams.imageUrl) { |
| | | // return |
| | | // } |
| | | // addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | // window.$viewer.addLayer(addPupoLayers[attrParams.name]) |
| | | // let iconEl = `<div class="marsBlueGradientPnl"> |
| | | // <div>${attrParams.fullName}</div> |
| | | // <img src="${attrParams.imageUrl}" width="160" height="160" /> |
| | | // </div>` |
| | | // let divIcon = new DC.DivIcon( |
| | | // new DC.Position(attrParams.lng, attrParams.lat, 64), |
| | | // `<div class="public-map-popup-two"> |
| | | // ${iconEl} |
| | | // </div>` |
| | | // ) |
| | | // let incident = () => { |
| | | // destroy() |
| | | // } |
| | | // divIcon.on(DC.MouseEventType.CLICK, incident) |
| | | // addPupoLayers[attrParams.name].addOverlay(divIcon) |
| | | |
| | | // 删除 |
| | | destroy() |
| | | addPupoLayers[attrParams.name] = new DC.HtmlLayer(attrParams.name) |
| | | window.$viewer.addLayer(addPupoLayers[attrParams.name]) |
| | | let iconEl = `<div class="marsBlueGradientPnl"> |
| | | <li>${attrParams.firmName || ''}</li> |
| | | <li>${attrParams.riskLevelName || ''}</li> |
| | | </div>` |
| | | let divIcon = new DC.DivIcon( |
| | | new DC.Position(attrParams.lng, attrParams.lat, 64), |
| | | `<div class="public-map-popup-three"> |
| | | ${iconEl} |
| | | </div>` |
| | | ) |
| | | let incident = () => { |
| | | destroy() |
| | | } |
| | | divIcon.on(DC.MouseEventType.CLICK, incident) |
| | | addPupoLayers[attrParams.name].addOverlay(divIcon) |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | |
| | | window.addTileLayers[item.layerName] = new DC.VectorLayer(item.layerName) |
| | | window.$viewer.addLayer(window.addTileLayers[item.layerName]) |
| | | |
| | | function computeCircle (radius) { |
| | | function computeCircle(radius) { |
| | | var positions = [] |
| | | for (var i = 0; i < 360; i++) { |
| | | var radians = DC.Math.toRadians(i) |
| | |
| | | }) |
| | | } |
| | | |
| | | function findObjectById (data, id) { |
| | | function findObjectById(data, id) { |
| | | // 遍历数据数组 |
| | | for (let i = 0; i < data.length; i++) { |
| | | const item = data[i] |
| | |
| | | // }); |
| | | |
| | | // 销毁 |
| | | function destroy () { |
| | | function destroy() { |
| | | let arr = Object.keys(addPupoLayers) |
| | | arr.filter(i => i != 'hgyq').forEach(i => { |
| | | addPupoLayers[i] && window.$viewer.removeLayer(addPupoLayers[i]) |