updated coords and address fix
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user