|
@@ -1,43 +1,87 @@
|
|
|
+import * as source from "ol/source";
|
|
|
+import * as layer from "ol/layer";
|
|
|
+import * as style from "ol/style";
|
|
|
+import * as ol from "ol";
|
|
|
+import GisDefaultDom from '@/views/gis/map-info/overlay/default/index.vue'
|
|
|
+
|
|
|
const state = {
|
|
|
menuRootName: '9cd5fbf9-35fd-4fb2-8c24-1f871afd67be',
|
|
|
map: null,
|
|
|
activeQyId: null,
|
|
|
- gisLayer: null,
|
|
|
- gisSource: null,
|
|
|
tempStatistic: {
|
|
|
total: 0,
|
|
|
lgszyjkscsb: 0,
|
|
|
jgzzmgs: 0,
|
|
|
lgsjkyfl: 0
|
|
|
- }
|
|
|
+ },
|
|
|
+ gisParams: {
|
|
|
+ default: {
|
|
|
+ layer: null,
|
|
|
+ source: null,
|
|
|
+ overlay: null,
|
|
|
+ feature: null,
|
|
|
+ type: '',
|
|
|
+ info: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
|
|
|
const getters = {
|
|
|
}
|
|
|
|
|
|
const mutations = {
|
|
|
- SET_GIS_MAP(state, map) {
|
|
|
- state.map = map
|
|
|
- },
|
|
|
SET_ACTIVE_QY_ID(state, id) {
|
|
|
state.activeQyId = id
|
|
|
},
|
|
|
SET_tempStatistic(state, data) {
|
|
|
state.tempStatistic = data
|
|
|
console.log(data)
|
|
|
- }
|
|
|
+ },
|
|
|
+ SET_GIS_MAP(state, map) {
|
|
|
+ state.map = map
|
|
|
+ state.gisParams.default.source = new source.Vector()
|
|
|
+ state.gisParams.default.layer = new layer.Vector({
|
|
|
+ zIndex: 200,
|
|
|
+ source: state.gisParams.default.source,
|
|
|
+ })
|
|
|
+ state.gisParams.default.layer.set('layerName', 'gisDefault')
|
|
|
+ state.map.addLayer(state.gisParams.default.layer)
|
|
|
+ console.log(GisDefaultDom)
|
|
|
+ // state.qyParams.sbOverlay = new ol.Overlay({
|
|
|
+ // id: 'gisDefalutDom',
|
|
|
+ // element: GisDefaultDom,
|
|
|
+ // autoPan: false,
|
|
|
+ // offset: [0, -60],
|
|
|
+ // positioning: 'bottom-center',
|
|
|
+ // stopEvent: true,
|
|
|
+ // autoPanAnimation: {
|
|
|
+ // duration: 250
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // state.map.addOverlay(state.qyParams.sbOverlay)
|
|
|
+ },
|
|
|
+ SET_GIS_PARAMS(state, {key, type}) {
|
|
|
+ if (!state.gisParams[key].layer) {
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
|
|
|
const actions = {
|
|
|
- LOAD_GIS_MAP({ commit }: any, map: any) {
|
|
|
- commit('SET_GIS_MAP', map)
|
|
|
- },
|
|
|
LOAD_ACTIVE_QY_ID({ commit }: any, id: any) {
|
|
|
commit('SET_ACTIVE_QY_ID', id)
|
|
|
},
|
|
|
LOAD_tempStatistic({ commit }: any, data: any) {
|
|
|
commit('SET_tempStatistic', data)
|
|
|
},
|
|
|
+ LOAD_GIS_MAP({ commit }: any, map: any) {
|
|
|
+ if (!state.map) {
|
|
|
+ commit('SET_GIS_MAP', map)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ LOAD_GIS_PARAMS({ commit }: any, {key, type}: any) {
|
|
|
+ commit('SET_GIS_PARAMS', {key, type})
|
|
|
+ },
|
|
|
}
|
|
|
|
|
|
export default {
|