Merge pull request #1069 from hargata/Hargata/image.map.update

Hargata/image.map.update
This commit is contained in:
Hargata Softworks 2025-09-17 08:47:19 -06:00 committed by GitHub
commit 969b28f1b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -13,5 +13,6 @@
public string Coordinates { get; set; }
public string Color { get; set; }
public decimal Opacity { get; set; }
public string Shape { get; set; }
}
}

View File

@ -23,7 +23,15 @@
@foreach(ImageMap imageMap in Model.Map)
{
<a style='cursor:pointer;' onclick='loadRecordsByTags("@imageMap.Tags")'>
@if(!string.IsNullOrWhiteSpace(imageMap.Shape) && imageMap.Shape.ToLower() == "circle") {
var cordParts = imageMap.Coordinates.Split(',');
if (cordParts.Length == 3)
{
<circle cx="@cordParts[0]" cy="@cordParts[1]" r="@cordParts[2]" fill="@imageMap.Color" opacity="@imageMap.Opacity.ToString(CultureInfo.InvariantCulture)"></circle>
}
} else {
<polygon points="@imageMap.Coordinates" fill="@imageMap.Color" opacity="@imageMap.Opacity.ToString(CultureInfo.InvariantCulture)"></polygon>
}
</a>
}
</svg>