Skip to content

Commit

Permalink
#9625: fix not showing layer name in identify dropdown for imported v…
Browse files Browse the repository at this point in the history
…ector layers (#9626)
  • Loading branch information
mahmoudadel54 authored Oct 19, 2023
1 parent e50eecd commit c27b0a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/client/components/data/identify/LayerSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const LayerSelector = ({ responses, index, loaded, setIndex, missingResponses, e
useEffect(()=>{
if (!isEmpty(responses)) {
setOptions(responses.map((opt, idx)=> {
const value = opt?.layerMetadata?.title;
const value = opt?.layerMetadata?.title || opt?.layer?.name;
// Display only valid responses in the drop down if showAllResponses is false,
// otherwise all response are visible and the first layer in toc is present in here
const valid = !!validator(format)?.getValidResponses([opt]).length;
Expand All @@ -37,7 +37,7 @@ const LayerSelector = ({ responses, index, loaded, setIndex, missingResponses, e
}, [responses]);

useEffect(()=>{
loaded && setTitle(responses[index]?.layerMetadata?.title || "");
loaded && setTitle(responses[index]?.layerMetadata?.title || responses[index]?.layer?.name || "");
}, [responses, index, loaded]);

const onChange = (event) => {
Expand Down

0 comments on commit c27b0a5

Please sign in to comment.