Skip to content

Commit

Permalink
Document sprite index file's sdf property (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
flother authored Sep 29, 2023
1 parent edeaee3 commit 9d11825
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/src/routes/sprite/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Apart from the required \`width\`, \`height\`, \`x\`, and \`y\` properties, the
- \`content\`: An array of four numbers, with the first two specifying the left, top corner, and the last two specifying the right, bottom corner. If present, and if the icon uses [\`icon-text-fit\`](${import.meta.env.BASE_URL}layers/#layout-symbol-icon-text-fit), the symbol's text will be fit inside the content box.
- \`stretchX\`: An array of two-element arrays, consisting of two numbers that represent the _from_ position and the _to_ position of areas that can be stretched.
- \`stretchY\`: Same as \`stretchX\`, but for the vertical dimension.
- \`sdf\`: Boolean. If \`true\` then the image is handled as a signed-distance field (SDF) and its color can be set at runtime using the [\`icon-color\`](${import.meta.env.BASE_URL}layers/#paint-symbol-icon-color) and [\`icon-halo-color\`](${import.meta.env.BASE_URL}layers/#paint-symbol-icon-halo-color) properties. Defaults to \`false\`.
MapLibre SDKs will use the value of the \`sprite\` property in the style to generate the URLs for loading both files. First, for both file types, it will append \`@2x\` to the URL on high-DPI devices. Second, it will append a file extension: \`.json\` for the index file, and \`.png\` for the image file. For example, if you specified \`"sprite": "https://example.com/sprite"\`, renderers would load \`https://example.com/sprite.json\` and \`https://example.com/sprite.png\`, or \`https://example.com/sprite@2x.json\` and \`https://example.com/sprite@2x.png\`.
Expand Down
2 changes: 1 addition & 1 deletion src/reference/v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -5208,7 +5208,7 @@
"type": "color",
"default": "#000000",
"transition": true,
"doc": "The color of the icon. This can only be used with sdf icons.",
"doc": "The color of the icon. This can only be used with SDF icons.",
"requires": [
"icon-image"
],
Expand Down

0 comments on commit 9d11825

Please sign in to comment.