diff --git a/frontend/src/components/gis/mapurlManage.ts b/frontend/src/components/gis/mapurlManage.ts new file mode 100644 index 0000000..71390c0 --- /dev/null +++ b/frontend/src/components/gis/mapurlManage.ts @@ -0,0 +1,749 @@ +/** + * @author: yjw + * @date: 2022-11-17 + * @description: 后期建议本文件内容做到系统配置中 + */ + +// import { MemoryCache } from '@zebras/qgc-share/cache/MemoryCache' +// import { Session } from '@zebras/qgc-share/service/Session' + +export interface MapBaseUrlItem { + code: string + name: string + url: string +} + +export interface ServerConfigItem { + id?: string + key?: string + urlType: 'gisurl' | 'online' + url?: string + url_3d?: string + layers?: string + rasteropacity?: number + _layer?: string + imgUrl?: string + visible?: boolean + visibility?: boolean //?是否可以删除 + minZoom?: number + maxZoom?: number + fillOpacity?: number + lineWidth?: number + [name: string]: any +} + +const tdtToken = 'e90d56e5a09d1767899ad45846b0cefd' //企业版密钥,勿换e650f138c4481cca888cd13094bb9026 +const mapType = 'w' //c:天地图经纬度底图;w:天地图墨卡托底图 +const URL_TerTDT = `https://t0.tianditu.gov.cn/ter_${mapType}/wmts?tk=${tdtToken}` //terMap +// const URL_TerLabelTDT = `http://t0.tianditu.gov.cn/cta_${mapType}/wmts?tk=${tdtToken}` //terLabel +// const URL_VecTDT = `http://t0.tianditu.com/vec_${mapType}/wmts?tk=${tdtToken}` //vecMap +// const URL_VecLableTDT = `http://t0.tianditu.com/cva_${mapType}/wmts?tk=${tdtToken}` //vecLabel +const URL_ImgTDT = `http://t0.tianditu.com/img_${mapType}/wmts?tk=${tdtToken}` //imgMap +// const URL_ImgLableTDT = `http://t0.tianditu.com/cia_${mapType}/wmts?tk=${tdtToken}` + +// const znyMapUrl = "http://10.219.26.6:8050/" //中南院的测试地图环境 +// const djjtMapUrl = "http://210.72.227.199:18084/" //中南院的测试地图环境 +//TODO:以后改成在系统管理里面配置地图可视化范围 +export const location_map_maxlon = 126.8267 +export const location_map_maxlat = 38.5769 +export const location_map_minlon = 73.7443 +export const location_map_minlat = 16.32 +// todo: 以后从接口获取数据 +export const servers: Record | Record = { + // 省(自治区)界 + province_boundaries: { + id: 'province_boundaries', + key: 'province_boundaries', + urlType: 'gisurl', + // url: this.gisServers.gisurl + '/geoserver/qgc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=qgc%3Aprovinceline&exceptions=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3857&WIDTH=768&HEIGHT=620&bbox={bbox-epsg-3857}', + url: '/geoserver/qgc/wms?service=WMS&version=1.1.0&request=GetMap&layers=qgc:provinceline&styles=&bbox={bbox-epsg-3857}&width=768&height=620&srs=EPSG:3857&format=image%2Fpng&TRANSPARENT=true', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:provinceline&outputFormat=application%2Fjson&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:provinceline', + rasteropacity: 1, + minZoom: 0, + maxZoom: 21, + type: 'wms', + layerType: 'line', + lineWidth: 2, + visible: true + }, + //国界 + chinaBoundary: { + id: 'chinaBoundary', + key: 'chinaBoundary', + urlType: 'gisurl', + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Achina@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:china&maxFeatures=50&outputFormat=application%2Fjson&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:china', + _layer: 'china', + layerType: 'line', + minZoom: 0, + maxZoom: 16, + minHeight: 0, + maxHeight: 80000000, + rasteropacity: 1, + type: 'vector_Boundary', + paint: { + 'line-color': '#AAA4C5', + 'line-width': 3, + 'line-opacity': 0.9 + } + }, + //九段线 + nineSegmentLine: { + id: 'nineSegmentLine', + key: 'nineSegmentLine', + urlType: 'gisurl', + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Azh_island1@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + url_3d: '/geoserver/qgc/wms', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:zh_island1&maxFeatures=50&outputFormat=application%2Fjson&token= + `, + layers: 'qgc:zh_island1', + _layer: 'zh_island1', + layerType: 'line', + minZoom: 0, + maxZoom: 16, + minHeight: 0, + maxHeight: 80000000, + rasteropacity: 1, + type: 'vector_Boundary', + paint: { + 'line-color': '#AAA4C5', + 'line-width': 3, + 'line-opacity': 0.9 + } + }, + // 基础图层 + BaseLayer: { + 'BASEMAP-img': { + type: 'raster-dem', + urlType: 'online', + url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}' + `&token=`, + url_3d: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}' + `&token=`, + _layer: 'img', + visible: false, + maxzoom: 20 + }, + 'BASEMAP-white': { + urlType: 'online', + type: 'raster-dem', + url: `${URL_TerTDT}&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ter&STYLE=default&TILEMATRIXSET=${mapType}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=tiles&token= + `, + url_3d: URL_TerTDT + `&token=`, + _layer: 'ter', + visible: false, + maxzoom: 14 + } + }, + // 区|县 + county: { + id: 'county', + key: 'county', + urlType: 'gisurl', + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Acounty@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:county&outputFormat=application%2Fjson&token=`, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:county', + _layer: 'county', + rasteropacity: 0.5, + imgUrl: '/zfile/qgc/icons/map-xzXian.png', + minZoom: 8, + maxZoom: 16, + minHeight: 0, + maxHeight: 800000, + type: 'vector', + layerType: 'symbol', + visible: true + }, + //县注记 + county_lable: { + id: 'county_lable', + key: 'county_lable', + urlType: 'gisurl', + // url: this.gisServers.gisurl + '/geoserver/qgc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=qgc%3Aprovinceline&exceptions=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3857&WIDTH=768&HEIGHT=620&bbox={bbox-epsg-3857}', + url: '/geoserver/qgc/wms?service=WMS&version=1.1.0&request=GetMap&layers=qgc:countyAno&styles=&bbox={bbox-epsg-3857}&width=768&height=620&srs=EPSG:3857&format=image%2Fpng&TRANSPARENT=true', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:countyAno&outputFormat=application%2Fjso&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:countyAno', + _layer: 'countyAno', + rasteropacity: 1, + minZoom: 8, + maxZoom: 16, + minHeight: 0, + maxHeight: 800000, + type: 'wms', + layerType: 'symbol', + visible: true + }, + + // 市 + city: { + id: 'city', + key: 'city', + urlType: 'gisurl', + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Acity@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:city&outputFormat=application%2Fjson&token=`, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:city', + _layer: 'city', + rasteropacity: 0.5, + imgUrl: '/zfile/qgc/icons/map-xzShi.png', + minZoom: 5, + maxZoom: 8, + minHeight: 800000, + maxHeight: 1200000, + type: 'vector', + layerType: 'symbol', + visible: false + }, + //市注记 + city_lable: { + id: 'city_lable', + key: 'city_lable', + urlType: 'gisurl', + // url: this.gisServers.gisurl + '/geoserver/qgc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=qgc%3Aprovinceline&exceptions=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3857&WIDTH=768&HEIGHT=620&bbox={bbox-epsg-3857}', + url: '/geoserver/qgc/wms?service=WMS&version=1.1.0&request=GetMap&layers=qgc:cityAno&styles=&bbox={bbox-epsg-3857}&width=768&height=620&srs=EPSG:3857&format=image%2Fpng&TRANSPARENT=true', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:cityAno&outputFormat=application%2Fjson&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:cityAno', + _layer: 'cityAno', + rasteropacity: 1, + minZoom: 5, + maxZoom: 8, + minHeight: 800000, + maxHeight: 1200000, + type: 'wms', + layerType: 'symbol', + visible: true + }, + // 省 + provincial_capital: { + id: 'provincial_capital', + key: 'provincial_capital', + urlType: 'gisurl', + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Aprovincecity@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:provincecity&outputFormat=application%2Fjson&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:provincecity', + _layer: 'provincecity', + rasteropacity: 0.5, + imgUrl: '/zfile/qgc/icons/map-xzSheng.png', + visible: true, + minZoom: 0, + maxZoom: 5, + minHeight: 1200000, + maxHeight: 99999999999, + type: 'vector', + layerType: 'symbol' + }, + //省注记 + province_lable: { + id: 'province_lable', + key: 'province_lable', + urlType: 'gisurl', + // url: this.gisServers.gisurl + '/geoserver/qgc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=qgc%3Aprovinceline&exceptions=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3857&WIDTH=768&HEIGHT=620&bbox={bbox-epsg-3857}', + url: '/geoserver/qgc/wms?service=WMS&version=1.1.0&request=GetMap&layers=qgc:provincecityAno&styles=&bbox={bbox-epsg-3857}&width=768&height=620&srs=EPSG:3857&format=image%2Fpng&TRANSPARENT=true', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:provincecityAno&outputFormat=application%2Fjson&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:provincecityAno', + _layer: 'provinceAno', + rasteropacity: 0.5, + minZoom: 0, + maxZoom: 5, + minHeight: 1200000, + maxHeight: 99999999999, + type: 'wms', + layerType: 'symbol', + visible: true + }, + baseImageLayerUrl: { + id: 'BaseLayer', + key: 'BaseLayer', + urlType: 'online', + url: 'http://t{s}.tianditu.gov.cn/img_w/wmts?tk=88735d6d9bbd5930f1b1c8b8df72e762&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}' + }, + WhiteBaseLayerUrl: { + id: 'BaseLayer', + key: 'BaseLayer', + urlType: 'online', + url: `https://t0.tianditu.gov.cn/ter_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ter&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=e6372a5333c4bac9b9ef6097453c3cd6&token= + ` + }, + + /** + * 电站基地 + */ + hydropBase: { + id: 'hydropBase', + key: 'hydropBase', + urlType: 'gisurl', + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3AstationEra1117@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:stationEra1117&maxFeatures=50&outputFormat=application/json&token= + `, + url_3d: '/geoserver/qgc/wms', + _layer: 'stationEra1117', + layers: 'qgc:stationEra1117', + rasteropacity: 0.5, + visible: true, + minZoom: 0, + maxZoom: 20, + type: 'vector', + layerType: 'fill', + paint: { + 'fill-color': '#f0dcda', + 'fill-opacity': 0.8, + 'fill-outline-color': '#dd7065' + } + }, + /** + * 电站基地配置 + */ + powerBaseStationLayerWFSUrl: { + id: 's_hydropBase_wfs', + key: 's_hydropBase_wfs', + urlType: 'gisurl', + url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:stationEra1117&maxFeatures=50&outputFormat=application/json&token= + `, + _layer: 'stationEra1117', + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:stationEra1117', + rasteropacity: 0.5, + visible: true, + minZoom: 0, + maxZoom: 20 + }, + + /** + * 电站基地配置 LM项目 + */ + powerBaseStationLayerWFSUrlOfLM: { + id: 's_hydropBase_wfs', + key: 's_hydropBase_wfs', + urlType: 'gisurl', + url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:stationEraLM&maxFeatures=50&outputFormat=application/json&token= + `, + _layer: 'stationEraLM', + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:stationEraLM', + rasteropacity: 0.5, + visible: true, + minZoom: 0, + maxZoom: 20 + }, + /** + * 河流连通性分析中河流水系配置 + */ + YLJ_LCJ_LayerWFSUrl: { + id: 'river_riverEvaTemp', + key: 'river_riverEvaTemp', + urlType: 'gisurl', + url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:ylj_lcj&maxFeatures=50&outputFormat=application%2Fjson&token= + `, + _layer: 'ylj_lcj', + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:ylj_lcj', + rasteropacity: 0.5, + visible: true, + minZoom: 0, + maxZoom: 20 + }, + + /** + * 水质水温渐变线配置 + */ + LCJ_WaterQuality_line: { + id: 'LCJ_WaterQuality_line', + key: 'LCJ_WaterQuality_line', + urlType: 'gisurl', + url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:lcj_waterquality_line&maxFeatures=50&outputFormat=application%2Fjson&token= + `, + _layer: 'lcj_waterquality_line', + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:lcj_waterquality_line', + rasteropacity: 0.5, + visible: true, + minZoom: 0, + maxZoom: 20 + }, + + /** + * 全国乡镇名称 + */ + NationalTownships: { + id: 'NationalTownships', + key: 'NationalTownships', + layerType: 'symbol', + isShowLabel: true, + urlType: 'gisurl', + url: `/geoserver/gwc/service/tms/1.0.0/qgc%3ANationalTownships@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf?token=`, + _layer: 'NationalTownships', + layers: 'qgc:NationalTownships', + visible: true, + minZoom: 10.5, + maxZoom: 18, + isOnlyAno: true, + type: 'vector', + layout_text: { + 'text-field': ['get', 'NAME'], + 'text-font': ['Open Sans Bold'], + 'text-size': 16, + 'text-anchor': 'top', + 'text-padding': 0, + 'text-max-width': 100, + 'text-ignore-placement': false, + 'text-allow-overlap': false, + visibility: 'visible' + }, + paint_text: { 'text-color': '#404040', 'text-halo-color': '#fff', 'text-halo-width': 2 }, + }, + + /** + * 一级流域 + */ + heliu1: { + id: 'heliu1', + key: 'heliu1', + urlType: 'gisurl', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:river1_line&maxFeatures=50&outputFormat=application/json&token= + `, + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Ariver1_line@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + url_3d: '/geoserver/qgc/wms', + _layer: 'river1_line', + layers: 'qgc:river1_line', + rasteropacity: 0.5, + visible: true, + minZoom: 0, + maxZoom: 18, + minHeight: 0, + maxHeight: 99999999999, + type: 'vector', + layerType: 'line', + paint: { + 'line-color': '#00A1E9', + 'line-width': 4, + 'line-opacity': 0.9 + } + }, + //一级河流注记 + heliu1_lable: { + id: 'heliu1_lable', + key: 'heliu1_lable', + urlType: 'gisurl', + // url: this.gisServers.gisurl + '/geoserver/qgc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=qgc%3Aprovinceline&exceptions=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3857&WIDTH=768&HEIGHT=620&bbox={bbox-epsg-3857}', + url: '/geoserver/qgc/wms?service=WMS&version=1.1.0&request=GetMap&layers=qgc:river1_lineAno&styles=&bbox={bbox-epsg-3857}&width=768&height=620&srs=EPSG:3857&format=image%2Fpng&TRANSPARENT=true', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:river1_lineAno&outputFormat=application%2Fjson&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:river1_lineAno', + _layer: 'river1_lineAno', + rasteropacity: 1, + minZoom: 0, + maxZoom: 18, + minHeight: 0, + maxHeight: 99999999999, + type: 'wms', + layerType: 'symbol', + visible: true + }, + + /** + * 二级流域 + */ + heliu2: { + id: 'heliu2', + key: 'heliu2', + urlType: 'gisurl', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:river2_line&maxFeatures=50&outputFormat=application/json&token= + `, + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Ariver2_line@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + url_3d: '/geoserver/qgc/wms', + _layer: 'river2_line', + layers: 'qgc:river2_line', + lineWidth: 2, + rasteropacity: 0.5, + visible: false, + minZoom: 4, + maxZoom: 18, + minHeight: 0, + maxHeight: 1200000, + type: 'vector', + layerType: 'line', + paint: { + 'line-color': '#00A1E9', + 'line-width': 3, + 'line-opacity': 0.9 + } + }, + //二级河流注记 + heliu2_lable: { + id: 'heliu2_lable', + key: 'heliu2_lable', + urlType: 'gisurl', + // url: this.gisServers.gisurl + '/geoserver/qgc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=qgc%3Aprovinceline&exceptions=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3857&WIDTH=768&HEIGHT=620&bbox={bbox-epsg-3857}', + url: '/geoserver/qgc/wms?service=WMS&version=1.1.0&request=GetMap&layers=qgc:river2_lineAno&styles=&bbox={bbox-epsg-3857}&width=768&height=620&srs=EPSG:3857&format=image%2Fpng&TRANSPARENT=true', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:river2_lineAno&outputFormat=application%2Fjson&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:river2_lineAno', + _layer: 'river2_lineAno', + rasteropacity: 1, + minZoom: 4, + maxZoom: 18, + minHeight: 0, + maxHeight: 1200000, + type: 'wms', + layerType: 'symbol', + visible: true + }, + /** + * 三级流域 + */ + heliu3: { + id: 'heliu3', + key: 'heliu3', + urlType: 'gisurl', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:river3_line&maxFeatures=50&outputFormat=application/json&token= + `, + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Ariver3_line@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + url_3d: '/geoserver/qgc/wms', + _layer: 'river3_line', + layers: 'qgc:river3_line', + lineWidth: 1, + rasteropacity: 0.5, + visible: false, + minZoom: 6, + maxZoom: 18, + minHeight: 0, + maxHeight: 800000, + type: 'vector', + layerType: 'line', + paint: { + 'line-color': '#00A1E9', + 'line-width': 2, + 'line-opacity': 0.9 + } + }, + //三级河流注记 + heliu3_lable: { + id: 'heliu3_lable', + key: 'heliu3_lable', + urlType: 'gisurl', + // url: this.gisServers.gisurl + '/geoserver/qgc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=qgc%3Aprovinceline&exceptions=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3857&WIDTH=768&HEIGHT=620&bbox={bbox-epsg-3857}', + url: '/geoserver/qgc/wms?service=WMS&version=1.1.0&request=GetMap&layers=qgc:river3_lineAno&styles=&bbox={bbox-epsg-3857}&width=768&height=620&srs=EPSG:3857&format=image%2Fpng&TRANSPARENT=true', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:river3_lineAno&outputFormat=application%2Fjson&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:river3_lineAno', + _layer: 'river3_lineAno', + rasteropacity: 1, + minZoom: 6, + maxZoom: 18, + minHeight: 0, + maxHeight: 800000, + type: 'wms', + layerType: 'symbol', + visible: true + }, + /** + * 四级流域 + */ + heliu4: { + id: 'heliu4', + key: 'heliu4', + urlType: 'gisurl', + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Ariver4_line@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + url_3d: '/geoserver/qgc/wms', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:river4_line&maxFeatures=8000&outputFormat=application%2Fjson&token= + `, + _layer: 'river4_line', + layers: 'qgc:river4_line', + visible: false, + minZoom: 8, + maxZoom: 18, + minHeight: 0, + maxHeight: 800000, + rasteropacity: 1, + type: 'vector', + layerType: 'line', + paint: { + 'line-color': '#00A1E9', + 'line-width': 1, + 'line-opacity': 0.9 + } + }, + //四级河流注记 + heliu4_lable: { + id: 'heliu4_lable', + key: 'heliu4_lable', + urlType: 'gisurl', + // url: this.gisServers.gisurl + '/geoserver/qgc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=qgc%3Aprovinceline&exceptions=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3857&WIDTH=768&HEIGHT=620&bbox={bbox-epsg-3857}', + url: '/geoserver/qgc/wms?service=WMS&version=1.1.0&request=GetMap&layers=qgc:river4_lineAno&styles=&bbox={bbox-epsg-3857}&width=768&height=620&srs=EPSG:3857&format=image%2Fpng&TRANSPARENT=true', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:river4_lineAno&outputFormat=application%2Fjson&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:river4_lineAno', + _layer: 'river4_lineAno', + rasteropacity: 1, + minZoom: 8, + maxZoom: 18, + minHeight: 0, + maxHeight: 800000, + type: 'wms', + layerType: 'symbol', + + visible: true + }, + /** + * 五级流域 - 水质等级图层 + */ + heliu5: { + id: 'heliu5', + key: 'heliu5', + urlType: 'gisurl', + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Ariver5_line@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + url_3d: '/geoserver/qgc/wms', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:river5_line&maxFeatures=8000&outputFormat=application%2Fjson&token= + `, + _layer: 'river5_line', + layers: 'qgc:river5_line', + visible: false, + minZoom: 8, + maxZoom: 18, + minHeight: 0, + maxHeight: 800000, + rasteropacity: 1, + type: 'vector', + layerType: 'line', + paint: { + 'line-color': '#00A1E9', + 'line-width': 1, + 'line-opacity': 0.9 + } + }, + //五级河流注记 + heliu5_lable: { + id: 'heliu5_lable', + key: 'heliu5_lable', + urlType: 'gisurl', + // url: this.gisServers.gisurl + '/geoserver/qgc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&STYLES&LAYERS=qgc%3Aprovinceline&exceptions=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A3857&WIDTH=768&HEIGHT=620&bbox={bbox-epsg-3857}', + url: '/geoserver/qgc/wms?service=WMS&version=1.1.0&request=GetMap&layers=qgc:river5_lineAno&styles=&bbox={bbox-epsg-3857}&width=768&height=620&srs=EPSG:3857&format=image%2Fpng&TRANSPARENT=true', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:river5_lineAno&outputFormat=application%2Fjson&token= + `, + url_3d: '/geoserver/qgc/wms', + layers: 'qgc:river5_lineAno', + _layer: 'river5_lineAno', + rasteropacity: 1, + minZoom: 8, + maxZoom: 18, + minHeight: 0, + maxHeight: 800000, + type: 'wms', + layerType: 'symbol', + visible: true + }, + //流域梯级图 + Tertiarybasin: { + id: 'Tertiarybasin', + key: 'Tertiarybasin', + urlType: 'gisurl', + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Anew_LiuYuThrLev@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + url_3d: '/geoserver/qgc/wms', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:new_LiuYuThrLev&outputFormat=application%2Fjson&token= + `, + _layer: 'new_LiuYuThrLev', + layers: 'qgc:new_LiuYuThrLev', + visible: true, + minZoom: 1, + maxZoom: 18, + minHeight: 0, + maxHeight: 800000, + rasteropacity: 0.8, + type: 'vector', + layerType: 'fill' + }, + // //鱼类栖息地 + // fishQxd: { + // id: 'fishQxd', + // key: 'fishQxd', + // urlType: 'gisurl', + // url: '/geoserver/gwc/service/tms/1.0.0/qgc%3Afish_qxd@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + // url_3d: '/geoserver/qgc/wms', + // geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:fish_qxd&outputFormat=application%2Fjson&token= + // `, + // _layer: 'fish_qxd', + // layers: 'qgc:fish_qxd', + // visible: true, + // minZoom: 0, + // maxZoom: 18, + // minHeight: 0, + // maxHeight: 80000000, + // rasteropacity: 0.9, + // type: 'vector', + // layerType: 'line', + // lineWidth: 2, + // paint: { + // 'line-color': '#A21C83', + // 'line-width': 4, + // 'line-opacity': 1 + // } + // }, + /** + * 水功能分区 + */ + WaterFunctionPartition: { + id: 'WaterFunctionPartition', + key: 'WaterFunctionPartition', + urlType: 'gisurl', + url: '/geoserver/gwc/service/tms/1.0.0/qgc%3AGNQ@EPSG%3A900913@pbf/{z}/{x}/{y}.pbf', + url_3d: '/geoserver/qgc/wms', + geojson_url: `/geoserver/qgc/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=qgc:GNQ&outputFormat=application%2Fjson&token=`, + _layer: 'GNQ', + layers: 'qgc:GNQ', + visible: true, + minZoom: 0, + maxZoom: 18, + minHeight: 0, + maxHeight: 8000000, + rasteropacity: 0.9, + type: 'vector', + layerType: 'line', + lineWidth: 2, + paint: { + 'line-color': '#A21C83', + 'line-width': 3, + 'line-opacity': 0 + } + } +} + +/** + * 获取Gis图层配置 + * @param key gis服务key + * @returns + */ +// export const getConfig = (key: string) => { +// const mapBaseUrls: Record = MemoryCache.get('mapBaseUrls') || {} +// if (Object.prototype.hasOwnProperty.call(servers, key)) { +// const r = { ...servers[key] } +// const { urlType } = r +// const baseUrlObj = mapBaseUrls[urlType as string] +// if (baseUrlObj) { +// r.url = baseUrlObj.url + r.url +// r.url_3d = baseUrlObj.url + r.url_3d +// if (r.geojson_url) { +// r.geojson_url = baseUrlObj.url + r.geojson_url +// } +// } +// return r +// } +// console.warn(`The gis config which key is ${key} not exist!`) +// return null +// } \ No newline at end of file