pomelo-schedule is the aoi module used in the demo of pomelo.
The aoi module include a set of aoi interface, and an implementation of tower aoi algorithm.
npm install pomelo-aoi
For the aoi service can be used in many areas, each area use the aoi module should use it's own aoi instance. We use a aoi factory to generate aoi instance, it accept an object as parameter, and return an aoi instance, which can be used to implament the aoi function.
var aoiManager = ;var config =map :width : 3200height : 2400tower :width : 300height : 300var aoi = qoiManager;
The aoi instace has the basic interface for aoi action.
//Add objectaoi;//Remove objectaoi;//Update objectaoi;//Add watcheraoi;//Remove watcheraoi
More api can be find in aoiService.js.
The aoi service will generate event when the status of objects or watchers changes. You can handler these event :
The event of tower aoi are: 'add', 'remove', 'update' for aoi object, and 'updateWatcher' for watcher. Of course you can ignore all these events without do any effect to aoi function.