Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop APIs that return data (callbacks, query functions, camera state) can't easily be implemented with the synchronous API #219

Open
sargunv opened this issue Jan 2, 2025 · 0 comments
Labels
desktop Affects Desktop in particular, or relates to Desktop specific code help wanted Extra attention is needed

Comments

@sargunv
Copy link
Owner

sargunv commented Jan 2, 2025

The desktop implementation uses an embedded chromium webview showing MapLibre GL JS. All communication between the app and the web view is async, but our API is synchronous, so any calls that would need to return data to the caller can't be implemented. This means that desktop support is lagging far behind in features compared to our other supported platforms.

Our options:

  • Use runBlocking to make these calls synchronous. I tried this, but can't get it to not freeze the app. I'm not sure why.
  • Render a native map (MapLibre Native) instead of a web view. Integrate with Maplibre Native Core #218
  • Redesign our API with suspend functions everywhere. Doable now, but I'm hesitant to do this just for a platform that wouldn't need to be async with a proper native integration
@sargunv sargunv added the desktop Affects Desktop in particular, or relates to Desktop specific code label Jan 2, 2025
@sargunv sargunv added the help wanted Extra attention is needed label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop Affects Desktop in particular, or relates to Desktop specific code help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant