| | |
| | | mapViews; |
| | | |
| | | districtPolygon; |
| | | |
| | | events = new Map(); |
| | | |
| | | // 绘制区县边界 |
| | | drawDistrict(districtName, isNew) { |
| | | onMapMounted(() => { |
| | |
| | | ] |
| | | // eslint-disable-next-line no-undef |
| | | .map((d) => new AMap.LngLat(d[0], d[1])), |
| | | extData: points[i] |
| | | extData: { |
| | | centerPoint: points[i], |
| | | // gridPoints, |
| | | gridCell: v |
| | | } |
| | | }; |
| | | }); |
| | | const gridViews = gridMapUtil.drawPolylines({ points: gridPoints, event }); |
| | |
| | | |
| | | // 绘制网格遥感数据值和网格颜色 |
| | | drawGrid({ |
| | | gridData, |
| | | gridDataDetail, |
| | | useCustomColor, |
| | | opacity, |
| | | zIndex, |
| | |
| | | const { resGridViews, pointsRes } = this.drawColor({ |
| | | gridViews: this.mapViews.gridViews, |
| | | points: this.mapViews.points, |
| | | gridDataDetail: gridData, |
| | | gridDataDetail: gridDataDetail, |
| | | lastGridViews: this.mapViews.lastGridViews, |
| | | customColor: useCustomColor, |
| | | opacity: opacity, |
| | |
| | | // 数据标记 |
| | | const { textViews: dataTxt, labelsLayer: dataLayer } = this.drawDataText( |
| | | this.mapViews.lastPoints, |
| | | gridData, |
| | | gridDataDetail, |
| | | this.mapViews.dataTxt, |
| | | this.mapViews.dataLayer |
| | | ); |
| | |
| | | |
| | | const { textViews: rankTxt, labelsLayer: rankLayer } = this.drawRankText( |
| | | this.mapViews.lastPoints, |
| | | gridData, |
| | | gridDataDetail, |
| | | this.mapViews.rankTxt, |
| | | this.mapViews.rankLayer |
| | | ); |
| | |
| | | }); |
| | | } |
| | | |
| | | setGridEvent(event) { |
| | | setGridEvent(name, event) { |
| | | if (!this.events.has(name)) { |
| | | this.events.set(name, []); |
| | | } |
| | | const list = this.events.get(name); |
| | | if (list.length > 0) { |
| | | const lastEvent = list[list.length - 1]; |
| | | this.mapViews.gridViews.forEach((polygon) => { |
| | | polygon.off(name, lastEvent); |
| | | }); |
| | | } |
| | | this.events.get(name).push(event); |
| | | this.mapViews.gridViews.forEach((polygon) => { |
| | | event(polygon); |
| | | polygon.on(name, event); |
| | | }); |
| | | } |
| | | |
| | | |
| | | goBackGridEvent(name) { |
| | | if (this.events.has(name)) { |
| | | const eventList = this.events.get(name); |
| | | //先移除原有的事件 |
| | | const lastEvent = eventList.pop(); |
| | | this.mapViews.gridViews.forEach((polygon) => { |
| | | polygon.off(name, lastEvent); |
| | | }); |
| | | //获取上一个事件 |
| | | const event = eventList.pop(); |
| | | this.mapViews.gridViews.forEach((polygon) => { |
| | | polygon.on(name, event); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // // 地图网格相关对象 |