Class ria.template.FeatureCollectionsFormatter

A FeatureCollectionsFormatter generates an HTML fragment containing all features of one or more feature collections. The formatting of features can be customized on a per-feature-collection basis. During formatting, the template for the features of a particular feature collection is taken from the ria.template.TemplateRepository passed into the constructor. The template is expected to be registered in the template repository with the same name as the feature collection it applies to. A ria.template.DefaultTemplate will be used if no matching template can be found.

Method Summary
Method Attributes Method Name and Description
format(names, featureCollections)
Generates an HTML fragment containing the formatted features of all given feature collections.
Constructor Detail
ria.template.FeatureCollectionsFormatter(templateRepository)
Parameters:
{ria.template.TemplateRepository} templateRepository
A repository of templates to format features with. The features of a particular feature collection will be formatted with the template of the same name as the feature collection.
Method Detail
{String} format(names, featureCollections)
Generates an HTML fragment containing the formatted features of all given feature collections. Each feature collection will be represented by an entry in and unordered list. The name of each feature collection will be written into an <h2> element at the beginning of each corresponding list element. The names of the feature collections are given in the names parameter. Each name corresponds to the feature collection at the same array index in the featureCollections parameter. The features of each feature collection are rendered as elements of a nested unordered list.
Parameters:
{String[]} names
array of table names which will be added to the HTML fragment
{FeatureCollection[]} featureCollections
an array of GeoJSON FeatureCollections
Returns:
{String} the formatted features collections represented as an HTML string