Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

[New Platform] Compile Mobile SDK to the Web/Javascript via Emscripten #510

@bugra9

Description

@bugra9

Hi @mtehver, I ported this excellent project to the web. My motivation,

  • As @jaakla mentioned here(Emscripten JS vector tile renderer #66), I wanted to learn the limits of Emscripten/Webassembly.
  • I wanted to see a map with powerful and performant vector rendering on the web.
  • I'm imagining a map that will run on three platforms (Android, iOS, Web) with the same code. This might be possible with React Native if someone integrates JSI into mobile swig.

This implementation covers multiple projects so I'm writing to this issue instead of a pull request. Related projects;

Demo: https://mobile-sdk-web.netlify.app/
Example Usage: https://github.com/bugra9/mobile-sdk/blob/emscripten-support/scripts/emscripten-dev/main.js

In the demo application, the debug icon appears after 7 seconds. You can test live with it.

Tested;

  • Marker
  • Line
  • Text
  • BalloonPopup
  • MbTiles with 3D Polygon
  • NMLModel
  • RasterTileLayer/HTTPTileDataSource
  • MapEventListener, VectorTileEventListener

Known Issues;

  • NMLModel looks transparent.
  • onMapClicked and onVectorTileClicked don't work. (Emscripten bug. Event is thrown to the listener only in the main thread.)
  • Emscripten don't support streaming downloads so the application cannot cancel the request when it is not needed. (Emscripten issue. https://emscripten.org/docs/api_reference/fetch.html#streaming-downloads)
  • I want to download tiles in parallel for performance. To do this I set setTileThreadPoolSize to 20 in options but it caused performance drops as it says in the documentation. In my opinion, network operations should be able to work asynchronously.
  • Rendering/animation worked on MacOS 12 and on iOS 15.5 but tiles were not loaded. Safari log shows 'Failed to load resource: Worker load was blocked by Cross-Origin-Embedder-Policy'
  • Empty page on iOS 14.3. Could not find anything in the log. My guess is that WebAssembly is not supported on this device. So probably expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions