Package-level declarations

Types

Link copied to clipboard

Hardcoded style table approximating an OpenMapTiles "basic" look. Covers the layer names commonly seen across OpenMapTiles, Maptiler v3, Mapbox v8, and Protomaps "basemaps" schemas.

Link copied to clipboard
actual class MvtAtlasIconFactory(val atlas: MvtSpriteAtlas, val entry: MvtSpriteEntry) : ImageSource.ImageFactory

Platform-specific ImageSource.ImageFactory that decodes the atlas PNG once (cached by atlas-identity) and crops the requested sub-rect on demand.

Platform-specific ImageSource.ImageFactory that decodes the atlas PNG once (cached by atlas-identity) and crops the requested sub-rect on demand.

actual class MvtAtlasIconFactory(val atlas: MvtSpriteAtlas, val entry: MvtSpriteEntry) : ImageSource.ImageFactory

Platform-specific ImageSource.ImageFactory that decodes the atlas PNG once (cached by atlas-identity) and crops the requested sub-rect on demand.

actual class MvtAtlasIconFactory(val atlas: MvtSpriteAtlas, val entry: MvtSpriteEntry) : ImageSource.ImageFactory

Platform-specific ImageSource.ImageFactory that decodes the atlas PNG once (cached by atlas-identity) and crops the requested sub-rect on demand.

actual class MvtAtlasIconFactory(val atlas: MvtSpriteAtlas, val entry: MvtSpriteEntry) : ImageSource.ImageFactory

Platform-specific ImageSource.ImageFactory that decodes the atlas PNG once (cached by atlas-identity) and crops the requested sub-rect on demand.

Link copied to clipboard
class MvtBatchedLineTile(features: List<MvtBatchedLineTile.BatchLineFeature>, boundingSector: Sector, displayName: String? = null) : AbstractRenderable

Batched line-stroke renderable for one MVT slippy tile.

Link copied to clipboard
class MvtBatchedPolygonTile(features: List<MvtBatchedPolygonTile.BatchFeature>, boundingSector: Sector, minHoleAreaDeg2: Double = 0.0, displayName: String? = null) : AbstractRenderable

Batched polygon-fill renderable for one MVT slippy tile.

Link copied to clipboard
class MvtCurvedLineLabel(val coords: DoubleArray, val text: String, val attributes: TextAttributes, val charWidths: FloatArray, val textWidth: Float, val pixelSize: Int, val priority: Int = 0, val featureId: Long = 0, val repeatGapPx: Float = 1100.0f, displayName: String? = null) : AbstractRenderable

Per-glyph baseline-following text label for one MVT LINESTRING feature. Each render-pass projects the polyline's geographic waypoints into screen space, runs the arc-length placer to produce one MvtCurvedTextPlacer.GlyphRun per repeat, then emits a single- character Label per glyph with its own rotation matching the local tangent.

Link copied to clipboard

Arc-length parameterised glyph placement along a polyline. Given a polyline in screen coordinates, a text string with its per-character advance widths in pixels, and a desired label-repeat interval, produces one GlyphRun per repeat position covering as much of the line as fits.

Link copied to clipboard
object MvtDecoder

Decode the bytes of a Mapbox Vector Tile (MVT v2.1) into an MvtTile. Geometry stays in tile-local extent coordinates; conversion to lat/lon is MvtGeometry's job.

Link copied to clipboard
object MvtExpr

Typed entry-points for the most common expression shapes. These let DSL/style code stay concise; full Mapbox expressions still flow through MvtExpression subclasses directly.

Link copied to clipboard
sealed class MvtExpression<out T>

Mapbox-style expression tree. Each node evaluates to T? against an EvalContext (current tile zoom + feature property map); null propagates when an upstream node has no value (e.g. Get on a missing property).

Link copied to clipboard

Parses Mapbox-GL JSON expression arrays into MvtExpression trees. Supports the subset documented on MvtExpression (literals + sources + comparisons + boolean + arithmetic + case/match/step + interpolate + coercion).

Link copied to clipboard
data class MvtFeature(val id: Long, val type: MvtGeometryType, val tags: IntArray, val geometry: IntArray)

One feature. geometry is the raw MVT command stream (interleaved CommandIntegers and ParameterIntegers, all as packed uint32s) — pass to MvtGeometry to materialise into lat/lon points/lines/rings. tags holds keyIdx, valueIdx, ... pairs that index into the parent MvtLayer's MvtLayer.keys / MvtLayer.values.

Link copied to clipboard
sealed class MvtFilter

Predicate over an MVT feature's inflated property map. Sealed so the matching set is known up front. Filters are pure data evaluated once per feature off the render thread (in MvtVectorLayer.toRenderables); construct via the companion factory methods or the DSL infix helpers ("kind" eq "motorway").

Link copied to clipboard

Convert the raw MVT command stream of an MvtFeature into lat/lon geometry for a slippy tile at (z, x, y) with the given extent (tile-coordinate resolution; conventionally 4096).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class MvtLabelGroup(labels: List<Label>, priorities: IntArray, pixelSizes: IntArray, widths: FloatArray, minZooms: IntArray, featureIds: LongArray, displayName: String? = null) : AbstractRenderable

Per-tile bundle of Labels for one slippy tile, plus parallel priority and pixel-size arrays that the layer's cross-tile collision pass reads. The pass writes enabledMask; doRender then emits only the masked survivors. All collision / dedup / budget logic lives in MvtLabelCollider as one global pass per frame, so groups never collide per-tile.

Link copied to clipboard
data class MvtLayer(val name: String, val version: Int, val extent: Int, val keys: List<String>, val values: List<Any?>, val features: List<MvtFeature>)

One named layer inside an MVT tile (e.g. water, transportation, building).

Link copied to clipboard

Parser for a subset of the Mapbox GL Style Specification, producing an MvtRuleBasedStyle usable with MvtVectorLayer. The intent is "drop in a hand-authored style.json or a downloaded one from Maptiler/Mapbox and have it just work for typical basemap use cases" — not full spec fidelity.

Link copied to clipboard
Link copied to clipboard
class MvtPerfHudLayer(target: MvtVectorLayer, xOffsetDp: Double = 8.0, yOffsetDp: Double = 48.0, displayName: String = "MVT Perf HUD") : AbstractLayer

Diagnostic overlay that reports the target layer's tile-cache and schema state. Useful during MVT style/source tuning — drop it next to the MvtVectorLayer in the engine's layer list and the corner of the viewport reports:

Link copied to clipboard
class MvtPickedFeature(val layerName: String, val geometryType: MvtGeometryType, val tile: MvtVectorLayer.TileKey, tags: IntArray, keys: List<String>, values: List<Any?>)

Payload exposed via earth.worldwind.PickedObject.userObject when a vector-tile feature is picked. Carries the original MVT layer name, geometry type, and (lazily) the inflated property map so an app can pickedObject.userObject as? MvtPickedFeature and read e.g. the feature's name or kind to drive an info panel.

Link copied to clipboard
class MvtRuleBasedStyle(val rules: List<MvtStyleRule>, val backgroundColor: Color? = null) : MvtStyle

Style backed by an ordered list of MvtStyleRules. For each feature, iterates rules in order and returns the first match's resolved attributes. The same first match's MvtStyleRule.zOrder is reported from zOrderFor.

Link copied to clipboard
class MvtRuleBuilder(sourceLayer: String)
Link copied to clipboard

Identifies which vector-tile schema a decoded MvtTile follows by inspecting its layer names. Useful for auto-selecting a compatible style — feeding an OpenMapTiles tile to a Shortbread style (or vice versa) produces a mostly-empty map because almost no layer names line up.

Link copied to clipboard
class MvtSpriteAtlas(val entries: Map<String, MvtSpriteEntry>, val imageBytes: ByteArray)

Mapbox sprite atlas: PNG bytes + JSON manifest. The PNG packs N icons into a single image and the manifest maps each icon name → its (x, y, width, height) sub-rectangle. The platform-specific iconFactory decodes the atlas once and crops per-icon on demand.

Link copied to clipboard

Fetches a Mapbox sprite atlas (<stem>.json manifest + <stem>.png packed image) from a URL stem and returns a populated MvtSpriteAtlas. The two fetches run sequentially — sprite endpoints typically serve both responses from the same edge node so concurrency doesn't save much round-trip time.

Link copied to clipboard
class MvtSpriteEntry(val name: String, val x: Int, val y: Int, val width: Int, val height: Int, val pixelRatio: Double = 1.0, val content: IntArray? = null, val sdf: Boolean = false)

One icon's slice within a Mapbox-format sprite sheet: pixel rectangle within the atlas PNG plus optional pixelRatio (@2x / @3x HiDPI variants ship the same icon at integer scales of the base; the renderer divides by pixelRatio when sizing the on-screen Placemark).

Link copied to clipboard
fun interface MvtStyle

Decides how each MVT feature should be drawn: for polygons and lines, what ShapeAttributes to apply; null skips the feature entirely.

Link copied to clipboard
Link copied to clipboard
annotation class MvtStyleDsl

Type-safe builder DSL for MvtRuleBasedStyle. Lets a style read as a flat list of declarations:

Link copied to clipboard
Link copied to clipboard
class MvtStyleRule(val sourceLayer: String, val filter: MvtFilter = MvtFilter.Always, val minZoom: Int = 0, val maxZoom: Int = Int.MAX_VALUE, val zOrder: Int = 0, val geometryType: MvtGeometryType? = null, val paint: MvtStyleRule.PaintSpec)

One declarative rule in an MvtRuleBasedStyle. Matches features by source layer name, optional filter over properties, and tile-zoom range, then resolves zoom-interpolated paint properties into a ShapeAttributes.

Link copied to clipboard
Link copied to clipboard
data class MvtTile(val layers: List<MvtLayer>)

Decoded Mapbox Vector Tile — the flat in-memory shape of Tile { repeated Layer }. Each MvtLayer holds its own dictionary of property keys/values plus a list of features whose geometry stream is still in tile-local extent coordinates. Ring grouping, geometry-type- specific handling, and Mercator unprojection happen in MvtGeometry, not here.

Link copied to clipboard
open class MvtVectorLayer(var source: TileSource, val minZoom: Int = 0, val maxZoom: Int = 14, val maxLoadedTiles: Int = 256, val maxConcurrentFetches: Int = 4, val maxConcurrentAssembly: Int = 4, val simplifyGeometry: Boolean = true, val simplifyMaxZoom: Int = 12, val useBatchedRendering: Boolean = true, var style: MvtStyle = DefaultMvtStyle, var spriteAtlas: MvtSpriteAtlas? = null, displayName: String? = "Vector Tiles") : MercatorTiledVectorLayer<List<Renderable>>

Renders Mapbox Vector Tile (MVT) data as flat surface-draped polygons and polylines.

Link copied to clipboard

Convenience constructors for the most common expression shape — linear interpolation over (zoom, value) stops, or a constant. Each factory returns an MvtExpression that fits directly into a paint-property slot.

Link copied to clipboard

Hand-coded MvtStyle that approximates the palette of OpenTopoMap for MVT sources following the OpenMapTiles v3 schema (Versatiles, Maptiler, self-hosted OpenMapTiles). Reference implementation for the imperative-DSL approach — for the same look with zoom-interpolation and labels, use the rule-based OpenTopoMapRules instead.

Link copied to clipboard
class UrlTemplateMvtTileSource(val urlTemplate: String, headers: Map<String, String> = emptyMap(), connectTimeoutMs: Long = 5.seconds.inWholeMilliseconds, requestTimeoutMs: Long = 30.seconds.inWholeMilliseconds, clientConfig: HttpClientConfig<*>.() -> Unit = {}) : HttpTileSource

URL-template-based HttpTileSource for Mapbox Vector Tile servers. The template uses {z}, {x}, {y} placeholders, matching the slippy-map convention used by every major vector-tile provider:

Properties

Link copied to clipboard
actual val mvtAssemblyDispatcher: CoroutineDispatcher

Low-priority dispatcher for the CPU-heavy MVT decode + tessellation, so the OS scheduler hands cores to the render/GL threads first. Background-priority threads on Android, MIN_PRIORITY on the JVM, plain default elsewhere. Shared process-wide; the per-layer assembly semaphore still bounds concurrency.

expect val mvtAssemblyDispatcher: CoroutineDispatcher

Low-priority dispatcher for the CPU-heavy MVT decode + tessellation, so the OS scheduler hands cores to the render/GL threads first. Background-priority threads on Android, MIN_PRIORITY on the JVM, plain default elsewhere. Shared process-wide; the per-layer assembly semaphore still bounds concurrency.

actual val mvtAssemblyDispatcher: CoroutineDispatcher

Low-priority dispatcher for the CPU-heavy MVT decode + tessellation, so the OS scheduler hands cores to the render/GL threads first. Background-priority threads on Android, MIN_PRIORITY on the JVM, plain default elsewhere. Shared process-wide; the per-layer assembly semaphore still bounds concurrency.

actual val mvtAssemblyDispatcher: CoroutineDispatcher

Low-priority dispatcher for the CPU-heavy MVT decode + tessellation, so the OS scheduler hands cores to the render/GL threads first. Background-priority threads on Android, MIN_PRIORITY on the JVM, plain default elsewhere. Shared process-wide; the per-layer assembly semaphore still bounds concurrency.

actual val mvtAssemblyDispatcher: CoroutineDispatcher

Low-priority dispatcher for the CPU-heavy MVT decode + tessellation, so the OS scheduler hands cores to the render/GL threads first. Background-priority threads on Android, MIN_PRIORITY on the JVM, plain default elsewhere. Shared process-wide; the per-layer assembly semaphore still bounds concurrency.

Link copied to clipboard

Functions

Link copied to clipboard
actual fun curvedGlyphAdvanceScale(rc: RenderContext): Float

Factor converting earth.worldwind.render.Font.measureChars advances (logical pixels) into the units of the rendered glyph bitmaps and the projected screen polyline. On platforms whose TextRenderer density-scales the glyph bitmap and projects into a device-pixel viewport (JVM, iOS, web) this is RenderContext.densityFactor; on platforms that rasterise text at logical size (Android) it is 1.

Factor converting earth.worldwind.render.Font.measureChars advances (logical pixels) into the units of the rendered glyph bitmaps and the projected screen polyline. On platforms whose TextRenderer density-scales the glyph bitmap and projects into a device-pixel viewport (JVM, iOS, web) this is RenderContext.densityFactor; on platforms that rasterise text at logical size (Android) it is 1.

actual fun curvedGlyphAdvanceScale(rc: RenderContext): Float

Factor converting earth.worldwind.render.Font.measureChars advances (logical pixels) into the units of the rendered glyph bitmaps and the projected screen polyline. On platforms whose TextRenderer density-scales the glyph bitmap and projects into a device-pixel viewport (JVM, iOS, web) this is RenderContext.densityFactor; on platforms that rasterise text at logical size (Android) it is 1.

actual fun curvedGlyphAdvanceScale(rc: RenderContext): Float

Factor converting earth.worldwind.render.Font.measureChars advances (logical pixels) into the units of the rendered glyph bitmaps and the projected screen polyline. On platforms whose TextRenderer density-scales the glyph bitmap and projects into a device-pixel viewport (JVM, iOS, web) this is RenderContext.densityFactor; on platforms that rasterise text at logical size (Android) it is 1.

actual fun curvedGlyphAdvanceScale(rc: RenderContext): Float

Factor converting earth.worldwind.render.Font.measureChars advances (logical pixels) into the units of the rendered glyph bitmaps and the projected screen polyline. On platforms whose TextRenderer density-scales the glyph bitmap and projects into a device-pixel viewport (JVM, iOS, web) this is RenderContext.densityFactor; on platforms that rasterise text at logical size (Android) it is 1.

Link copied to clipboard
infix fun String.eq(value: Any?): MvtFilter
Link copied to clipboard
infix fun String.isIn(values: Set<Any?>): MvtFilter
Link copied to clipboard

Top-level DSL entry: build an MvtRuleBasedStyle.

Link copied to clipboard
infix fun String.notEq(value: Any?): MvtFilter