Implementation of multi-sprites in mbgl-core (#1858)

Co-authored-by: Christophe Brasseur <christophe.brasseur@geolives.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart.louwers@gmail.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
Geolives
2024-02-27 18:42:17 +01:00
committed by GitHub
parent 9e8837b0fb
commit f4c6fabbe6
39 changed files with 649 additions and 83 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,56 @@
{
"version": 8,
"metadata": {
"test": {
"pixelRatio": 1,
"width": 128,
"height": 64
}
},
"center": [
0,
0
],
"zoom": 0,
"sources": {
"geojson": {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [25, 0]
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-25, 0]
}
}
]
}
}
},
"sprite": [{
"id": "default",
"url": "local://sprites/emerald"
}],
"layers": [
{
"id": "default",
"type": "symbol",
"source": "geojson",
"layout": {
"symbol-placement": "point",
"icon-image": "post_icon"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,79 @@
{
"version": 8,
"metadata": {
"test": {
"pixelRatio": 1,
"width": 128,
"height": 64
}
},
"center": [
0,
0
],
"zoom": 0,
"sources": {
"source-one": {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [25, 0]
}
}
]
}
},
"source-two": {
"type": "geojson",
"data": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-25, 0]
}
}
]
}
}
},
"sprite": [
{
"id": "default",
"url": "local://sprites/emerald"
},
{
"id": "sprite",
"url": "local://sprites/sprite"
}
],
"layers": [
{
"id": "default-sprite-features",
"type": "symbol",
"source": "source-one",
"layout": {
"symbol-placement": "point",
"icon-image": "post_icon"
}
},
{
"id": "sprite-sprite-features",
"type": "symbol",
"source": "source-two",
"layout": {
"symbol-placement": "point",
"icon-image": "sprite:night-lighthouse-12"
}
}
]
}