Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/circle/CircleCompose.kt.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fun MapViewScope.Circle(
radiusMeters: Double,
id: String? = null,
strokeColor: Color = Color.Red,
strokeWidth: Dp = 2.dp,
strokeWidth: Dp = 1.dp,
fillColor: Color = Color.White.copy(alpha = 0.5f),
zIndex: Int? = null,
extra: Serializable? = null,
Expand Down
4 changes: 2 additions & 2 deletions docs/groundimage/GroundImageComponent.kt.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ its geographical bounds, and other optional properties directly as parameters.
fun MapViewScope.GroundImage(
bounds: GeoRectBounds,
image: Drawable,
opacity: Float = 0.5f,
opacity: Float = 1.0f,
tileSize: Int = GroundImageTileProvider.DEFAULT_TILE_SIZE,
id: String? = null,
extra: Serializable? = null,
Expand All @@ -46,7 +46,7 @@ be called within the `MapView` composable's content scope.
- `opacity`
- Type: `Float`
- Description: The opacity of the image, ranging from `0.0` (fully transparent) to `1.0` (fully
opaque). Defaults to `0.5f`.
opaque). Defaults to `1.0f`.
- `tileSize`
- Type: `Int`
- Description: The size of the tiles (in pixels) used to render the image on the map. Defaults
Expand Down
2 changes: 1 addition & 1 deletion docs/polygon/Polygon.kt.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The `PolygonState` is initialized with the following parameters:
- Description: The color of the polygon's outline.
- `strokeWidth`
- Type: `Dp`
- Default: `2.dp`
- Default: `1.dp`
- Description: The width of the polygon's outline.
- `fillColor`
- Type: `Color`
Expand Down
27 changes: 15 additions & 12 deletions docs/spherical/Spherical.kt.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,11 @@ fun computeSignedArea(path: List<GeoPointInterface>): Double

This function computes the signed area of a closed polygon. The sign of the result indicates the
orientation of the vertices:
- **Positive value:** The vertices are in a counter-clockwise order.
- **Negative value:** The vertices are in a clockwise order.
- **Positive value:** The vertices are in a clockwise order.
- **Negative value:** The vertices are in a counter-clockwise order.

Orientation is as seen on a north-up map (longitude increasing to the right, latitude increasing
upward).

The magnitude of the result is the area in square meters. The path is assumed to be closed.

Expand All @@ -327,28 +330,28 @@ The magnitude of the result is the area in square meters. The path is assumed to
### Returns

- Type: `Double`
- Description: The signed area in square meters. Positive for CCW, negative for CW.
- Description: The signed area in square meters. Positive for CW, negative for CCW.

### Example

```kotlin
// Counter-clockwise polygon
val ccwPolygon = listOf(
// Clockwise polygon (SW -> NW -> NE -> SE)
val cwPolygon = listOf(
GeoPoint(latitude = 40.0, longitude = -75.0),
GeoPoint(latitude = 41.0, longitude = -75.0),
GeoPoint(latitude = 41.0, longitude = -74.0),
GeoPoint(latitude = 40.0, longitude = -74.0)
)

val signedAreaCCW = Spherical.computeSignedArea(ccwPolygon)
// signedAreaCCW will be a positive value
println("Counter-clockwise signed area: $signedAreaCCW")

// Clockwise polygon
val cwPolygon = ccwPolygon.reversed()
val signedAreaCW = Spherical.computeSignedArea(cwPolygon)
// signedAreaCW will be a negative value with the same magnitude
// signedAreaCW will be a positive value
println("Clockwise signed area: $signedAreaCW")

// Counter-clockwise polygon
val ccwPolygon = cwPolygon.reversed()
val signedAreaCCW = Spherical.computeSignedArea(ccwPolygon)
// signedAreaCCW will be a negative value with the same magnitude
println("Counter-clockwise signed area: $signedAreaCCW")
```

---
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/mapconductor/core/polygon/Polygon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PolygonState(
holes: List<List<GeoPointInterface>> = emptyList(),
id: String? = null,
strokeColor: Color = Color.Black,
strokeWidth: Dp = 2.dp,
strokeWidth: Dp = 1.dp,
fillColor: Color = Color.Transparent,
geodesic: Boolean = false,
clickable: Boolean = true,
Expand Down
Loading
Loading