CartoCssPlotHelper

Helper object for preparing map data using CartoCSS styling for rendering on the map.

This class provides utility methods to populate polygons, polylines, points, and text into feature vectors and icon maps based on entity metadata and styling rules.

Key responsibilities include:

  • Applying CartoCSS-based metadata and layer styles

  • Formatting text (including multi-line handling)

  • Adapting styles based on device density

  • Supporting optional geometry simplification for performance

Used internally during map plotting to transform core entities into renderable formats compatible with the Carto Mobile SDK.

Properties

Link copied to clipboard
val errorHandler: CoroutineExceptionHandler

Functions

Link copied to clipboard
fun buildPolygonGeometryWithHoles(boundary: List<Mercator>, holes: List<List<Mercator>> = emptyList()): PolygonGeometry?

Builds a Carto PolygonGeometry from an explicit outer boundary and an optional set of hole (inner ring) loops, producing a donut / multi-hole polygon when holes are supplied and a solid polygon otherwise.

Link copied to clipboard
Link copied to clipboard
fun populatePoint(coreApi: CoreApi, point: MapPoint, featureVectorMap: ConcurrentHashMap<String, FeatureVector>, iconDetailsMap: ConcurrentHashMap<String, List<IconDetails>>)

Populate's Point Geometry into feature vector map and/or icon style map This is designed for use with the new CartoCSS Styling

Link copied to clipboard
fun populatePolygon(coreApi: CoreApi, polygon: MapPolygon, entity: Entity, featureVectorMap: ConcurrentHashMap<String, FeatureVector>, iconDetailsMap: ConcurrentHashMap<String, List<IconDetails>>)

Populate's Polygon Geometry into feature vector map and/or icon style map This is designed for use with the new CartoCSS Styling

Link copied to clipboard
fun populatePolyline(coreApi: CoreApi, polyline: MapPolyline, featureVectorMap: ConcurrentHashMap<String, FeatureVector>, iconDetailsMap: ConcurrentHashMap<String, List<IconDetails>>)

Populate's Polyline Geometry into feature vector map and/or icon style map This is designed for use with the new CartoCSS Styling

Link copied to clipboard
fun populateText(coreApi: CoreApi, entity: Entity, featureVectorMap: ConcurrentHashMap<String, FeatureVector>, alreadyValidated: Boolean = false)

Populate's Text into feature vector map This is designed for use with the new CartoCSS Styling

Link copied to clipboard
fun setDensityDpi(densityDpi: Int)

Set the density dpi of the device so that text sizes can be preset. If this method is not called, by default device is assumed to be of high density.