An open API service indexing awesome lists of open source software.

https://github.com/turbo87/ozone.js

HTML5 gliding observation zone renderer
https://github.com/turbo87/ozone.js

Last synced: 11 months ago
JSON representation

HTML5 gliding observation zone renderer

Awesome Lists containing this project

README

          

# ozone.js

ozone.js is a gliding observation zone renderer based on the HTML5 canvas API.

## Usage

Create a HTML5 canvas somewhere on your page:

~~~~html

~~~~

Create an `O3` instance passing in the `id` of the canvas:

~~~~javascript
var o = new O3('myCanvas');
~~~~

Set the observation zone parameters:

~~~~javascript
o.setZone({
'A1': 45,
'R1': 10000,
'A2': 180,
'R2': 500,
});
~~~~

Set the observation zone angle, or set the legs to calculate the angle automatically:

~~~~javascript
o.setAngle(30);
o.setLegs(80, 200);
~~~~

Setting the legs will also cause the renderer to draw the legs below the observation zone.

Finally draw the observation zone to the canvas:

~~~~javascript
o.draw();
~~~~