Create UI component for Iss Location Map
This commit is contained in:
parent
6628fe97b4
commit
addcd64f06
1 changed files with 24 additions and 0 deletions
24
web/src/main/kotlin/components/IssLocationMap.kt
Normal file
24
web/src/main/kotlin/components/IssLocationMap.kt
Normal file
|
@ -0,0 +1,24 @@
|
|||
package components
|
||||
|
||||
import com.surrus.common.remote.IssPosition
|
||||
import components.materialui.Map
|
||||
import components.materialui.Marker
|
||||
import react.RBuilder
|
||||
|
||||
fun RBuilder.IssLocationMap(issPosition: IssPosition) {
|
||||
val locationCoordinates = arrayOf(issPosition.latitude, issPosition.longitude)
|
||||
Map {
|
||||
attrs {
|
||||
height = 300
|
||||
defaultZoom = 4
|
||||
defaultCenter = locationCoordinates
|
||||
}
|
||||
|
||||
Marker {
|
||||
attrs {
|
||||
width = 50
|
||||
anchor = locationCoordinates
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue