Skip to content

Commit

Permalink
#10136: Search for Map CRS coordinates
Browse files Browse the repository at this point in the history
Description:
- fix issue in switch to aeronautical inputs then switch to map crs coord search
  • Loading branch information
mahmoudadel54 committed May 6, 2024
1 parent 486c1c5 commit 8e0da7c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions web/client/components/mapcontrols/search/SearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export default ({
onChangeActiveSearchTool={onChangeActiveSearchTool}
onClearBookmarkSearch={onClearBookmarkSearch}
currentMapCRS={currentMapCRS}
onChangeFormat={onChangeFormat}
/>);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const CoordinateOptions = ({
}
}
}),
coordinatesMenuItem: ({activeTool, searchText, clearSearch, onChangeActiveSearchTool, onClearBookmarkSearch, currentMapCRS}) =>{
coordinatesMenuItem: ({activeTool, searchText, clearSearch, onChangeActiveSearchTool, onClearBookmarkSearch, currentMapCRS, onChangeFormat}) =>{
if (currentMapCRS === 'EPSG:4326') {
return (<MenuItem active={activeTool === "coordinatesSearch"} onClick={() => {
if (searchText !== undefined && searchText !== "") {
Expand Down Expand Up @@ -107,6 +107,7 @@ export const CoordinateOptions = ({
}
onClearBookmarkSearch("selected");
onChangeActiveSearchTool("mapCRSCoordinatesSearch");
onChangeFormat("decimal");
document.dispatchEvent(new MouseEvent('click'));
}}>
<span style={{marginLeft: 20}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ const CurrentMapCRSCoordinatesSearch = ({
};
// helper function to validate if the coordinate is within the crs extent or not
const isCoordWithinCrs = (value, coordType) => {
const min = getConstraintsCoordEditor(currentMapCRS)[format][coordType].min;
const max = getConstraintsCoordEditor(currentMapCRS)[format][coordType].max;
const min = getConstraintsCoordEditor(currentMapCRS).decimal[coordType]?.min || 0;
const max = getConstraintsCoordEditor(currentMapCRS).decimal[coordType]?.max || 0;
const coordValue = parseFloat(value);
if (isNaN(coordValue) || coordValue < min || coordValue > max ) {
return false;
Expand Down

0 comments on commit 8e0da7c

Please sign in to comment.