| | |
| | | window.urlParameterLayer = null; |
| | | window.divIcon = null; |
| | | |
| | | |
| | | const urlParameter = { |
| | | state: { |
| | | urlParameterData: {}, |
| | | urlParameterLayer: null // 自定义标签图层 |
| | | // urlParameterLayer: null // 自定义标签图层 |
| | | }, |
| | | actions: { |
| | | addurlParameterLayerIcon ({ |
| | | addurlParameterLayerIcon({ |
| | | state, |
| | | commit, |
| | | dispatch |
| | | }, val) { |
| | | const list = val.list |
| | | if (val.clear) { |
| | | // state.urlParameterLayer.remove(); |
| | | state.urlParameterLayer.clear() |
| | | // window.urlParameterLayer.remove(); |
| | | window.urlParameterLayererLayer.clear() |
| | | } |
| | | for (const i in list) { |
| | | // console.log(list[i], 112233) |
| | | const divIcon = new global.DC.DivIcon( |
| | | window.divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position( |
| | | Number(list[i].jd), |
| | | Number(list[i].wd), |
| | |
| | | </div> |
| | | ` |
| | | ) |
| | | divIcon.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | window.divIcon.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | const lntLat = [+list[i].jd, +list[i].wd] |
| | | const d = { |
| | | position: {}, |
| | |
| | | } |
| | | dispatch('setMobileWindows', d) |
| | | }) |
| | | state.urlParameterLayer.addOverlay(divIcon) |
| | | window.urlParameterLayer.addOverlay(window.divIcon) |
| | | } |
| | | } |
| | | }, |
| | | mutations: { |
| | | initurlParameterLayer (state, val) { |
| | | if (!state.urlParameterLayer) { |
| | | state.urlParameterLayer = new global.DC.HtmlLayer('urlParameterLayer') |
| | | state.mviewer.addLayer(state.urlParameterLayer) |
| | | initurlParameterLayer(state, val) { |
| | | if (!window.urlParameterLayer) { |
| | | window.urlParameterLayer = new global.DC.HtmlLayer('urlParameterLayer') |
| | | global.viewer.addLayer(window.urlParameterLayer) |
| | | } |
| | | }, |
| | | set_urlParameterData (state, val) { |
| | | set_urlParameterData(state, val) { |
| | | state.urlParameterData = val |
| | | }, |
| | | |
| | | clearurlParameterLayerIcon (state, val) { |
| | | if (state.urlParameterLayer) { |
| | | state.urlParameterLayer.clear() |
| | | clearurlParameterLayerIcon(state, val) { |
| | | if (window.urlParameterLayer) { |
| | | window.urlParameterLayer.clear() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | export default urlParameter |
| | | export default urlParameter |