` | — | Label overrides (closePopup), merged over provideMapLabels() and the English defaults. |
| `className` | `string` | — | Extra space-separated classes added to the rendered .ng-popup-card element. Reactive; the built-in class is always kept. Pass ng-popup-passthrough to make the whole popup non-interactive (pointer-events: none), so a hover popup does not capture the cursor and close itself. |
| `open` | `boolean` | `true` | Whether the popup is shown. Two-way bindable with [(open)]: closing it writes false, setting true opens it again at the current position. |
**Outputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `popupClose` | `void` | — | Emits when the popup closes, by the user or by setting open to false. |
| `openChange` | `boolean` | — | Emits the new open state (the [(open)] binding). |
### MapRoute
`ng-map-route`
Renders a line/route from the given coordinates. Must be used inside ng-map. Supports click and hover interactions, an active (highlighted) state and a covered-progress line via child ng-route-progress / ng-route-marker components.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `coordinates` | `[number, number][]` | `required` | Array of [longitude, latitude] points forming the line. |
| `id` | `string` | `auto` | Optional stable id for the underlying source/layer. |
| `color` | `string` | `'#4285F4'` | Line color. |
| `width` | `number` | `3` | Line width in pixels. |
| `opacity` | `number` | `0.8` | Line opacity. |
| `dashArray` | `number[]` | — | Dash pattern, e.g. [2, 2]. |
| `interactive` | `boolean` | `true` | Enables pointer events on the line. |
| `beforeId` | `string` | — | Id of an existing layer to insert the route (and its progress line) below. Applied at creation only. |
| `progress` | `number` | — | Covered fraction of the route (0 to 1). Drawn by a child ng-route-progress and followed by ng-route-marker at="progress". |
| `active` | `boolean` | `false` | Highlights the route: the active* inputs override the base paint while true. |
| `activeColor` | `string` | — | Line color while active. Falls back to color. |
| `activeWidth` | `number` | — | Line width while active. Falls back to width. |
| `activeOpacity` | `number` | — | Line opacity while active. Falls back to opacity. |
| `activeDashArray` | `number[]` | — | Dash pattern while active. Falls back to dashArray. |
**Outputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `routeClick` | `MapMouseEvent` | — | Emits when the route is clicked. |
| `routeMouseEnter` | `MapMouseEvent` | — | Emits when the pointer enters the route (the cursor becomes a pointer). |
| `routeMouseLeave` | `MapMouseEvent` | — | Emits when the pointer leaves the route. |
### RouteProgress
`ng-route-progress`
Draws the covered part of the parent ng-map-route, as set by its progress input (computed by cumulative distance along the line). Use inside ng-map-route.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `color` | `string` | `'#22c55e'` | Color of the covered line. |
| `width` | `number` | `route width` | Width of the covered line in pixels. |
| `opacity` | `number` | `1` | Opacity of the covered line. |
| `dashArray` | `number[]` | — | Dash pattern of the covered line. |
### RouteMarker
`ng-route-marker`
A marker placed along the parent ng-map-route. Project ng-marker-content (and label, popup, tooltip) into it. Created once and moved as progress or coordinates change.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `at` | `'start' \| 'end' \| 'progress' \| number` | `'start'` | Position on the route: its start, end, the current progress, or a fraction between 0 and 1 of the total distance. |
### MapArc
`ng-map-arc`
Renders curved lines between coordinate pairs using quadratic Bézier interpolation, with longitude unwrapping across the antimeridian. Must be used inside ng-map.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `data` | `MapArcDatum[]` | `required` | Arcs to draw: { id, from: [lng, lat], to: [lng, lat] }. Extra properties are exposed to paint expressions. |
| `id` | `string` | `auto` | Optional stable id for the underlying source/layer. |
| `curvature` | `number` | `0.2` | How much the arc bends. |
| `samples` | `number` | `64` | Number of interpolation points per arc. |
| `paint` | `LineLayerSpecification["paint"]` | — | MapLibre line paint properties. |
| `layout` | `LineLayerSpecification["layout"]` | — | MapLibre line layout properties. |
| `hoverPaint` | `LineLayerSpecification["paint"]` | — | Paint overrides applied to the hovered arc via feature-state. |
| `interactive` | `boolean` | `true` | Enables pointer events (adds an invisible hit layer). |
| `beforeId` | `string` | — | Insert the layer before this layer id. |
**Outputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `arcClick` | `MapArcEvent` | — | Emits { arc, longitude, latitude, originalEvent } when an arc is clicked. |
| `arcHover` | `MapArcEvent \| null` | — | Emits on hover; null when the pointer leaves. |
### MapGeoJSON
`ng-map-geojson`
Renders GeoJSON polygons and lines with theme-aware monochrome defaults and declarative feature-state hover. Accepts a URL or an inline GeoJSON object. Generic over the feature properties: MapGeoJSONComponent, with P inferred from data. Must be used inside ng-map.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `data` | `MapGeoJSONData
` | `required` | GeoJSON object or URL string. P types the featureClick/featureHover payloads. |
| `id` | `string` | `auto` | Optional stable id for the underlying source/layer. |
| `promoteId` | `string` | — | Feature property used as feature id — required for hover feature-state. |
| `fillPaint` | `FillLayerSpecification["paint"]` | `theme mono` | Fill paint properties. |
| `linePaint` | `LineLayerSpecification["paint"]` | `theme mono` | Outline paint properties. |
| `fillHoverPaint` | `FillLayerSpecification["paint"]` | — | Fill paint overrides applied to the hovered feature. |
| `interactive` | `boolean` | `false` | Enables pointer events and hover tracking. |
| `beforeId` | `string` | — | Insert the layers before this layer id. |
**Outputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `featureClick` | `MapGeoJSONEvent
` | — | Emits { feature, longitude, latitude, originalEvent } on click. |
| `featureHover` | `MapGeoJSONEvent
\| null` | — | Emits on hover; null when the pointer leaves. |
### MapClusterLayer
`ng-map-cluster-layer`
Renders clustered points with MapLibre GL native clustering. Automatically styles cluster circles by point count, zooms in on cluster click. Generic over the feature properties: MapClusterLayerComponent
, with P inferred from data. Must be used inside ng-map.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `data` | `string \| FeatureCollection` | `required` | GeoJSON points (object or URL string). P types the pointClick payload. |
| `id` | `string` | `auto` | Optional stable id prefix for the source and layers: cluster-source-, clusters-, cluster-count-, unclustered-point-. Changing it re-creates them. |
| `beforeId` | `string` | — | Insert the cluster layers before this layer id. Applied at creation only. |
| `clusterMaxZoom` | `number` | `14` | Max zoom at which points are clustered. |
| `clusterRadius` | `number` | `50` | Cluster radius in pixels. |
| `clusterColors` | `[string, string, string]` | `['#22c55e', '#eab308', '#ef4444']` | Circle colors for small/medium/large clusters. ng-mapcn defaults to green/yellow/red; mapcn uses ['#3b82f6', '#1d4ed8', '#1e3a8a']. |
| `clusterThresholds` | `[number, number]` | `[100, 750]` | Point-count thresholds between color tiers. |
| `pointColor` | `string` | `'#3b82f6'` | Color of unclustered points. |
| `zoomOnClusterClick` | `boolean` | `true` | Zooms into a cluster when it is clicked. |
**Outputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `pointClick` | `ClusterPointClickEvent` | — | Emits { feature, coordinates } when an unclustered point is clicked. |
| `clusterClick` | `ClusterClickEvent` | — | Emits { clusterId, coordinates, pointCount } when a cluster is clicked. |
### MapHeatmap
`ng-map-heatmap`
Renders GeoJSON points as a MapLibre heatmap layer with a theme-aware default gradient. Generic over the feature properties: MapHeatmapComponent
, with P inferred from data. Must be used inside ng-map.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `data` | `string \| FeatureCollection` | `required` | GeoJSON points (object or URL string). |
| `id` | `string` | `auto` | Optional stable id prefix for the source and layer: heatmap-source-, heatmap-layer-. Changing it re-creates them. |
| `beforeId` | `string` | — | Insert the layer before this layer id. Applied at creation only. |
| `weightProperty` | `string` | — | Numeric feature property used as the point weight. Without it every point weighs the same. |
| `weightRange` | `[number, number]` | `[0, 1]` | [min, max] of weightProperty, mapped linearly to a weight of 0..1. |
| `radius` | `number \| expression` | `30` | Influence radius of each point in pixels. Accepts MapLibre expressions. |
| `intensity` | `number \| expression` | `1` | Global intensity multiplier. Accepts MapLibre expressions. |
| `opacity` | `number \| expression` | `1` | Layer opacity. Accepts MapLibre expressions. |
| `gradient` | `HeatmapGradient` | `theme default` | Color stops [density 0..1, color]. Sorted, with a transparent stop at 0 prepended when missing. Defaults to defaultHeatmapGradients for the resolved theme. |
| `minZoom` | `number` | `0` | Minimum zoom at which the heatmap is rendered. |
| `maxZoom` | `number` | `24` | Zoom from which the heatmap is no longer rendered (e.g. to hand over to a point layer). |
| `paint` | `HeatmapLayerSpecification["paint"]` | — | Escape hatch: heatmap paint properties merged last. |
### MapRasterSource
`ng-map-raster-source`
Raster tile source (XYZ, TMS, WMS) plus the raster layer that draws it. Source and layer are re-added after a theme switch. Must be used inside ng-map.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `id` | `string` | `auto` | MapLibre source id, used verbatim (other components reference it as source: id). The layer is raster-layer-. Changing it re-creates both. |
| `tiles` | `string[]` | — | Tile URL templates ({z}/{x}/{y}, {bbox-epsg-3857} for WMS). Updated in place with setTiles. |
| `url` | `string` | — | TileJSON URL, instead of tiles (takes precedence). Updated in place with setUrl. |
| `tileSize` | `number` | `256` | Tile size in pixels. Applied at creation. |
| `minzoom` | `number` | `0` | Minimum tile zoom. Applied at creation. |
| `maxzoom` | `number` | `22` | Maximum tile zoom. Applied at creation. |
| `attribution` | `string` | — | Attribution for the map attribution control. Applied at creation. |
| `bounds` | `[number, number, number, number]` | — | [west, south, east, north] limit of the tiles. Applied at creation. |
| `scheme` | `'xyz' \| 'tms'` | `'xyz'` | Tile addressing scheme. Applied at creation. |
| `opacity` | `number \| expression` | `1` | Raster layer opacity (raster-opacity). |
| `visible` | `boolean` | `true` | Whether the layer is drawn; the source stays loaded when hidden. |
| `beforeId` | `string` | — | Insert the layer before this layer id. Applied at creation only. |
| `paint` | `RasterLayerSpecification["paint"]` | — | Escape hatch: raster paint properties merged last. |
### MapVectorSource
`ng-map-vector-source`
Vector tile source (MVT, TileJSON or pmtiles://). Adds the source only: draw it with layers that reference it by id and wait for it with MapContextService.hasSource(id). ng-mapcn does not depend on pmtiles; register the protocol yourself with maplibregl.addProtocol. When torn down or the style reloads it removes every layer still using the source, then the source: gate your layers on hasSource(id). tiles vs url mode is fixed at creation. Must be used inside ng-map.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `id` | `string` | `auto` | MapLibre source id, used verbatim; layers reference it as source: id. Announced through MapContextService.hasSource(id) while it exists. Changing it re-creates the source. |
| `tiles` | `string[]` | — | Tile URL templates. Updated in place with setTiles. |
| `url` | `string` | — | TileJSON URL or pmtiles:// (register the pmtiles protocol first), instead of tiles. Updated in place with setUrl. |
| `minzoom` | `number` | `0` | Minimum tile zoom. Applied at creation. |
| `maxzoom` | `number` | `22` | Maximum tile zoom. Applied at creation. |
| `attribution` | `string` | — | Attribution for the map attribution control. Applied at creation. |
| `bounds` | `[number, number, number, number]` | — | [west, south, east, north] limit of the tiles. Applied at creation. |
| `scheme` | `'xyz' \| 'tms'` | `'xyz'` | Tile addressing scheme. Applied at creation. |
| `promoteId` | `string \| Record` | — | Feature property (or per source-layer map) used as the feature id, which enables feature-state on vector tiles. Applied at creation. |
### MapImageOverlay
`ng-map-image-overlay`
Georeferenced image pinned to four corner coordinates, drawn as a raster layer. Must be used inside ng-map.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `id` | `string` | `auto` | MapLibre image source id, used verbatim. The layer is image-layer-. Changing it re-creates both. |
| `url` | `string` | `required` | Image URL. Changing it calls updateImage on the live source. |
| `coordinates` | `ImageOverlayCoordinates` | `required` | Four [lng, lat] corners, clockwise from the top-left. Changing them calls setCoordinates. |
| `opacity` | `number \| expression` | `1` | Layer opacity (raster-opacity). |
| `visible` | `boolean` | `true` | Whether the layer is drawn. |
| `beforeId` | `string` | — | Insert the layer before this layer id. Applied at creation only. |
| `paint` | `RasterLayerSpecification["paint"]` | — | Escape hatch: raster paint properties merged last (e.g. raster-fade-duration: 0 to avoid a flash on url change). |
### MapFillExtrusion
`ng-map-fill-extrusion`
3D extrusion of polygons (fill-extrusion layer), e.g. 3D buildings. Creates only the layer: the source is a basemap source or one added by a source component or the application, and the layer waits for it. Re-added after a theme switch. Must be used inside ng-map.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `id` | `string` | `auto` | Layer id prefix; the layer is fill-extrusion-layer-. Changing it re-creates the layer. |
| `source` | `string` | `Carto basemap source` | Id of the source to extrude: a tile source component, an application source or a basemap source. Without it, the Carto basemap's building source is used ('protomaps', or 'carto' in the earlier styles). The layer is added once map.getSource(source) exists. |
| `sourceLayer` | `string` | `'buildings' for 'protomaps', 'building' for 'carto', else none` | Layer of a vector source. Omit for GeoJSON sources. |
| `heightProperty` | `string` | `'height' for 'protomaps', else 'render_height'` | Feature property with the height in meters. |
| `baseProperty` | `string` | `'min_height' for 'protomaps', else 'render_min_height'` | Feature property with the base height in meters. |
| `color` | `string \| expression` | `theme gray` | Fill color; defaults to a theme-aware gray (defaultExtrusionColors). |
| `opacity` | `number` | `0.8` | Layer opacity, 0..1. |
| `minZoom` | `number` | `14` | Minimum zoom at which the extrusion is drawn (the Carto tiles stop at 14). |
| `maxZoom` | `number` | `24` | Zoom from which the extrusion is no longer drawn. |
| `filter` | `FilterSpecification \| null` | `['!=', ['get', 'hide_3d'], true]` | MapLibre filter, updated with setFilter. null removes the default filter. |
| `beforeId` | `string` | — | Insert the layer before this layer id. Applied at creation only. |
| `paint` | `FillExtrusionLayerSpecification["paint"]` | — | Escape hatch: fill-extrusion paint properties merged last. |
### MapTerrain
`ng-map-terrain`
3D terrain from a raster-dem source (map.setTerrain) with an optional hillshade layer. The terrain is style-level state: it is re-applied after a theme switch and disabled on teardown. One terrain per map. Must be used inside ng-map.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `id` | `string` | `auto` | Id prefix: DEM source terrain-source-, hillshade source terrain-hillshade-source-, hillshade layer terrain-hillshade-. Changing it re-creates all. |
| `tiles` | `string[]` | `public Terrarium tiles` | Elevation tile URL templates. Applied at creation. |
| `url` | `string` | — | TileJSON URL, instead of tiles (takes precedence). Applied at creation. |
| `encoding` | `'terrarium' \| 'mapbox'` | `'terrarium'` | Encoding of the elevation tiles. Applied at creation. |
| `tileSize` | `number` | `256` | Tile size in pixels. Applied at creation. |
| `minzoom` | `number` | — | Minimum zoom of the elevation tiles. Applied at creation. |
| `maxzoom` | `number` | `15 for the default tiles` | Maximum zoom of the elevation tiles. Applied at creation. |
| `attribution` | `string` | `Mapzen / AWS for the default tiles` | Attribution for the map attribution control. Applied at creation. |
| `exaggeration` | `number` | `1` | How tall the terrain looks. Changing it calls setTerrain again. |
| `hillshade` | `boolean` | `false` | Draw a hillshade layer (with its own DEM source). Added and removed on toggle; the terrain is untouched. |
| `hillshadeExaggeration` | `number` | — | Hillshade intensity, 0..1 (MapLibre default 0.5). |
| `hillshadeShadowColor` | `string` | — | Hillshade color of the shaded slopes. |
| `hillshadeHighlightColor` | `string` | — | Hillshade color of the lit slopes. |
| `hillshadeAccentColor` | `string` | — | Hillshade accent color for steep slopes. |
| `hillshadePaint` | `HillshadeLayerSpecification["paint"]` | — | Escape hatch: hillshade paint properties merged last. |
| `beforeId` | `string` | — | Insert the hillshade layer before this layer id. Applied when the layer is created only. |
### MapDraw
`ng-map-draw`
Draws, selects and edits points, lines and polygons on terra-draw. Lives in the optional ng-mapcn/draw entry point (import { MapDrawComponent } from 'ng-mapcn/draw') and needs the terra-draw and terra-draw-maplibre-gl-adapter peer dependencies. A theme switch (setStyle) stops and restarts terra-draw with the same features and mode. Must be used inside ng-map.
**Inputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `modes` | `('point' \| 'line' \| 'polygon')[]` | `all three` | Shapes the user can draw. Changing it restarts terra-draw with the same features and drops an unfinished shape. |
| `mode` | `'point' \| 'line' \| 'polygon' \| 'select' \| 'static'` | `'static'` | Active tool (two-way with [(mode)]). A mode that is not enabled falls back to 'static'. |
| `features` | `FeatureCollection` | `empty` | Drawn features as a GeoJSON FeatureCollection of Point, LineString and Polygon (two-way with [(features)]). Updates when a draw, edit or delete completes. Assigning a collection diffs by feature id; features keep their own ids (any non-empty string or finite number) and those without one get an id; unsupported geometries are dropped and reported through mapError. |
| `editable` | `boolean` | `true` | Enables the select mode: select, drag, reshape and delete features. Changing it restarts terra-draw and drops an unfinished shape. |
| `color` | ``#${string}`` | `theme default` | Accent color of the drawn shapes (#rrggbb). Defaults to a theme-aware blue. Changing it restyles the modes in place (no restart). |
**Outputs**
| Name | Type | Default | Description |
|---|---|---|---|
| `drawEnd` | `MapDrawEvent` | — | Emits { feature, mode, action } when a new shape is completed. |
| `featureEdit` | `MapDrawEvent` | — | Emits { feature, mode, action } when an existing feature is moved, reshaped or otherwise edited. |
| `featureSelect` | `MapDrawFeature` | — | Emits the selected Feature (select mode). |
| `featureDeselect` | `string \| number` | — | Emits the id of the deselected feature. |
## MapContextService
Component-scoped service provided by `ng-map` — the Angular equivalent of mapcn's `useMap()` hook. Inject it in any component projected inside `ng-map` to reach the raw map.
| Name | Type | Default | Description |
|---|---|---|---|
| `map()` | `Signal