Add LIFECYCLE filtering, street exceptions UI, address matching improvements, map viewer fixes
This commit is contained in:
+38
-5
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user