Technical documentation of Geoportal API

  • FR
  • UK

Index / Documentation / Technical documentation

Adding controls

Controls 
Adding in MXML 
Adding in ActionScript

Controls

Controls are components which enable to establish a dialog with the map: display et reorganize layers, pan the map, zoom,...

To automatically insert the default controls, simply set the parameter defaultControls of the Map tag to true.

Adding in MXML

To add controls, simply add the corresponding tags inside the <Geoportal:Map> tag.

Example :

<geoportail:Map id="fxMap" ... defaultControls="false" >
    (...)
    <geoportail:PermanentLogo bottom="15" left="15" />
    (...)
</geoportail:Map>

Adding in ActionScript

It is also possible to add controls to the map by ActionScript using the method addControl of the component Map.

For example, one can add the component LayerManager, by adding the following script into the application (before the component Map):

<fx:Script>

import geoportalFx.control.layermanager.FxLayerManager;

private function addLayerManager():void{

    //Creating a new Layer Manager
    var control:FxLayerManager = new FxLayerManager();

    // Addding the Layer Maneger to the map
    fxMap.addControl(control);
}

</fx:Script>

Then execute this method once the application is loaded by filling the s:Application> tag with the following attribute:

creationComplete="this.addLayerManager()"