UNPKG

692 BHTMLView Raw
1---
2layout: example.html
3title: Styling feature with CanvasGradient or CanvasPattern
4shortdesc: Example showing the countries vector layer styled with patterns and gradients.
5docs: >
6 First this example creates a reusable [`CanvasPattern`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern)
7 and a [`CanvasGradient`](https://developer.mozilla.org/en/docs/Web/API/CanvasGradient). The countries are loaded from
8 a GeoJSON file. A style function determines for each country whether to use a fill with the pregenerated
9 CanvasGradient (rainbow colors) or a CanvasPattern (repeating stacked circles).
10tags: "canvas, gradient, pattern, style"
11---
12<div id="map" class="map"></div>