From 21e4029acf757898da8695474f94642f9858acd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Mon, 4 Jan 2016 12:30:13 +0100 Subject: [core] use stale styles This adds support for using cached styles that are stale. They're treated like changing styles; when the refreshed style changed compared to the one we've already had, we're swapping out the entire style, which might cause a slight flicker. --- test/fixtures/stale/0-0-0.vector.pbf | Bin 0 -> 482553 bytes test/fixtures/stale/stale_style/expected.png | Bin 0 -> 13447 bytes test/fixtures/stale/streets.json | 14 ++++++++++++++ test/fixtures/stale/style.json | 25 +++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 test/fixtures/stale/0-0-0.vector.pbf create mode 100644 test/fixtures/stale/stale_style/expected.png create mode 100644 test/fixtures/stale/streets.json create mode 100644 test/fixtures/stale/style.json (limited to 'test/fixtures') diff --git a/test/fixtures/stale/0-0-0.vector.pbf b/test/fixtures/stale/0-0-0.vector.pbf new file mode 100644 index 0000000000..a0f049ad43 Binary files /dev/null and b/test/fixtures/stale/0-0-0.vector.pbf differ diff --git a/test/fixtures/stale/stale_style/expected.png b/test/fixtures/stale/stale_style/expected.png new file mode 100644 index 0000000000..d3c6ef3cd5 Binary files /dev/null and b/test/fixtures/stale/stale_style/expected.png differ diff --git a/test/fixtures/stale/streets.json b/test/fixtures/stale/streets.json new file mode 100644 index 0000000000..11cb5c8557 --- /dev/null +++ b/test/fixtures/stale/streets.json @@ -0,0 +1,14 @@ +{ + "bounds": [ -180, -85.0511, 180, 85.0511 ], + "center": [ 0, 0, 0 ], + "description": "", + "format": "pbf", + "id": "streets", + "maskLevel": 8, + "maxzoom": 15, + "minzoom": 0, + "name": "Streets", + "scheme": "xyz", + "tilejson": "2.0.0", + "tiles": [ "asset://test/fixtures/stale/{z}-{x}-{y}.vector.pbf" ] +} diff --git a/test/fixtures/stale/style.json b/test/fixtures/stale/style.json new file mode 100644 index 0000000000..ca86503d4f --- /dev/null +++ b/test/fixtures/stale/style.json @@ -0,0 +1,25 @@ +{ + "version": 8, + "name": "Water", + "sources": { + "mapbox": { + "type": "vector", + "url": "asset://test/fixtures/stale/streets.json" + } + }, + "layers": [{ + "id": "background", + "type": "background", + "paint": { + "background-color": "red" + } + }, { + "id": "water", + "type": "fill", + "source": "mapbox", + "source-layer": "water", + "paint": { + "fill-color": "blue" + } + }] +} -- cgit v1.2.1