Skip to content

Commit

Permalink
run code gen
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Sep 24, 2024
1 parent 38e2a89 commit 5aaf298
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 42 deletions.
68 changes: 58 additions & 10 deletions android/src/main/kotlin/com/github/josxha/maplibre/Pigeon.g.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ data class MapOptions (
val style: String,
/** The initial zoom level of the map. */
val zoom: Double,
/** The initial pitch of the map. */
/** The initial pitch / tilt of the map. */
val pitch: Double,
/** The initial bearing of the map. */
val bearing: Double,
Expand All @@ -124,7 +124,9 @@ data class MapOptions (
/** If the native map should listen to click events. */
val listensOnClick: Boolean,
/** If the native map should listen to long click events. */
val listensOnLongClick: Boolean
val listensOnLongClick: Boolean,
/** The map gestures. */
val gestures: MapGestures
)
{
companion object {
Expand All @@ -141,7 +143,8 @@ data class MapOptions (
val maxPitch = pigeonVar_list[9] as Double
val listensOnClick = pigeonVar_list[10] as Boolean
val listensOnLongClick = pigeonVar_list[11] as Boolean
return MapOptions(style, zoom, pitch, bearing, center, maxBounds, minZoom, maxZoom, minPitch, maxPitch, listensOnClick, listensOnLongClick)
val gestures = pigeonVar_list[12] as MapGestures
return MapOptions(style, zoom, pitch, bearing, center, maxBounds, minZoom, maxZoom, minPitch, maxPitch, listensOnClick, listensOnLongClick, gestures)
}
}
fun toList(): List<Any?> {
Expand All @@ -158,6 +161,42 @@ data class MapOptions (
maxPitch,
listensOnClick,
listensOnLongClick,
gestures,
)
}
}

/**
* Map gestures
*
* Generated class from Pigeon that represents data sent in messages.
*/
data class MapGestures (
/** Rotate the map bearing. */
val rotate: Boolean,
/** Move the center of the map around. */
val pan: Boolean,
/** Zoom the map in and out. */
val zoom: Boolean,
/** Tilt (pitch) the map camera. */
val tilt: Boolean
)
{
companion object {
fun fromList(pigeonVar_list: List<Any?>): MapGestures {
val rotate = pigeonVar_list[0] as Boolean
val pan = pigeonVar_list[1] as Boolean
val zoom = pigeonVar_list[2] as Boolean
val tilt = pigeonVar_list[3] as Boolean
return MapGestures(rotate, pan, zoom, tilt)
}
}
fun toList(): List<Any?> {
return listOf(
rotate,
pan,
zoom,
tilt,
)
}
}
Expand Down Expand Up @@ -302,20 +341,25 @@ private open class PigeonPigeonCodec : StandardMessageCodec() {
}
133.toByte() -> {
return (readValue(buffer) as? List<Any?>)?.let {
LngLat.fromList(it)
MapGestures.fromList(it)
}
}
134.toByte() -> {
return (readValue(buffer) as? List<Any?>)?.let {
ScreenLocation.fromList(it)
LngLat.fromList(it)
}
}
135.toByte() -> {
return (readValue(buffer) as? List<Any?>)?.let {
MapCamera.fromList(it)
ScreenLocation.fromList(it)
}
}
136.toByte() -> {
return (readValue(buffer) as? List<Any?>)?.let {
MapCamera.fromList(it)
}
}
137.toByte() -> {
return (readValue(buffer) as? List<Any?>)?.let {
LngLatBounds.fromList(it)
}
Expand All @@ -341,22 +385,26 @@ private open class PigeonPigeonCodec : StandardMessageCodec() {
stream.write(132)
writeValue(stream, value.toList())
}
is LngLat -> {
is MapGestures -> {
stream.write(133)
writeValue(stream, value.toList())
}
is ScreenLocation -> {
is LngLat -> {
stream.write(134)
writeValue(stream, value.toList())
}
is MapCamera -> {
is ScreenLocation -> {
stream.write(135)
writeValue(stream, value.toList())
}
is LngLatBounds -> {
is MapCamera -> {
stream.write(136)
writeValue(stream, value.toList())
}
is LngLatBounds -> {
stream.write(137)
writeValue(stream, value.toList())
}
else -> super.writeValue(stream, value)
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/native/pigeon.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class MapOptions {
/// The initial zoom level of the map.
double zoom;

/// The initial pitch of the map.
/// The initial pitch / tilt of the map.
double pitch;

/// The initial bearing of the map.
Expand Down
Loading

0 comments on commit 5aaf298

Please sign in to comment.