Querying

A main design goal of the SDK is to provide a succinct, efficient API for manipulating and querying a Unit Map®. This is achieved through selection instances which provide a chaining API and maintain a collection of the instances they represent. Each set can further be manipulated and filtered using methods such as find, where, has, etc; similar to jQuery and other jQuery-like API's.

For example, the following code snippet will set the fill color to #f0f for Unit instances with ID's of 1, 2, 3, 4, or 5.

map.units().find([1, 2, 3, 4, 5]).color('#f0f');
🚧

All queryable values should be strings, however the values are cast internally, so it's safe to pass integer representations.