From 9d118250b4d5fe034fe798193d5e171690eaa5e4 Mon Sep 17 00:00:00 2001 From: Matt Riggott Date: Fri, 29 Sep 2023 05:23:58 +0000 Subject: [PATCH] Document sprite index file's sdf property (#356) --- docs/src/routes/sprite/index.tsx | 1 + src/reference/v8.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/routes/sprite/index.tsx b/docs/src/routes/sprite/index.tsx index e9a6707c6..5de0fbdc2 100644 --- a/docs/src/routes/sprite/index.tsx +++ b/docs/src/routes/sprite/index.tsx @@ -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\`. diff --git a/src/reference/v8.json b/src/reference/v8.json index 66b7c8c4f..ae4c40db6 100644 --- a/src/reference/v8.json +++ b/src/reference/v8.json @@ -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" ],