diff --git a/FMS.Infrastructure/DbScripts/GetNearbyFacilities.cs b/FMS.Infrastructure/DbScripts/GetNearbyFacilities.cs index 8aabc26c..fd79b130 100644 --- a/FMS.Infrastructure/DbScripts/GetNearbyFacilities.cs +++ b/FMS.Infrastructure/DbScripts/GetNearbyFacilities.cs @@ -49,7 +49,7 @@ INNER JOIN [dbo].[FacilityStatuses] as b ON a.FacilityStatusId = b.Id INNER JOIN [dbo].[FacilityTypes] as c ON a.FacilityTypeId = c.Id - INNER JOIN [dbo].[Files] as d + LEFT JOIN [dbo].[Files] as d ON a.FileId = d.Id where (a.Active = 1 AND ( @FacilityTypeId IS NULL OR a.FacilityTypeId = @FacilityTypeId )) or @Active = 0 diff --git a/FMS/wwwroot/js/mapSearch.js b/FMS/wwwroot/js/mapSearch.js index d72db41b..fbc5e923 100644 --- a/FMS/wwwroot/js/mapSearch.js +++ b/FMS/wwwroot/js/mapSearch.js @@ -186,10 +186,18 @@ $(document).ready(function mapSearch() { zip = "" } const hyplink = "./Details/" + data.id; - const hyplink2 = "../Files/Details/" + data.fileLabel; + var hyplink2; + var fileLabel; + if (data.fileLabel === null) { + hyplink2 = hyplink; + fileLabel = "No File Label. Facility Details"; + } else { + hyplink2 = "../Files/Details/" + data.fileLabel; + fileLabel = data.fileLabel; + } // This defines the contents of the InfoWindow that pops up when a marker is clicked on. google.maps.event.addListener(marker, "spider_click", function () { - infowindow.setContent('