From 68b1378191fa4042d270006b955f1f9cd44adc47 Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Tue, 7 Jan 2025 18:17:10 +0100 Subject: [PATCH 1/9] document and correct clusterProperties of GeoJsonSource (part of #80) --- .../expressions/dsl/feature.kt | 15 ------- .../core/source/GeoJsonSource.kt | 3 +- .../core/source/GeoJsonOptions.kt | 42 +++++++++++++------ .../core/source/GeoJsonSource.kt | 9 +++- 4 files changed, 39 insertions(+), 30 deletions(-) diff --git a/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt b/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt index 7f2ae6bc..efac91de 100644 --- a/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt +++ b/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt @@ -91,21 +91,6 @@ public object Feature { * layer, see [LineLayer][dev.sargunv.maplibrecompose.compose.layer.LineLayer]. */ public fun lineProgress(value: Float): Expression = lineProgress(const(value)) - - /** - * Gets the value of a cluster property accumulated so far. Can only be used in the - * `clusterProperties` option of a clustered GeoJSON source, see - * [GeoJsonOptions][dev.sargunv.maplibrecompose.core.source.GeoJsonOptions]. - */ - public fun accumulated(key: Expression): Expression<*> = - FunctionCall.of("accumulated", key) - - /** - * Gets the value of a cluster property accumulated so far. Can only be used in the - * `clusterProperties` option of a clustered GeoJSON source, see - * [GeoJsonOptions][dev.sargunv.maplibrecompose.core.source.GeoJsonOptions]. - */ - public fun accumulated(key: String): Expression<*> = accumulated(const(key)) } /** Accesses to feature-related data */ diff --git a/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt b/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt index 2785ea3b..91633f37 100644 --- a/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt +++ b/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt @@ -3,6 +3,7 @@ package dev.sargunv.maplibrecompose.core.source import dev.sargunv.maplibrecompose.core.util.correctedAndroidUri import dev.sargunv.maplibrecompose.core.util.toMLNExpression import dev.sargunv.maplibrecompose.expressions.ExpressionContext +import dev.sargunv.maplibrecompose.expressions.dsl.Feature import dev.sargunv.maplibrecompose.expressions.dsl.const import io.github.dellisd.spatialk.geojson.GeoJson import org.maplibre.android.style.sources.GeoJsonOptions as MLNGeoJsonOptions @@ -33,7 +34,7 @@ public actual class GeoJsonSource : Source { withClusterProperty( key, const(value.operator).toMLNExpression()!!, - value.mapper.compile(ExpressionContext.None).toMLNExpression()!!, + Feature.get(value.featureProperty).compile(ExpressionContext.None).toMLNExpression()!!, ) } } diff --git a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt index 7101a7c1..ad4c6462 100644 --- a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt +++ b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt @@ -1,7 +1,6 @@ package dev.sargunv.maplibrecompose.core.source import androidx.compose.runtime.Immutable -import dev.sargunv.maplibrecompose.expressions.ast.Expression /** * @param minZoom Minimum zoom level at which to create vector tiles (lower means more field of view @@ -16,11 +15,12 @@ import dev.sargunv.maplibrecompose.expressions.ast.Expression * @param cluster If the data is a collection of point features, setting this to `true` clusters the * points by radius into groups. Cluster groups become new `Point` features in the source with * additional properties: - * * `cluster`: Is `true` if the point is a cluster - * * `cluster_id`: A unique id for the cluster to be used in conjunction with the cluster - * inspection methods. (TODO which are not implemented yet on [GeoJsonSource] - #80) - * * `point_count`: Number of original points grouped into this cluster - * * `point_count_abbreviated`: An abbreviated point count + * + * - `cluster`: Is `true` if the point is a cluster + * - `cluster_id`: A unique id for the cluster to be used in conjunction with the cluster + * inspection methods. + * - `point_count`: Number of original points grouped into this cluster + * - `point_count_abbreviated`: An abbreviated point count * * @param clusterRadius Radius of each cluster when clustering points, measured in 1/512ths of a * tile. I.e. a value of 512 indicates a radius equal to the width of a tile. @@ -33,10 +33,18 @@ import dev.sargunv.maplibrecompose.expressions.ast.Expression * Minimum number of points necessary to form a cluster if clustering is enabled. * * @param clusterProperties A map defining custom properties on the generated clusters if clustering - * is enabled, aggregating values from clustered points. The keys are the property names, the - * values are expressions. + * is enabled, aggregating values from clustered features. The keys are the property names, the + * values define how the value should be aggregated from the features within one cluster. * - * TODO examples missing, see https://maplibre.org/maplibre-style-spec/sources/#clusterproperties + * Example: + * ```kt + * mapOf( + * "totalCapacity" to ClusterAggregation("+", "capacity") + * ) + * ``` + * Let's assume a geojson source consisting of points for parking lots in which each parking lot + * has a `capacity` property. The code above adds the `capacity` values of all parking lots within + * one cluster together into a property named `totalCapacity` of the cluster point. * * @param lineMetrics Whether to calculate line distance metrics. This is required for * [LineLayer][dev.sargunv.maplibrecompose.compose.layer.LineLayer]s that specify a `gradient`. @@ -51,9 +59,19 @@ public data class GeoJsonOptions( val clusterRadius: Int = 50, val clusterMinPoints: Int = 2, val clusterMaxZoom: Int = maxZoom - 1, - val clusterProperties: Map = emptyMap(), + val clusterProperties: Map = emptyMap(), val lineMetrics: Boolean = false, ) { - // TODO seems to contradict https://maplibre.org/maplibre-style-spec/sources/#clusterproperties - public data class ClusterProperty(val operator: String, val mapper: Expression<*>) + /** + * Defines how the values from the features within a cluster should be aggregated into a cluster + * property. + * + * @param operator Expression name to aggregate the values from the feature properties. This can + * be any expression function that accepts at least 2 operands but typically is a math function + * like `"+"` or `"max"`. See + * [MapLibre Style Spec][https://maplibre.org/maplibre-style-spec/expressions/#math] for valid + * names for the operator. + * @param featureProperty name of the feature property whose value should be aggregated. + * */ + public data class ClusterAggregation(val operator: String, val featureProperty: String) } diff --git a/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt b/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt index bf113cf6..d51fa0b2 100644 --- a/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt +++ b/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt @@ -14,6 +14,8 @@ import dev.sargunv.maplibrecompose.core.util.toMLNShape import dev.sargunv.maplibrecompose.core.util.toNSExpression import dev.sargunv.maplibrecompose.expressions.ExpressionContext import dev.sargunv.maplibrecompose.expressions.ast.FunctionCall +import dev.sargunv.maplibrecompose.expressions.dsl.Feature +import dev.sargunv.maplibrecompose.expressions.dsl.const import io.github.dellisd.spatialk.geojson.GeoJson import platform.Foundation.NSNumber import platform.Foundation.NSURL @@ -43,8 +45,11 @@ public actual class GeoJsonSource : Source { put(MLNShapeSourceOptionClusterRadius, NSNumber(options.clusterRadius)) put( MLNShapeSourceOptionClusterProperties, - options.clusterProperties.mapValues { (_, p) -> - FunctionCall.of(p.operator, p.mapper).compile(ExpressionContext.None).toNSExpression() + options.clusterProperties.mapValues { (_, value) -> + arrayOf( + const(value.operator).toNSExpression(), + Feature.get(value.featureProperty).compile(ExpressionContext.None).toNSExpression() + ) }, ) } From 29f6872b7661cb18c8bf95a2b5a468644397b2b6 Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Wed, 8 Jan 2025 20:42:31 +0100 Subject: [PATCH 2/9] revert naming --- .../sargunv/maplibrecompose/core/source/GeoJsonSource.kt | 2 +- .../sargunv/maplibrecompose/core/source/GeoJsonOptions.kt | 6 +++--- .../sargunv/maplibrecompose/core/source/GeoJsonSource.kt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt b/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt index 91633f37..78e1e0fd 100644 --- a/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt +++ b/lib/maplibre-compose/src/androidMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt @@ -34,7 +34,7 @@ public actual class GeoJsonSource : Source { withClusterProperty( key, const(value.operator).toMLNExpression()!!, - Feature.get(value.featureProperty).compile(ExpressionContext.None).toMLNExpression()!!, + Feature.get(value.property).compile(ExpressionContext.None).toMLNExpression()!!, ) } } diff --git a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt index ad4c6462..6b1c5d18 100644 --- a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt +++ b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt @@ -59,7 +59,7 @@ public data class GeoJsonOptions( val clusterRadius: Int = 50, val clusterMinPoints: Int = 2, val clusterMaxZoom: Int = maxZoom - 1, - val clusterProperties: Map = emptyMap(), + val clusterProperties: Map = emptyMap(), val lineMetrics: Boolean = false, ) { /** @@ -71,7 +71,7 @@ public data class GeoJsonOptions( * like `"+"` or `"max"`. See * [MapLibre Style Spec][https://maplibre.org/maplibre-style-spec/expressions/#math] for valid * names for the operator. - * @param featureProperty name of the feature property whose value should be aggregated. + * @param property name of the feature property whose value should be aggregated. * */ - public data class ClusterAggregation(val operator: String, val featureProperty: String) + public data class ClusterProperty(val operator: String, val property: String) } diff --git a/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt b/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt index d51fa0b2..a18431c5 100644 --- a/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt +++ b/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt @@ -48,7 +48,7 @@ public actual class GeoJsonSource : Source { options.clusterProperties.mapValues { (_, value) -> arrayOf( const(value.operator).toNSExpression(), - Feature.get(value.featureProperty).compile(ExpressionContext.None).toNSExpression() + Feature.get(value.property).compile(ExpressionContext.None).toNSExpression() ) }, ) From d2a08b0e4051e05e297f115af0016e9e8c6413de Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Wed, 8 Jan 2025 20:44:26 +0100 Subject: [PATCH 3/9] revert deletion of unusable function --- .../maplibrecompose/expressions/dsl/feature.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt b/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt index efac91de..5431598a 100644 --- a/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt +++ b/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt @@ -91,6 +91,21 @@ public object Feature { * layer, see [LineLayer][dev.sargunv.maplibrecompose.compose.layer.LineLayer]. */ public fun lineProgress(value: Float): Expression = lineProgress(const(value)) + + /** + * Gets the value of a cluster property accumulated so far. Can only be used in the + * `clusterProperties` option of a clustered GeoJSON source, see + * [GeoJsonOptions][dev.sargunv.maplibrecompose.core.source.GeoJsonOptions]. + */ + public fun accumulated(key: Expression): Expression<*> = + FunctionCall.of("accumulated", key) + + /** + * Gets the value of a cluster property accumulated so far. Can only be used in the + * `clusterProperties` option of a clustered GeoJSON source, see + * [GeoJsonOptions][dev.sargunv.maplibrecompose.core.source.GeoJsonOptions]. + */ + public fun accumulated(key: String): Expression<*> = accumulated(const(key)) } /** Accesses to feature-related data */ From 24cb739ee9881d52b994009e2c755b450ed87ac9 Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Wed, 8 Jan 2025 20:44:53 +0100 Subject: [PATCH 4/9] sp --- .../dev/sargunv/maplibrecompose/expressions/dsl/feature.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt b/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt index 5431598a..7f2ae6bc 100644 --- a/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt +++ b/lib/maplibre-compose-expressions/src/commonMain/kotlin/dev/sargunv/maplibrecompose/expressions/dsl/feature.kt @@ -91,7 +91,7 @@ public object Feature { * layer, see [LineLayer][dev.sargunv.maplibrecompose.compose.layer.LineLayer]. */ public fun lineProgress(value: Float): Expression = lineProgress(const(value)) - + /** * Gets the value of a cluster property accumulated so far. Can only be used in the * `clusterProperties` option of a clustered GeoJSON source, see From 4e03ee75f13b20d22a5029c536a0471e5a7d0ca1 Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Wed, 8 Jan 2025 20:47:30 +0100 Subject: [PATCH 5/9] correct gbfs parsing --- .../maplibrecompose/demoapp/demos/ClusteredPointsDemo.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo-app/src/commonMain/kotlin/dev/sargunv/maplibrecompose/demoapp/demos/ClusteredPointsDemo.kt b/demo-app/src/commonMain/kotlin/dev/sargunv/maplibrecompose/demoapp/demos/ClusteredPointsDemo.kt index b55305ba..bddb5c3c 100644 --- a/demo-app/src/commonMain/kotlin/dev/sargunv/maplibrecompose/demoapp/demos/ClusteredPointsDemo.kt +++ b/demo-app/src/commonMain/kotlin/dev/sargunv/maplibrecompose/demoapp/demos/ClusteredPointsDemo.kt @@ -180,7 +180,7 @@ private suspend fun readGbfsData(gbfsFilePath: String): FeatureCollection { "vehicle_type" to (bike["vehicle_type"] ?: JsonNull), "vehicle_type_id" to (bike["vehicle_type_id"] ?: JsonNull), "last_reported" to (bike["last_reported"] ?: JsonNull), - "vehicle_range_meters" to (bike["vehicle_range_meters"] ?: JsonNull), + "current_range_meters" to (bike["current_range_meters"] ?: JsonNull), "is_reserved" to (bike["is_reserved"] ?: JsonNull), "is_disabled" to (bike["is_disabled"] ?: JsonNull), ), From 3fbbbe39ce34466095556473770d8fd6b77cef2c Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Wed, 8 Jan 2025 21:00:35 +0100 Subject: [PATCH 6/9] correct documentation comment --- .../sargunv/maplibrecompose/compose/layer/HillshadeLayer.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/compose/layer/HillshadeLayer.kt b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/compose/layer/HillshadeLayer.kt index e5d1ae13..1d44c43e 100644 --- a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/compose/layer/HillshadeLayer.kt +++ b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/compose/layer/HillshadeLayer.kt @@ -28,8 +28,8 @@ import dev.sargunv.maplibrecompose.expressions.value.IlluminationAnchor * gorges. * @param illuminationDirection The direction of the light source used to generate the hillshading * in degrees. A value in the range of `[0..360)`. `0` means - * - the top of the viewport if [illuminationAnchor] = [IlluminationAnchor.Viewport] or - * - north if [illuminationAnchor] = [IlluminationAnchor.Map] + * - the top of the viewport if [illuminationAnchor] = [IlluminationAnchor.Viewport] or + * - north if [illuminationAnchor] = [IlluminationAnchor.Map] * * @param illuminationAnchor Direction of light source when map is rotated. See * [illuminationDirection]. From 6a6903ea5778e622b1ba9e2d414a40b2aa357574 Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Wed, 8 Jan 2025 21:04:16 +0100 Subject: [PATCH 7/9] reformat comment --- .../core/source/GeoJsonOptions.kt | 20 +++++++++---------- .../core/source/GeoJsonSource.kt | 3 +-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt index 6b1c5d18..b32a1e42 100644 --- a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt +++ b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt @@ -36,15 +36,15 @@ import androidx.compose.runtime.Immutable * is enabled, aggregating values from clustered features. The keys are the property names, the * values define how the value should be aggregated from the features within one cluster. * - * Example: - * ```kt - * mapOf( - * "totalCapacity" to ClusterAggregation("+", "capacity") - * ) - * ``` - * Let's assume a geojson source consisting of points for parking lots in which each parking lot - * has a `capacity` property. The code above adds the `capacity` values of all parking lots within - * one cluster together into a property named `totalCapacity` of the cluster point. + * Example: + * ```kt + * mapOf( + * "totalCapacity" to ClusterAggregation("+", "capacity") + * ) + * ``` + * Let's assume a geojson source consisting of points for parking lots in which each parking lot + * has a `capacity` property. The code above adds the `capacity` values of all parking lots within + * one cluster together into a property named `totalCapacity` of the cluster point. * * @param lineMetrics Whether to calculate line distance metrics. This is required for * [LineLayer][dev.sargunv.maplibrecompose.compose.layer.LineLayer]s that specify a `gradient`. @@ -72,6 +72,6 @@ public data class GeoJsonOptions( * [MapLibre Style Spec][https://maplibre.org/maplibre-style-spec/expressions/#math] for valid * names for the operator. * @param property name of the feature property whose value should be aggregated. - * */ + */ public data class ClusterProperty(val operator: String, val property: String) } diff --git a/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt b/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt index a18431c5..ba201427 100644 --- a/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt +++ b/lib/maplibre-compose/src/iosMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonSource.kt @@ -13,7 +13,6 @@ import cocoapods.MapLibre.MLNShapeSourceOptionSimplificationTolerance import dev.sargunv.maplibrecompose.core.util.toMLNShape import dev.sargunv.maplibrecompose.core.util.toNSExpression import dev.sargunv.maplibrecompose.expressions.ExpressionContext -import dev.sargunv.maplibrecompose.expressions.ast.FunctionCall import dev.sargunv.maplibrecompose.expressions.dsl.Feature import dev.sargunv.maplibrecompose.expressions.dsl.const import io.github.dellisd.spatialk.geojson.GeoJson @@ -48,7 +47,7 @@ public actual class GeoJsonSource : Source { options.clusterProperties.mapValues { (_, value) -> arrayOf( const(value.operator).toNSExpression(), - Feature.get(value.property).compile(ExpressionContext.None).toNSExpression() + Feature.get(value.property).compile(ExpressionContext.None).toNSExpression(), ) }, ) From f5da48e26f7302321d84616f99862136cb6772e2 Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Wed, 8 Jan 2025 21:12:43 +0100 Subject: [PATCH 8/9] that dog... --- .../core/source/GeoJsonOptions.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt index b32a1e42..36f48b4c 100644 --- a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt +++ b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt @@ -36,15 +36,15 @@ import androidx.compose.runtime.Immutable * is enabled, aggregating values from clustered features. The keys are the property names, the * values define how the value should be aggregated from the features within one cluster. * - * Example: - * ```kt - * mapOf( - * "totalCapacity" to ClusterAggregation("+", "capacity") - * ) - * ``` - * Let's assume a geojson source consisting of points for parking lots in which each parking lot - * has a `capacity` property. The code above adds the `capacity` values of all parking lots within - * one cluster together into a property named `totalCapacity` of the cluster point. + * Example: + * ```kt + * mapOf( + * "totalCapacity" to ClusterAggregation("+", "capacity") + * ) + * ``` + * Let's assume a geojson source consisting of points for parking lots in which each parking lot has + * a `capacity` property. The code above adds the `capacity` values of all parking lots within one + * cluster together into a property named `totalCapacity` of the cluster point. * * @param lineMetrics Whether to calculate line distance metrics. This is required for * [LineLayer][dev.sargunv.maplibrecompose.compose.layer.LineLayer]s that specify a `gradient`. From 3b13ca14eae3ecc8d7d41fe5e8b9c8f31f32407f Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Wed, 8 Jan 2025 21:41:11 +0100 Subject: [PATCH 9/9] Update lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt index 36f48b4c..c4dd337d 100644 --- a/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt +++ b/lib/maplibre-compose/src/commonMain/kotlin/dev/sargunv/maplibrecompose/core/source/GeoJsonOptions.kt @@ -42,6 +42,7 @@ import androidx.compose.runtime.Immutable * "totalCapacity" to ClusterAggregation("+", "capacity") * ) * ``` + * * Let's assume a geojson source consisting of points for parking lots in which each parking lot has * a `capacity` property. The code above adds the `capacity` values of all parking lots within one * cluster together into a property named `totalCapacity` of the cluster point.