Skip to content

Commit

Permalink
deploy: b134cb2
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Oct 22, 2024
1 parent 8f522c3 commit 9f19582
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
14 changes: 13 additions & 1 deletion print.html
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,8 @@ <h4 id="tilejson-in-sql-comments-1"><a class="header" href="#tilejson-in-sql-com
curl localhost:3000/points,lines/0/0/0
</code></pre>
<div style="break-before: page; page-break-before: always;"></div><h2 id="sprite-sources"><a class="header" href="#sprite-sources">Sprite Sources</a></h2>
<p>Given a directory with SVG images, Martin will generate a sprite – a JSON index and a PNG image, for both low and highresolution displays. The SVG filenames without extension will be used as the sprites’ image IDs (remember that one sprite and thus <code>sprite_id</code> contains multiple images).
<p>Given a directory with SVG images, Martin will generate a sprite – a JSON index and a PNG image, for both low and highresolution displays.
The SVG filenames without extension will be used as the sprites’ image IDs (remember that one sprite and thus <code>sprite_id</code> contains multiple images).
The images are searched recursively in the given directory, so subdirectory names will be used as prefixes for the image IDs.
For example <code>icons/bicycle.svg</code> will be available as <code>icons/bicycle</code> sprite image.</p>
<p>The sprite generation is not yet cached, and may require external reverse proxy or CDN for faster operation.
Expand Down Expand Up @@ -1225,6 +1226,16 @@ <h5 id="sprite-index"><a class="header" href="#sprite-index">Sprite index</a></h
...
}
</code></pre>
<h5 id="coloring-at-runtime-via-signed-distance-fields-sdfs"><a class="header" href="#coloring-at-runtime-via-signed-distance-fields-sdfs">Coloring at runtime via Signed Distance Fields (SDFs)</a></h5>
<p>If you want to set the color of a sprite at runtime, you will need use the <a href="https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf">Signed Distance Fields (SDFs)</a>-endpoints.
For example, maplibre does support the image being modified via the <a href="https://maplibre.org/maplibre-style-spec/layers/#icon-color"><code>icon-color</code></a> and <a href="https://maplibre.org/maplibre-style-spec/layers/#icon-halo-color"><code>icon-halo-color</code></a> properties if using SDFs.</p>
<p>SDFs have the significant <strong>downside of only allowing one color</strong>.
If you want multiple colors, you will need to layer icons on top of each other.</p>
<p>The following APIs are available:</p>
<ul>
<li><code>/sdf_sprite/&lt;sprite_id&gt;.json</code> for getting a sprite index as SDF and</li>
<li><code>/sdf_sprite/&lt;sprite_id&gt;.png</code> for getting sprite PNGs as SDF</li>
</ul>
<h4 id="combining-multiple-sprites"><a class="header" href="#combining-multiple-sprites">Combining Multiple Sprites</a></h4>
<p>Multiple <code>sprite_id</code> values can be combined into one sprite with the same pattern as for tile
joining: <code>/sprite/&lt;sprite_id1&gt;,&lt;sprite_id2&gt;,...,&lt;sprite_idN&gt;</code>. No ID renaming is done, so identical sprite names will
Expand Down Expand Up @@ -1322,6 +1333,7 @@ <h2 id="configuring-from-config-file"><a class="header" href="#configuring-from-
<tr><td><code>/{source1},…,{sourceN}</code></td><td><a href="using.html#source-tilejson">Composite Source TileJSON</a></td></tr>
<tr><td><code>/{source1},…,{sourceN}/{z}/{x}/{y}</code></td><td><a href="sources-composite.html">Composite Source Tiles</a></td></tr>
<tr><td><code>/sprite/{spriteID}[@2x].{json,png}</code></td><td><a href="sources-sprites.html">Sprite sources</a></td></tr>
<tr><td><code>/sdf_sprite/{spriteID}[@2x].{json,png}</code></td><td><a href="sources-sprites.html">SDF Sprite sources</a></td></tr>
<tr><td><code>/font/{font}/{start}-{end}</code></td><td><a href="sources-fonts.html">Font source</a></td></tr>
<tr><td><code>/font/{font1},…,{fontN}/{start}-{end}</code></td><td><a href="sources-fonts.html">Composite Font source</a></td></tr>
<tr><td><code>/health</code></td><td>Martin server health check: returns 200 <code>OK</code></td></tr>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion sources-sprites.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ <h1 class="menu-title">Martin Tile Server Documentation</h1>
<div id="content" class="content">
<main>
<h2 id="sprite-sources"><a class="header" href="#sprite-sources">Sprite Sources</a></h2>
<p>Given a directory with SVG images, Martin will generate a sprite – a JSON index and a PNG image, for both low and highresolution displays. The SVG filenames without extension will be used as the sprites’ image IDs (remember that one sprite and thus <code>sprite_id</code> contains multiple images).
<p>Given a directory with SVG images, Martin will generate a sprite – a JSON index and a PNG image, for both low and highresolution displays.
The SVG filenames without extension will be used as the sprites’ image IDs (remember that one sprite and thus <code>sprite_id</code> contains multiple images).
The images are searched recursively in the given directory, so subdirectory names will be used as prefixes for the image IDs.
For example <code>icons/bicycle.svg</code> will be available as <code>icons/bicycle</code> sprite image.</p>
<p>The sprite generation is not yet cached, and may require external reverse proxy or CDN for faster operation.
Expand Down Expand Up @@ -208,6 +209,16 @@ <h5 id="sprite-index"><a class="header" href="#sprite-index">Sprite index</a></h
...
}
</code></pre>
<h5 id="coloring-at-runtime-via-signed-distance-fields-sdfs"><a class="header" href="#coloring-at-runtime-via-signed-distance-fields-sdfs">Coloring at runtime via Signed Distance Fields (SDFs)</a></h5>
<p>If you want to set the color of a sprite at runtime, you will need use the <a href="https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf">Signed Distance Fields (SDFs)</a>-endpoints.
For example, maplibre does support the image being modified via the <a href="https://maplibre.org/maplibre-style-spec/layers/#icon-color"><code>icon-color</code></a> and <a href="https://maplibre.org/maplibre-style-spec/layers/#icon-halo-color"><code>icon-halo-color</code></a> properties if using SDFs.</p>
<p>SDFs have the significant <strong>downside of only allowing one color</strong>.
If you want multiple colors, you will need to layer icons on top of each other.</p>
<p>The following APIs are available:</p>
<ul>
<li><code>/sdf_sprite/&lt;sprite_id&gt;.json</code> for getting a sprite index as SDF and</li>
<li><code>/sdf_sprite/&lt;sprite_id&gt;.png</code> for getting sprite PNGs as SDF</li>
</ul>
<h4 id="combining-multiple-sprites"><a class="header" href="#combining-multiple-sprites">Combining Multiple Sprites</a></h4>
<p>Multiple <code>sprite_id</code> values can be combined into one sprite with the same pattern as for tile
joining: <code>/sprite/&lt;sprite_id1&gt;,&lt;sprite_id2&gt;,...,&lt;sprite_idN&gt;</code>. No ID renaming is done, so identical sprite names will
Expand Down
1 change: 1 addition & 0 deletions using.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ <h2 id="martin-endpoints"><a class="header" href="#martin-endpoints">Martin Endp
<tr><td><code>/{source1},…,{sourceN}</code></td><td><a href="#source-tilejson">Composite Source TileJSON</a></td></tr>
<tr><td><code>/{source1},…,{sourceN}/{z}/{x}/{y}</code></td><td><a href="sources-composite.html">Composite Source Tiles</a></td></tr>
<tr><td><code>/sprite/{spriteID}[@2x].{json,png}</code></td><td><a href="sources-sprites.html">Sprite sources</a></td></tr>
<tr><td><code>/sdf_sprite/{spriteID}[@2x].{json,png}</code></td><td><a href="sources-sprites.html">SDF Sprite sources</a></td></tr>
<tr><td><code>/font/{font}/{start}-{end}</code></td><td><a href="sources-fonts.html">Font source</a></td></tr>
<tr><td><code>/font/{font1},…,{fontN}/{start}-{end}</code></td><td><a href="sources-fonts.html">Composite Font source</a></td></tr>
<tr><td><code>/health</code></td><td>Martin server health check: returns 200 <code>OK</code></td></tr>
Expand Down

0 comments on commit 9f19582

Please sign in to comment.