-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
934 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
demo-app/src/commonMain/kotlin/dev/sargunv/maplibrecompose/demoapp/platform.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
demo-app/src/desktopMain/kotlin/dev/sargunv/maplibrecompose/demoapp/platform.desktop.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
demo-app/src/iosMain/kotlin/dev/sargunv/maplibrecompose/demoapp/platform.ios.kt
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
demo-app/src/jsMain/kotlin/dev/sargunv/maplibrecompose/demoapp/main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package dev.sargunv.maplibrecompose.demoapp | ||
|
||
import androidx.compose.material3.ColorScheme | ||
import androidx.compose.material3.darkColorScheme | ||
import androidx.compose.material3.lightColorScheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.ExperimentalComposeUiApi | ||
import androidx.compose.ui.window.ComposeViewport | ||
import kotlinx.browser.document | ||
import org.jetbrains.skiko.wasm.onWasmReady | ||
|
||
@OptIn(ExperimentalComposeUiApi::class) | ||
fun main() { | ||
onWasmReady { ComposeViewport(document.body!!) { DemoApp() } } | ||
} | ||
|
||
@Composable | ||
actual fun getDefaultColorScheme(isDark: Boolean): ColorScheme { | ||
return if (isDark) darkColorScheme() else lightColorScheme() | ||
} | ||
|
||
actual object Platform { | ||
actual val supportsBlending = false | ||
actual val supportsFps = false | ||
actual val supportsCamera = false | ||
actual val supportsLayers = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>MapLibre Compose demo app</title> | ||
<script src="skiko.js"></script> | ||
<style> | ||
html, | ||
body { | ||
width: 100%; | ||
height: 100%; | ||
margin: 0; | ||
padding: 0; | ||
overflow: hidden; | ||
} | ||
</style> | ||
</head> | ||
<body></body> | ||
<script src="app.js"></script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
html, body { | ||
width: 100%; | ||
height: 100%; | ||
margin: 0; | ||
padding: 0; | ||
overflow: hidden; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,11 @@ | |
"@jridgewell/resolve-uri" "^3.1.0" | ||
"@jridgewell/sourcemap-codec" "^1.4.14" | ||
|
||
"@js-joda/[email protected]": | ||
version "3.2.0" | ||
resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-3.2.0.tgz#3e61e21b7b2b8a6be746df1335cf91d70db2a273" | ||
integrity sha512-PMqgJ0sw5B7FKb2d5bWYIoxjri+QlW/Pys7+Rw82jSH0QN3rB05jZ/VrrsUdh1w4+i2kw9JOejXGq/KhDOX7Kg== | ||
|
||
"@leichtgewicht/ip-codec@^2.0.1": | ||
version "2.0.5" | ||
resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz#4fc56c15c580b9adb7dc3c333a134e540b44bfb1" | ||
|
@@ -3288,7 +3293,7 @@ wrappy@1: | |
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" | ||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== | ||
|
||
ws@^8.13.0: | ||
ws@8.18.0, ws@^8.13.0: | ||
version "8.18.0" | ||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" | ||
integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ kotlin { | |
iosSimulatorArm64() | ||
iosX64() | ||
jvm("desktop") | ||
js(IR) { browser() } | ||
|
||
cocoapods { | ||
noPodspec() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ kotlin { | |
iosSimulatorArm64() | ||
iosX64() | ||
jvm("desktop") | ||
js(IR) { browser() } | ||
|
||
cocoapods { | ||
noPodspec() | ||
|
39 changes: 39 additions & 0 deletions
39
lib/maplibre-compose/src/jsMain/kotlin/dev/sargunv/maplibrecompose/compose/WebMapView.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package dev.sargunv.maplibrecompose.compose | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import co.touchlab.kermit.Logger | ||
import dev.sargunv.maplibrecompose.core.MaplibreMap | ||
|
||
@Composable | ||
internal actual fun ComposableMapView( | ||
modifier: Modifier, | ||
styleUri: String, | ||
update: (map: MaplibreMap) -> Unit, | ||
onReset: () -> Unit, | ||
logger: Logger?, | ||
callbacks: MaplibreMap.Callbacks, | ||
) = | ||
WebMapView( | ||
modifier = modifier, | ||
styleUri = styleUri, | ||
update = update, | ||
onReset = onReset, | ||
logger = logger, | ||
callbacks = callbacks, | ||
) | ||
|
||
@Composable | ||
internal fun WebMapView( | ||
modifier: Modifier, | ||
styleUri: String, | ||
update: (map: MaplibreMap) -> Unit, | ||
onReset: () -> Unit, | ||
logger: Logger?, | ||
callbacks: MaplibreMap.Callbacks, | ||
) { | ||
Box(modifier = modifier.background(Color.Red)) | ||
} |
23 changes: 23 additions & 0 deletions
23
...libre-compose/src/jsMain/kotlin/dev/sargunv/maplibrecompose/core/layer/BackgroundLayer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package dev.sargunv.maplibrecompose.core.layer | ||
|
||
import dev.sargunv.maplibrecompose.expressions.ast.CompiledExpression | ||
import dev.sargunv.maplibrecompose.expressions.value.ColorValue | ||
import dev.sargunv.maplibrecompose.expressions.value.FloatValue | ||
import dev.sargunv.maplibrecompose.expressions.value.ImageValue | ||
|
||
internal actual class BackgroundLayer actual constructor(id: String) : Layer() { | ||
|
||
override val impl: Nothing = TODO() | ||
|
||
actual fun setBackgroundColor(color: CompiledExpression<ColorValue>) { | ||
TODO() | ||
} | ||
|
||
actual fun setBackgroundPattern(pattern: CompiledExpression<ImageValue>) { | ||
TODO() | ||
} | ||
|
||
actual fun setBackgroundOpacity(opacity: CompiledExpression<FloatValue>) { | ||
TODO() | ||
} | ||
} |
Oops, something went wrong.