Skip to content

Layer Types

Every layer in autk-map has a type that controls how its geometry is triangulated and rendered. The type is expressed via the LayerType enum.

OSM Layers

These types correspond directly to what autk-db extracts from OpenStreetMap data:

LayerTypeGeometryDescription
AUTK_OSM_SURFACEPolygonGround surface / land cover
AUTK_OSM_PARKSPolygonParks and green areas
AUTK_OSM_WATERPolygonWater bodies
AUTK_OSM_ROADSPolylineRoad network
AUTK_OSM_BUILDINGSPolygonBuildings with 3D extrusion

AUTK_OSM_BUILDINGS is the only type that renders in 3D. Height is derived from OSM height and building:levels tags when available.

Custom Geometry Layers

Use these when loading your own GeoJSON data:

LayerTypeGeometry
AUTK_GEO_POINTSPoint / MultiPoint
AUTK_GEO_POLYLINESLineString / MultiLineString
AUTK_GEO_POLYGONSPolygon / MultiPolygon

Raster Layer

LayerTypeDescription
AUTK_RASTERGrid-based raster data (e.g. GeoTIFF, heatmaps)

Auto-detection

If you don't specify a LayerType, loadGeoJsonLayer detects it from the GeoJSON geometry type:

typescript
// Type is inferred from the first feature's geometry
map.loadGeoJsonLayer('neighborhoods', geojson);

Auto-detection maps PointAUTK_GEO_POINTS, LineStringAUTK_GEO_POLYLINES, PolygonAUTK_GEO_POLYGONS. OSM-specific types (surface, buildings, etc.) are not auto-detected — pass them explicitly.

Released under the MIT License.