updateLayer()

Information

Implementation version: beta 1.06

Description

Updates the properties of a feature layer.

Invocation

updateLayer(
	layerName,
	uploadParam,
	newData,
	joinField,
	symbologyType,
	showUpdateInfo
)

Input parameters

layerName

The name of the layer from which the dataSource will be selected. This name corresponds to the name of the feature collection (featureCollection.name). It is entered as a text string.

uploadParam

Parameter that includes the option to update. It is received as a text string, and currently it accepts only 'position'.

newData

Parameter with the new information regarding which the existing one will be checked. This parameter must correspond to a FeatureCollection equal to the one used to create the original layer with the createLayer() method. It accepts an object with the feature collection.

joinField

Corresponds to the name of the property that will interrelate the collection of entities of the new data with the entities of the layer. This property must be defined in 'entityProperties' or 'entityProperties.properties' of the entity. It is entered into the method as a text string.

symbologyType

Parameter specifying the type of symbology that the layer being updated has. The entered value must correspond to the value used when executing the createLayer(). It is input as a text string, and as of now it only accepts 'billboard'.

showUpdateInfo

Parameter that shows or hides the layer's update information in the browser console. This parameter is entered as a text string, and can be:

  1. true: shows the layer's update information of the layer
  2. false: hides the layer's update information of the layer

Use examples

Update the position of the entities of a layer named "realTimeBusData" with symbology common to all its entities, from a JSON object called "newPositionsFeatureCollection" and in FeatureCollection format, using as, a link between the old and new data, a field called "codBus", displaying updated data in the console.

updateLayer(
	'realTimeBusData',
    'position',
    newPositionsFeatureCollection,
    'codBus',
    'billboard',
    true
)