JS API
Map Object
QueryEngine Object
Layer Object
Feature Object
Query Object
GeoJson Function Library (Experimental)

changeProperties

Creates an filter that restricts, adds or changes the feature properties that are returned from a layer. This is analogous to the SELECT clause of a SQL query.

Parameters

Name Required Description
properties Yes Accepts either an array of strings or a comma-delimited string. Each string is a property definition in the following format:

expression AS/as/As property-name
or
expression

If the "AS property-name' clause is excluded, the name of the property will be the underlying property in the expression, if it is simply the property name or automatically generated if it is an expression or built-in keyword.

Expressions can be anything that is valid for the filterByText filter.

A number of built-in keywords exist:
- Area() - This returns an the area of the geometry related to the feature.
- Length() - This returns the length of the geometry related to the feature.

Example

map.usingLayer("COUNTRIES")
  .changeProperties(["Name", "Region", "CALC_AREA"])
  .update();

map.usingLayer("COUNTRIES")
  .changeProperties("Name AS 'Country Name'")
  .update();
  
map.usingLayer("COUNTRIES")
  .changeProperties("Format(Population / Area(), '#,###.0') as Density")
  .update();

map.usingLayer("COUNTRIES")
  .changeProperties("Population / Area()")
  .update();

map.usingLayer("COUNTRIES")
  .changeProperties("Area() As 'MyArea', Length() As 'MyLength'")
  .update();