You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Case: I want to provide a "magnifier" for when the user is selecting a coordinate on the map, or drawing a route on the map. This way they can see what is under their finger. This is a second MapView displayed on top of the main map.
Problem: This is all possible, except that I want to clip this second, smaller map view to a circle to look like a magnifier. I have tried all of the standard ways to clip a View, but none of them actually clip the map — it is still displayed as a rectangle.
overridefundraw(canvas:Canvas) {
val path =Path().apply {
val radius =400val centerX = width /2val centerY = height /2val left = (centerX - radius).toFloat()
val top = (centerY - radius).toFloat()
val right = (centerX + radius).toFloat()
val bottom = (centerY + radius).toFloat()
addOval(left, top, right, bottom, Path.Direction.CW)
}
canvas.clipPath(path)
super.draw(canvas)
}
Am I missing something, or is this not currently possible with a MapView?
If not, is this something that could be added? It could also be applicable to something like a minimap, which could also be useful.
The text was updated successfully, but these errors were encountered:
Use Case: I want to provide a "magnifier" for when the user is selecting a coordinate on the map, or drawing a route on the map. This way they can see what is under their finger. This is a second MapView displayed on top of the main map.
Problem: This is all possible, except that I want to clip this second, smaller map view to a circle to look like a magnifier. I have tried all of the standard ways to clip a View, but none of them actually clip the map — it is still displayed as a rectangle.
Here's what I've tried:
From what I've read, it seems that the compose modifier isn't actually able to modify the view's outline, although the size modifier works.
Doing this gets me a white circle on top of the map, but the map remains a square.
Am I missing something, or is this not currently possible with a MapView?
If not, is this something that could be added? It could also be applicable to something like a minimap, which could also be useful.
The text was updated successfully, but these errors were encountered: