135 lines
3.3 KiB
JSON
135 lines
3.3 KiB
JSON
{
|
|
"version": 8,
|
|
"metadata": {
|
|
"test": {
|
|
"description": "For radial offsets, we try to make the distance from the anchor to the first pixels of the text even in all positions. But we don't actually know where the pixels in the glyph are, so we approximate based on where we think the baseline of the glyph is. The circle in this test is a way to check that our approximation works visually.",
|
|
"height": 256,
|
|
"width": 256
|
|
}
|
|
},
|
|
"center": [ 0, 0 ],
|
|
"zoom": 0,
|
|
"sources": {
|
|
"point": {
|
|
"type": "geojson",
|
|
"data": {
|
|
"type": "FeatureCollection",
|
|
"features": [
|
|
{
|
|
"type": "Feature",
|
|
"properties": { "x": "bottom-right" },
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ 0, 0 ]
|
|
}
|
|
},
|
|
{
|
|
"type": "Feature",
|
|
"properties": { "x": "bottom" },
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ 0, 0 ]
|
|
}
|
|
},
|
|
{
|
|
"type": "Feature",
|
|
"properties": { "x": "bottom-left" },
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ 0, 0 ]
|
|
}
|
|
},
|
|
{
|
|
"type": "Feature",
|
|
"properties": { "x": "right" },
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ 0, 0 ]
|
|
}
|
|
},
|
|
{
|
|
"type": "Feature",
|
|
"properties": { "x": "center" },
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ 0, 0 ]
|
|
}
|
|
},
|
|
{
|
|
"type": "Feature",
|
|
"properties": { "x": "left" },
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ 0, 0 ]
|
|
}
|
|
},
|
|
{
|
|
"type": "Feature",
|
|
"properties": { "x": "top-right" },
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ 0, 0 ]
|
|
}
|
|
},
|
|
{
|
|
"type": "Feature",
|
|
"properties": { "x": "top" },
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ 0, 0 ]
|
|
}
|
|
},
|
|
{
|
|
"type": "Feature",
|
|
"properties": { "x": "top-left" },
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ 0, 0 ]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
|
|
"layers": [
|
|
{
|
|
"id": "background",
|
|
"type": "background",
|
|
"paint": {
|
|
"background-color": "white"
|
|
}
|
|
},
|
|
{
|
|
"id": "circle",
|
|
"type": "circle",
|
|
"source": "point",
|
|
"paint": {
|
|
"circle-radius": 40,
|
|
"circle-color": "aqua",
|
|
"circle-translate": [0, 4]
|
|
}
|
|
},
|
|
{
|
|
"id": "text",
|
|
"type": "symbol",
|
|
"source": "point",
|
|
"layout": {
|
|
"text-field": "x",
|
|
"text-size": 40,
|
|
"text-anchor": {
|
|
"type": "identity",
|
|
"property": "x"
|
|
},
|
|
"text-radial-offset": 1,
|
|
"text-allow-overlap": true,
|
|
"text-padding": 0,
|
|
"text-font": [
|
|
"Open Sans Semibold",
|
|
"Arial Unicode MS Bold"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|