The Lightspeed map components are created using a TLcyLspMapComponentFactory, which is an extension of ALcyGUIFactory.

A general description on how to customize ALcyGUIFactory instances can be found in Working with ALcyGUIFActory instances..

Replacing the map component factory

The default factory can be replaced in the config file (see TLcyLspMapAddOn.cfg) or by overriding the TLcyLspMapAddOn#createGUIFactory method. Both approaches are illustrated below:

Specifying a custom map component factory in the configuration file of the TLcyLspMapAddOn
# Include the default configuration, so that you only need
# to overwrite the settings you want to customize
includeConfig=lucy/lspmap/TLcyLspMapAddOn.cfg

# Replace the map component factory for the default map component type
# Consult the documentation of the TLcyLspMapAddOn.GUIFactory.default property for more information
TLcyLspMapAddOn.GUIFactory.default = samples.lucy.lightspeed.map.guifactory.LspMapComponentFactory

See How to customize the configuration file of a standard Lucy add-on for more information on how to use a custom configuration file.

Specifying a custom map component factory through the API. (from samples/lucy/lightspeed/map/guifactory/LspMapAddOn)
@Override
protected ALcyGUIFactory<ILcyLspMapComponent> createGUIFactory(String aMapComponentType) {
    return new LspMapComponentFactory(getLucyEnv());
}

See How to customize the add-ons used by your application for more information on how to use a custom add-on.

Customizing the layer control

Each map component features a layer control panel. The creation of the layer control is delegated to another ALcyGUIFactory.

This layer control factory can be configured in the configuration file (see TLcyLspMapAddOn.cfg) or be set through the API by calling TLcyLspMapComponentFactory#setMapLayerControlFactory(TLcyLspMapLayerControlFactory).

When no factory is set, the default factory will be used.

Both approaches are illustrated below:

Specifying a custom map layer control factory in the configuration file of the TLcyLspMapAddOn
# Include the default configuration, so that you only need
# to overwrite the settings you want to customize
includeConfig=lucy/lspmap/TLcyLspMapAddOn.cfg

# Replace the map layer control factory for the default map component type
# Consult the documentation of the TLcyLspMapAddOn.layerControl.GUIFactory.default property for more information
TLcyLspMapAddOn.layerControl.GUIFactory.default = samples.lucy.lightspeed.map.guifactory.LspMapLayerControlFactory

See How to customize the configuration file of a standard Lucy add-on for more information on how to use a custom configuration file.

Setting a custom map layer control factory in the constructor of a custom map component factory. (from samples/lucy/lightspeed/map/guifactory/LspMapComponentFactory)
public LspMapComponentFactory(ILcyLucyEnv aLucyEnv) {
  super(aLucyEnv);

  //Install a custom TLcyMapLayerControlFactory.
  setMapLayerControlFactory(new LspMapLayerControlFactory(aLucyEnv));
}

The samples.lucy.lightspeed.map.guifactory.Main sample illustrates how to use a custom map component factory and layer control factory.