Releases: p-lr/MapCompose
2.9.2
2.9.1
2.9.0
- Added
zIndex
property for paths - Added
isPathWithinRange
path api. Useful to check whether or not a point is a near a path. - Added
allPaths
helper api to loop over all paths - Fixed an issue which would cause all paths to be clickable when only one path is clickable
- Compose BOM updated to 2023.08.00 and target sdk 34
2.8.1
2.8.0
- Paths can now be clickable.
addPath
andupdatePath
apis accept a newclickable
parameter. - A new
onPathClick
api works the same way asonMarkerClick
:
fun MapState.onPathClick(cb: (id: String, x: Double, y: Double) -> Unit)
On path click, the registered callback provides the id of the path, and the relative coordinates of the clicked point on the path.
- The demo app is updated to show how to use this new
onPathClick
api. - This release is based on Compose BOM to 2023.05.01
2.7.1
2.7.1 only slightly changes path join (now having rounded corners).
2.7.0 release notes are important and are reported below:
This feature release is mainly focused on path apis.
- Bug fix: Path width was set in pixels, not dp. So if the width was set like:
mapState.addPath("pathId", width = 12.dp) { .. }
The path, which was 12px wide in previous versions of the library, will now appear much thicker than it should be.
So after updating, you should set the desired width in dp. The default is 4.dp.
- Paths rendering is improved. They're no longer made of series of lines (see #85 )
- Paths are now automatically simplified depending on the scale, using Ramer-Douglas-Peucker algorithm. This improves performance when zooming-out.
- The simplification can be tweaked using the new
simplify
parameter foraddPath
andupdatePath
apis. - A new
cap
parameter for path apis allows for customizing path start and end cap. The default isCap.Round
. - New overload for
addPath
, taking a builder block with aPathDataBuilder
as receiver. This simplifies path creation. The demo is updated. - This release is still based on Compose BOM to 2023.05.01
2.7.0
This feature release is mainly focused on path apis.
- Bug fix: Path width was set in pixels, not dp. So if the width was set like:
mapState.addPath("pathId", width = 12.dp) { .. }
The path, which was 12px wide in previous versions of the library, will now appear much thicker than it should be.
So after updating, you should set the desired width in dp. The default is 4.dp.
- Paths rendering is improved. They're no longer made of series of lines (see #85 )
- Paths are now automatically simplified depending on the scale, using Ramer-Douglas-Peucker algorithm. This improves performance when zooming-out.
- The simplification can be tweaked using the new
simplify
parameter foraddPath
andupdatePath
apis. - A new
cap
parameter for path apis allows for customizing path start and end cap. The default isCap.Round
. - New overload for
addPath
, taking a builder block with aPathDataBuilder
as receiver. This simplifies path creation. The demo is updated. - This release is still based on Compose BOM to 2023.05.01
2.6.1
2.5.0
- Update Compose BOM to 2023.03.00, and Kotlin 1.8.10. The application code needs to be updated as well.
- New overload for
centerOnMarker
api:
suspend fun MapState.centerOnMarker(
id: String,
destScale: Float,
destAngle: AngleDegree,
animationSpec: AnimationSpec<Float> = SpringSpec(stiffness = Spring.StiffnessLow)
)
This allows for scaling, rotating, and scrolling the map at the same time while centering on a marker.
- The
setVisibleAreaPadding
api withDp
inputs is no longer a@Composable
function. The "VisibleAreaPadding" demo is updated.
2.4.1
- Update Kotlin 1.8.0
- Use Compose BOM 2023.01
- Compose compiler 1.4.0
clipShape
parameter ofaddMarker
api is made no-op and deprecated.