sendValue()

Information

Implementation version: beta 1.06

Updated in: 1.12

Description

Sends the value of a property, or list of properties, of the properties object from the map gadget to another gadget. The later will receive the value with the fromMap() method, which must be defined in the target gadget (it can be the same as in the map, given the case). This function is exclusively for the Platform's Dashboard. In other environments, it will not send any value.


Invocation

sendValue(
	layerName,
	propertyName
)

Input parameters

layerName

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

propertyName

The name of the property or list of property names whose value you want to send. This parameter is sent as a text string. For example, if you want to send the identifier of the selected element, this parameter would receive the text string 'id', which would refer to properties.id.

Use examples

Send the selected item¡s ID, and express it in the console from fromMap():

sendValue(
	'capa puntos',
	'id'
)

window.fromMap = (param) => {
	console.log(param)
}

Send a number of properties of the selected element, and express it in the console from fromMap():

sendValue(
	'capa puntos',
	['id','name','size']
)

window.fromMap = (params) => {
	if (Array.isArray(params)) {
		console.log("My ID is: " + id + ", the name is: " + name + ", and the size is: " + size + ".")
	}
}