Accept an object literal for static layer styling

This commit is contained in:
Tim Schaub
2022-07-28 18:13:13 -06:00
parent d5086a7ab5
commit ab48290bd7
22 changed files with 705 additions and 174 deletions

View File

@@ -1,4 +1,3 @@
import {Circle, Fill, Style} from '../src/ol/style.js';
import {Feature, Map, Overlay, View} from '../src/ol/index.js';
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
import {Point} from '../src/ol/geom.js';
@@ -25,12 +24,10 @@ const map = new Map({
source: new VectorSource({
features: [new Feature(point)],
}),
style: new Style({
image: new Circle({
radius: 9,
fill: new Fill({color: 'red'}),
}),
}),
style: {
'circle-radius': 9,
'circle-fill-color': 'red',
},
}),
],
});