| | |
| | | "semi": true, |
| | | "tabWidth": 2, |
| | | "singleQuote": true, |
| | | "printWidth": 100, |
| | | "printWidth": 80, |
| | | "trailingComma": "none" |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import axios from 'axios'; |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | const debug = false; |
| | | |
| | | let ip1 = 'http://114.215.109.124:8805/'; |
| | | |
| | | if (debug) { |
| | | ip1 = 'http://192.168.0.138:8082/'; |
| | | } |
| | | |
| | | const $http = axios.create({ |
| | | baseURL: ip1, |
| | | timeout: 20000 |
| | | }); |
| | | |
| | | //æ·»å æ¦æªå¨ |
| | | [$http].forEach((i) => { |
| | | // æ·»å è¯·æ±æ¦æªå¨ |
| | | i.interceptors.request.use( |
| | | function (config) { |
| | | // å¨åé请æ±ä¹ååäºä»ä¹ |
| | | console.log('==>请æ±å¼å§'); |
| | | console.log(`${config.baseURL}${config.url}`); |
| | | if (config.data) { |
| | | console.log('==>è¯·æ±æ°æ®', config.data); |
| | | } |
| | | return config; |
| | | }, |
| | | function (error) { |
| | | // 对请æ±é误åäºä»ä¹ |
| | | console.log('==>请æ±å¼å§'); |
| | | console.log(error); |
| | | ElMessage({ |
| | | message: error, |
| | | type: 'error' |
| | | }); |
| | | return Promise.reject(error); |
| | | } |
| | | ); |
| | | |
| | | // æ·»å ååºæ¦æªå¨ |
| | | i.interceptors.response.use( |
| | | function (response) { |
| | | // 2xx èå´å
çç¶æç é½ä¼è§¦åè¯¥å½æ°ã |
| | | // 对ååºæ°æ®åç¹ä»ä¹ |
| | | console.log(response); |
| | | console.log('==>请æ±ç»æ'); |
| | | if (response.status == 200) { |
| | | if ( |
| | | response.data.success != undefined && |
| | | response.data.success != null |
| | | ) { |
| | | if (response.data.success == true) { |
| | | return response; |
| | | } else { |
| | | ElMessage({ |
| | | message: response.data.message, |
| | | type: 'error' |
| | | }); |
| | | return Promise.reject(response.data.message); |
| | | } |
| | | } else { |
| | | return response; |
| | | } |
| | | } else { |
| | | return Promise.reject(response); |
| | | } |
| | | }, |
| | | function (error) { |
| | | // è¶
åº 2xx èå´çç¶æç é½ä¼è§¦åè¯¥å½æ°ã |
| | | // 对ååºé误åç¹ä»ä¹ |
| | | console.log(error); |
| | | console.log('==>请æ±ç»æ'); |
| | | ElMessage({ |
| | | message: error, |
| | | type: 'error' |
| | | }); |
| | | return Promise.reject(error); |
| | | } |
| | | ); |
| | | }); |
| | | |
| | | export { $http }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { $http } from './index'; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | export default { |
| | | fethchMission({ type, page, pageSize }) { |
| | | let params = `page=${page}&perPage=${pageSize}`; |
| | | params += type ? `&type=${type}` : ''; |
| | | return $http.get(`air/mission/type?${params}`).then((res) => res.data); |
| | | } |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { $http } from './index'; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | export default { |
| | | fethcRealtimeData(deviceCode, type, page, perPage) { |
| | | const params = `deviceCode=${deviceCode}&type=${type}&page=${page}&perPage=${perPage}`; |
| | | $http.get(`air/realtime/sec?${params}`); |
| | | } |
| | | }; |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: var(--border-color); |
| | | z-index: 1000px; |
| | | z-index: 1000px; |
| | | } |
| | | |
| | | /* èæ¯ */ |
| | |
| | | position: relative; |
| | | color: var(--font-color); |
| | | background-color: var(--bg-color); |
| | | z-index: 1000px; |
| | | z-index: 1000px; |
| | | } |
| | | |
| | | .ff-border-top img.ff-img { |
| | |
| | | .ff-toggle-btn-down .ff-border-top .ff-border-content { |
| | | transform: rotateZ(90deg); |
| | | } |
| | | |
| | | /*****************æé®åºåæ ·å¼ - end *************************/ |
| | |
| | | CoreMenu: typeof import('./components/core/CoreMenu.vue')['default'] |
| | | ElButton: typeof import('element-plus/es')['ElButton'] |
| | | ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] |
| | | ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] |
| | | ElDropdown: typeof import('element-plus/es')['ElDropdown'] |
| | | ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] |
| | | ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] |
| | | ElForm: typeof import('element-plus/es')['ElForm'] |
| | | ElFormItem: typeof import('element-plus/es')['ElFormItem'] |
| | | ElIcon: typeof import('element-plus/es')['ElIcon'] |
| | | ElOption: typeof import('element-plus/es')['ElOption'] |
| | | ElRadio: typeof import('element-plus/es')['ElRadio'] |
| | | ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] |
| | | ElRow: typeof import('element-plus/es')['ElRow'] |
| | | ElSelect: typeof import('element-plus/es')['ElSelect'] |
| | | FactorRadio: typeof import('./components/monitor/FactorRadio.vue')['default'] |
| | | MapToolbox: typeof import('./components/map/MapToolbox.vue')['default'] |
| | | OptionDevice: typeof import('./components/search/OptionDevice.vue')['default'] |
| | | OptionMission: typeof import('./components/search/OptionMission.vue')['default'] |
| | | OptionTime: typeof import('./components/search/OptionTime.vue')['default'] |
| | | OptionType: typeof import('./components/search/OptionType.vue')['default'] |
| | | RouterLink: typeof import('vue-router')['RouterLink'] |
| | | RouterView: typeof import('vue-router')['RouterView'] |
| | | SearchBar: typeof import('./components/search/SearchBar.vue')['default'] |
| | | } |
| | | } |
| | |
| | | // çæµå ååéæ¡ |
| | | import { radioOptions } from '@/constant/radio-options'; |
| | | export default { |
| | | emits:['change'], |
| | | emits: ['change'], |
| | | data() { |
| | | return { |
| | | radio: radioOptions.type0[0].value, |
| | | options: radioOptions.type0 |
| | | }; |
| | | }, |
| | | method:{ |
| | | method: { |
| | | handleChange(value) { |
| | | this.$emit('change', value) |
| | | this.$emit('change', value); |
| | | // todo å°å¾3då¾å忢å±ç¤ºçæµå å |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-form-item label="设å¤"> |
| | | <el-select |
| | | :model-value="modelValue" |
| | | @change="handleChange" |
| | | placeholder="设å¤" |
| | | size="small" |
| | | class="w-120" |
| | | > |
| | | <el-option |
| | | v-for="(s, i) in deviceList" |
| | | :key="i" |
| | | :label="s.label" |
| | | :value="s.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | type: String, |
| | | modelValue: String |
| | | }, |
| | | emits: ['update:modelValue'], |
| | | data() { |
| | | return {}; |
| | | }, |
| | | computed: { |
| | | deviceList() { |
| | | const t = this.type ? this.type : '0a'; |
| | | return [1, 2, 3].map((v) => { |
| | | const text = `${t}000000000${v}`; |
| | | return { |
| | | label: text, |
| | | value: text |
| | | }; |
| | | }); |
| | | } |
| | | }, |
| | | watch: { |
| | | deviceList(nV, oV) { |
| | | if (nV != oV) { |
| | | this.handleChange(nV[0].value); |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | handleChange(value) { |
| | | this.$emit('update:modelValue', value); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.handleChange(this.deviceList[0].value); |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-form-item label="ä»»å¡"> |
| | | <el-select |
| | | :model-value="modelValue" |
| | | @change="handleChange" |
| | | placeholder="ä»»å¡" |
| | | size="small" |
| | | class="w-150" |
| | | > |
| | | <el-option |
| | | v-for="(s, i) in missionList" |
| | | :key="i" |
| | | :label="s.label" |
| | | :value="s.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </template> |
| | | |
| | | <script> |
| | | import missionApi from '../../api/missionApi'; |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | |
| | | export default { |
| | | setup() { |
| | | const { loading, fetchData } = useFetchData(); |
| | | return { loading, fetchData }; |
| | | }, |
| | | props: { |
| | | type: String, |
| | | modelValue: String |
| | | }, |
| | | emits: ['update:modelValue'], |
| | | data() { |
| | | return { |
| | | missionList: [] |
| | | }; |
| | | }, |
| | | methods: { |
| | | fetchMission() { |
| | | this.fetchData((page, pageSize) => { |
| | | return missionApi |
| | | .fethchMission({ type: this.type, page, pageSize }) |
| | | .then((res) => { |
| | | this.missionList = res.data.map((item) => { |
| | | return { |
| | | label: item.missionCode, |
| | | value: item.missionCode |
| | | }; |
| | | }); |
| | | if (this.missionList.length > 0) { |
| | | this.handleChange(this.missionList[0].value); |
| | | } |
| | | return res.head; |
| | | }); |
| | | }); |
| | | }, |
| | | handleChange(value) { |
| | | this.$emit('update:modelValue', value); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.fetchMission(); |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | /* :deep() .el-form-item__label { |
| | | color: red !important; |
| | | } */ |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-form-item label="æ¶é´"> |
| | | <el-date-picker |
| | | v-model="date" |
| | | @change="handleChange" |
| | | :type="type" |
| | | start-placeholder="éæ©å¼å§æ¶é´" |
| | | end-placeholder="éæ©ç»ææ¶é´" |
| | | size="small" |
| | | class="w-150" |
| | | /> |
| | | </el-form-item> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | modelValue: Array, |
| | | type: { |
| | | type: String, |
| | | default: 'datetimerange' |
| | | } |
| | | }, |
| | | emits: ['update:modelValue'], |
| | | data() { |
| | | return { |
| | | date: this.modelValue |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleChange(value) { |
| | | this.$emit('update:modelValue', value); |
| | | } |
| | | }, |
| | | mounted() { |
| | | // this.handleChange(); |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-form-item label="ç±»å"> |
| | | <el-select |
| | | :model-value="modelValue" |
| | | @change="handleChange" |
| | | placeholder="ç±»å" |
| | | size="small" |
| | | class="w-80" |
| | | > |
| | | <el-option |
| | | v-for="(s, i) in typeList" |
| | | :key="i" |
| | | :label="s.label" |
| | | :value="s.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | modelValue: String |
| | | }, |
| | | emits: ['update:modelValue'], |
| | | data() { |
| | | return { |
| | | typeList: [ |
| | | { |
| | | label: '车载', |
| | | value: '0a' |
| | | }, |
| | | { |
| | | label: 'æ 人æº', |
| | | value: '0b' |
| | | }, |
| | | { |
| | | label: 'æ 人è¹', |
| | | value: '0c' |
| | | } |
| | | ] |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleChange(value) { |
| | | this.$emit('update:modelValue', value); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.handleChange(this.typeList[0].value); |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <BaseCard class="map-date-selector"> |
| | | <template #content> |
| | | <el-form :inline="true"> |
| | | <OptionMission v-model="formSearch.missionCode"></OptionMission> |
| | | <OptionType v-model="formSearch.type"></OptionType> |
| | | <OptionDevice |
| | | :type="formSearch.type" |
| | | v-model="formSearch.deviceCode" |
| | | ></OptionDevice> |
| | | <OptionTime v-model="formSearch.timeArray"></OptionTime> |
| | | </el-form> |
| | | </template> |
| | | </BaseCard> |
| | | </template> |
| | | |
| | | <script> |
| | | // æç´¢æ¡ |
| | | export default { |
| | | data() { |
| | | return { |
| | | formSearch: { |
| | | missionCode: '', |
| | | type: '', |
| | | deviceCode: '', |
| | | timeArray: [] |
| | | } |
| | | }; |
| | | }, |
| | | method: {} |
| | | }; |
| | | </script> |
| | | <style scoped></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // æ¥å£æ°æ®çè·å |
| | | import { ref, watch, computed } from 'vue'; |
| | | |
| | | export function useFetchData(page_size) { |
| | | // åé¡µä¿¡æ¯ |
| | | const page = ref(1); |
| | | const pageNum = ref(1); |
| | | const pageSize = ref(page_size ? page_size : 20); |
| | | const total = ref(0); |
| | | watch(page, (nValue, oValue) => { |
| | | if (nValue != oValue) { |
| | | fetchData(); |
| | | } |
| | | }); |
| | | watch(pageSize, (nValue, oValue) => { |
| | | if (nValue != oValue) { |
| | | fetchData(); |
| | | } |
| | | }); |
| | | |
| | | // å è½½ç¶æ, 0: å è½½å®æ; 1: å è½½ä¸; 2: å·²å
¨é¨å è½½; 3: å 载失败; |
| | | const loadStatus = ref(0); |
| | | |
| | | const loading = computed(() => { |
| | | return loadStatus.value == 1; |
| | | }); |
| | | |
| | | // æ°æ®è·å |
| | | function fetchData(fetch) { |
| | | loadStatus.value = 1; |
| | | fetch(page.value, pageSize.value) |
| | | .then((pageInfo) => { |
| | | if (pageInfo) { |
| | | page.value = pageInfo.page ? pageInfo.page : 1; |
| | | pageNum.value = pageInfo.pageNum ? pageInfo.pageNum : 1; |
| | | total.value = pageInfo.total ? pageInfo.total : 0; |
| | | } |
| | | |
| | | loadStatus.value = 0; |
| | | }) |
| | | .catch(() => { |
| | | loadStatus.value = 3; |
| | | }) |
| | | .finally(() => { |
| | | loadStatus.value = 2; |
| | | }); |
| | | } |
| | | |
| | | return { page, pageNum, pageSize, total, loadStatus, loading, fetchData }; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * çæµå ååç§° |
| | | */ |
| | | export const factorName = { |
| | | NO2: 'NO2', //2 |
| | | CO: 'CO', //4 |
| | | H2S: 'H2S', //6 |
| | | SO2: 'SO2', //3 |
| | | O3: 'O3', //1 |
| | | PM25: 'PM2.5', //7 |
| | | PM10: 'PM10', //8 |
| | | TEMPERATURE: '温度', |
| | | HUMIDITY: '湿度', |
| | | VOC: 'TVOC', //5 |
| | | // 'NOI': 'NOI', //9 |
| | | LNG: 'ç»åº¦', |
| | | LAT: '纬度', |
| | | VELOCITY: '车é', |
| | | TIME: 'æ¶é´', |
| | | WIND_SPEED: 'é£é', |
| | | WIND_DIRECTION: 'é£å', |
| | | HEIGHT: 'é«åº¦', |
| | | |
| | | TMP: '温度', //1 |
| | | spC: 'çµå¯¼ç', //2 |
| | | tur: 'æµåº¦', //3 |
| | | DO: '溶解氧', //4 |
| | | PH: 'PH' //5 |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * çæµå ååä½ |
| | | */ |
| | | export const factorUnit = { |
| | | NO2: 'μg/m³', //2 |
| | | CO: 'mg/m³', //4 |
| | | H2S: 'μg/m³', //6 |
| | | SO2: 'μg/m³', //3 |
| | | O3: 'μg/m³', //1 |
| | | PM25: 'μg/m³', //7 |
| | | PM10: 'μg/m³', //8 |
| | | TEMPERATURE: 'â', |
| | | HUMIDITY: '%', |
| | | VOC: 'μg/m³', //5 |
| | | NOI: 'μg/m³', //9 |
| | | LNG: '', |
| | | LAT: '', |
| | | VELOCITY: 'km/s', |
| | | TIME: 'æ¶é´', |
| | | WIND_SPEED: 'm/s', |
| | | WIND_DIRECTION: '°', |
| | | HEIGHT: 'm', |
| | | |
| | | TMP: 'â', //1 |
| | | spC: 'μS/cm', //2, çµå¯¼çï¼è¥¿é¨å/ç±³ï¼ |
| | | tur: 'NTU', //3, æµåº¦ |
| | | DO: 'mg/L', //4, 溶解氧 |
| | | PH: '' //5 |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * é£åä¸æè½¬è¯ |
| | | */ |
| | | export function windDir(angle) { |
| | | if (angle == 0) { |
| | | return 'åé£'; |
| | | } else if (angle > 0 && angle < 90) { |
| | | return 'ä¸åé£'; |
| | | } else if (angle == 90) { |
| | | return 'ä¸é£'; |
| | | } else if (angle > 90 && angle < 180) { |
| | | return 'ä¸åé£'; |
| | | } else if (angle == 180) { |
| | | return 'åé£'; |
| | | } else if (angle > 180 && angle < 270) { |
| | | return '西åé£'; |
| | | } else if (angle == 270) { |
| | | return '西é£'; |
| | | } else if (angle > 270 && angle < 360) { |
| | | return '西åé£'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ref } from 'vue'; |
| | | import { defineStore } from 'pinia'; |
| | | |
| | | export const useToolboxStore = defineStore('toolbox', () => { |
| | | // å¼å
³å°ç©æ 注 |
| | | const featuresStatus = ref(false); |
| | | // å¼å
³å«æå°å¾ |
| | | const satelliteStatus = ref(false); |
| | | // å¼å
³æ§å¶ç½ç |
| | | const controlbarStatus = ref(false); |
| | | // å¼å
³åæ æ¾å |
| | | const coorPickStatus = ref(false); |
| | | // å¼å
³æ°æ®æ è®° |
| | | const dataMarkerStatus = ref(true); |
| | | // å¼å
³æ°æ®å¼¹æ¡ |
| | | const dataDialogStatus = ref(true); |
| | | |
| | | return { |
| | | featuresStatus, |
| | | satelliteStatus, |
| | | controlbarStatus, |
| | | coorPickStatus, |
| | | dataMarkerStatus, |
| | | dataDialogStatus |
| | | }; |
| | | }); |
| | |
| | | default: var(--el-component-size-default), |
| | | large: var(--el-component-size-large) |
| | | ); |
| | | $ws: (20px, 40px, 60px, 100px, 150px, 300px); |
| | | $ws: (20, 40, 60, 80, 100, 120, 150, 300); |
| | | @each $name, $value in $csize { |
| | | .w-#{$name} { |
| | | width: #{$value}; |
| | |
| | | } |
| | | @each $i in $ws { |
| | | .w-#{$i} { |
| | | width: #{$i}; |
| | | width: #{$i}px; |
| | | } |
| | | .h-#{$i} { |
| | | height: #{$i}; |
| | | height: #{$i}px; |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | :root { |
| | | // --el-text-color-regular: #ffffff; |
| | | } |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | |
| | | .el-form-item__label { |
| | | color: white; |
| | | } |
| | | |
| | | // .el-radio { |
| | | // --el-radio-text-color: white; |
| | | // } |
| | |
| | | @use './base.scss'; |
| | | @use './elementUI.scss'; |
| | |
| | | /** |
| | | * é«å¾·å°å¾3Då¾å½¢ç»å¶ç¸å
³ |
| | | */ |
| | | |
| | | import { map, object3Dlayer } from './index_old'; |
| | | |
| | | // 3då¾å½¢ |
| | |
| | | } |
| | | const fDatas = _factorDatas; |
| | | const factor = _factor; |
| | | // MapUtil._object3Dlayer.clear() |
| | | // MapUtil.drawMesh(f.lnglats, f.heights, f.type, false) |
| | | MapUtil.drawMesh2(fDatas, factor); |
| | | MapUtil.drawMarker(); |
| | | drawMesh(fDatas, factor); |
| | | } |
| | | |
| | | var _maxHeight = 1000, |
| | | _minHeight = 100, |
| | | _lastZoom = -1; |
| | | /** |
| | | * è·åå½åå°å¾ç¼©æ¾ç级ä¸çç»å¶é«åº¦ç¼©æ¾æ¯ä¾ |
| | | * @param {*} minH å½åçæµæ°æ®çæå°é«åº¦ |
| | | * @param {*} maxH å½åçæµæ°æ®çæå¤§é«åº¦ |
| | | */ |
| | | function _getScale(minH, maxH) { |
| | | var zoom = map.getZoom(); |
| | | if (_lastZoom == -1) { |
| | | _lastZoom = zoom; |
| | | } else if (_lastZoom <= 8) { |
| | | _lastZoom = zoom; |
| | | return; |
| | | } else if (_lastZoom >= 18) { |
| | | _lastZoom = zoom; |
| | | return; |
| | | } |
| | | if (zoom <= 8) { |
| | | _maxHeight = 10000; |
| | | _minHeight = 1000; |
| | | } else if (zoom <= 9) { |
| | | _maxHeight = 9000; |
| | | _minHeight = 900; |
| | | } else if (zoom <= 10) { |
| | | _maxHeight = 8000; |
| | | _minHeight = 800; |
| | | } else if (zoom <= 11) { |
| | | _maxHeight = 7000; |
| | | _minHeight = 700; |
| | | } else if (zoom <= 12) { |
| | | _maxHeight = 6000; |
| | | _minHeight = 600; |
| | | } else if (zoom <= 14) { |
| | | _maxHeight = 5000; |
| | | _minHeight = 500; |
| | | } else if (zoom <= 15) { |
| | | _maxHeight = 4500; |
| | | _minHeight = 450; |
| | | } else if (zoom <= 16) { |
| | | _maxHeight = 4000; |
| | | _minHeight = 400; |
| | | } else if (zoom <= 17) { |
| | | _maxHeight = 2500; |
| | | _minHeight = 250; |
| | | } else if (zoom > 17) { |
| | | _maxHeight = 1000; |
| | | _minHeight = 100; |
| | | } |
| | | |
| | | var scale = (_maxHeight - _minHeight) / (maxH - minH); |
| | | return scale; |
| | | } |
| | | |
| | | /** |
| | | * ç»å¾ |
| | | */ |
| | | function drawMesh(fDatas, factor, center, merge) { |
| | | const lnglats_GD = fDatas.lnglats_GD; |
| | | const coors = fDatas.coors_GD; |
| | | const heights = factor.heights; |
| | | const colors = factor.colors; |
| | | const bColor = factor.bottomColor; |
| | | if (center) { |
| | | map.setZoomAndCenter(16, center); |
| | | } |
| | | |
| | | // eslint-disable-next-line no-undef |
| | | var cylinder = new AMap.Object3D.Mesh(); |
| | | cylinder.backOrFront = 'both'; |
| | | cylinder.transparent = true; |
| | | |
| | | var geometry = cylinder.geometry; |
| | | |
| | | const scale = _getScale(_minH, _maxH); |
| | | for (let i = 0; i < coors.length; i++) { |
| | | var r = lnglats_GD[i]; |
| | | var lastP = lnglats_GD[i - 1]; |
| | | var p = coors[i]; |
| | | var h = (heights[i] - _minH) * scale + _minHeight; |
| | | if (heights[i] == -1) { |
| | | h = -1; |
| | | } |
| | | |
| | | geometry.vertices.push(p.x, p.y, 0); //åºé¨é¡¶ç¹ |
| | | geometry.vertices.push(p.x, p.y, 0 - h); //é¡¶é¨é¡¶ç¹ |
| | | |
| | | if (i > 0) { |
| | | // eslint-disable-next-line no-undef |
| | | var distance = AMap.GeometryUtil.distance(r, lastP); |
| | | //ä¸¤ä¸ªæ°æ®ç¹æå°é´éæ¶é´ä¸º4sï¼å设车éæç
§120km/h计ç®ï¼4sè¡é©¶æå¤§è·ç¦»ä½ä¸º132ç±³ï¼ |
| | | //设å®è¶
è¿1åéçæ°æ®ç»å¶ç¹æ®çè¿çº¿ |
| | | if (distance <= 500 && h != -1) { |
| | | var bottomIndex = i * 2; |
| | | var topIndex = bottomIndex + 1; |
| | | var lastBottomIndex = bottomIndex - 2; |
| | | var lastTopIndex = bottomIndex - 1; |
| | | geometry.faces.push(bottomIndex, topIndex, lastTopIndex); |
| | | geometry.faces.push(bottomIndex, lastBottomIndex, lastTopIndex); |
| | | } |
| | | } |
| | | |
| | | // var bColor = bColor |
| | | var tColor = colors[i]; |
| | | geometry.vertexColors.push.apply(geometry.vertexColors, bColor); //åºé¨é¡¶ç¹é¢è² |
| | | geometry.vertexColors.push.apply(geometry.vertexColors, tColor); //é¡¶é¨é¡¶ç¹é¢è² |
| | | } |
| | | |
| | | // 7.æ ¹æ®åå¹¶é项éç½®ææ°å¢å½åç¼åæ°æ® |
| | | if (merge != true) { |
| | | _factorDatas = fDatas; |
| | | _factor = factor; |
| | | if (_cylinder != undefined) { |
| | | object3Dlayer.remove(_cylinder); |
| | | } |
| | | } else { |
| | | // _factorDatas.lnglats.push.apply( |
| | | // _factorDatas.lnglats, |
| | | // lnglats_GD |
| | | // ); |
| | | // _factorDatas.coors.push.apply(_factorDatas.coors, coors); |
| | | // _factorDatas.heights.push.apply(_factorDatas.heights, heights); |
| | | // _factorDatas.colors.push.apply(_factorDatas.colors, colors); |
| | | // _factorDatas.bottomColor = bColor; |
| | | } |
| | | object3Dlayer.add(cylinder); |
| | | /**************test ****************/ |
| | | // object3Dlayer.on('mouseover', function (e) { |
| | | // console.log( |
| | | // `é¼ æ ç§»å
¥è¦çç©! [${e.lnglat.getlng()}, ${e.lnglat.getLat()}]` |
| | | // ); |
| | | // }); |
| | | /**************test ****************/ |
| | | _cylinder = cylinder; |
| | | } |
| | | |
| | | export default { |
| | | /** |
| | | * ç»å¶3Dèµ°è¡è·¯çº¿å¾ |
| | | * @param fDatas 宿´çæµæ°æ® |
| | | * @param factor å½åå±ç¤ºççæµå åçå¼value |
| | | * @param factor å½åå±ç¤ºççæµå å对象 |
| | | * @param merge æ¯å¦åä¹åç»å¶çå¾å½¢åå¹¶ |
| | | * @param setCenter é头æ¯å¦èªå¨ç§»å¨è³å¾å½¢ä¸å¿ |
| | | */ |
| | |
| | | const heights = factor.heights; |
| | | |
| | | // 1.å
³éå°å¾ç¼©æ¾çå¬ |
| | | map.off('zoomend', this._onMapZoom); |
| | | map.off('zoomend', onMapZoom); |
| | | |
| | | // 2.计ç®ç»å¾é«åº¦çè¾¹çå¼ |
| | | if (merge != true) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | // eslint-disable-next-line no-undef |
| | | center = new AMap.LngLat(...p); |
| | | } |
| | | |
| | | // 5.ç»å¶3Då¾å½¢ |
| | | drawMesh2(fDatas, factor, center, merge); |
| | | drawMesh(fDatas, factor, center, merge); |
| | | |
| | | // 缩æ¾å°å¾å°åéçè§éçº§å« |
| | | // map.setFitView() |
| | | |
| | | // 6.å¼å¯å°å¾ç¼©æ¾çå¬ |
| | | if (lnglats_GD.length > 0) { |
| | | map.on('zoomend', this._onMapZoom); |
| | | map.on('zoomend', onMapZoom); |
| | | } |
| | | } |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * å°å¾åæ ç¸å
³è®¡ç® |
| | | */ |
| | | |
| | | import { map } from './index_old'; |
| | | |
| | | export default { |
| | | /** |
| | | * æ ¹æ®åæ ç¹ãè·ç¦»åè§åº¦ï¼å¾å°å¦ä¸ä¸ªåæ ç¹ |
| | | * @param {*} pos |
| | | * @param {*} distance ç±³ |
| | | * @param {*} angle |
| | | */ |
| | | getLatLon: function (pos, distance, angle) { |
| | | var Ea = 6378137; // 赤éåå¾ |
| | | var Eb = 6356725; // æåå¾ |
| | | var dx = distance * Math.sin((angle * Math.PI) / 180); |
| | | var dy = distance * Math.cos((angle * Math.PI) / 180); |
| | | var ec = Eb + ((Ea - Eb) * (90.0 - pos[1])) / 90.0; |
| | | var ed = ec * Math.cos((pos[1] * Math.PI) / 180); |
| | | var lng = ((dx / ed + (pos[0] * Math.PI) / 180.0) * 180.0) / Math.PI; |
| | | var lat = ((dy / ec + (pos[1] * Math.PI) / 180.0) * 180.0) / Math.PI; |
| | | return [lng, lat]; |
| | | }, |
| | | |
| | | /** |
| | | * å°äºç»´æ°ç»å½¢å¼çåæ ç¹æ°ç»è½¬æ¢ä¸ºé«å¾·å°å¾ä¸ LngLat ç±» |
| | | * @param {*} lnglats |
| | | * @returns |
| | | */ |
| | | parse2LngLat: function (lnglats) { |
| | | // å建å
å«4个èç¹çæçº¿åæåæ æ³¨ |
| | | var path = []; |
| | | lnglats.forEach(function (value) { |
| | | // eslint-disable-next-line no-undef |
| | | path.push(new AMap.LngLat(value[0], value[1])); |
| | | }); |
| | | return path; |
| | | }, |
| | | |
| | | /** |
| | | * å°é«å¾·å°å¾çç»çº¬åº¦åæ 转æ¢ä¸ºå¾å½¢åæ |
| | | * @param {*} lnglats_GD |
| | | * @returns |
| | | */ |
| | | lngLatToGeodeticCoord: function (lnglats_GD) { |
| | | var coors_GD = []; |
| | | |
| | | for (let i = 0; i < lnglats_GD.length; i++) { |
| | | var gd = lnglats_GD[i]; |
| | | // eslint-disable-next-line no-undef |
| | | var r = new AMap.LngLat(...gd); |
| | | var p = map.lngLatToGeodeticCoord(r); |
| | | // **è®°å½è½¬æ¢åç3Då°å¾å¾å½¢åæ |
| | | coors_GD.push(p); |
| | | } |
| | | return coors_GD; |
| | | } |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { factorName } from '../../constant/factor-name'; |
| | | import { factorUnit } from '../../constant/factor-unit'; |
| | | import { windDir } from '../../constant/wind-dir'; |
| | | |
| | | export const DialogUtil = { |
| | | show: true, |
| | | toggleDataDialog() { |
| | | this.show = !this.show; |
| | | if (this.show) { |
| | | return 'æ°æ®å¼¹æ¡ï¼å¼'; |
| | | } else { |
| | | return 'æ°æ®å¼¹æ¡ï¼å
³'; |
| | | } |
| | | }, |
| | | /** |
| | | * åå»ºå¼¹åºæ¡ |
| | | * @param {*} factorDatas çæµæ°æ® |
| | | * @param {*} i å½åæ¾ç¤ºçæµæ°æ®ç´¢å¼ |
| | | * @param {*} onClose å
³éå¼¹åºæ¡åè° |
| | | * @returns |
| | | */ |
| | | createInfoWindow(factorDatas, i, onClose) { |
| | | let m = { |
| | | data: factorDatas, |
| | | index: i, |
| | | window: '', |
| | | close: onClose |
| | | }; |
| | | // eslint-disable-next-line no-undef |
| | | m.window = new AMap.InfoWindow({ |
| | | isCustom: true, //使ç¨èªå®ä¹çªä½ |
| | | content: this.createWindowContent(m), |
| | | // eslint-disable-next-line no-undef |
| | | offset: new AMap.Pixel(16, -45) |
| | | }); |
| | | return m.window; |
| | | }, |
| | | |
| | | createInfoWindow2(factorData, onClose) { |
| | | let m = { |
| | | time: factorData.time, |
| | | factorList: factorData.values, |
| | | window: '', |
| | | close: onClose |
| | | }; |
| | | // eslint-disable-next-line no-undef |
| | | m.window = new AMap.InfoWindow({ |
| | | isCustom: true, //使ç¨èªå®ä¹çªä½ |
| | | content: this.createWindowContent2(m), |
| | | // eslint-disable-next-line no-undef |
| | | offset: new AMap.Pixel(16, -45) |
| | | }); |
| | | return m.window; |
| | | }, |
| | | /** |
| | | * ç«ç¹æ è®°ä¿¡æ¯çªä½ |
| | | */ |
| | | createWindowContent: function (marker) { |
| | | const factorDatas = marker.data; |
| | | const i = marker.index; |
| | | const time = factorDatas.times[i]; |
| | | const factorList = []; |
| | | Object.keys(factorDatas.factor).forEach((k) => { |
| | | var f = factorDatas.factor[k].datas[i]; |
| | | factorList.push(f); |
| | | }); |
| | | marker.time = time; |
| | | marker.factorList = factorList; |
| | | return this.createWindowContent2(marker); |
| | | }, |
| | | |
| | | createWindowContent2(marker) { |
| | | const time = marker.time; |
| | | const factorList = marker.factorList; |
| | | //å®ä¾åä¿¡æ¯çªä½ |
| | | // var title = '<div>' + site.name + '</div>' + '<div class="sub-title">ç¼å·:' + site.code + '</div>', |
| | | var title = '', |
| | | content = '', |
| | | tag = ''; |
| | | |
| | | tag += "<div class='time'>" + 'æ¶é´: ' + time; |
| | | |
| | | // éåç«ç¹æ°æ®ä¸çæ¯ä¸é¡¹çæµå åï¼çæé¡µé¢ |
| | | content += "<div><table class='text-table'>"; |
| | | var _contents = new Map(); |
| | | factorList.forEach((f) => { |
| | | // å é䏿¾ç¤ºçå å |
| | | if ( |
| | | f.factorName == 'NOI' || |
| | | f.factorName == 'LNG' || |
| | | f.factorName == 'LAT' || |
| | | f.factorName == 'VELOCITY' || |
| | | f.factorName == 'TIME' || |
| | | f.factorName == 'HEIGHT' |
| | | ) { |
| | | return; |
| | | } |
| | | |
| | | var factor = factorName[f.factorName]; |
| | | var n = 1; |
| | | if (f.factorName == 'WIND_DIRECTION') { |
| | | n = 0; |
| | | } |
| | | var v = f.factorData.toFixed(n); |
| | | var unit = factorUnit[f.factorName]; |
| | | if (f.factorName == 'CO') { |
| | | unit = 'μg/m³'; |
| | | } |
| | | if (f.factorName == 'WIND_DIRECTION') { |
| | | unit += '(' + windDir(f.factorData) + ')'; |
| | | } |
| | | var c = '<tr>'; |
| | | if (f.factorName == 'H2S' || f.factorName == 'PM10') { |
| | | c = "<tr class='divide'>"; |
| | | } |
| | | c += '<td>' + factor + '</td>'; |
| | | c += '<td>' + ': ' + '</td>'; |
| | | c += '<td>' + v + '</td>'; |
| | | c += "<td class='last-col'>" + unit + '</td>'; |
| | | c += '</tr>'; |
| | | |
| | | _contents.set(f.factorName, c); |
| | | }); |
| | | var orderList = [ |
| | | 'VOC', |
| | | 'H2S', |
| | | 'NO2', |
| | | 'CO', |
| | | 'SO2', |
| | | 'O3', |
| | | 'PM25', |
| | | 'PM10', |
| | | 'TEMPERATURE', |
| | | 'HUMIDITY', |
| | | 'WIND_SPEED', |
| | | 'WIND_DIRECTION' |
| | | ]; |
| | | orderList.forEach((e) => { |
| | | content += _contents.get(e); |
| | | }); |
| | | |
| | | // content += |
| | | |
| | | content += '</table></div>'; |
| | | |
| | | var info = document.createElement('div'); |
| | | // info.className = "custom-info input-card content-window-card"; |
| | | info.className = 'flexbox-col'; |
| | | |
| | | //å¯ä»¥éè¿ä¸é¢çæ¹å¼ä¿®æ¹èªå®ä¹çªä½çå®½é« |
| | | //info.style.width = "400px"; |
| | | // å®ä¹é¡¶é¨æ é¢ |
| | | var top = document.createElement('div'); |
| | | // top.className = "info-top"; |
| | | top.className = 'ff-content ff-content-top-left ff-content-small-borderless-t info-top'; |
| | | var top_b = document.createElement('div'); |
| | | top_b.className = 'ff-border-bottom'; |
| | | var top_t = document.createElement('div'); |
| | | top_t.className = 'ff-border-top'; |
| | | var top_c = document.createElement('div'); |
| | | top_c.className = 'ff-border-content flexbox flex-space-between'; |
| | | |
| | | var titleD = document.createElement('div'); |
| | | var closeX = document.createElement('i'); |
| | | titleD.innerHTML = title; |
| | | closeX.className = 'fa fa-times'; |
| | | // eslint-disable-next-line no-undef |
| | | $(closeX).attr('aria-hidden', 'true'); |
| | | closeX.onclick = function () { |
| | | marker.close(); |
| | | marker.window.close(); |
| | | }; |
| | | |
| | | top_c.appendChild(titleD); |
| | | top_c.appendChild(closeX); |
| | | |
| | | top_t.appendChild(top_c); |
| | | top.appendChild(top_b); |
| | | top.appendChild(top_t); |
| | | |
| | | info.appendChild(top); |
| | | |
| | | // å®ä¹ä¸é¨å
容 |
| | | var refreshV = document.createElement('div'); |
| | | refreshV.className = 'refresh-btn'; |
| | | var refresh = document.createElement('i'); |
| | | refresh.className = 'fa fa-refresh'; |
| | | // eslint-disable-next-line no-undef |
| | | $(refresh).attr('aria-hidden', 'true'); |
| | | // eslint-disable-next-line no-undef |
| | | $(refresh).css('color', '#ffffffc0'); |
| | | // eslint-disable-next-line no-undef |
| | | $(refresh).css('cursor', 'pointer'); |
| | | refresh.onclick = function () { |
| | | // $(this).addClass('fa-spin') |
| | | // that.fetchingData(site.code, function () { |
| | | // setTimeout(() => { |
| | | // $(this).removeClass('fa-spin') |
| | | // }, 1000); |
| | | // }.bind(this)) |
| | | }; |
| | | var m_top = document.createElement('div'); |
| | | m_top.className = 'ff-content ff-content-left ff-content-medium'; |
| | | var m_top_b = document.createElement('div'); |
| | | m_top_b.className = 'ff-border-bottom'; |
| | | var m_top_t = document.createElement('div'); |
| | | m_top_t.className = 'ff-border-top'; |
| | | var m_top_c = document.createElement('div'); |
| | | m_top_c.className = 'ff-border-content'; |
| | | var m_top_f = document.createElement('div'); |
| | | m_top_f.className = 'ff-footer flexbox-col flex-center'; |
| | | var m_top_tr = document.createElement('div'); |
| | | m_top_tr.className = 'ff-triangle'; |
| | | var m_top_trb = document.createElement('div'); |
| | | m_top_trb.className = 'ff-triangle-border'; |
| | | refreshV.appendChild(refresh); |
| | | // m_top_c.appendChild(refreshV); |
| | | |
| | | var middle = document.createElement('div'); |
| | | middle.className = 'info-middle'; |
| | | middle.innerHTML = content; |
| | | m_top_f.innerHTML = tag; |
| | | |
| | | m_top_c.appendChild(middle); |
| | | |
| | | m_top_t.appendChild(m_top_c); |
| | | m_top_tr.appendChild(m_top_trb); |
| | | |
| | | m_top.appendChild(m_top_b); |
| | | m_top.appendChild(m_top_t); |
| | | m_top.appendChild(m_top_f); |
| | | m_top.appendChild(m_top_tr); |
| | | |
| | | info.appendChild(m_top); |
| | | |
| | | // å®ä¹åºé¨å
容 |
| | | var bottom = document.createElement('div'); |
| | | bottom.className = 'info-bottom'; |
| | | bottom.style.position = 'relative'; |
| | | bottom.style.top = '0px'; |
| | | bottom.style.margin = '0 auto'; |
| | | var sharp = document.createElement('img'); |
| | | sharp.src = 'https://webapi.amap.com/images/sharp.png'; |
| | | bottom.appendChild(sharp); |
| | | info.appendChild(bottom); |
| | | return info; |
| | | }, |
| | | |
| | | openNewWindow(factorDatas, i, map, position, onClose) { |
| | | if (!this.show) return; |
| | | const window = this.createInfoWindow(factorDatas, i, onClose); |
| | | window.open(map, position); |
| | | }, |
| | | |
| | | openNewWindow2(factorData, map, position, onClose) { |
| | | if (!this.show) return; |
| | | const window = this.createInfoWindow2(factorData, onClose); |
| | | window.open(map, position); |
| | | } |
| | | }; |
| | |
| | | /* eslint-disable no-undef */ |
| | | // import '@/lib/AMap'; |
| | | import { useToolboxStore } from '@/stores/toolbox'; |
| | | |
| | | const toolboxStore = useToolboxStore(); |
| | | |
| | | var mapInitDone = false; |
| | | var onMapMountedEvents = []; |
| | |
| | | satellite = new AMap.TileLayer.Satellite(); |
| | | satellite.show(); |
| | | map.add([satellite]); |
| | | toolboxStore.featuresStatus = true; |
| | | |
| | | _initControlbar(); |
| | | // _initMouseTool(); |
| | |
| | | } |
| | | }); |
| | | map.addControl(controlbar); |
| | | toolboxStore.controlbarStatus = true; |
| | | } |
| | | |
| | | // é¼ æ ç»å¾åå§å |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * é«å¾·å°å¾ç¹æ è®°ç»å¶ç¸å
³ |
| | | */ |
| | | |
| | | import { map } from './index_old'; |
| | | import sector from './sector'; |
| | | import { DialogUtil } from './dialog'; |
| | | import { useToolboxStore } from '@/stores/toolbox'; |
| | | |
| | | const toolboxStore = useToolboxStore(); |
| | | |
| | | var _massMarks = undefined; |
| | | |
| | | export default { |
| | | /** |
| | | * ç»å¶æµ·éç¹æ è®° |
| | | * @param fDatas 宿´çæµæ°æ® |
| | | * @param _factor å½åå±ç¤ºççæµå å对象 |
| | | */ |
| | | drawMassMarks(fDatas, _factor, onClick) { |
| | | if (!toolboxStore.dataMarkerStatus) { |
| | | return; |
| | | } |
| | | if (_massMarks) { |
| | | map.remove(_massMarks); |
| | | _massMarks = undefined; |
| | | } |
| | | const lnglats = fDatas.lnglats_GD; |
| | | var data = []; |
| | | for (let i = 0; i < lnglats.length; i++) { |
| | | data.push({ |
| | | lnglat: lnglats[i], //ç¹æ è®°ä½ç½® |
| | | name: `${fDatas.times[i]}<br/>${_factor.factorName}: ${_factor.datas[i].factorData} mg/m³`, |
| | | id: i |
| | | }); |
| | | } |
| | | |
| | | // åå»ºæ ·å¼å¯¹è±¡ |
| | | var styleObject = { |
| | | url: 'https://a.amap.com/jsapi_demos/static/images/mass1.png', |
| | | // url: './asset/mipmap/ic_up_white.png', // 徿 å°å |
| | | // eslint-disable-next-line no-undef |
| | | size: new AMap.Size(11, 11), // 徿 å¤§å° |
| | | // eslint-disable-next-line no-undef |
| | | anchor: new AMap.Pixel(5, 5) // 徿 æ¾ç¤ºä½ç½®åç§»éï¼åºåç¹ä¸ºå¾æ å·¦ä¸è§ |
| | | }; |
| | | // eslint-disable-next-line no-undef |
| | | var massMarks = new AMap.MassMarks(data, { |
| | | zIndex: 5, // æµ·éç¹å¾å±å å çé¡ºåº |
| | | zooms: [15, 18], // 卿å®å°å¾ç¼©æ¾çº§å«èå´å
å±ç¤ºæµ·éç¹å¾å± |
| | | style: styleObject // è®¾ç½®æ ·å¼å¯¹è±¡ |
| | | }); |
| | | massMarks.on('click', (event) => { |
| | | const i = event.data.id; |
| | | // 1. ç»å¶æå½¢åºå |
| | | sector.drawSector(fDatas, i); |
| | | |
| | | // 2. ç»å¶å¯¹è¯æ¡ |
| | | DialogUtil.openNewWindow(fDatas, i, map, lnglats[i], () => { |
| | | // ç§»é¤æå½¢åºå |
| | | // clearSector3(); |
| | | }); |
| | | |
| | | // 3. èªå®ä¹ç¹å»äºä»¶ |
| | | onClick(); |
| | | }); |
| | | // eslint-disable-next-line no-undef |
| | | var marker = new AMap.Marker({ |
| | | content: ' ', |
| | | map: map, |
| | | // eslint-disable-next-line no-undef |
| | | offset: new AMap.Pixel(13, 12) |
| | | }); |
| | | var timeout; |
| | | massMarks.on('mouseover', (e) => { |
| | | if (timeout) { |
| | | clearTimeout(timeout); |
| | | } |
| | | marker.setPosition(e.data.lnglat); |
| | | marker.setLabel({ content: e.data.name }); |
| | | map.add(marker); |
| | | timeout = setTimeout(() => { |
| | | map.remove(marker); |
| | | }, 2000); |
| | | }); |
| | | _massMarks = massMarks; |
| | | map.add(massMarks); |
| | | } |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { map, object3Dlayer } from './index_old'; |
| | | import calculate from './calculate'; |
| | | |
| | | var _defaultDeg = 30, |
| | | _sector = undefined, |
| | | _sectorViews = {}; |
| | | |
| | | function clearSector() { |
| | | var list = []; |
| | | for (const key in _sectorViews) { |
| | | list.push(_sectorViews[key]); |
| | | } |
| | | if (list.length > 0) { |
| | | map.remove(list); |
| | | _sectorViews = {}; |
| | | } |
| | | if (_sector) { |
| | | object3Dlayer.remove(_sector); |
| | | } |
| | | } |
| | | |
| | | export default { |
| | | drawSector(fDatas, i) { |
| | | const lnglat = fDatas.lnglats_GD[i]; |
| | | let windDir = fDatas.factor[17].datas[i].factorData; |
| | | let windSpeed = fDatas.factor[16].datas[i].factorData; |
| | | if (!windDir) windDir = 0; |
| | | if (!windSpeed) windSpeed = 0; |
| | | |
| | | if (windSpeed > 10) { |
| | | return; |
| | | } |
| | | if (_sector != undefined) { |
| | | clearSector(); |
| | | } |
| | | |
| | | // eslint-disable-next-line no-undef |
| | | var sector = new AMap.Object3D.Mesh(); |
| | | sector.transparent = true; |
| | | sector.backOrFront = 'both'; |
| | | |
| | | var unit = 5; |
| | | |
| | | var sDeg = windDir - _defaultDeg; //æå½¢èµ·å§è§åº¦ï¼ä»¥ä¸æ¹ä½ä¸º0åº¦ï¼ |
| | | // sDeg = sDeg < 0 ? sDeg + 360 : sDeg |
| | | var eDeg = windDir + _defaultDeg; //æå½¢ç»æè§åº¦ |
| | | // eDeg = eDeg < 0 ? eDeg + 360 : eDeg |
| | | |
| | | var distance = windSpeed * 10 * 60; //åå¾(é£é*æ¶é´) |
| | | var lnglat2 = calculate.getLatLon(lnglat, distance, sDeg); |
| | | var lnglat3 = calculate.getLatLon(lnglat, distance, windDir); |
| | | var lnglat4 = calculate.getLatLon(lnglat, distance, eDeg); |
| | | var list = calculate.parse2LngLat([lnglat, lnglat2, lnglat3, lnglat4]); |
| | | |
| | | var distance2 = windSpeed * 5 * 60; //åå¾(é£é*æ¶é´) |
| | | var lnglat2_2 = calculate.getLatLon(lnglat, distance2, sDeg); |
| | | var lnglat2_3 = calculate.getLatLon(lnglat, distance2, windDir); |
| | | var lnglat2_4 = calculate.getLatLon(lnglat, distance2, eDeg); |
| | | var list2 = calculate.parse2LngLat([lnglat2_2, lnglat2_3, lnglat2_4]); |
| | | |
| | | var p0 = calculate.lngLatToGeodeticCoord([lnglat])[0]; |
| | | var geometry = sector.geometry; |
| | | |
| | | var count = distance / unit; |
| | | var unitDeg = (eDeg - sDeg) / count; |
| | | for (let i = 0; i < count; i++) { |
| | | var angle1 = sDeg + unitDeg * i; |
| | | var angle2 = sDeg + unitDeg * (i + 1); |
| | | |
| | | var l1 = calculate.getLatLon(lnglat, distance, angle1); |
| | | var l2 = calculate.getLatLon(lnglat, distance, angle2); |
| | | var l3 = calculate.getLatLon(lnglat, distance2, angle1); |
| | | var l4 = calculate.getLatLon(lnglat, distance2, angle2); |
| | | |
| | | var coors = calculate.lngLatToGeodeticCoord([l1, l2, l3, l4]); |
| | | l1 = coors[0]; |
| | | l2 = coors[1]; |
| | | l3 = coors[2]; |
| | | l4 = coors[3]; |
| | | |
| | | // å
æµæå½¢ |
| | | geometry.vertices.push(p0.x, p0.y, 0); |
| | | geometry.vertices.push(l3.x, l3.y, 0); |
| | | geometry.vertices.push(l4.x, l4.y, 0); |
| | | // å¤ä¾§æå½¢ |
| | | geometry.vertices.push(l3.x, l3.y, 0); |
| | | geometry.vertices.push(l4.x, l4.y, 0); |
| | | geometry.vertices.push(l1.x, l1.y, 0); |
| | | geometry.vertices.push(l2.x, l2.y, 0); |
| | | // console.log(l3.x + ',' + l3.y + ' | ' + l1.x + ',' + l1.y); |
| | | |
| | | // å
æµæå½¢é¢è² |
| | | geometry.vertexColors.push(1, 0.11, 0.25, 0.6); |
| | | geometry.vertexColors.push(1, 0.11, 0.25, 0.6); |
| | | geometry.vertexColors.push(1, 0.11, 0.25, 0.6); |
| | | //å¤ä¾§æå½¢é¢è² |
| | | geometry.vertexColors.push(1, 0.37, 0.07, 0.5); |
| | | geometry.vertexColors.push(1, 0.37, 0.07, 0.5); |
| | | geometry.vertexColors.push(1, 0.37, 0.07, 0.5); |
| | | geometry.vertexColors.push(1, 0.37, 0.07, 0.5); |
| | | |
| | | var index = i * 7; |
| | | geometry.faces.push(index, index + 1, index + 2); |
| | | geometry.faces.push(index + 3, index + 4, index + 5); |
| | | geometry.faces.push(index + 4, index + 5, index + 6); |
| | | } |
| | | object3Dlayer.add(sector); |
| | | _sector = sector; |
| | | |
| | | distance = distance.toFixed(0); |
| | | distance2 = distance2.toFixed(0); |
| | | const zoomStyleMapping = { |
| | | 14: 0, |
| | | 15: 0, |
| | | 16: 0, |
| | | 17: 0, |
| | | 18: 0, |
| | | 19: 0, |
| | | 20: 0 |
| | | }; |
| | | //10åéæå½¢ |
| | | // eslint-disable-next-line no-undef |
| | | var text15 = new AMap.ElasticMarker({ |
| | | zoom: [14, 20], |
| | | position: list[2], |
| | | styles: [ |
| | | { |
| | | icon: { |
| | | img: './asset/mipmap/location.png', |
| | | size: [16, 16], //å¯è§åºåçå¤§å° |
| | | ancher: [8, 16], //éç¹ |
| | | fitZoom: 18, //æåéççº§å« |
| | | scaleFactor: 1, //å°å¾æ¾å¤§ä¸çº§çç¼©æ¾æ¯ä¾ç³»æ° |
| | | maxScale: 2, //æå¤§æ¾å¤§æ¯ä¾ |
| | | minScale: 1 //æå°æ¾å¤§æ¯ä¾ |
| | | }, |
| | | label: { |
| | | content: '<div>10åé</div>', |
| | | offset: [-35, 0], |
| | | position: 'BM', |
| | | minZoom: 15 |
| | | } |
| | | } |
| | | ], |
| | | zoomStyleMapping: zoomStyleMapping |
| | | }); |
| | | _sectorViews['text10'] = text15; |
| | | // eslint-disable-next-line no-undef |
| | | var textM = new AMap.ElasticMarker({ |
| | | zoom: [14, 20], |
| | | position: list[1], |
| | | styles: [ |
| | | { |
| | | icon: { |
| | | img: './asset/mipmap/location.png', |
| | | size: [16, 16], //å¯è§åºåçå¤§å° |
| | | ancher: [8, 16], //éç¹ |
| | | fitZoom: 18, //æåéççº§å« |
| | | scaleFactor: 1, //å°å¾æ¾å¤§ä¸çº§çç¼©æ¾æ¯ä¾ç³»æ° |
| | | maxScale: 2, //æå¤§æ¾å¤§æ¯ä¾ |
| | | minScale: 1 //æå°æ¾å¤§æ¯ä¾ |
| | | }, |
| | | label: { |
| | | content: `<div>${distance}m</div>`, |
| | | offset: [-35, 0], |
| | | position: 'BM', |
| | | minZoom: 15 |
| | | } |
| | | } |
| | | ], |
| | | zoomStyleMapping: zoomStyleMapping |
| | | }); |
| | | _sectorViews['textM'] = textM; |
| | | map.add(_sectorViews['text10']); |
| | | map.add(_sectorViews['textM']); |
| | | |
| | | //5åéæå½¢ |
| | | let pList = list2; |
| | | // eslint-disable-next-line no-undef |
| | | var text5 = new AMap.ElasticMarker({ |
| | | position: pList[1], |
| | | styles: [ |
| | | { |
| | | icon: { |
| | | img: './asset/mipmap/location.png', |
| | | size: [16, 16], //å¯è§åºåçå¤§å° |
| | | ancher: [8, 16], //éç¹ |
| | | fitZoom: 18, //æåéççº§å« |
| | | scaleFactor: 1, //å°å¾æ¾å¤§ä¸çº§çç¼©æ¾æ¯ä¾ç³»æ° |
| | | maxScale: 2, //æå¤§æ¾å¤§æ¯ä¾ |
| | | minScale: 1 //æå°æ¾å¤§æ¯ä¾ |
| | | }, |
| | | label: { |
| | | content: `<div>5åé</div>`, |
| | | offset: [-35, 0], |
| | | position: 'BM', |
| | | minZoom: 15 |
| | | } |
| | | } |
| | | ], |
| | | zoomStyleMapping: zoomStyleMapping |
| | | }); |
| | | _sectorViews['text5'] = text5; |
| | | // eslint-disable-next-line no-undef |
| | | var textM5 = new AMap.ElasticMarker({ |
| | | position: pList[0], |
| | | styles: [ |
| | | { |
| | | icon: { |
| | | img: './asset/mipmap/location.png', |
| | | size: [16, 16], //å¯è§åºåçå¤§å° |
| | | ancher: [8, 16], //éç¹ |
| | | fitZoom: 18, //æåéççº§å« |
| | | scaleFactor: 1, //å°å¾æ¾å¤§ä¸çº§çç¼©æ¾æ¯ä¾ç³»æ° |
| | | maxScale: 2, //æå¤§æ¾å¤§æ¯ä¾ |
| | | minScale: 1 //æå°æ¾å¤§æ¯ä¾ |
| | | }, |
| | | label: { |
| | | content: `<div>${distance2}m</div>`, |
| | | offset: [-35, 0], |
| | | position: 'BM', |
| | | minZoom: 15 |
| | | } |
| | | } |
| | | ], |
| | | zoomStyleMapping: zoomStyleMapping |
| | | }); |
| | | _sectorViews['textM5'] = textM5; |
| | | map.add(_sectorViews['textM5']); |
| | | map.add(_sectorViews['text5']); |
| | | } |
| | | }; |
| | |
| | | /* eslint-disable no-undef */ |
| | | import { map, satellite, controlbar } from './index_old'; |
| | | import { map, satellite } from './index_old'; |
| | | import { useToolboxStore } from '@/stores/toolbox'; |
| | | // import '@/lib/jquery-3.5.1.min'; |
| | | |
| | | const toolboxStore = useToolboxStore(); |
| | | |
| | | /** |
| | | * åæ æ¾åé¼ æ ç¹å»åè°äºä»¶ |
| | |
| | | */ |
| | | toggleFeatures(value) { |
| | | value ? map.setFeatures(['bg', 'road', 'point', 'building']) : map.setFeatures(['bg', 'road']); |
| | | toolboxStore.featuresStatus = value; |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | toggleSatellite(value) { |
| | | value ? satellite.show() : satellite.hide(); |
| | | toolboxStore.satelliteStatus = value; |
| | | }, |
| | | |
| | | /** |
| | |
| | | toggleControlbar(value) { |
| | | // value ? controlbar.show() : controlbar.hide(); |
| | | value ? $('.amap-controlbar').show() : $('.amap-controlbar').hide(); |
| | | toolboxStore.controlbarStatus = value; |
| | | }, |
| | | |
| | | /** |
| | |
| | | _locationMarker = undefined; |
| | | _locationText = undefined; |
| | | } |
| | | toolboxStore.coorPickStatus = value; |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <div class="fy-container"> |
| | | <FactorRadio></FactorRadio> |
| | | <FactorRadio @change="(e) => (factorType = e)"></FactorRadio> |
| | | <SearchBar></SearchBar> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Layer from '@/utils/map/3dLayer'; |
| | | import marks from '@/utils/map/marks'; |
| | | |
| | | export default { |
| | | name: 'HistoryPage' |
| | | name: 'HistoryPage', |
| | | data() { |
| | | return { |
| | | factorType: '', |
| | | factorDatas: [], |
| | | merge: false, |
| | | setCenter: true |
| | | }; |
| | | }, |
| | | watch: { |
| | | factorType(nValue, oValue) { |
| | | if (nValue != oValue) { |
| | | this.draw(); |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | draw() { |
| | | const factor = this.factorDatas.factor[this.factorType]; |
| | | this.drawRoadMap(factor); |
| | | this.drawMassMarks(factor); |
| | | }, |
| | | // ç»å¶3Dèµ°è¡è·¯çº¿å¾ |
| | | drawRoadMap(e) { |
| | | // this.factorMode = factorMode; |
| | | // this.factorType = factorType; |
| | | // this.factorName = factorName; |
| | | // this.factorDatas.refreshHeight(this.factorType + 1 + ''); |
| | | // this.refreshLegend(this.factorDatas); |
| | | // this.mapMaker.setFactorType(factorType); |
| | | // if (!this.mapMaker.runStatus()) { |
| | | |
| | | Layer.drawRoadMap(this.factorDatas, e, this.merge, this.setCenter); |
| | | // } |
| | | }, |
| | | drawMassMarks(e) { |
| | | marks.drawMassMarks(this.factorDatas, e, () => { |
| | | // æ¥è¯¢èå´å
ççæµç«ç¹ |
| | | // SceneUtil.searchByCoordinate(lnglat[0], lnglat[1], distance); |
| | | // 3. è¶å¿å¾è·³è½¬å®ä½ |
| | | // const progress = FChart.locate(lineChart.chart, lineChart.option, i, _factor.factorName); |
| | | // 4. è¡¨æ ¼æ°æ®è·³è½¬å®ä½ |
| | | // Table.locate(i); |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .fy-container { |
| | | background-color: antiquewhite; |
| | | } |
| | | </style> |