bertagnan
Posts: 5
Joined: Mon Oct 09, 2017 11:01 am

Change icon when ignition on

Wed Jan 17, 2018 9:58 am

Hi all,
I created an event for "ignition on" and then during this event wanted to change the icon according to the ignition state.

I thus used Client script acquiring the ignition signal through the "Argument" as well explained in the blog.

Code: Select all

var quadro = Core.resolveInput('Quadro');

Core.log("Quadro:");

Core.log(quadro);


if (quadro) {
   Map.setMarkerIcon('car_yellow.png');
   Map.setMarkerColor('FF0000');
}

else

{
   Map.setMarkerIcon('car_white.png');
   Map.setMarkerColor('00FF00');

}
"Quadro" is the argument for [SIGNAL_IGNITION]

Where in the code you find "if (quadro)" I have tried every possible expression (boolean, text, integer) to try to make it work. The event is running always (start, pending, finish) as I expect the icon to be restored at the last step.


I should be making some big conceptual mistake.

Is anyone willing to help? Where I am terribly wrong? :roll:

Return to “GpsGate for Developers”