Skip to content

Instantly share code, notes, and snippets.

@indus
Last active December 19, 2025 21:53
Show Gist options
  • Select an option

  • Save indus/b5cf76bf24130a5723a63aae9cde0b35 to your computer and use it in GitHub Desktop.

Select an option

Save indus/b5cf76bf24130a5723a63aae9cde0b35 to your computer and use it in GitHub Desktop.
export default function(api) {
var options = [{
name: 'string',
DEFAULT: true
}];
var cmd = {
name: 'set-baz',
options,
command: run,
target: 'layer'
};
return cmd;
// modifies layer in place
function run(lyr, dataset, opts) {
lyr.data.getRecords().forEach(function(d) {
d.baz = opts.string || '';
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment