Every map component contains a number of layers, which are placed one on top of the other. How these layers are ordered determines which information is visible and which information is not. Information that is hidden underneath another layer will not be visible.

To determine the optimal order of these layers and show the most relevant information, Lucy must know the characteristics of these layers. Layers can contain different kinds of content, or may need to be updated more or less frequently.

For instance, layers that represent real-time data, such as moving airplanes, need to be updated very frequently, while satellite imagery usually remains static. Re-drawing all the layers when only the real-time layer has changed, could have a big impact on performance, even to the point where the application becomes too slow.

A similar problem arises when layers with distinct content types are mixed, for instance a layer with a background satellite image and a layer containing points. It would be inconvenient if the layer with points were placed underneath the raster layer, because none of the points would be visible.

To prevent those types of problems, Lucy uses a specific algorithm to determine the order in which the layers should be inserted initially. This algorithm uses the type of each layer and the type of its model, which are determined by ILcyGXYLayerTypeProvider instances and ILcyModelContentTypeProvider instances. You can make Lucy aware of the characteristics of a layer by implementing these interfaces to return the right information for the right layer, and adding these implementations to the Lucy back-end.

The following sections explain what information each interface provides, how to implement each of these interfaces to work correctly within Lucy, and how to add your implementations to the Lucy back-end.

Model content types

The interface ILcyModelContentTypeProvider defines what sort of content is contained within a model. The following model content types, defined in ILcyModelContentType, are allowed:

  • ILcyModelContentType.FILLED_AREA for models with only filled areas in it.

  • ILcyModelContentType.RASTER for models with raster data.

  • ILcyModelContentType.MIXED for models with different types of objects in it.

  • ILcyModelContentType.POLYGON for models with only polygons.

  • ILcyModelContentType.POLYLINE for models with only polylines.

  • ILcyModelContentType.POINT for models with only points.

  • ILcyModelContentType.TEXT for models with only text data.

  • ILcyModelContentType.GRID for models that contain a grid.

  • ILcyModelContentType.UNKNOWN for models for which the content type is not known.

To make a specific implementation of ILcyModelContentTypeProvider, you must implement only the method getModelContentType( ILcdModel aModel ). This method returns the appropriate ILcyModelContentType if the provider is able to find one for the given model. Otherwise, ILcyModelContentType.UNKNOWN must be returned. This means that this ILcyModelContentTypeProvider is not able to return an appropriate type. By default, Lucy tries the registered providers one by one until a known type is returned. You can add your implementation of ILcyModelContentTypeProvider to the back-end with the method addModelContentTypeProvider.

Layer types

ILcyGXYLayerType defines the following layer types:

  • ILcyGXYLayerType.BACKGROUND for layers that serve as background data, and do not need editing.

  • ILcyGXYLayerType.EDITABLE for editable layers.

  • ILcyGXYLayerType.REALTIME for layers with real-time data, which will be updated frequently.

  • ILcyGXYLayerType.UNKNOWN for layers for which the type is not known.

Making an implementation of ILcyGXYLayerTypeProvider is equivalent to making an implementation of ILcyModelContentTypeProvider: you must implement only the method getGXYLayerType( ILcdGXYLayer aGXYLayer ). This method must return the appropriate ILcyGXYLayerType if the provider is able to find one for the given model, or ILcyGXYLayerType.UNKNOWN otherwise. As with ILcyModelContentTypeProvider instances, Lucy will try all registered providers one by one until a known type is returned. You can add your implementation of ILcyGXYLayerTypeProvider to the back-end with the method addGXYLayerTypeProvider.