Error using Github example for plotgeotriggerhandler.js

10 views
Skip to first unread message

Andreas Arvidsson

unread,
Oct 15, 2015, 3:06:07 AM10/15/15
to plot-users
Hi!

When I use the Github example for plotgeotriggerhandler.js in my titanium app I get an error when I enter a geotrigger zone:

"undefined is not a function (evaluating 'plot.markGeoTriggersHandled(geotriggersPassed)') at plotgeotriggerhandler.js (line 1)"


What is it I do wrong? 

All best,

Andreas


This is the code:



var plot = require('com.plotprojects.ti');


Ti.API.info('Plot version: ' + plot.version);


var geotriggersHandler = plot.popGeotriggers();

var geotriggersPassed = [];


for (var i = 0; i < geotriggersHandler.geotriggers.length; i++) {

    var geotrigger = geotriggersHandler.geotriggers[i];

    if (geotrigger.data == "pass") {

        geotriggersPassed.push(geotrigger);

    }


    Ti.API.info(JSON.stringify(geotrigger));

}


plot.markGeoTriggersHandled(geotriggersPassed);

Mark van der Tol

unread,
Oct 15, 2015, 3:46:20 AM10/15/15
to plot-users
Hi Andreas,

There is a typo on the last line. It should say plot.markGeotriggersHandled(geotriggersPassed);. The T shouldn't be capitalized. 

Thanks for mentioning. We will update the documentation.

Kind regards,
Mark van der Tol
Plot Projects
Reply all
Reply to author
Forward
0 new messages