Skip to content

Commit

Permalink
Merge pull request #3886 from terrestris/coordinate-info
Browse files Browse the repository at this point in the history
feat: update coordinate button to use the new result value
  • Loading branch information
simonseyock authored Jun 10, 2024
2 parents 6322ec8 + fa6587a commit ea87122
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@fortawesome/react-fontawesome": "^0.2.2",
"@terrestris/base-util": "^2.0.0",
"@terrestris/ol-util": ">=18",
"@terrestris/react-util": "^7.0.0",
"@terrestris/react-util": "^8.0.2",
"@types/lodash": "^4.17.4",
"ag-grid-community": "^31.3.2",
"ag-grid-react": "^31.3.2",
Expand Down
12 changes: 7 additions & 5 deletions src/CoordinateInfo/CoordinateInfo.example.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const CoordinateInfoExample = () => {
};

return (
Object.keys(features).length === 1 && features[Object.keys(features)[0]].length === 1 ?
features.length > 0 ?
<div>
<div
style={{
Expand Down Expand Up @@ -155,8 +155,8 @@ const CoordinateInfoExample = () => {
>
<Statistic
title="State"
value={getValue(features[Object.keys(features)[0]][0], 'STATE_NAME')
|| getValue(features[Object.keys(features)[0]][0], 'name')}
value={getValue(features[0].feature, 'STATE_NAME')
|| getValue(features[0].feature, 'name')}
/>
</Spin>
<Tooltip
Expand All @@ -166,7 +166,7 @@ const CoordinateInfoExample = () => {
style={{ marginTop: 16 }}
type="primary"
onClick={() => {
copy(features[Object.keys(features)[0]][0].get('STATE_NAME'));
copy(features[0].feature.get('STATE_NAME'));
}}
icon={
<FontAwesomeIcon
Expand All @@ -177,7 +177,9 @@ const CoordinateInfoExample = () => {
</Tooltip>
</div>
</div> :
<span>Click on a state to get details about the clicked coordinate.</span>
<span>
Click on a state to get details about the clicked coordinate.
</span>
);
}}
/>
Expand Down

0 comments on commit ea87122

Please sign in to comment.