From 56ccd66db501b340152c6993a78c1f1c81586a25 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Tue, 27 Dec 2022 12:46:27 +0300 Subject: [PATCH] Make attributeMap val --- .../center/sciprog/maps/features/Feature.kt | 28 +++++++++---------- maps-kt-geojson/build.gradle.kts | 1 - 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/maps-kt-features/src/commonMain/kotlin/center/sciprog/maps/features/Feature.kt b/maps-kt-features/src/commonMain/kotlin/center/sciprog/maps/features/Feature.kt index 51b98ed..5374cdc 100644 --- a/maps-kt-features/src/commonMain/kotlin/center/sciprog/maps/features/Feature.kt +++ b/maps-kt-features/src/commonMain/kotlin/center/sciprog/maps/features/Feature.kt @@ -24,7 +24,7 @@ public interface Feature { public val zoomRange: FloatRange - public var attributes: AttributeMap + public val attributes: AttributeMap public fun getBoundingBox(zoom: Float): Rectangle? } @@ -68,7 +68,7 @@ public fun Iterable>.computeBoundingBox( public class FeatureSelector( override val space: CoordinateSpace, override val zoomRange: FloatRange, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), public val selector: (zoom: Float) -> Feature, ) : Feature { @@ -84,7 +84,7 @@ public class PathFeature( override val zoomRange: FloatRange, public val style: DrawStyle = Fill, public val targetRect: Rect = path.getBounds(), - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), ) : DraggableFeature { override fun withCoordinates(newCoordinates: T): Feature = with(space) { PathFeature( @@ -109,7 +109,7 @@ public class PointsFeature( public val stroke: Float = 2f, public val color: Color = Color.Red, public val pointMode: PointMode = PointMode.Points, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), ) : Feature { override fun getBoundingBox(zoom: Float): Rectangle? = with(space) { points.wrapPoints() @@ -122,7 +122,7 @@ public data class CircleFeature( override val zoomRange: FloatRange, public val size: Dp = 5.dp, public val color: Color = Color.Red, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), ) : MarkerFeature { override fun getBoundingBox(zoom: Float): Rectangle = space.Rectangle(center, zoom, DpSize(size, size)) @@ -137,7 +137,7 @@ public class RectangleFeature( override val zoomRange: FloatRange, public val size: DpSize = DpSize(5.dp, 5.dp), public val color: Color = Color.Red, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), ) : MarkerFeature { override fun getBoundingBox(zoom: Float): Rectangle = space.Rectangle(center, zoom, size) @@ -152,7 +152,7 @@ public class LineFeature( public val b: T, override val zoomRange: FloatRange, public val color: Color = Color.Red, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), ) : SelectableFeature { override fun getBoundingBox(zoom: Float): Rectangle = space.Rectangle(a, b) @@ -173,7 +173,7 @@ public class ArcFeature( public val arcLength: Float, override val zoomRange: FloatRange, public val color: Color = Color.Red, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), ) : DraggableFeature { override fun getBoundingBox(zoom: Float): Rectangle = oval @@ -186,7 +186,7 @@ public data class DrawFeature( override val space: CoordinateSpace, public val position: T, override val zoomRange: FloatRange, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), public val drawFeature: DrawScope.() -> Unit, ) : DraggableFeature { override fun getBoundingBox(zoom: Float): Rectangle = space.Rectangle(position, position) @@ -200,7 +200,7 @@ public data class BitmapImageFeature( public val size: DpSize, public val image: ImageBitmap, override val zoomRange: FloatRange, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), ) : MarkerFeature { override fun getBoundingBox(zoom: Float): Rectangle = space.Rectangle(center, zoom, size) @@ -213,7 +213,7 @@ public data class VectorImageFeature( public val size: DpSize, public val image: ImageVector, override val zoomRange: FloatRange, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), ) : MarkerFeature, PainterFeature { override fun getBoundingBox(zoom: Float): Rectangle = space.Rectangle(center, zoom, size) @@ -232,7 +232,7 @@ public class ScalableImageFeature( override val space: CoordinateSpace, public val rectangle: Rectangle, override val zoomRange: FloatRange, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), public val painter: @Composable () -> Painter, ) : Feature, PainterFeature{ @Composable @@ -249,7 +249,7 @@ public class FeatureGroup( override val space: CoordinateSpace, public val children: Map, Feature>, override val zoomRange: FloatRange, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), ) : Feature { override fun getBoundingBox(zoom: Float): Rectangle? = with(space) { children.values.mapNotNull { it.getBoundingBox(zoom) }.wrapRectangles() @@ -262,7 +262,7 @@ public class TextFeature( public val text: String, override val zoomRange: FloatRange, public val color: Color = Color.Black, - override var attributes: AttributeMap = AttributeMap(), + override val attributes: AttributeMap = AttributeMap(), public val fontConfig: FeatureFont.() -> Unit, ) : DraggableFeature { override fun getBoundingBox(zoom: Float): Rectangle = space.Rectangle(position, position) diff --git a/maps-kt-geojson/build.gradle.kts b/maps-kt-geojson/build.gradle.kts index 8d9cced..0024fef 100644 --- a/maps-kt-geojson/build.gradle.kts +++ b/maps-kt-geojson/build.gradle.kts @@ -3,7 +3,6 @@ plugins { `maven-publish` } - kotlin { sourceSets { commonMain {