diff --git a/components/search/dnssearchresults.js b/components/search/dnssearchresults.js index 1522e88c..01708b5a 100644 --- a/components/search/dnssearchresults.js +++ b/components/search/dnssearchresults.js @@ -8,7 +8,7 @@ import { connect } from "react-redux"; import transLookup from "../../data/lookuptranslations.json"; import PaginationControl from "./pagination"; -import { getBasicDNSSearchPaged } from "../../actions"; +import { getBasicDNSSearchPaged, getDNSCoords } from "../../actions"; import GoogleMapReact from "google-map-react"; import { parseCookies } from "nookies"; @@ -42,7 +42,6 @@ const DNSSearchResults = (props) => { setSearchDetails, advancedSearch, setCurrentPage, - dnsCoords, myportal, watchedCases, setWatchedCases, @@ -59,86 +58,86 @@ const DNSSearchResults = (props) => { const [searchLoaded, setSearchLoaded] = useState(false); const [showSpinnerState, setShowSpinnerState] = useState(false); - let dataArray = []; - //push your Json Data in the array - if (showMap == "true") { - dnsCoords.map((item) => { - let point = new OSPoint( - item.pinswg_anticipatedgridrefnorthing || - item.pinswg_anticipatedgridreferencenorthingtext || - 0, - item.pinswg_anticipatedgridrefeasting || - item.pinswg_anticipatedgridreferenceeastingtext || - 0 - ); - let siteCoords = point.toOSGB36(); - //console.log(siteCoords); - //console.log(item); - dataArray.push({ - appellant: - item[ - "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" - ], - name: item.pinswg_projectname, - lat: parseFloat(siteCoords.latitude), - lng: parseFloat(siteCoords.longitude), - title: item.pinswg_name, - }); - }); - } + // let dataArray = []; + // //push your Json Data in the array + // if (showMap == "true") { + // dnsCoords.map((item) => { + // let point = new OSPoint( + // item.pinswg_anticipatedgridrefnorthing || + // item.pinswg_anticipatedgridreferencenorthingtext || + // 0, + // item.pinswg_anticipatedgridrefeasting || + // item.pinswg_anticipatedgridreferenceeastingtext || + // 0 + // ); + // let siteCoords = point.toOSGB36(); + // //console.log(siteCoords); + // //console.log(item); + // dataArray.push({ + // appellant: + // item[ + // "_pinswg_appellant_value@OData.Community.Display.V1.FormattedValue" + // ], + // name: item.pinswg_projectname, + // lat: parseFloat(siteCoords.latitude), + // lng: parseFloat(siteCoords.longitude), + // title: item.pinswg_name, + // }); + // }); + // } //console.log(dataArray); - const ModelsMap = (map, maps) => { - //instantiate array that will hold your Json Data - //console.log("here"); - var prev_infowindow = false; - //Loop through the dataArray to create a marker per data using the coordinates in the json - console.log(dataArray.length); - for (let i = 0; i < dataArray.length; i++) { - const infowindow = new google.maps.InfoWindow({ - content: - "