sergej.shirokov пишет:Actually I don't like my own code because now have to do explicit remote call 'wialon.util.Helper.getZonesInPoint' per each unit, but ok, it works.
You can try some ways of optimization, e.g listen units 'positionChange' event and send 'wialon.util.Helper.getZonesInPoint' only when unit far away from previous calculated point. More over you can push such units in array and send batch request once in minute or any other time you need. And even more, you can get all geofences info and solve 'point inside polygon' task on JS without sending requests at all
sergej.shirokov пишет:Traditional question: is it possible to be notified when something happens with a zone(s), so that minimize number of getZonesInPoint calls?
Actually, from developers side 'zone', 'customFields', 'adminFields' and all other sub-elements of item the same class of objects - Items propitem. And same logic should be used for all of them. My post from previous topic works with propItem 'CustomFields', here is same example for more common situation
// load library to work with <propItem> (including events)
wialon.core.Session.getInstance().loadLibrary("item<propItem>");
// add "update<propItem>" listener
item.addListener("update<propItem>", function (e) {
console.log("<propItem> updated", e);
});