Repository navigation
Add exportImage to export the map as the viewer sees it - #149
Open
aaronfraint wants to merge 1 commit into
Open
aaronfraint wants to merge 1 commit into
aaronfraint wants to merge 1 commit into
Conversation
Adds felt.exportImage(), which renders the embedded map inside the embed and returns the file to the host page. Unlike the REST image export, it includes SDK-made session changes: layer visibility, ephemeral filters and layers from createLayersFromGeoJson. Supports png, jpg, pdf and svg (Business plan and up), an optional viewport, legend switches, a scale bar, and download: true to also save the file from inside the embed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PbCHs2dhkbaJSPke8AQvBW
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
felt.exportImage(), which renders the embedded map inside the embed and returns the file to the host page.Why: the REST image export (
POST /api/v2/maps/:id/image_exports) renders the saved map in a headless browser, so it can't see SDK session changes. This method runs the app's existing in-browser export inside the embed, so it includes layer visibility, ephemeral filters and layers fromcreateLayersFromGeoJson.Design doc: https://claude.ai/artifact/9yncpovQAMHMsQw8nCosdY
API
miscmodule: schema, controller, types, and their TSDoc (which feedsllms-full.txt).Blob. Method results already travel back over aMessagePortwith no JSON step, so it arrives intact.download: truemay be blocked by the browser in a cross-origin or sandboxed iframe. The TSDoc tells hosts to save the returnedblobwhen they need the download to be reliable.App side
The handler, the owner opt-in permission and the setting live in the felt app. That PR needs a prerelease containing this change before it can type-check.
Checks
npm run checkpasses: build, format, API report, types, 21 tests, docs. The docs andetc/js-sdk.api.mdwere regenerated.Generated by Claude Code