Skip to content

Instantly share code, notes, and snippets.

@Terny22
Created March 1, 2018 10:38
Show Gist options
  • Save Terny22/ff18d0c8d1e10c568416920ee8016847 to your computer and use it in GitHub Desktop.
Save Terny22/ff18d0c8d1e10c568416920ee8016847 to your computer and use it in GitHub Desktop.
Custom Label example:
<div style="position: relative; white-space: nowrap; text-align: center; font-size: 14px; top: 5px;">
<span style="border: 2px solid #000; border-radius: 10px; color: #000; background-color: #fff; padding-left: 5px; padding-right: 5px; padding-top: 3px; padding-bottom: 3px;">${entityName}</span>
</div>
Color function example:
var status = dsData[dsIndex]['status'];
if (status == 'On route') {
return "#1976d2";
} else if (status == 'At the stop') {
return "green";
}
Marker image fanction example:
var status = dsData[dsIndex]['status'];
var res = { size: 70 };
if (status == 'On route') {
res.url = images[0];
} else if (status == 'At the stop') {
res.url = images[1];
}
return res;
@zouhr
Copy link

zouhr commented Aug 30, 2018

Custom Label example:

${entityName}

Color function example:

var status = dsData[dsIndex]['status'];
if (status == 'On route') {
return "#1976d2";
} else if (status == 'At the stop') {
return "green";
}

Marker image fanction example:

var status = dsData[dsIndex]['status'];
var res = { size: 70 };
if (status == 'On route') {
res.url = images[0];
} else if (status == 'At the stop') {
res.url = images[1];
}
return res;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment