Add LIFECYCLE filtering, street exceptions UI, address matching improvements, map viewer fixes

This commit is contained in:
zyphlar
2026-04-09 09:36:14 -07:00
parent 449a182fa4
commit e8267b1eee
10 changed files with 544 additions and 33 deletions
+38 -5
View File
@@ -352,10 +352,13 @@ function countyMarkerStyle(feature) {
// Filter function for OSM features
function shouldShowOsmFeature(feature) {
const props = feature.properties || {};
const isService = props.highway === 'service';
const isService = props.highway === 'service' || props.highway === 'track';
const isUnclassified = props.highway === 'unclassified';
const hideService = document.getElementById('hideService').checked;
const hideUnclassified = document.getElementById('hideUnclassified').checked;
if (isService && hideService) return false;
if (isUnclassified && hideUnclassified) return false;
return true;
}
@@ -424,18 +427,21 @@ function createOsmLayer() {
function shouldShowFeature(feature) {
const props = feature.properties || {};
const isRemoved = props.removed === true || props.removed === 'True';
const isService = props.highway === 'service';
const isService = props.highway === 'service' || props.highway === 'track';
const isUnclassified = props.highway === 'unclassified';
const showAdded = document.getElementById('showAdded').checked;
const showRemoved = document.getElementById('showRemoved').checked;
const hideService = document.getElementById('hideService').checked;
const hideUnclassified = document.getElementById('hideUnclassified').checked;
// Check removed/added filter
if (isRemoved && !showRemoved) return false;
if (!isRemoved && !showAdded) return false;
// Check service filter
// Check service/track and unclassified filters
if (isService && hideService) return false;
if (isUnclassified && hideUnclassified) return false;
return true;
}
@@ -504,10 +510,13 @@ function createDiffLayer() {
// Filter function for county features
function shouldShowCountyFeature(feature) {
const props = feature.properties || {};
const isService = props.highway === 'service';
const isService = props.highway === 'service' || props.highway === 'track';
const isUnclassified = props.highway === 'unclassified';
const hideService = document.getElementById('hideService').checked;
const hideUnclassified = document.getElementById('hideUnclassified').checked;
if (isService && hideService) return false;
if (isUnclassified && hideUnclassified) return false;
return true;
}
@@ -694,7 +703,20 @@ function showMultiFeaturePopup(latlng) {
'addr:postcode': 4,
'addr:state': 5,
'name': 10,
'highway': 11
'highway': 11,
// County road fields
'Lifecycle': 20,
'LIFECYCLE': 20,
'FullStreetN': 21,
'FullName': 21,
'StreetClass': 22,
'STRCLASS': 22,
'SpeedLimit': 23,
'SPEEDLIMIT': 23,
'LeftCity': 24,
'RightCity': 25,
'LeftZip': 26,
'RightZip': 27,
};
const sortedKeys = Array.from(allKeys).sort((a, b) => {
@@ -1201,6 +1223,17 @@ document.addEventListener('DOMContentLoaded', function() {
createCountyLayer();
});
document.getElementById('hideUnclassified').addEventListener('change', function() {
createDiffLayer();
createOsmLayer();
createCountyLayer();
});
// Click on empty map area closes any open popup and clears selection
map.on('click', function() {
clearSelection();
});
// Load button
document.getElementById('loadButton').addEventListener('click', function() {
loadFiles();