====== Object selection ====== This page does not reflect features in version 4.2 of the OFM product. Objects are selected by clicking or dragging on the map.\\ When objects were selected, OFM will load the first object's attribute rows from the server.\\ Several events are fired during this procedure : * Selection changed event : The selected objects changed. * Attribute rows changed event : The attribute rows of the active object changed. * Attribute row changed event : The selected attribute row changed. Usually you listen for the attributeRowChanged event to occur. ===== General Functions ===== * ''setSelectionLayer()'' : //Update the selection layer specified in the [[flashmap:configuration:map|map configuration file]].// * ''getSelectionBoundingBox()'' : //Returns the bounding box of the last user selection in system units.// ===== Event Listener Functions ===== Events : * "selectionChanged" : The selected objects changed. * "attributeRowsChanged" : The attribute rows of the active object changed. * "attributeRowChanged" : The selected attribute row changed. ===== Multiple Selected Objects ===== When multiple objects are selected, you can also navigate between the selected objects or navigate between the selected object's attribute rows. These functions are available : * activateSelectedObject(index) * selectAttributeRow(index); * getSelectedObjectCount(); * getAttributeRowCount() Whenever the active selected object changes, its attribute rows are retrieved. The centroid will indicate the active selected object and will reposition of you activate a new object. ===== Accessing Attributes ===== Attributes can be retrieved using : * ''getAttributes()'' : //an object with all attributes.// * ''getAttributeName(index)'' : //Get the name of the attribute on the given index.// * ''getAttributeValue(index)'' : //Get the value of the attribute on the given index.// * ''getAttributeType(index)'' : //Get the type of the attribute on the given index.// Don't forget you need to wait for the proper events to come in before you can access attributes! ===== Background Information ===== ==== OrbitGIS Relation ==== Object selection in OFM is a reflection of object selection in OrbitGIS. In OrbitGIS a selection usually results in a group of selected objects, of which one is the **active selected object**. This object can be inspected in more detail using the Object Inspector tool. ==== OFM UI Configuration ==== When a selection layer is defined, the following toolbar buttons will be visible : * query ((this button may still stay visible because it can also be used to view map tooltips)) * subquery * show properties panel If no layer is defined, these buttons may not appear. ==== Example Scenario ==== When the user makes a selection... : * OFM sends a selection request to the server.. * The Server returns the number of selected objects. * => //New Selection// event fired * The first selected object becomes the //active selected object//. * A new **active selected object** causes OFM to an send attribute rows request to the server.. * The Server returns the attribute rows. * => //New Attribute Rows// event fired. * OFM automatically selects the first row as selected row. * => //New Attribute Row// event fired.