Add 2 files
Browse files- README.md +7 -5
- index.html +306 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: gis-map
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,306 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Sales Territory Maps</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
|
| 9 |
+
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
| 10 |
+
<style>
|
| 11 |
+
.map-container {
|
| 12 |
+
width: 100%;
|
| 13 |
+
height: 80vh;
|
| 14 |
+
position: relative;
|
| 15 |
+
background-color: #f0f4f8;
|
| 16 |
+
border: 2px solid #e2e8f0;
|
| 17 |
+
}
|
| 18 |
+
#map {
|
| 19 |
+
height: 100%;
|
| 20 |
+
width: 100%;
|
| 21 |
+
}
|
| 22 |
+
.legend {
|
| 23 |
+
position: absolute;
|
| 24 |
+
bottom: 20px;
|
| 25 |
+
right: 20px;
|
| 26 |
+
background: white;
|
| 27 |
+
padding: 15px;
|
| 28 |
+
border-radius: 5px;
|
| 29 |
+
box-shadow: 0 0 15px rgba(0,0,0,0.2);
|
| 30 |
+
z-index: 1000;
|
| 31 |
+
max-height: 60vh;
|
| 32 |
+
overflow-y: auto;
|
| 33 |
+
width: 300px;
|
| 34 |
+
}
|
| 35 |
+
.hospital-marker {
|
| 36 |
+
background: #3b82f6;
|
| 37 |
+
color: white;
|
| 38 |
+
border-radius: 50%;
|
| 39 |
+
width: 24px;
|
| 40 |
+
height: 24px;
|
| 41 |
+
display: flex;
|
| 42 |
+
justify-content: center;
|
| 43 |
+
align-items: center;
|
| 44 |
+
font-weight: bold;
|
| 45 |
+
font-size: 12px;
|
| 46 |
+
box-shadow: 0 0 5px rgba(0,0,0,0.3);
|
| 47 |
+
}
|
| 48 |
+
.airport-marker {
|
| 49 |
+
background: #ef4444;
|
| 50 |
+
color: white;
|
| 51 |
+
border-radius: 50%;
|
| 52 |
+
width: 20px;
|
| 53 |
+
height: 20px;
|
| 54 |
+
display: flex;
|
| 55 |
+
justify-content: center;
|
| 56 |
+
align-items: center;
|
| 57 |
+
font-weight: bold;
|
| 58 |
+
font-size: 10px;
|
| 59 |
+
box-shadow: 0 0 5px rgba(0,0,0,0.3);
|
| 60 |
+
}
|
| 61 |
+
.hospital-table {
|
| 62 |
+
width: 100%;
|
| 63 |
+
border-collapse: collapse;
|
| 64 |
+
}
|
| 65 |
+
.hospital-table th, .hospital-table td {
|
| 66 |
+
border: 1px solid #e2e8f0;
|
| 67 |
+
padding: 8px;
|
| 68 |
+
text-align: left;
|
| 69 |
+
font-size: 12px;
|
| 70 |
+
}
|
| 71 |
+
.hospital-table th {
|
| 72 |
+
background-color: #3b82f6;
|
| 73 |
+
color: white;
|
| 74 |
+
}
|
| 75 |
+
.hospital-table tr:nth-child(even) {
|
| 76 |
+
background-color: #f8fafc;
|
| 77 |
+
}
|
| 78 |
+
.hospital-table tr:hover {
|
| 79 |
+
background-color: #e2e8f0;
|
| 80 |
+
}
|
| 81 |
+
.state-title {
|
| 82 |
+
position: absolute;
|
| 83 |
+
top: 20px;
|
| 84 |
+
left: 20px;
|
| 85 |
+
background: rgba(255,255,255,0.9);
|
| 86 |
+
padding: 10px 20px;
|
| 87 |
+
border-radius: 5px;
|
| 88 |
+
font-size: 24px;
|
| 89 |
+
font-weight: bold;
|
| 90 |
+
z-index: 1000;
|
| 91 |
+
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
| 92 |
+
}
|
| 93 |
+
.print-controls {
|
| 94 |
+
margin-bottom: 20px;
|
| 95 |
+
display: flex;
|
| 96 |
+
gap: 10px;
|
| 97 |
+
}
|
| 98 |
+
@media print {
|
| 99 |
+
.no-print {
|
| 100 |
+
display: none;
|
| 101 |
+
}
|
| 102 |
+
body {
|
| 103 |
+
margin: 0;
|
| 104 |
+
padding: 0;
|
| 105 |
+
}
|
| 106 |
+
.map-container {
|
| 107 |
+
height: 100vh;
|
| 108 |
+
width: 100vw;
|
| 109 |
+
}
|
| 110 |
+
.legend {
|
| 111 |
+
position: absolute;
|
| 112 |
+
bottom: 20px;
|
| 113 |
+
right: 20px;
|
| 114 |
+
max-height: 80vh;
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
</style>
|
| 118 |
+
</head>
|
| 119 |
+
<body class="bg-gray-100 p-4">
|
| 120 |
+
<div class="max-w-7xl mx-auto">
|
| 121 |
+
<h1 class="text-3xl font-bold text-gray-800 mb-6">Sales Territory Maps</h1>
|
| 122 |
+
|
| 123 |
+
<div class="print-controls no-print">
|
| 124 |
+
<select id="state-selector" class="px-4 py-2 border rounded-lg">
|
| 125 |
+
<option value="california">California</option>
|
| 126 |
+
<option value="texas">Texas</option>
|
| 127 |
+
<option value="florida">Florida</option>
|
| 128 |
+
<option value="new-york">New York</option>
|
| 129 |
+
<option value="pennsylvania">Pennsylvania</option>
|
| 130 |
+
<option value="illinois">Illinois</option>
|
| 131 |
+
<option value="ohio">Ohio</option>
|
| 132 |
+
<option value="georgia">Georgia</option>
|
| 133 |
+
<option value="north-carolina">North Carolina</option>
|
| 134 |
+
</select>
|
| 135 |
+
<button onclick="window.print()" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">Print Map</button>
|
| 136 |
+
</div>
|
| 137 |
+
|
| 138 |
+
<div class="map-container">
|
| 139 |
+
<div id="map"></div>
|
| 140 |
+
<div class="state-title" id="state-title">California</div>
|
| 141 |
+
<div class="legend">
|
| 142 |
+
<h3 class="font-bold text-lg mb-2">Hospital Legend</h3>
|
| 143 |
+
<div class="overflow-x-auto">
|
| 144 |
+
<table class="hospital-table">
|
| 145 |
+
<thead>
|
| 146 |
+
<tr>
|
| 147 |
+
<th>#</th>
|
| 148 |
+
<th>Name</th>
|
| 149 |
+
<th>Beds</th>
|
| 150 |
+
<th>NPR</th>
|
| 151 |
+
<th>Parent</th>
|
| 152 |
+
<th>Airport</th>
|
| 153 |
+
</tr>
|
| 154 |
+
</thead>
|
| 155 |
+
<tbody id="legend-table">
|
| 156 |
+
<!-- Will be populated by JavaScript -->
|
| 157 |
+
</tbody>
|
| 158 |
+
</table>
|
| 159 |
+
</div>
|
| 160 |
+
<div class="mt-3 text-sm">
|
| 161 |
+
<div class="flex items-center mb-1">
|
| 162 |
+
<div class="hospital-marker mr-2">1</div>
|
| 163 |
+
<span>Hospital</span>
|
| 164 |
+
</div>
|
| 165 |
+
<div class="flex items-center">
|
| 166 |
+
<div class="airport-marker mr-2">A</div>
|
| 167 |
+
<span>Major Airport</span>
|
| 168 |
+
</div>
|
| 169 |
+
</div>
|
| 170 |
+
</div>
|
| 171 |
+
</div>
|
| 172 |
+
</div>
|
| 173 |
+
|
| 174 |
+
<script>
|
| 175 |
+
// Sample data - in a real implementation, this would come from your spreadsheet
|
| 176 |
+
const stateData = {
|
| 177 |
+
'california': {
|
| 178 |
+
name: 'California',
|
| 179 |
+
center: [36.7783, -119.4179],
|
| 180 |
+
zoom: 6,
|
| 181 |
+
hospitals: [
|
| 182 |
+
{ id: 1, name: 'UCSF Medical Center', beds: 785, npr: 3200000000, parent: 'UCSF Health', lat: 37.7631, lng: -122.4581, airportTime: 25 },
|
| 183 |
+
{ id: 2, name: 'Cedars-Sinai Medical Center', beds: 886, npr: 3800000000, parent: 'Cedars-Sinai', lat: 34.0836, lng: -118.3836, airportTime: 20 },
|
| 184 |
+
{ id: 3, name: 'Stanford Hospital', beds: 613, npr: 2800000000, parent: 'Stanford Health Care', lat: 37.4349, lng: -122.1755, airportTime: 15 },
|
| 185 |
+
{ id: 4, name: 'UCLA Medical Center', beds: 520, npr: 2500000000, parent: 'UCLA Health', lat: 34.0669, lng: -118.4467, airportTime: 18 },
|
| 186 |
+
{ id: 5, name: 'Kaiser Permanente Oakland', beds: 349, npr: 1500000000, parent: 'Kaiser Permanente', lat: 37.8119, lng: -122.2696, airportTime: 22 }
|
| 187 |
+
],
|
| 188 |
+
airports: [
|
| 189 |
+
{ code: 'LAX', name: 'Los Angeles International', lat: 33.9416, lng: -118.4085 },
|
| 190 |
+
{ code: 'SFO', name: 'San Francisco International', lat: 37.6213, lng: -122.3790 },
|
| 191 |
+
{ code: 'SAN', name: 'San Diego International', lat: 32.7338, lng: -117.1933 },
|
| 192 |
+
{ code: 'SJC', name: 'San Jose International', lat: 37.3626, lng: -121.9290 }
|
| 193 |
+
]
|
| 194 |
+
},
|
| 195 |
+
'texas': {
|
| 196 |
+
name: 'Texas',
|
| 197 |
+
center: [31.9686, -99.9018],
|
| 198 |
+
zoom: 6,
|
| 199 |
+
hospitals: [
|
| 200 |
+
{ id: 1, name: 'Houston Methodist Hospital', beds: 948, npr: 4200000000, parent: 'Houston Methodist', lat: 29.7099, lng: -95.4019, airportTime: 18 },
|
| 201 |
+
{ id: 2, name: 'UT Southwestern Medical Center', beds: 460, npr: 2100000000, parent: 'UT Southwestern', lat: 32.8136, lng: -96.8386, airportTime: 15 },
|
| 202 |
+
{ id: 3, name: 'Baylor University Medical Center', beds: 1025, npr: 3800000000, parent: 'Baylor Scott & White', lat: 32.7996, lng: -96.8007, airportTime: 12 }
|
| 203 |
+
],
|
| 204 |
+
airports: [
|
| 205 |
+
{ code: 'DFW', name: 'Dallas/Fort Worth International', lat: 32.8968, lng: -97.0380 },
|
| 206 |
+
{ code: 'IAH', name: 'George Bush Intercontinental', lat: 29.9844, lng: -95.3414 },
|
| 207 |
+
{ code: 'AUS', name: 'Austin-Bergstrom International', lat: 30.1945, lng: -97.6699 }
|
| 208 |
+
]
|
| 209 |
+
}
|
| 210 |
+
// Additional states would follow the same pattern
|
| 211 |
+
};
|
| 212 |
+
|
| 213 |
+
let map;
|
| 214 |
+
let currentState = 'california';
|
| 215 |
+
|
| 216 |
+
function initMap() {
|
| 217 |
+
const state = stateData[currentState];
|
| 218 |
+
|
| 219 |
+
// Initialize map
|
| 220 |
+
map = L.map('map').setView(state.center, state.zoom);
|
| 221 |
+
|
| 222 |
+
// Add tile layer (using OpenStreetMap)
|
| 223 |
+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
| 224 |
+
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
| 225 |
+
}).addTo(map);
|
| 226 |
+
|
| 227 |
+
// Update state title
|
| 228 |
+
document.getElementById('state-title').textContent = state.name;
|
| 229 |
+
|
| 230 |
+
// Clear previous markers
|
| 231 |
+
map.eachLayer(layer => {
|
| 232 |
+
if (layer instanceof L.Marker) {
|
| 233 |
+
map.removeLayer(layer);
|
| 234 |
+
}
|
| 235 |
+
});
|
| 236 |
+
|
| 237 |
+
// Add hospitals
|
| 238 |
+
state.hospitals.forEach(hospital => {
|
| 239 |
+
const marker = L.marker([hospital.lat, hospital.lng], {
|
| 240 |
+
icon: L.divIcon({
|
| 241 |
+
className: 'hospital-icon',
|
| 242 |
+
html: `<div class="hospital-marker">${hospital.id}</div>`,
|
| 243 |
+
iconSize: [24, 24]
|
| 244 |
+
})
|
| 245 |
+
}).addTo(map);
|
| 246 |
+
|
| 247 |
+
// Add popup
|
| 248 |
+
marker.bindPopup(`
|
| 249 |
+
<b>${hospital.name}</b><br>
|
| 250 |
+
Beds: ${hospital.beds.toLocaleString()}<br>
|
| 251 |
+
NPR: $${(hospital.npr / 1000000).toLocaleString()}M<br>
|
| 252 |
+
Parent: ${hospital.parent}<br>
|
| 253 |
+
Airport: ${hospital.airportTime} min
|
| 254 |
+
`);
|
| 255 |
+
});
|
| 256 |
+
|
| 257 |
+
// Add airports
|
| 258 |
+
state.airports.forEach(airport => {
|
| 259 |
+
const marker = L.marker([airport.lat, airport.lng], {
|
| 260 |
+
icon: L.divIcon({
|
| 261 |
+
className: 'airport-icon',
|
| 262 |
+
html: `<div class="airport-marker">${airport.code}</div>`,
|
| 263 |
+
iconSize: [20, 20]
|
| 264 |
+
})
|
| 265 |
+
}).addTo(map);
|
| 266 |
+
|
| 267 |
+
// Add popup
|
| 268 |
+
marker.bindPopup(`
|
| 269 |
+
<b>${airport.name} (${airport.code})</b>
|
| 270 |
+
`);
|
| 271 |
+
});
|
| 272 |
+
|
| 273 |
+
// Update legend table
|
| 274 |
+
const tableBody = document.getElementById('legend-table');
|
| 275 |
+
tableBody.innerHTML = '';
|
| 276 |
+
|
| 277 |
+
state.hospitals.forEach(hospital => {
|
| 278 |
+
const row = document.createElement('tr');
|
| 279 |
+
row.innerHTML = `
|
| 280 |
+
<td>${hospital.id}</td>
|
| 281 |
+
<td>${hospital.name}</td>
|
| 282 |
+
<td>${hospital.beds.toLocaleString()}</td>
|
| 283 |
+
<td>$${(hospital.npr / 1000000).toLocaleString()}M</td>
|
| 284 |
+
<td>${hospital.parent}</td>
|
| 285 |
+
<td>${hospital.airportTime} min</td>
|
| 286 |
+
`;
|
| 287 |
+
tableBody.appendChild(row);
|
| 288 |
+
});
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
// Initialize with first state
|
| 292 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 293 |
+
initMap();
|
| 294 |
+
|
| 295 |
+
// Handle state selection change
|
| 296 |
+
document.getElementById('state-selector').addEventListener('change', (e) => {
|
| 297 |
+
currentState = e.target.value;
|
| 298 |
+
initMap();
|
| 299 |
+
});
|
| 300 |
+
});
|
| 301 |
+
|
| 302 |
+
// For printing, we'd ideally generate a high-resolution version
|
| 303 |
+
// In a real implementation, you might use a server-side solution for this
|
| 304 |
+
</script>
|
| 305 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=Mishak/gis-map" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
|
| 306 |
+
</html>
|