Choose a render target
A mln_render_sessionRenderSessionHandleRenderSessionHandleRenderSessionHandleMaplibreNativeFfiRenderSessionRenderSessionHandleRenderSessionHandleRenderSessionHandleRenderSessionHandleRenderSessionHandleRenderSessionHandleRenderSession draws one map into one target: a surface that
presents to a window, or a texture that your code reads or draws. Set
mln_map_modeMapModeMapModeMapModeMaplibreNativeFfiMapModeMapModeMapModeMapModeMapModeMapModeMapModeMapMode to define how the map renders: continuously for slippy
maps, or once for each image you request.
flowchart TD
accTitle: How to pick a render target
animated{Is the map animated?}
animated -->|No| images[Render images]
animated -->|Yes| frames{Where do the frames go?}
frames -->|A window or view| window[Render to a window]
frames -->|Another renderer| texture[Render to a texture]
click images "/maplibre-native-ffi/guides/images/"
click window "/maplibre-native-ffi/guides/window/"
click texture "/maplibre-native-ffi/guides/texture/"Render imagesFor a map that doesn't move, create it in static mode for a region you choose, or in tile mode for map tiles, and read the pixels of each image.
Render to a windowFor an animated map in a window or view, create it in continuous mode and attach a surface. The session presents each frame to it.
Render to a textureFor an animated map in another renderer, such as a UI framework, a game engine, or a compositor, create it in continuous mode and attach a ring of your textures. Your renderer draws each frame from them.
Surfaces and textures use your graphics objects, for the graphics backend you chose when you installed the library. Images render on a GPU device that the library creates. See Install.