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