Styling feature with CanvasGradient or CanvasPattern——使用CanvasGradient或者CanvasPattern为要素设置样式

Styling feature with CanvasGradient or CanvasPattern——使用CanvasGradient或者CanvasPattern为要素设置样式_第1张图片
First this example creates a reusable CanvasPattern and a 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).
首先这个例子创建了一个可复用的CanvasPattern和CanvasGradient。国家数据从GeoJSON文件中加载。样式函数决定了每一个国家是否使用预先创建的CanvasGradient(多彩色)或者CanvasPattern(重复堆叠的圆)来填充。

代码:


  
    Styling feature with CanvasGradient or CanvasPattern
    
    
    
    
    
  
  
    



你可能感兴趣的:(OpenLayers3)