Add example using CanvasPattern and CanvasGradient

This commit is contained in:
Marc Jansen
2016-09-08 12:07:56 +02:00
parent e5ac575eb3
commit 09d3028ece
3 changed files with 126 additions and 0 deletions

View File

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