Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ol3-async-source

An Asynchronous ImageCanvas Source for OpenLayers 3.x

Usage

This source is based on the original ol.source.ImageCanvas (docs) and the interface is largely the same, but of course there are some differences:

  • Instead of the canvasFunction returning a canvas object, the source has an extra config parameter: a reference to a canvas object, called canvasElement
  • The canvasFunction has an extra parameter, a callback to call when rendering is complete.

Example

var canvas = document.createElement('canvas');

var source = new ol.source.ImageCanvasAsync({
    canvasElement: canvas,
    canvasFunction: function (extent, resolution, pixelRatio, size, projection, callback) {
        doAsyncRender(...).then(callback);
    }
    projection: ...,
    ratio: ...
});

License

BSD-2 (c) Commonwealth Computer Research, Inc.

About

An Asynchronous ImageCanvas Source for OpenLayers 3.x

Resources

Stars

3 stars

Watchers

54 watching

Forks

Releases

Packages

Contributors

Languages