From 6e6f9f649bf9cfe7b35fa9ae9f93a8fbbc71cfd7 Mon Sep 17 00:00:00 2001 From: AlexZorkin Date: Mon, 10 Aug 2020 03:53:02 -0700 Subject: [PATCH 1/4] migration for licensed works layer --- ...20200810025228_add_licensed_works_layer.py | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 backend/alembic/versions/20200810025228_add_licensed_works_layer.py diff --git a/backend/alembic/versions/20200810025228_add_licensed_works_layer.py b/backend/alembic/versions/20200810025228_add_licensed_works_layer.py new file mode 100644 index 000000000..25886e930 --- /dev/null +++ b/backend/alembic/versions/20200810025228_add_licensed_works_layer.py @@ -0,0 +1,96 @@ +"""add licensed works layer + +Revision ID: 369150228f9d +Revises: 603d93ba52ea +Create Date: 2020-08-10 02:52:28.638544 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '369150228f9d' +down_revision = '603d93ba52ea' +branch_labels = None +depends_on = None + + +def upgrade(): + op.execute('SET search_path TO metadata') + + # populate water_licensed_works info + op.execute(""" + WITH ds_id AS ( + INSERT INTO data_source ( + data_source_id, + data_format_code, + name, + description, + source_url, + source_object_name, + data_table_name, + source_object_id, + create_user, create_date, update_user, update_date, effective_date, expiry_date + ) VALUES ( + NEXTVAL(pg_get_serial_sequence('data_source','data_source_id')), + 'json', + 'Water Licensed Works - Lines', + 'Province-wide SDE layer showing linear works associated with a Water Licence', + 'https://catalogue.data.gov.bc.ca/dataset/water-licensed-works-lines', + 'WHSE_WATER_MANAGEMENT.WLS_WATER_LICENCED_WRK_LINE_SP', + 'water_licensed_works', + 'WATER_LICENCED_WORK_LINE_ID', + 'ETL_USER', CURRENT_DATE, 'ETL_USER', CURRENT_DATE, CURRENT_DATE, '9999-12-31T23:59:59Z' + ) RETURNING data_source_id + ), + wms_id AS ( + INSERT INTO wms_catalogue ( + wms_catalogue_id, + description, + wms_name, + wms_style, + create_user, create_date, update_user, update_date, effective_date, expiry_date + ) VALUES ( + (select wms_catalogue_id from wms_catalogue order by wms_catalogue_id desc limit 1) + 1, + 'Water Licensed Works - Lines', + 'WHSE_WATER_MANAGEMENT.WLS_WATER_LICENCED_WRK_LINE_SP', + '', + 'ETL_USER', CURRENT_DATE, 'ETL_USER', CURRENT_DATE, CURRENT_DATE, '9999-12-31T23:59:59Z' + ) RETURNING wms_catalogue_id + ) + INSERT INTO display_catalogue ( + display_data_name, + display_name, + label_column, + label, + highlight_columns, + data_source_id, + wms_catalogue_id, + layer_category_code, + mapbox_layer_id, + mapbox_source_id, + create_user, create_date, update_user, update_date, effective_date, expiry_date + ) SELECT + 'water_licensed_works', + 'Water Licensed Works - Lines', + 'WATER_LICENCED_WORK_LINE_ID', + 'Work Line ID', + ARRAY[ + 'WORKS_ID', 'FEATURE_CODE', 'DISPLAY_COLOUR' + ], + ds_id.data_source_id, + wms_id.wms_catalogue_id, + 'WATER_ADMINISTRATION', + 'iit-water.448thhpa', + 'iit-water.448thhpa', + 'ETL_USER', CURRENT_DATE, 'ETL_USER', CURRENT_DATE, CURRENT_DATE, '9999-12-31T23:59:59Z' + FROM ds_id, wms_id ; + """) + + op.execute('SET search_path TO public') + + + +def downgrade(): + pass From 614be3a5b9973b1655e6a65b2786800c759d47fe Mon Sep 17 00:00:00 2001 From: AlexZorkin Date: Tue, 11 Aug 2020 01:27:41 -0700 Subject: [PATCH 2/4] custom dashed lines for licensed works --- .../surface_water/ModelExplanations.vue | 4 +- .../watershed_demand/WatershedDemand.vue | 2 +- frontend/src/components/map/MapLegend.js | 66 ++++++++++++++++++- frontend/src/store/mapStore.js | 14 +++- 4 files changed, 81 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/analysis/surface_water/ModelExplanations.vue b/frontend/src/components/analysis/surface_water/ModelExplanations.vue index 616fff1d7..43d287b52 100644 --- a/frontend/src/components/analysis/surface_water/ModelExplanations.vue +++ b/frontend/src/components/analysis/surface_water/ModelExplanations.vue @@ -23,7 +23,7 @@

Steyx represents the standard error in the estimate of the hydrological variable (Y) as a function of the regression model (X). - You can find more information on what standard error is here: + You can find more information on what standard error is here: Standard Error - Wikipedia @@ -64,7 +64,7 @@ {{item.solar_exposure_co}} {{item.average_slope_co}} {{item.intercept_co}} - + diff --git a/frontend/src/components/analysis/surface_water/watershed_demand/WatershedDemand.vue b/frontend/src/components/analysis/surface_water/watershed_demand/WatershedDemand.vue index d086d29d4..6bde2280f 100644 --- a/frontend/src/components/analysis/surface_water/watershed_demand/WatershedDemand.vue +++ b/frontend/src/components/analysis/surface_water/watershed_demand/WatershedDemand.vue @@ -143,7 +143,7 @@ export default { let licenseeName = e.features[0].properties['PRIMARY_LICENSEE_NAME'] let sourceName = e.features[0].properties['SOURCE_NAME'] let qty = e.features[0].properties['qty_m3_yr'] - if(qty) { qty = qty.toFixed(1) } // fix on null value + if (qty) { qty = qty.toFixed(1) } // fix on null value let purpose = e.features[0].properties['PURPOSE_USE'] // Ensure that if the map is zoomed out such that multiple diff --git a/frontend/src/components/map/MapLegend.js b/frontend/src/components/map/MapLegend.js index 40537626b..89d5fb375 100644 --- a/frontend/src/components/map/MapLegend.js +++ b/frontend/src/components/map/MapLegend.js @@ -18,6 +18,22 @@ export default { try { mapLayerType = this.map.getLayer(layerID).type + // Add legend items for dashed licensed works layers + if (layerID === 'water_licensed_works') { + for (let i = 0; i < 5; i++) { + mapLayerPaint = this.getPaint(mapLayerType, i === 0 ? layerID : 'water_licensed_works_dash' + i) + legendItems = this.getLegendItems(mapLayerPaint, mapLayerType, 'water_licensed_works_dash' + i) + var layerLegend = { + name: i === 0 ? 'Water Licensed Works - Lines' : '', + legendItems, + 'plenty': true, + 'className': 'grouped' + } + this.legend.push(layerLegend) + } + return + } + if (mapLayerType !== 'raster') { mapLayerPaint = this.getPaint(mapLayerType, layerID) legendItems = this.getLegendItems(mapLayerPaint, mapLayerType, layerID) @@ -148,7 +164,6 @@ export default { } // Streams with allocation restrictions - for (let i = 1; i < paint.color.length; i += 2) { if (paint.color[i].constructor === Array) { text = this.replaceLabelCode(paint.color[i][2].join(', ')) @@ -187,6 +202,55 @@ export default { return 'Active Approvals' case 'Refuse/Abandoned, Cancelled': return 'Non-Active Approvals' + // Water Licensed Works + case 'DB25150000': + return 'Accessway' + case 'DB00100000': + return 'Access Road' + case 'EA06100200': + return 'Conduit - Water' + case 'GA08450000': + return 'Dam' + case 'GE09400000': + return 'Dike/Levee/Berm' + case 'GA08800000': + return 'Ditch' + case 'GB09150000': + return 'Dugout' + case 'GA11500000': + return 'Flume' + case 'GA21050000': + return 'Penstock' + case 'EA21400610': + return 'Pipeline - Water' + case 'GB22100000': + return 'Pond' + case 'GA05200200': + return 'Channel-Rearing' + case 'GB22100210': + return 'Pond-Rearing' + case 'GA05200210': + return 'Channel-Release' + case 'GB24300000': + return 'Reservoir' + case 'GB24300120': + return 'Reservoir - Balancing' + case 'DA25050180': + return 'Road (Paved Divided)' + case 'DA25100190': + return 'Road (Paved Undivided)' + case 'PI11500000': + return 'Spawning Channel' + case 'GA28550000': + return 'Spillway' + case 'EA16400110': + return 'Line (Transmission) - Electrical' + case 'GA30350000': + return 'Tailrace' + case 'DB25150000, DB00100000, DA25100190, DA25050180, GB24300120': + return 'Accessway, Access Road, Road (Paved Undivided), Road (Paved Divided), Reservoir - Balancing' + case 'GA21050000, GB22100000, GA05200200, GB22100210': + return 'Penstock, Pond, Channel-Rearing, Pond-Rearing' default: return code } diff --git a/frontend/src/store/mapStore.js b/frontend/src/store/mapStore.js index a4107863b..dfb348fbb 100644 --- a/frontend/src/store/mapStore.js +++ b/frontend/src/store/mapStore.js @@ -247,7 +247,14 @@ export default { // get list of layers that were deselected (they were in `prev`, but are not in payload), // and sent an event to remove them. - prev.filter((l) => !selectedLayers.includes(l)).forEach((l) => dispatch('removeMapLayer', l)) + prev.filter((l) => !selectedLayers.includes(l)).forEach((l) => { + dispatch('removeMapLayer', l) + if (l === 'water_licensed_works') { + for (let i = 1; i < 5; i++) { + commit('deactivateLayer', 'water_licensed_works_dash' + i) + } + } + }) // similarly, now get a list of layers that are in payload but weren't in the previous active layers. selectedLayers.filter((l) => !prev.includes(l)).forEach((l) => { @@ -255,6 +262,11 @@ export default { const layerName = state.mapLayers.find(e => e.display_data_name === l).display_name window._paq && window._paq.push(['trackEvent', 'Layer', 'Activate Layer', layerName]) commit('activateLayer', l) + if (l === 'water_licensed_works') { + for (let i = 1; i < 5; i++) { + commit('activateLayer', 'water_licensed_works_dash' + i) + } + } }) // reset the list of active layers From 5c8fd58ba98ae945b35aca5f300453f85d8cb351 Mon Sep 17 00:00:00 2001 From: AlexZorkin Date: Tue, 11 Aug 2020 10:54:09 -0700 Subject: [PATCH 3/4] added dotted line icons --- frontend/src/assets/images/lines/conduit.png | Bin 0 -> 1043 bytes frontend/src/assets/images/lines/ditch.png | Bin 0 -> 1044 bytes frontend/src/assets/images/lines/flume.png | Bin 0 -> 1055 bytes frontend/src/assets/images/lines/pipeline.png | Bin 0 -> 1056 bytes .../assets/images/lines/releasechannel.png | Bin 0 -> 1045 bytes frontend/src/assets/images/lines/spillway.png | Bin 0 -> 1041 bytes frontend/src/assets/images/lines/tailrace.png | Bin 0 -> 1071 bytes .../src/assets/images/lines/transmission.png | Bin 0 -> 1057 bytes frontend/src/components/map/MapLegend.js | 39 ++++++++++++++++-- frontend/src/components/map/MapLegend.vue | 3 +- 10 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 frontend/src/assets/images/lines/conduit.png create mode 100644 frontend/src/assets/images/lines/ditch.png create mode 100644 frontend/src/assets/images/lines/flume.png create mode 100644 frontend/src/assets/images/lines/pipeline.png create mode 100644 frontend/src/assets/images/lines/releasechannel.png create mode 100644 frontend/src/assets/images/lines/spillway.png create mode 100644 frontend/src/assets/images/lines/tailrace.png create mode 100644 frontend/src/assets/images/lines/transmission.png diff --git a/frontend/src/assets/images/lines/conduit.png b/frontend/src/assets/images/lines/conduit.png new file mode 100644 index 0000000000000000000000000000000000000000..b3b36b2c17ec0dfb0c8b0cfa6581303394b096dc GIT binary patch literal 1043 zcmbVLziZS`9FG)BDRfXlP!JyJPz&bA%O$x>Y^-T=XAitut|#8$;LFRqyU->tCa+$4 zbSf_X6RvJTX9rzf1Xl-V2SH~M>dW;~9ZClSNnXDBe7?UwueP@yEG^z#6a-0|MGH8j>zS;lcBdWK9s}im2CT{mw%h(^y6& zMlRx%vjt&oy+{$>B@6^)7$uJQT{6!0Zxvv@9IhUB5Mp#lIYJ#8_%8%6L4M$2FN|Lj_uvrKp;sX%a_B z`9Z=^Atm{8<-sR8&Z3k>Gy$bY6wrOFclsVbg7xn!aIJs;fa) zueX{Nx1Hn+C74vPBOZIk^)KYwUPch3S&!1aY74eUl+k=dQ{Z{!)GctkgK(6T#?^9A zr*-=zi(ZhhmC+bXJ8ehjWC5{`OjJjbr9v#}wOS|z8Z;!Ln)SfK*dQ7aXZ-MgJE-ua zlyY7ES)aEynCZSK~GpT{q+Twn3Nt_YXrh2zgxFF$_sX{VHFySe4R-FSBN2flAX82|tP literal 0 HcmV?d00001 diff --git a/frontend/src/assets/images/lines/ditch.png b/frontend/src/assets/images/lines/ditch.png new file mode 100644 index 0000000000000000000000000000000000000000..1d173b8969d41fad8468fefcf6e81b7c9f6d9813 GIT binary patch literal 1044 zcmbVLJ#W)M7&aN#O;E_ z#)4o1#Dc`c(m%ieD;qN_KY)P+38ZpPlfqCjV9ECR_4B;n&y%gqTZ{8o=Osy6?6keE zcwZ6s?A)w)S`ku818?^EHXHB}&ZtxmSwKN2#yhl2ad`0H6J3?0nIh`-dEdX|5EiSr z#HdA_3brJzt`{jLyOe`~?nH?ze|!Hy22tqB_mHpqX@d@<_F+c14>x<{aF^JjyuJoj z3r9GJDaW9Q_mbQxTzTx*5$DpZ$zTlOyRLkaRNvnM4VF=WR7)YyM4)P`(5jfWeG?cu ztZ8~pgB1l@j;T9_0VbC$qGjR0>3Xe6Eb-;aL(Wr2(?+9_I;yBF+tHwH+nR1@hM@?A zk{=`-7fO<^Og(rsCs~y8h$W!(hy%9IU0Gy$QbL^i{;A_6pEOFeOe=7zK~>k{xU6f8 z&Uu&qN#jg(-aAOC)}=Yy&xn}EU}Z`cz592d5-759?q-n~3f}V=*^g<$JDw|xKWZ3- zj*SsSL`MqJ4WyV*)E(HEDu$^C)fyZGCaq5WoW(a=8EYE~32%GhqWtbbt*6RkW zo7Glx%IzdM#|fd+*pY}m;i7+Xokm76XIYQ2z3CQg4H;+okfor}D5q|N>pmt?QW|fR zgF30(qgnKjhOLanVBBdZIwK26Ol;vQR%{&-#jI39B`_dTsBTpQn-D||Do^;~|8`Il zNonP}{Ixz)li11fcq#_*aVjU82n}UIEN`>^DBZMe?WGrMFPG+Y`1#zzwcD4Ue+}C|&x4QBqj#4s{P@27tkh|zx#=Bk+<*KVs_Q{_ literal 0 HcmV?d00001 diff --git a/frontend/src/assets/images/lines/flume.png b/frontend/src/assets/images/lines/flume.png new file mode 100644 index 0000000000000000000000000000000000000000..2f84cbac04ae9b771d45b737b7d9d06dfd9f8b4f GIT binary patch literal 1055 zcmbVLJ#W)M7&awij7~u0vi&X)3`8H9k68k{Q7y`?`N;Qc4Kzt(u^Pov&|K^ z!{77#o<2X#pJrglxq;PtY@PPm2qi?Q`qU$0GejGtLy*7y;D9U&!c-P?d#u;GX=55H zD90#S7<0BDEG}g+!kdJN9@z*YNBaK$qa+5tBi%JxS}U%RL9nuukoBFlF5cP1mM<+` z7Z)>|I|vCwVis;ishv5}*ssmcxmlIOF@$Y8(os^qR$HvmgouV>${6T|Shf^kmUPRy zCPEEVRIQ?dk_=2+*K7#I$tCeu{CvDjAC(P*TMN(xOjRA5<_szDV( znIq(MJ7Or4qjaJ0;F1(4LCgXgiMdDQ(IImrp6O8uVccpRJC4#xqj<~I48UK#IJS2W2p`keLv>lv~1;9EoQ5ngW2C%G`O1|ttV8}!>%bta?K_HPPeE)wt zsPd%Ld|m!opTfjf;Q5>Vy literal 0 HcmV?d00001 diff --git a/frontend/src/assets/images/lines/pipeline.png b/frontend/src/assets/images/lines/pipeline.png new file mode 100644 index 0000000000000000000000000000000000000000..64af76bba0cfa9e13cf29f5925129caf9f44904e GIT binary patch literal 1056 zcmbVLO>5LZ7>+G0Qd&guqNgE6snC2(Hpy;c)3V*{+J$agw+k*Fq?5^PH?+ybWa_5H zlLw*V9}rYLc-6BY)T`cl_UaGtEC_Y7-Bb^y2LnkaZ=UDqHff&?Q9^{8Pdx%!A=)M#g8co*-^hX>OlCp1$9nBm8`Drm zIY!RHn6m|8VJV9d-XRQlWIKo)@#p6+A_#m(d|BYRB}22UTh=_# zR9IEisshUrG;LkAH4Tg}kw;7XzTI(~<5>L55eJOLwxSG&LwQ)1X|k}LB*jS(vw%h*_lP{Y#~hJodRjslx7%lqqjcOT-ZCXau>xgP3B$au z5jtfZ@;8lh(P?)-CQ65-bT7et9{t&Z%zJlnpd84vvDcG;4+ZVI6z_#3VlCGZ`5)O2 zeA_|>G_Yz&hN>Bo4td?4g@~l-s#mGPzNeE);paTQ-qhT>tCw9JHX&@(s-~td843(dUeBj)fw?xqL6jTs z+;X~6ehlt`SDB){NqecB;p!MxL97!ExzGGTWqyt1sEj;>l{qXLG`!v^V MtFh*OT;6*22jz`KH~;_u literal 0 HcmV?d00001 diff --git a/frontend/src/assets/images/lines/releasechannel.png b/frontend/src/assets/images/lines/releasechannel.png new file mode 100644 index 0000000000000000000000000000000000000000..ce7753ae43120658068e7ebe18d2092e1a9fbacf GIT binary patch literal 1045 zcmbVLJ#W)M7&fY?prR6DqNu~kT|mMg=h#lpYTBl8LW6KAX(TfCe7-bRYoD<%#I1yc z*t%6hVrFGwVq;)L{R>QNY_N4gD(5sV3{?j#**?F1p7;AX+S+_HKX-3VlBD_0hT9eI z1#!>bm=#Yuw3NcYTYbLG27HWDDm4P;Q_zXvQm#~_dPhgI~eQygiSxSMW+6sZD1*%AecEv>KAux1U z)AX7KD+;t7Q+EslOfOkPOM`*ab=%We;;SwXIZqr-8;{58xT3OjSAz&4O*b^dPy|BB z4q}dTCC-*g4=&9}8YVnsF(^D@pN)837MY%x5G9^>;W*BwjS?->a-3*T)wL)p>YAW4 z-lc!jxD=iB4ic($X~sq=5%U-0&E6UK<@* xOEx;LsjqZ&d&hr2b9d#PE`L2aKE1j2`kM6i!=3Bh$KT~bsGZiP`*D5e%^#EzLPr1q literal 0 HcmV?d00001 diff --git a/frontend/src/assets/images/lines/spillway.png b/frontend/src/assets/images/lines/spillway.png new file mode 100644 index 0000000000000000000000000000000000000000..b074eed1e2662906da9f46b324fb5d16263e77b6 GIT binary patch literal 1041 zcmbVLO>5LZ7>-nnme#ZNG^8L3CX>k~*-hwLw#jb0U~1W}xJM_G*=}f)Nt3CY){A)a zEC_-i^#^$Mpx{mMFL?7Jc=9enooqMNL+QallF6IrdB2}$n;UBjbJyo2Nm}Txdp+@9 z6!+}qS@EXkx$j3ONQY&Nu1>G2L(;mg)!QL0TEJ-s()F1GHf7c-_R&j|@ zi#Qc*Nm^bhQcQLz2LauVlBWFg{YM!@VN-r!`kJ4*bQG;0W_0UtqfZWZh#kr+cffMt z2nR9c7!>htk~>9Hp7?ddximu=Odx!xDW4=Y@Hc_WG73!9QV23kP`6cN)ePId4Rj4P zpw@t>rXb5PG)LFL^pZuiEF3yLuQQD$zMArg^VETGJRYm#n#!_mh-}-2nhtec5eOwe zNH{K(BwwmLcr+(jl=6rrp!A3Xw$Gcg$n>OyIQ9Kg$4NeIlxP_&a0-#C!8k7KnxJ#u zqkq#l6P@=DQVM%CXZslu^B68wWYN3x1C>CLjdL%H#8B|A$H;z66W;ZjviPHhQRvv% zL?+Qp#ng0DF_5S`urXD1LksE+Gz<({ul$_FH#)lKdbL&0KplkIt%ju=tER2Bbks8H zop#0TCOO9mp;hci#GZ0n=W-o4qnNX-&)9CY1)C$rSw3PZaNTn1Hn{0y5+$YaRynAX zx;>gjk7(G*SPUkecA_(~K*Ycnu4Bd45K)X;EmQ&>nF`gcdSDY`Qk}|Ee)zu~gd!ue_(L`t{6Jq%^dU-5_2D@IXUwjRIA0MyG%zt=(znxx|jy}Iz u-236an7MFc)_L-cTv^Iq%}1}Li`S$#->+VJe6;qf6lu4;;k{jb`1B8^c0sNH literal 0 HcmV?d00001 diff --git a/frontend/src/assets/images/lines/tailrace.png b/frontend/src/assets/images/lines/tailrace.png new file mode 100644 index 0000000000000000000000000000000000000000..ef349911a1db58315d30358092cf96898f3340b3 GIT binary patch literal 1071 zcmbVL&ui0A9FGo%PIq#G8%#n5;)ZGR(j@H*tD|dLS6t@oDi+bc^;6V^Pc+ksEUd5ZBf+r821Yy2(?es8qFp%Wso6qO_`}1gd>GJ5v#0bZ6 zqtyko#@^%X9zH(Ip1P-rsezUobcHl&7e$yWy2QqO)kkZ%hLO8*cL&dM+)(1x8?<39 z8V>O@D8*zFKV)owh=w*v3E1>uHf$yQjxEpK5n!Yi9gb!W5f zKv$T%#Lp%MbKql&_{3iiVk0RCJ--G!r)Ejudl1?#2zyC2tYyALBFt+UU37q|@i~|Q zdRB$-BCp6GFUffcWJRDGs%$6<-@gPFEpnSi&8+lev9E&AqBJxlsoU*ly4ehg)+7KS zlw?Ix6pM?v*Ed2e)o@HYk;CTEoEnf>?+y=?0$Dc3)yQK*LF*=QIzA3) z)hr0?Psa6J10oG*j;x8AtZ1SNSlu>6SX5Nm&gDVVR&j3N=ODgXnb)D3FPbW-08lRG zbw!=mpj=cyQO#A#18y~lDGD4si0!f1eJ(tdYm_34D2eKXtPi$exkV_6TO{O5rF80$ zzhEK93sU2BI;g$6O&odmuv>|U&-XfQcn4$w92My(heRj?M^v*}SF{zNiCETiHgp^f zD_H3B-T&>N#FCQIb@^v~1}3(X>2Y5S>|@9r>*smDpEs*3kLKrY%n5=p-(Ge* z{C%C@vlnOivm6>yVPMT3Tcdq8L@5#K0rd%JM`(j|2nu#yd?Qssn90L#kM+FAHl~q` z3XGgb31@f~?G*EQ^cSaO-n)MXDu6s2`$-z|p`b07;_ZmUtnE4?|04%s zU|Yz5238HpP&Gr+A+OuF5Ro)p_008W5 z*t`0+BL6%d^%h=VIG+9fVd3Vwzdr+x?!G&`bz2p`UV1M)-@OdJ2z%+ZSBFolCxvL+ L%@y}xX?^!MZSqGU literal 0 HcmV?d00001 diff --git a/frontend/src/components/map/MapLegend.js b/frontend/src/components/map/MapLegend.js index 89d5fb375..0e989ec6d 100644 --- a/frontend/src/components/map/MapLegend.js +++ b/frontend/src/components/map/MapLegend.js @@ -1,4 +1,12 @@ import { mapGetters } from 'vuex' +// import conduit from '@/assets/images/lines/conduit' +// import ditch from '@/assets/images/lines/ditch' +// import flume from '@/assets/images/lines/flume' +// import pipeline from '@/assets/images/lines/pipeline' +// import releasechannel from '@/assets/images/lines/releasechannel' +// import spillway from '@/assets/images/lines/spillway' +// import tailrace from '@/assets/images/lines/tailrace' +// import transmission from '@/assets/images/lines/transmission' export default { name: 'MapLegend', @@ -21,8 +29,9 @@ export default { // Add legend items for dashed licensed works layers if (layerID === 'water_licensed_works') { for (let i = 0; i < 5; i++) { - mapLayerPaint = this.getPaint(mapLayerType, i === 0 ? layerID : 'water_licensed_works_dash' + i) - legendItems = this.getLegendItems(mapLayerPaint, mapLayerType, 'water_licensed_works_dash' + i) + let layerName = i === 0 ? layerID : 'water_licensed_works_dash' + i + mapLayerPaint = this.getPaint(mapLayerType, layerName) + legendItems = this.getLegendItems(mapLayerPaint, mapLayerType, layerName) var layerLegend = { name: i === 0 ? 'Water Licensed Works - Lines' : '', legendItems, @@ -150,13 +159,15 @@ export default { global.config.debug && console.log('[wally]', paint.color[i].constructor) if (paint.color[i].constructor === Array) { text = this.replaceLabelCode(paint.color[i].join(', ')) + let image = this.lineImage(text) color = paint.color[i + 1] legendItems.push({ text, color, outlineColor: paint.outlineColor, icon, - iconSize + iconSize, + image }) } } @@ -255,6 +266,28 @@ export default { return code } }, + lineImage (name) { + switch (name) { + case 'Conduit - Water': + return 'conduit.png' + case 'Ditch': + return 'ditch.png' + case 'Flume': + return 'flume.png' + case 'Pipeline - Water': + return 'pipeline.png' + case 'Channel-Release': + return 'releasechannel.png' + case 'Spillway': + return 'spillway.png' + case 'Tailrace': + return 'tailrace.png' + case 'Line (Transmission) - Electrical': + return 'transmission.png' + default: + return null + } + }, toggle () { this.show = !this.show } diff --git a/frontend/src/components/map/MapLegend.vue b/frontend/src/components/map/MapLegend.vue index 5c2a4b7f3..d81ce187b 100644 --- a/frontend/src/components/map/MapLegend.vue +++ b/frontend/src/components/map/MapLegend.vue @@ -5,7 +5,8 @@

{{layer.name}}

- {{item.icon}} + {{item.icon}} + {{item.text}} {{layer.name}}
From 2427c29e34b7907f641c4f86cad078169baaaf2a Mon Sep 17 00:00:00 2001 From: AlexZorkin Date: Tue, 11 Aug 2020 10:54:58 -0700 Subject: [PATCH 4/4] cleanup --- frontend/src/components/map/MapLegend.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/frontend/src/components/map/MapLegend.js b/frontend/src/components/map/MapLegend.js index 0e989ec6d..aaa1e65d8 100644 --- a/frontend/src/components/map/MapLegend.js +++ b/frontend/src/components/map/MapLegend.js @@ -1,12 +1,4 @@ import { mapGetters } from 'vuex' -// import conduit from '@/assets/images/lines/conduit' -// import ditch from '@/assets/images/lines/ditch' -// import flume from '@/assets/images/lines/flume' -// import pipeline from '@/assets/images/lines/pipeline' -// import releasechannel from '@/assets/images/lines/releasechannel' -// import spillway from '@/assets/images/lines/spillway' -// import tailrace from '@/assets/images/lines/tailrace' -// import transmission from '@/assets/images/lines/transmission' export default { name: 'MapLegend',