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
- Host: GitHub
- URL: https://github.com/turbo87/ozone.js
- Owner: Turbo87
- License: mit
- Created: 2014-05-10T09:35:14.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-05-27T18:24:16.000Z (about 12 years ago)
- Last Synced: 2025-02-21T21:56:38.325Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 168 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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();
~~~~