| | |
| | | switch (type) { |
| | | case 0: |
| | | window.marsmap._layerCache.zhandian_layer && window.marsmap._layerCache.zhandian_layer.remove() |
| | | window.marsmap._layerCache.changzhan_layer && window.marsmap._layerCache.changzhan_layer.remove() |
| | | window.marsmap._layerCache.cheliang_layer && window.marsmap._layerCache.cheliang_layer.remove() |
| | | window.marsmap._layerCache.changzhan_layer && window.marsmap._layerCache.changzhan_layer.remove() |
| | | window.marsmap._layerCache.cheliang_layer && window.marsmap._layerCache.cheliang_layer.remove() |
| | | this.initfgsLayer(); |
| | | this.isActivatetool = false |
| | | this.isActivatetoolcl = false |
| | |
| | | this.bar[type].text_div = false; |
| | | break; |
| | | case 1: |
| | | window.marsmap._layerCache.zhandian_layer && window.marsmap._layerCache.zhandian_layer.remove() |
| | | window.marsmap._layerCache.fengongsi_layer && window.marsmap._layerCache.fengongsi_layer.remove() |
| | | window.marsmap._layerCache.cheliang_layer && window.marsmap._layerCache.cheliang_layer.remove() |
| | | window.marsmap._layerCache.zhandian_layer && window.marsmap._layerCache.zhandian_layer.remove() |
| | | window.marsmap._layerCache.fengongsi_layer && window.marsmap._layerCache.fengongsi_layer.remove() |
| | | window.marsmap._layerCache.cheliang_layer && window.marsmap._layerCache.cheliang_layer.remove() |
| | | this.initczLayer(); |
| | | this.$store.commit("SET_MapMenu", "场站") |
| | | this.$store.commit("SET_SelAttr", { visa: false }) |
| | |
| | | this.bar[type].text_div = false; |
| | | break; |
| | | case 2: |
| | | window.marsmap._layerCache.fengongsi_layer && window.marsmap._layerCache.fengongsi_layer.remove() |
| | | window.marsmap._layerCache.changzhan_layer && window.marsmap._layerCache.changzhan_layer.remove() |
| | | window.marsmap._layerCache.cheliang_layer && window.marsmap._layerCache.cheliang_layer.remove() |
| | | window.marsmap._layerCache.zhandian_layer && window.marsmap._layerCache.zhandian_layer.remove() |
| | | this.isActivatetool = false |
| | | this.isActivatetoolcl = false |
| | | this.isActivateSearch = false |
| | |
| | | window.marsmap.addLayer(changzhan_area_layer) |
| | | |
| | | this.$axios.get(this.$Interface.mapResource.getChangZhanAllData, {}).then((res) => { |
| | | console.log(res,"changzhan") |
| | | console.log(res, "changzhan") |
| | | if (res.code === 0) { |
| | | console.log(res.data); |
| | | for (let i = 0; i < res.data.length; i++) { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | initxlLayer () { |
| | | // 路线 |
| | | initxlLayer (id = "411", type = "1") { |
| | | let that = this |
| | | const luxian_layer = new this.mars3d.layer.GraphicLayer({ id: 'luxian_layer' }) |
| | | // 2.在layer上绑定监听事件 |
| | | luxian_layer.on(this.mars3d.EventType.click, function (event) { |
| | | console.log('监听layer,单击了矢量对象', event) |
| | | console.log(event.graphic.attr) |
| | | that.$store.commit("SET_SelAttr", { visa: true, type: "luxian", id: event.graphic.attr.stationId, value: event.graphic.attr.stationName }) |
| | | event.graphic.flyTo({ radius: 2000, duration: 1 }) |
| | | |
| | | }) |
| | | const luxian_area_layer = new this.mars3d.layer.GraphicLayer({ id: 'luxian_area_layer' }) |
| | | window.marsmap.addLayer(luxian_layer) |
| | | window.marsmap.addLayer(luxian_area_layer) |
| | | |
| | | this.$axios.get(this.$Interface.mapResource.getXianLuDataByLineID, { |
| | | params: { lineId: id, flag: type }, |
| | | }).then((res) => { |
| | | console.log(res.data.stationList, "luxian") |
| | | if (res.code === 0) { |
| | | console.log(res.data); |
| | | for (let i = 0; i < res.data.stationList.length; i++) { |
| | | console.log("dingwei", res.data.stationList[i].longitude, res.data.stationList[i].latitude) |
| | | const graphic = new this.mars3d.graphic.PointEntity({ |
| | | position: [res.data.stationList[i].longitude, res.data.stationList[i].latitude, 0], |
| | | style: { |
| | | color: "#ff0000", |
| | | pixelSize: 10, |
| | | outlineColor: "#ffffff", |
| | | outlineWidth: 2, |
| | | label: { |
| | | text: res.data.stationList[i].stationName, |
| | | } |
| | | }, |
| | | attr: res.data[i] |
| | | }) |
| | | luxian_layer.addGraphic(graphic) |
| | | } |
| | | } |
| | | }); |
| | | // utils.loadGeometryById("411", "1"); |
| | | console.log("eee") |
| | | }, |
| | |
| | | window.marsmap.addLayer(cheliang_area_layer) |
| | | |
| | | this.$axios.get(this.$Interface.mapResource.getChangZhanAllData, {}).then((res) => { |
| | | console.log(res,"cheliang") |
| | | console.log(res, "cheliang") |
| | | if (res.code === 0) { |
| | | console.log(res.data); |
| | | for (let i = 0; i < res.data.length; i++) { |