Added function to draw custom markers with Kotlin DSL Canvas API #1

Merged
ArystanK merged 3 commits from main into main 2022-07-16 19:28:06 +03:00
Showing only changes of commit 6b7f0d1015 - Show all commits

View File

@ -45,9 +45,6 @@ fun App() {
mapTileProvider, mapTileProvider,
viewPoint, viewPoint,
onClick = { coordinates = focus }, onClick = { coordinates = focus },
onFeatureClick = {
},
config = MapViewConfig(inferViewBoxFromFeatures = true) config = MapViewConfig(inferViewBoxFromFeatures = true)
) { ) {
val pointOne = 55.568548 to 37.568604 val pointOne = 55.568548 to 37.568604
@ -57,14 +54,17 @@ fun App() {
image(pointOne, Icons.Filled.Home) image(pointOne, Icons.Filled.Home)
//remember feature Id //remember feature Id
val circleId: FeatureId = custom(position = pointThree) { val circleId: FeatureId = circle(
centerCoordinates = pointTwo,
)
custom(position = pointThree) {
drawRect( drawRect(
color = Color.Red, color = Color.Red,
topLeft = it, topLeft = it,
size = Size(20f, 20f) size = Size(20f, 20f)
) )
} }
line(pointOne, pointTwo) line(pointOne, pointTwo)
text(pointOne, "Home") text(pointOne, "Home")