Render page
render_pageLoad a web page with a MapLibre map in a headless browser and capture a screenshot, including plugins, controls, page code, errors, failed requests, and map camera. Pass an HTML file or URL.
Instructions
Loads a web page with a MapLibre map in a headless browser and returns a screenshot of it, so you can see a map together with the plugins, controls and code of its page, which render_style leaves out since a style cannot hold them. Also reports the errors and warnings of the page, the requests that failed and the camera of the map. Pass an HTML file, which is served together with the files in its folder, or the URL of a page. A page that keeps its map in window.map is drawn once that map has loaded everything, and script can then use the map, for example to move the camera before the screenshot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL of a page, for example on a development server. | |
| path | No | Path to an HTML file, relative to the directory the server runs in. The page can load the files next to it. | |
| width | No | ||
| height | No | ||
| script | No | JavaScript to run in the page before the screenshot, like map.jumpTo({center: [7.66, 45.98], zoom: 12}). What it evaluates to is returned. |