Ciclo de vida OnCreate de experiencias y componente visual MapView
Aquí te dejamos el código utilizado en esta lección:
Application {
Array treasureScores
OnInit {
treasureScores = [10, 20, 30, 50, 100]
}
}
Experience CreateTreasure {
String name label("Treasure name") as TextField
Double latitude label("latitude") as TextField
Double longitude label("longitude") as TextField
Array points value([]) as Select
Array treasureLocationInMap as MapView
OnCreate {
CreateTreasure ct = broker.ui.getDataSource()
ct.points = treasureScores
ct.treasureLocationInMap = []
}
}