Change GPS Marker Color Based on Attribute

Hi @David_MacKenzie,

Yes, you can modify the color of the GPS based on the conditions of a given attribute. You’re going to want to use Conditional Block Helpers, which had a really nice write up as a Losant tip:

In your GPS History block, first, you’ll want to configure additional attributes along with the GPS coordinates:

Then, in your Point Display Configuration, under Pin Style, select ‘Advanced’ and using the icon template area input your code using Handlebars and the Conditional Block helpers to set the logic for determining pin color. You’ll want to use the {{#gt}} helper to set the conditional logic. I built up a test application based around the specifics you stated above, and was able to get the following code to modify the color of my GPS pin correctly, where 1000 is used as the threshold for the conditional:

{{#if isLastPoint}}
{{#gt data.motorHoursUsed 1000}}
{{colorMarker '#8db319'}}
{{else}}
{{colorMarker '#ff261b'}}
{{/gt}}
{{/if}}

Let me know if you have any other questions.

Thanks,
@Aidan_Zebertavage