Overview of Renderers
A renderer is an object that is used to transform a map feature into a graphic object of the class IlvGraphic or one of its subclasses.
A r
IlvGraphic* makeGraphic(const IlvMapFeature& feature,
const IlvMapInfo& targetMapInfo,
IlvMapsError& status);
The second argument, targetMapInfo, allows you to specify a target projection and an adapter. An adapter is a converter that provides facilities to convert geographic coordinates (that are generally expressed with floating point values in a coordinate system where the vertical axis is oriented upwards) into the points used by an IlvManager which are expressed with integer values in a coordinate system where the vertical axis is oriented downwards.
If the projection of the IlvMapInfo is set to 0 or is an instance of IlvUnknownProjection, the target projection is considered to be the same as the source projection of the IlvMapFeature. In this case, no projection conversion is performed.
For information about projections and adapters, see Selecting a Target Projection and Map Projections.
Views Maps includes a set of
The following code sample shows how to transform a map feature whose geometry is of the
|
IlvFeatureRenderer* renderer = new IlvDefaultCurveRenderer(_display); IlvMapLineRenderingStyle *lrs = new IlvMapLineRenderingStyle(_display); lrs->setForeground("green"); lrs->setLineWidth(2); renderer->setLineRenderingStyle(lrs);
IlvGraphic* graphic = renderer->makeGraphic(feature, mapInfo, status); if(graphic) { _manager->addObject(graphic); } else { IlvWarning("This renderer can’t translate the map feature"); if(status != IlvMaps::NoError()) IlvWarning(IlvMaps::GetErrorMessage(status, _display)); } |