diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-01-07 16:21:45 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-01-15 17:04:07 +0100 |
commit | bd1f71cdbd4aa55ffa1beb61ddee1dd6da32412d (patch) | |
tree | 8bdc66df5446353faa2d315654f0f908c9d8098f /test/fixtures | |
parent | 40e908677e58f186d13ef9a33d2dcde396390ac4 (diff) | |
download | qtlocation-mapboxgl-bd1f71cdbd4aa55ffa1beb61ddee1dd6da32412d.tar.gz |
[core] use stale sprite data
This is a naïve implementation that essentially merges updated data into existing data. It will *not* remove icons from the stale sprite if they aren't present in the fresh sprite (we aren't tracking the source of a sprite, and the user could have changed it as well). Similarly, it will not update icons that have changed in dimension. This is a rare edge case and probably not worth implementing.
Diffstat (limited to 'test/fixtures')
-rw-r--r-- | test/fixtures/stale/sprite.json | 10 | ||||
-rw-r--r-- | test/fixtures/stale/sprite.png | bin | 0 -> 3351 bytes | |||
-rw-r--r-- | test/fixtures/stale/stale_style_and_sprite/expected.png | bin | 0 -> 26859 bytes | |||
-rw-r--r-- | test/fixtures/stale/style_and_sprite.json | 26 |
4 files changed, 36 insertions, 0 deletions
diff --git a/test/fixtures/stale/sprite.json b/test/fixtures/stale/sprite.json new file mode 100644 index 0000000000..e640365519 --- /dev/null +++ b/test/fixtures/stale/sprite.json @@ -0,0 +1,10 @@ +{ + "noise": { + "x": 0, + "y": 0, + "width": 32, + "height": 32, + "pixelRatio": 1, + "sdf": false + } +} diff --git a/test/fixtures/stale/sprite.png b/test/fixtures/stale/sprite.png Binary files differnew file mode 100644 index 0000000000..a02d8eb542 --- /dev/null +++ b/test/fixtures/stale/sprite.png diff --git a/test/fixtures/stale/stale_style_and_sprite/expected.png b/test/fixtures/stale/stale_style_and_sprite/expected.png Binary files differnew file mode 100644 index 0000000000..171599bf5c --- /dev/null +++ b/test/fixtures/stale/stale_style_and_sprite/expected.png diff --git a/test/fixtures/stale/style_and_sprite.json b/test/fixtures/stale/style_and_sprite.json new file mode 100644 index 0000000000..61e3214a5e --- /dev/null +++ b/test/fixtures/stale/style_and_sprite.json @@ -0,0 +1,26 @@ +{ + "version": 8, + "name": "Water", + "sources": { + "mapbox": { + "type": "vector", + "url": "asset://test/fixtures/stale/streets.json" + } + }, + "sprite": "http://127.0.0.1:3000/stale/sprite", + "layers": [{ + "id": "background", + "type": "background", + "paint": { + "background-color": "red" + } + }, { + "id": "water", + "type": "fill", + "source": "mapbox", + "source-layer": "water", + "paint": { + "fill-pattern": "noise" + } + }] +} |