mcfxkh-Web/src/views/Home/MapCtrl/mapstyle/sources.js

181 lines
4.6 KiB
JavaScript
Raw Normal View History

2025-05-19 14:26:18 +08:00
import ContourLayer from "./contourlayer";
import RealDrpLayer from "./realdrplayer";
import RealHDLayer from "./realhdlayer";
import RealSkLayer from "./realsklayer";
import { DCPJ_TYPES } from "../../consts";
import WataLayer from "./watalayer";
import PlaneAreaLayer from "./planarealayer";
import YuwaiLayer from "./yuwailayer";
import PicStLayer from "./picstlayer";
import config from "../../../../config";
import PumpLayer from "./tmp/pumplayer";
import BxSkLayer from "./tmp/bxsk";
const hash = window.location.origin;
const sources = {
"mapbox-dem": {
'type': 'raster-dem',
'url': `${hash}/data/dem.json`,
'tileSize': 512,
'maxzoom': 12
},
"mapbox-demrgb": {
'type': 'raster-dem',
'url': `${hash}/data/dem.json`,
},
"mapbox-dom": {
'type': 'raster',
'tiles': [
`http://res3dstatic0.cloudowr.cn/${config.address}/dom2/{z}/{x}/{y}.png`,
`http://res3dstatic1.cloudowr.cn/${config.address}/dom2/{z}/{x}/{y}.png`,
`http://res3dstatic2.cloudowr.cn/${config.address}/dom2/{z}/{x}/{y}.png`,
`http://res3dstatic3.cloudowr.cn/${config.address}/dom2/{z}/{x}/{y}.png`,
`http://res3dstatic4.cloudowr.cn/${config.address}/dom2/{z}/{x}/{y}.png`,
`http://res3dstatic5.cloudowr.cn/${config.address}/dom2/{z}/{x}/{y}.png`,
`http://res3dstatic6.cloudowr.cn/${config.address}/dom2/{z}/{x}/{y}.png`,
`http://res3dstatic7.cloudowr.cn/${config.address}/dom2/{z}/{x}/{y}.png`,
],
'tileSize': 256,
'minzoom': 1,
'maxzoom': 18,
},
2025-05-21 09:17:19 +08:00
//热力图
"heatmapImg": {
'type': 'image',
'url': `${hash}/assets/bg.png`,
'coordinates': [
// 图片覆盖地图的四至点
[114.6710271999999929, 31.6068084090000987], // 左上
[115.4557823634995805, 31.6068084090000987], // 右上
[115.4907823634995805, 30.8713739500000008], // 右下
[114.7460271999999929, 30.8613739500000008], // 左下
],
},
2025-05-19 14:26:18 +08:00
"县界": {
"data": `${hash}/mapbox/geojson/县界.geojson`,
"type": "geojson"
},
"乡镇边界": {
"data": `${hash}/mapbox/geojson/乡镇边界.geojson`,
"type": "geojson"
},
"水系": {
"data": `${hash}/mapbox/geojson/水系.geojson`,
"type": "geojson"
},
"河流": {
"data": `${hash}/mapbox/geojson/RIVL.geojson`,
"type": "geojson"
},
"adcd": {
"data": `${hash}/data/adcd.geojson`,
"type": "geojson"
},
/*
"绿色区域": {
"data": `${hash}/mapbox/geojson/绿色区域.geojson`,
"type": "geojson"
},
*/
"高速": {
"data": `${hash}/mapbox/geojson/高速.geojson`,
"type": "geojson"
},
"国道": {
"data": `${hash}/mapbox/geojson/国道.geojson`,
"type": "geojson"
},
"铁路": {
"data": `${hash}/mapbox/geojson/铁路.geojson`,
"type": "geojson"
},
"省道": {
"data": `${hash}/mapbox/geojson/省道.geojson`,
"type": "geojson"
},
"县道": {
"data": `${hash}/mapbox/geojson/县道.geojson`,
"type": "geojson"
},
"高速引路": {
"data": `${hash}/mapbox/geojson/高速引路.geojson`,
"type": "geojson"
},
...(
Object.keys(DCPJ_TYPES).reduce((total, cur) => {
total[DCPJ_TYPES[cur]] = {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
};
return total;
}, {})
),
[RealDrpLayer.SourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
[RealHDLayer.SourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
[RealSkLayer.SourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
[PicStLayer.SourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
[YuwaiLayer.SourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
[BxSkLayer.SourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
[ContourLayer.SourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
[ContourLayer.LabelSourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
[PlaneAreaLayer.SourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
[WataLayer.SourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
[PumpLayer.SourceName]: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
highlight: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
fzdx: {
type: 'geojson',
data: { type: 'FeatureCollection', features: [] },
},
};
export default sources;