Skip to content

Commit

Permalink
Merge pull request #15086 from ragolodc/ragolodc-restore-style-in-can…
Browse files Browse the repository at this point in the history
…vas-gradient-pattern

Change the style code in canvas-gradient-pattern.js  to the previous …
  • Loading branch information
tschaub committed Sep 6, 2023
2 parents 232e5f1 + 6544d5c commit 9452ddc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions examples/canvas-gradient-pattern.js
Expand Up @@ -4,6 +4,7 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {DEVICE_PIXEL_RATIO} from '../src/ol/has.js';
import {Fill, Stroke, Style} from '../src/ol/style.js';
import {fromLonLat} from '../src/ol/proj.js';

// Gradient and pattern are in canvas pixel space, so we adjust for the
Expand All @@ -28,11 +29,13 @@ const vectorLayer = new VectorLayer({
url: 'data/kml/states.kml',
format: new KML({extractStyles: false}),
}),
style: {
'fill-color': gradient,
'stroke-width': 1,
'stroke-color': '#333',
},
style: new Style({
fill: new Fill({color: gradient}),
stroke: new Stroke({
color: '#333',
width: 1,
}),
}),
});

const map = new Map({
Expand Down

0 comments on commit 9452ddc

Please sign in to comment.