Skip to content

Commit

Permalink
Show input URL in exported style JSON. (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon authored Jan 20, 2025
1 parent 46d8312 commit 97e4e4f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions app/src/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,10 @@ function getMaplibreStyle(
return style;
}

function StyleJsonPane(props: { theme: string; lang: string }) {
function StyleJsonPane(props: { theme: string; lang: string; tiles: string }) {
const stringified = createMemo(() => {
return JSON.stringify(
getMaplibreStyle(
props.theme,
props.lang,
false,
"https://example.com/tiles.json",
),
getMaplibreStyle(props.theme, props.lang, false, props.tiles),
null,
4,
);
Expand Down Expand Up @@ -723,7 +718,11 @@ function MapView() {
droppedArchive={droppedArchive()}
/>
<Show when={showStyleJson()}>
<StyleJsonPane theme={theme()} lang={lang()} />
<StyleJsonPane
theme={theme()}
lang={lang()}
tiles={droppedArchive() ? "example.pmtiles" : tiles()}
/>
</Show>
</div>
</div>
Expand Down

0 comments on commit 97e4e4f

Please sign in to comment.