Make pool upload map show district border

This commit is contained in:
Eli Ribble 2026-02-17 06:05:24 +00:00
parent 5a7c9fd090
commit cd6bbc69a4
No known key found for this signature in database
4 changed files with 61 additions and 53 deletions

View file

@ -8,8 +8,8 @@
></script>
<script src="/static/js/map-libre-test.js"></script>
<script>
const CSV_FILE_ID={{ .CSVFileID }};
const ORG_ID={{ .User.Organization.ID }}
const CSV_FILE_ID={{.CSVFileID}};
const ORG_ID={{.Organization.ID}};
function handleShowIssuesOnly() {
const checkboxShowIssuesOnly = document.getElementById("showIssuesOnly");
const allRows = document.querySelectorAll('tr');
@ -28,16 +28,16 @@ function handleShowIssuesOnly() {
function onLoad() {
const map = document.querySelector("map-libre-test");
map.addEventListener("load", (event) => {
map.addSource('tegola-nidus-fileupload', {
map.addSource('tegola-nidus', {
'type': 'vector',
'tiles': [
`{{.URL.Tegola}}maps/fileupload/{z}/{x}/{y}?csv_file=${CSV_FILE_ID}&organization_id=${ORG_ID}`
`{{.URL.Tegola}}maps/nidus/{z}/{x}/{y}?csv_file=${CSV_FILE_ID}&id=${ORG_ID}`
]
});
map.addLayer({
'id': 'pool',
'source': 'tegola-nidus-fileupload',
'source-layer': 'pool',
'source': 'tegola-nidus',
'source-layer': 'fileupload-pool',
'type': 'circle',
'paint': {
'circle-color': "#91b979",
@ -46,6 +46,15 @@ function onLoad() {
'circle-stroke-color': "#7aab5f"
}
});
map.addLayer({
"id": "clear-service-area",
"source": "tegola-nidus",
"source-layer": "service-area-bounds",
"type": "line",
"paint": {
"line-color": "#f00"
}
});
});
const checkboxShowIssuesOnly = document.getElementById("showIssuesOnly");
@ -110,7 +119,17 @@ document.addEventListener('DOMContentLoaded', onLoad);
</div>
<div class="card mb-4">
<map-libre-test></map-libre-test>
<map-libre-test
centroid="{{ if .Organization.ServiceAreaCentroidGeojson.IsValue }}
{{ .Organization.ServiceAreaCentroidGeojson.MustGet|json }}
{{ end }}"
organization-id="{{ .Organization.ID }}"
xmin="{{ .Organization.ServiceAreaXmin.GetOr 0 }}"
ymin="{{ .Organization.ServiceAreaYmin.GetOr 0 }}"
xmax="{{ .Organization.ServiceAreaXmax.GetOr 0 }}"
ymax="{{ .Organization.ServiceAreaYmax.GetOr 0 }}"
></map-libre-test>
const CENTROID=;
</div>
<div class="card mb-4">
<div