File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
build-resources/geocml-server/portal/src/components Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1+ import { useSelector } from "react-redux" ;
2+
3+ export function Legend ( ) {
4+ const layers = useSelector ( ( state ) => state . app . layers ) ;
5+
6+ return (
7+ < div
8+ id = "legend"
9+ className = "position-absolute bg-light rounded p-2 overflow-auto"
10+ style = { {
11+ bottom : "25px" ,
12+ right : 0 ,
13+ zIndex : 99 ,
14+ maxHeight : "40%" ,
15+ maxWidth : "20%" ,
16+ } }
17+ >
18+ < img src = { `/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERTITLE=true&RULELABEL=true&LAYERS=${ layers . map ( ( layer ) => {
19+ return layer . name
20+ } ) . join ( "," ) } `} alt = "Legend" />
21+ </ div >
22+ ) ;
23+ }
Original file line number Diff line number Diff line change 11import { useEffect , useRef } from "react" ;
22import { useDispatch , useSelector } from "react-redux" ;
33import { LayersPane } from "./LayersPane" ;
4+ import { Legend } from "./Legend" ;
45import { hideWebMap } from "../app-slice" ;
56
67const L = require ( "leaflet" ) ;
@@ -67,7 +68,8 @@ export function WebMap() {
6768 </ div >
6869
6970 < LayersPane />
70- </ div >
71+ < Legend />
72+ </ div >
7173 ) ;
7274 }
7375}
You can’t perform that action at this time.
0 commit comments