-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvpa.template.html
More file actions
139 lines (121 loc) · 5.27 KB
/
vpa.template.html
File metadata and controls
139 lines (121 loc) · 5.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Value Per Acre Overlay</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<style>
#map {
height: 100vh;
}
.popup-content {
min-width: 200px;
}
.property-info {
margin-bottom: 5px;
}
.property-label {
font-weight: bold;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script>
var map = L.map('map').setView([{AVGLAT}, {AVGLON}], 12);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
}).addTo(map);
// Load GeoJSON files for each tax level
var numLevels = {LEVELS};
var taxLevels = [];
// Format currency with dollar sign and commas
function formatCurrency(value) {
return '$' + parseFloat(value).toLocaleString('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2
});
}
// Format number with commas
function formatNumber(value) {
return parseFloat(value).toLocaleString('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2
});
}
// Create popup content for property information
function createPopupContent(properties) {
var content = '<div class="popup-content">';
if (properties.formatted_address) {
content += '<div class="property-info"><span class="property-label">Address:</span> ' + properties.formatted_address + '</div>';
}
if (properties.FOLIO || properties.id) {
var pid = properties.FOLIO || properties.id || 'N/A';
content += '<div class="property-info"><span class="property-label">FOLIO:</span> ' + pid + '</div>';
}
if (properties.size_acres) {
content += '<div class="property-info"><span class="property-label">Parcel Size:</span> ' +
formatNumber(properties.size_acres) + ' Acre(s) (' + formatNumber(properties.size_sqft) + 'ft² / ' + formatNumber(properties.size_sqm) + 'm²)</div>';
}
// Show the actual assessed value if available
if (properties.AssessedValue) {
content += '<div class="property-info"><span class="property-label">Assessed Value:</span> ' +
formatCurrency(properties.AssessedValue) + '</div>';
}
// Show property tax as the taxable value
if (properties.TaxableValue) {
content += '<div class="property-info"><span class="property-label">Estimated Property Taxes Paid (excluding utilities):</span> ' +
formatCurrency(properties.TaxableValue) + '</div>';
}
if (properties.value_per_acre) {
content += '<div class="property-info"><span class="property-label">Value per Acre:</span> ' +
formatCurrency(properties.value_per_acre) + '/acre</div>';
}
content += '</div>';
return content;
}
for (var i = 0; i < numLevels; i++) {
var taxLevel = L.geoJSON(null, {
style: function(feature) {
var taxLevel = feature.properties.level;
var hue = (1 - (taxLevel / numLevels)) * 240; // Interpolate hue from blue (240) to red (0)
return {
fillColor: 'hsl(' + hue + ', 100%, 50%)',
weight: 0.5,
opacity: 0.45,
color: 'hsl(' + hue + ', 100%, 50%)',
fillOpacity: 0.45
};
},
onEachFeature: function(feature, layer) {
// Create popup with property info
var popupContent = createPopupContent(feature.properties);
layer.bindPopup(popupContent);
// Add hover effect
layer.on('mouseover', function() {
this.setStyle({
weight: 2,
opacity: 0.7,
fillOpacity: 0.7
});
});
layer.on('mouseout', function() {
this.setStyle({
weight: 0.5,
opacity: 0.45,
fillOpacity: 0.45
});
});
}
});
taxLevels.push(taxLevel);
}
{DATALIST}
for (var i = 0; i < numLevels; i++) {
taxLevels[i].addTo(map);
}
</script>
</body>
</html>