Skip to content

Commit

Permalink
Updated to have links shown in Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Vismayak committed Mar 23, 2023
1 parent b898463 commit 1f0e0de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/core/src/components/ol/LayersControl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const LayersControl = ({ el, layers, exclude, layersInfo }: Props) => {

const [infoDialogControl, toggleInfoDialog] = React.useState(false);
const [showLayers, updateShowLayers] = React.useState(false);
const [dialogInfo, setDialogInfo] = React.useState({ label:'',description:'' });
const [dialogInfo, setDialogInfo] = React.useState({ label:'',description:'', link:'', more_info:'' });

const [openGroups, updateOpenGroups] = React.useState<{ [groupName: string]: boolean; }>({});

Expand All @@ -103,13 +103,14 @@ const LayersControl = ({ el, layers, exclude, layersInfo }: Props) => {

const handleLayerGroupInfoDialog = (e, layerGroupName) => {
e.stopPropagation();
setDialogInfo({ label:layerGroupName, description: layersInfo[layerGroupName][0] });
setDialogInfo({ label:layerGroupName, description: layersInfo[layerGroupName][0].description, link: layersInfo[layerGroupName][0].link,
more_info:layersInfo[layerGroupName][0].link});
toggleInfoDialog(true);
};

const handleLayerInfoDialog = (e, layerGroupName, layerName) => {
e.stopPropagation();
setDialogInfo({ label:layerName, description: layersInfo[layerGroupName]?.[1][layerName] });
setDialogInfo({ label:layerName, description: layersInfo[layerGroupName]?.[1][layerName].description, link: layersInfo[layerGroupName]?.[1][layerName].link });
toggleInfoDialog(true);
};

Expand Down

0 comments on commit 1f0e0de

Please sign in to comment.