Skip to content

Commit

Permalink
Update Map Search JS and DB SP
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-karasch committed Mar 5, 2024
1 parent b30606b commit b6a1bb0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion FMS.Infrastructure/DbScripts/GetNearbyFacilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions FMS/wwwroot/js/mapSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('<div style="font-family: arial, helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #00F;"><b><a target="_blank" href= ' + '' + hyplink + "" + '>' + data.name + '</a></b></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10px; font-weight: bold; color: #808080;"><b>' + data.address + '</b></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10px; font-weight: bold; color: #808080;"><b>' + data.city + ', GA ' + zip + '</b></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #00F;"><b><a target="_blank" href= ' + '' + hyplink2 + "" + '> FILE ID: ' + data.fileLabel + '</a></b></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10px; font-weight: bold; color: #808080;"><b>STATUS: ' + data.facilityStatus + '</b></div>');
infowindow.setContent('<div style="font-family: arial, helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #00F;"><b><a target="_blank" href= ' + '' + hyplink + "" + '>' + data.name + '</a></b></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10px; font-weight: bold; color: #808080;"><b>' + data.address + '</b></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10px; font-weight: bold; color: #808080;"><b>' + data.city + ', GA ' + zip + '</b></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #00F;"><b><a target="_blank" href= ' + '' + hyplink2 + "" + '> FILE ID: ' + fileLabel + '</a></b></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10px; font-weight: bold; color: #808080;"><b>STATUS: ' + data.facilityStatus + '</b></div>');
infowindow.open(map, marker);
});
// This adds listener to say, if the marker is "Spiderfiable" then Use the image with the "+" plus sign.
Expand Down

0 comments on commit b6a1bb0

Please sign in to comment.