libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
osmscout::DynamicFeatureLabelReader Class Reference

#include <LabelProvider.h>

+ Inheritance diagram for osmscout::DynamicFeatureLabelReader:

Public Member Functions

 DynamicFeatureLabelReader (const TypeConfig &typeConfig, const std::string &featureName, const std::string &labelName)
 Assigns a label to the reader. More...
 
std::string GetLabel (const MapParameter &parameter, const FeatureValueBuffer &buffer) const override
 Returns the label based on the given feature value buffer. More...
 
std::string GetName () const override
 Returns the name of the label provider as it must get stated in the style sheet. More...
 
- Public Member Functions inherited from osmscout::LabelProvider
virtual ~LabelProvider ()=default
 

Detailed Description

Generates a label based on a given feature name and label name.

Example: Give me the label "inMeter" of the Ele-Feature.

Constructor & Destructor Documentation

◆ DynamicFeatureLabelReader()

osmscout::DynamicFeatureLabelReader::DynamicFeatureLabelReader ( const TypeConfig typeConfig,
const std::string &  featureName,
const std::string &  labelName 
)

Assigns a label to the reader.

Parameters
typeConfigReference to the current type configuration
featureNameName of the feature which must be valid and must support labels
labelNameThe name of the label to use (a feature might support multiple labels)

References osmscout::TypeConfig::GetFeature(), osmscout::TypeConfig::GetTypeCount(), and osmscout::TypeConfig::GetTypes().

Member Function Documentation

◆ GetLabel()

std::string osmscout::DynamicFeatureLabelReader::GetLabel ( const MapParameter parameter,
const FeatureValueBuffer buffer 
) const
overridevirtual

Returns the label based on the given feature value buffer.

Parameters
bufferThe FeatureValueBuffer instance
Returns
The label, if the given feature has a value and a label or a empty string

Implements osmscout::LabelProvider.

References osmscout::FeatureValue::GetLabel(), osmscout::MapParameter::GetLocale(), osmscout::FeatureValueBuffer::GetType(), osmscout::FeatureValueBuffer::GetValue(), and osmscout::FeatureValueBuffer::HasFeature().

◆ GetName()

std::string osmscout::DynamicFeatureLabelReader::GetName ( ) const
inlineoverridevirtual

Returns the name of the label provider as it must get stated in the style sheet.

Implements osmscout::LabelProvider.


The documentation for this class was generated from the following files: