96 lines
2.2 KiB
JSON
96 lines
2.2 KiB
JSON
{
|
|
"version": 8,
|
|
"metadata": {
|
|
"test": {
|
|
"height": 256,
|
|
"width": 256,
|
|
"fadeDuration": 100,
|
|
"description": "Start with space for both labels to show with left anchor. Zoom out so that second has to switch to top anchor. Zoom out further so that second is forced to collide out. Zoom all the way back in so that the second label _could_ show in original position, but instead uses the last successfully placed one.",
|
|
"operations": [
|
|
["wait", 100],
|
|
["wait", 100],
|
|
["setZoom", 0.6],
|
|
["wait"],
|
|
["wait", 100],
|
|
["wait", 100],
|
|
["setZoom", 0],
|
|
["wait"],
|
|
["wait", 100],
|
|
["wait", 100],
|
|
["setZoom", 1.7],
|
|
["wait"],
|
|
["wait", 100],
|
|
["wait", 100]
|
|
]
|
|
}
|
|
},
|
|
"center": [ 0, 0 ],
|
|
"zoom": 1.5,
|
|
"sources": {
|
|
"point": {
|
|
"type": "geojson",
|
|
"data": {
|
|
"type": "FeatureCollection",
|
|
"features": [
|
|
{
|
|
"type": "Feature",
|
|
"properties": {
|
|
"name": "First"
|
|
},
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ -10, 0 ]
|
|
}
|
|
},
|
|
{
|
|
"type": "Feature",
|
|
"properties": {
|
|
"name": "Second"
|
|
},
|
|
"geometry": {
|
|
"type": "Point",
|
|
"coordinates": [ 10, -7 ]
|
|
}
|
|
}]
|
|
}
|
|
}
|
|
},
|
|
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
|
|
"layers": [
|
|
{
|
|
"id": "background",
|
|
"type": "background",
|
|
"paint": {
|
|
"background-color": "white"
|
|
}
|
|
},
|
|
{
|
|
"id": "text",
|
|
"type": "symbol",
|
|
"source": "point",
|
|
"layout": {
|
|
"text-field": ["get", "name"],
|
|
"text-size": 20,
|
|
"text-justify": "auto",
|
|
"text-variable-anchor": [
|
|
"left",
|
|
"top"
|
|
],
|
|
"text-radial-offset": 0.3,
|
|
"text-font": [
|
|
"Open Sans Semibold",
|
|
"Arial Unicode MS Bold"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"id": "anchor",
|
|
"type": "circle",
|
|
"source": "point",
|
|
"paint" :{
|
|
"circle-radius": 2
|
|
}
|
|
}
|
|
]
|
|
}
|