Skip to content

Latest commit

 

History

100 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tilo.Compose

Compose-first Kotlin Multiplatform maps and GIS toolkit.

Tilo.Compose is an open-source Kotlin Multiplatform toolkit for building modern map and GIS applications with Compose. It scales from a simple OpenStreetMap view with a few markers to complex GIS workflows with multiple coordinate systems.

The framework provides a declarative Compose API, tiled raster layers (WMS, XYZ, and custom tile stores), projection-aware rendering, vector geometry and styling, label placement, feature selection, interactive drawing, spatial indexing, and extension points for custom data sources and coordinate transformations.

⚠️ Tilo is currently in alpha. Public APIs may change before 1.0.

Showcase

The Tilo.Samples Android app exercises the public API with real maps: a minimal OpenStreetMap layer, feature selection and app-owned callouts, interactive drawing, and live ČÚZK ortofoto rendered directly in S-JTSK (EPSG:5514).

Tilo.Samples minimal OpenStreetMap XYZ layer Tilo.Samples points, line, polygon, labels, and selected feature styling Tilo.Samples feature selection with an app-owned Compose callout Tilo.Samples polygon drawing with undo, redo, clear, and save controls Tilo.Samples live ČÚZK ortofoto rendered in S-JTSK EPSG:5514

Installation

repositories {
    google()
    mavenCentral()
}

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("eu.tilomaps:tilo-compose:0.1.4-alpha10")
            // Optional drawing plugin:
            implementation("eu.tilomaps:tilo-compose-draw:0.1.4-alpha10")
        }
    }
}

Quick Example

@OptIn(ExperimentalTiloApi::class)
@Composable
fun MapScreen() {
    val brno = Point(16.6068, 49.1951)
    val cameraState = rememberMapCameraState(
        initialPosition =
            CameraPosition(
                center = Wgs84ToEpsg5514Transformation.sourceToTarget(brno),
                zoom = 11.5,
            ),
        projection = epsg5514(),
    )

    val places = remember {
        features {
            point("brno", brno) {
                label = "Brno"
                labelStyle = labelStyle {
                    fontSize(15.sp)
                    halo(width = 3.5.dp)
                    offsetY(14.dp)
                }
                style = pointStyle {
                    size = 14.dp
                    fill(0xFF43A047)
                    stroke(0xFF263238, width = 2.dp)
                }
            }
        }
    }

    TiloMap(
        cameraState = cameraState,
        modifier = Modifier.fillMaxSize(),
    ) {
        wmsTileLayer(
            id = "cuzk-ortofoto",
            capabilitiesUrl = "https://ags.cuzk.gov.cz/arcgis1/services/ORTOFOTO/MapServer/WMSServer",
            layerNames = listOf("0"),
            projection = epsg5514(),
        ) {
            format = WmsImageFormat.Jpeg
        }

        featureLayer("places", places) {
            projection = wgs84()
        }
    }
}

See the web API reference for the current public API shape, including map layers, raster sources, features, styles, labels, selection, default UI overlays, drawing, tile grids, and projections.

The remaining alpha releases will focus on API stability and making Tilo Compose pleasant and intuitive to use.

License

MIT License. See LICENSE.

The GeoCore module is part of this repository. SpatialIndex is also MIT licensed in its own repository. The Android core artifact uses Proj4J and proj4j-epsg; the iOS artifact bundles PROJ. Both platform distributions include their applicable software licenses and the full EPSG Dataset Terms of Use. See third-party notices.

About

Compose-first, declarative Kotlin Multiplatform framework for building modern, extensible maps

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages