Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the style code in canvas-gradient-pattern.js to the previous … #15086

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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