Add MN sales tax layers
This commit is contained in:
parent
e39c23a102
commit
e0a778fc15
4 changed files with 121 additions and 0 deletions
45
layers/mn-sales-tax/index.js
Normal file
45
layers/mn-sales-tax/index.js
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import GeoJSON from 'ol/format/GeoJSON.js';
|
||||
import VectorLayer from 'ol/layer/Vector.js';
|
||||
import VectorSource from 'ol/source/Vector.js';
|
||||
|
||||
import history from './data/history.js';
|
||||
|
||||
import { Fill, Stroke, Style, Text } from 'ol/style.js';
|
||||
|
||||
|
||||
function style(feature){
|
||||
return new Style({
|
||||
text: new Text({
|
||||
text: feature.get('NameLabel') + ': ' + feature.get('TotalFrmal'),
|
||||
}),
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,255,255,0.4)',
|
||||
}),
|
||||
stroke: new Stroke({
|
||||
color: '#008800',
|
||||
width: 1.25,
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
const layers = {
|
||||
name: "Minnesota Sales Tax",
|
||||
layers: [],
|
||||
};
|
||||
|
||||
for (let [name, url] of Object.entries(history)) {
|
||||
const layer = new VectorLayer({
|
||||
source: new VectorSource({
|
||||
url,
|
||||
format: new GeoJSON,
|
||||
}),
|
||||
style: style,
|
||||
});
|
||||
|
||||
layers.layers.push({
|
||||
name,
|
||||
layer,
|
||||
});
|
||||
}
|
||||
|
||||
export default layers;
|
||||
Loading…
Add table
Add a link
Reference in a new issue