a JMapSelection object
a JLocation representing the centroid of the selection
Error if selection is empty
// get the current selected features by layer id
const selection = JMap.Map.Selection.getSelectedFeatures()
// compute the centroid of the selection
const centroid = JMap.Map.Selection.getSelectionCentroid(selection)
console.log(`centroid of selection is located at: LAT: ${centroid.y}, LON: ${centroid.x}`)
JMap.Map.Selection.getSelectionCentroid