updated coords and address fix

This commit is contained in:
2025-03-14 15:20:06 +00:00
parent 9eace1b626
commit 68d03ed93d
15 changed files with 347 additions and 727 deletions
+34 -2
View File
@@ -64,8 +64,12 @@ const DNSSearchResults = (props) => {
if (showMap == "true") {
dnsCoords.map((item) => {
let point = new OSPoint(
item.pinswg_anticipatedgridreferencenorthingtext || 0,
item.pinswg_anticipatedgridreferenceeastingtext || 0
item.pinswg_anticipatedgridrefnorthing ||
item.pinswg_anticipatedgridreferencenorthingtext ||
0,
item.pinswg_anticipatedgridrefeasting ||
item.pinswg_anticipatedgridreferenceeastingtext ||
0
);
let siteCoords = point.toOSGB36();
//console.log(siteCoords);
@@ -193,6 +197,15 @@ const DNSSearchResults = (props) => {
});
};
function hasValidKey(obj, key) {
return (
obj.hasOwnProperty(key) &&
obj[key] !== null &&
obj[key] !== undefined &&
obj[key] !== ""
);
}
const ResultsView = (resultsArr) => {
return (
<div className="govuk-grid-row govuk-!-margin-top-9">
@@ -394,7 +407,26 @@ const DNSSearchResults = (props) => {
";"
)[0]
: ""
: hasValidKey(
item,
"pinswg_caseaddress"
)
? item.pinswg_caseaddress !=
null
? item.pinswg_caseaddress.indexOf(
";"
) < 0
? item.pinswg_caseaddress
: router.locale == "cy"
? item.pinswg_caseaddress.split(
";"
)[1]
: item.pinswg_caseaddress.split(
";"
)[0]
: ""
: ""}
{_.has(
detailsObj,
"pinswg_siteaddressline1"