How to use the ol-ext/featureanimation/FeatureAnimation.call function in ol-ext

To help you get started, we’ve selected a few ol-ext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Viglino / ol-games / featureanimation / Explode.js View on Github external
var ol_featureAnimation_Explode = function(options) {
  options = options||{};
  ol_featureAnimation.call(this, options);
  this.radius = options.radius || 50;

  // Create gradient
  var c = document.createElement('canvas');
  c.width=c.height=10;
  var ctx=c.getContext("2d");
  var gradient = this.gradient = ctx.createRadialGradient( 0, 0, 0, 0,0, this.radius );

  function mask(value, mask) {
    return ((value * mask / 255) | 0);
  }

  var color = ol_color_asArray(options.color||"#ebb")
  var r=color[0], g=color[1], b=color[2], a=color[3];

  gradient.addColorStop(0, 'rgba(' + [mask(r, 255), mask(g, 255), mask(b, 255), a] + ')');

ol-ext

A set of cool extensions for OpenLayers (ol) in node modules structure

BSD-3-Clause
Latest version published 24 days ago

Package Health Score

83 / 100
Full package analysis