Add UPS service area layers

Requested-By: Eric Villnow
This commit is contained in:
Chandler Swift 2025-11-29 20:25:43 -06:00
parent 2faf722f03
commit 7e5cb5ff1d
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F
7 changed files with 180 additions and 0 deletions

38
layers/ups/index.js Normal file
View file

@ -0,0 +1,38 @@
import VectorLayer from 'ol/layer/Vector';
import {Vector as VectorSource} from 'ol/source.js';
import GeoJSON from 'ol/format/GeoJSON.js';
import states from './states.js';
import {Style, Fill, Text, Stroke} from 'ol/style.js';
let layers = [];
for (let [name, state] of Object.entries(states)) {
const vectorLayer = new VectorLayer({
source: new VectorSource({
url: state,
format: new GeoJSON,
}),
style: function(feature){
return new Style({
text: new Text({
text: feature.get('center'),
}),
fill: new Fill({
color: 'rgba(255,255,255,0.4)',
}),
stroke: new Stroke({
color: '#3399CC',
width: 1.25,
}),
});
}
});
layers.push({
name: name + ' UPS',
layer: vectorLayer,
});
}
layers.sort((a, b) => a.name > b.name ? 1 : -1); // Names are always unique
export default {name: "UPS Service Areas (stale 2023-06 data)", layers};