@@ -26,7 +26,7 @@ Enhance MapLibre GL JS with fully interactive HTML-based clusters and markers.
2626
2727## Installation
2828
29- Install @teritorio/maplibre-gl-teritorio-cluster with yarn
29+ Install ` @teritorio/maplibre-gl-teritorio-cluster ` with yarn
3030
3131``` bash
3232yarn add @teritorio/maplibre-gl-teritorio-cluster
@@ -97,7 +97,7 @@ function clusterRender(element, props) {
9797}
9898
9999// Create whatever HTML element you want as individual Marker
100- // You can you buildCss helper as well (exported by @teritorio/maplibre-gl-teritorio-cluster)
100+ // You can use buildCss helper as well (exported by @teritorio/maplibre-gl-teritorio-cluster)
101101function markerRender (element , feature , markerSize ) {
102102 element .innerHTML = props .point_count .toLocaleString ()
103103
@@ -155,26 +155,26 @@ map.on('load', () => {
155155const clusterLayer = new TeritorioCluster (id, sourceId, options)
156156```
157157
158- | Parameter | Type | Description |
159- | ---------- | -- -------------------------------- | ---------------------------------------- |
158+ | Parameter | Type | Description |
159+ | ------------ | ------------------------------------| -----------------------------------|
160160| ` id ` | ` string ` | Unique ID for the layer. |
161- | ` sourceId ` | ` string ` | ID of the GeoJSON source. |
161+ | ` sourceId ` | ` string ` | ID of the GeoJSON source. |
162162| ` options ` | ` Partial<TeritorioClusterOptions> ` | Optional configuration overrides. |
163163
164164#### Options
165165
166- | Option | Type | Default | Description |
167- | -------------------------- | ----------------------------- | ---------------------------- | -------------------------------------------------------------- |
168- | ` clusterMaxZoom ` | ` number ` | ` 17 ` | Maximum zoom level where clusters are visible. |
169- | ` clusterMinZoom ` | ` number ` | ` 0 ` | Minimum zoom level where clustering starts. |
170- | ` clusterRender ` | ` (feature) => HTMLElement ` | ` clusterRenderDefault ` | Custom function to render cluster. |
171- | ` markerRender ` | ` (feature) => HTMLElement ` | ` markerRenderDefault ` | Custom function to render individual markers. |
172- | ` markerSize ` | ` number ` | ` 24 ` | Pixel size of rendered markers. |
173- | ` unfoldedClusterRender ` | ` (features) => HTMLElement[] ` | ` unfoldedClusterRenderSmart ` | Custom function to render unfolded cluster. |
174- | ` unfoldedClusterMaxLeaves ` | ` number ` | ` 7 ` | Maximum number of features to show when a cluster is unfolded. |
175- | ` fitBoundsOptions ` | ` mapboxgl.FitBoundsOptions ` | ` { padding: 20 } ` | Options for [ fitBounds] ( https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#fitbounds ) method |
176- | ` initialFeature ` | ` GeoJSONFeature \| undefined ` | ` undefined ` | Feature to auto-select on load. |
177- | ` pinMarkerRender ` | ` (feature) => HTMLElement ` | ` pinMarkerRenderDefault ` | Custom renderer for the pinned marker. |
166+ | Option | Type | Default | Description | |
167+ | ---------------------------- | ------------------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------- | --------------------------------- |
168+ | ` clusterMaxZoom ` | ` number ` | ` 17 ` | Maximum zoom level where clusters are visible. | |
169+ | ` clusterMinZoom ` | ` number ` | ` 0 ` | Minimum zoom level where clustering starts. | |
170+ | ` clusterRender ` | ` (feature) => HTMLElement ` | ` clusterRenderDefault ` | Custom function to render cluster. | |
171+ | ` markerRender ` | ` (feature) => HTMLElement ` | ` markerRenderDefault ` | Custom function to render individual markers. | |
172+ | ` markerSize ` | ` number ` | ` 24 ` | Pixel size of rendered markers. | |
173+ | ` unfoldedClusterRender ` | ` (features) => HTMLElement[] ` | ` unfoldedClusterRenderSmart ` | Custom function to render unfolded cluster. | |
174+ | ` unfoldedClusterMaxLeaves ` | ` number ` | ` 7 ` | Maximum number of features to show when a cluster is unfolded. | |
175+ | ` fitBoundsOptions ` | ` mapboxgl.FitBoundsOptions ` | ` { padding: 20 } ` | Options for [ fitBounds] ( https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#fitbounds ) method | |
176+ | ` initialFeature ` | `GeoJSONFeature \ | undefined` | ` undefined ` | Feature to auto-select on load. |
177+ | ` pinMarkerRender ` | ` (feature) => HTMLElement ` | ` pinMarkerRenderDefault ` | Custom renderer for the pinned marker. | |
178178
179179##### unfoldedClusterRender
180180The following rendering function are at your disposal:
0 commit comments