Browse Source

444

tags/v1.1.0^2
unknown 1 year ago
parent
commit
3b8b7a4275
1 changed files with 14 additions and 30 deletions
  1. +14
    -30
      src/views/dashboard/components/OneMap.vue

+ 14
- 30
src/views/dashboard/components/OneMap.vue View File

<air-info :data="airDetail" /> <air-info :data="airDetail" />
</div> </div>
<div <div
v-show="problemPopupShow"
id="problemOverlay" id="problemOverlay"
class="problem-overlay" class="problem-overlay"
> >
airportFontStyle: { airportFontStyle: {
'color': '#1890FF' 'color': '#1890FF'
}, },
problemPopupShow: false,
tabIndex: 1, tabIndex: 1,
page: ref(1), page: ref(1),
pageCount: 0, pageCount: 0,
url: 'https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=f634525a82da65f715d168d7ba1899c0' url: 'https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=f634525a82da65f715d168d7ba1899c0'
}) })
}) })

var wmsSource = new Tile({
source: new TileWMS({
url: 'https://geoserver.t-aaron.com:4080/geoserver/jiangning/wms',
params: { 'LAYERS': 'jiangning:town' }
})
})
data.map = new Map({ data.map = new Map({
// 地图容器 // 地图容器
target: props.id, target: props.id,
maxZoom: 17 maxZoom: 17
}), }),
layers: [ layers: [
tdtImgMap,
new Tile({
source: new TileWMS({
url: 'https://geoserver.t-aaron.com:4080/geoserver/jiangning/wms',
params: { 'LAYERS': 'jiangning:town' }
})
})
// new TileLayer({
// source: new WMTS({

// url: 'https://geoserver.t-aaron.com:4080/geoserver/gwc/service/wmts',
// matrixSet: 'EPSG:4326',
// layer: 'jiangning-town',
// format: 'image/png',
// projection: projection,
// tileGrid: new WMTSTileGrid({
// origin: getTopLeft(projectionExtent),
// resolutions: resolutions,
// matrixIds: matrixIds
// }),
// style: 'default',
// wrapX: true
// })
// })
tdtImgMap

], ],
controls: control.defaults({ controls: control.defaults({
attribution: false, attribution: false,
}) })


}) })
// WMTS资源对象
var wmtsSource = new WMTS({
url: ''
})
data.map.addLayer(wmsSource)
wmsSource.setOpacity(0.3)
} }


/** /**
// console.log(data.problemDetail, '详情') // console.log(data.problemDetail, '详情')
const coord = feature.getProperties().coordinate const coord = feature.getProperties().coordinate
data.problemOverlay.setPosition(coord) data.problemOverlay.setPosition(coord)
data.problemPopupShow = true
data.map.addOverlay(data.problemOverlay) data.map.addOverlay(data.problemOverlay)


// data.problemOverlay.setPosition(coord) // data.problemOverlay.setPosition(coord)
const hideProblemInfo = () => { const hideProblemInfo = () => {
if (data.map.getOverlayById('problem_overlay')) { if (data.map.getOverlayById('problem_overlay')) {
data.problemDetail = {} data.problemDetail = {}
data.problemPopupShow = false
data.map.removeOverlay(data.problemOverlay) data.map.removeOverlay(data.problemOverlay)
} }
} }

Loading…
Cancel
Save