From 6f112849bebbacedb9c5fed51c349c386ae9738c Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Mon, 7 Jul 2014 17:25:15 -0700 Subject: [PATCH 01/52] first attempt at testing malformed style parsing --- bin/build-style.js | 1 - bin/fuzz-style.js | 24 ++++++++++++++++++++++++ bin/package.json | 11 ++++++----- llmr.gyp | 24 +++++++++++++++++++++++- test/style.cpp | 26 ++++++++++++++++++++++++++ test/test.gyp | 16 ++++++++++++++++ 6 files changed, 95 insertions(+), 7 deletions(-) create mode 100644 bin/fuzz-style.js create mode 100644 test/style.cpp diff --git a/bin/build-style.js b/bin/build-style.js index c69fcb8b4..9b931c811 100755 --- a/bin/build-style.js +++ b/bin/build-style.js @@ -4,7 +4,6 @@ var path = require('path'); var fs = require('fs'); var mkdirp = require('./mkdirp'); -var name = 'style'; var data = JSON.stringify(require(path.join(process.cwd(), process.argv[2]))); var out_path = path.join(process.argv[3], 'bin/style.min.js'); diff --git a/bin/fuzz-style.js b/bin/fuzz-style.js new file mode 100644 index 000000000..8dae68e4a --- /dev/null +++ b/bin/fuzz-style.js @@ -0,0 +1,24 @@ +#!/usr/bin/env node +'use strict'; + +var fuzzer = require('fuzzer'); +var path = require('path'); +var fs = require('fs'); +var mkdirp = require('./mkdirp'); +var json = require(path.join(process.cwd(), process.argv[2])); + +fuzzer.seed(0); + +json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { + var value = json.constants[key]; + if (typeof value === 'string') { + obj[key] = fuzzer.mutate.string(value); + } + return obj; +}, {}); + +var data = JSON.stringify(json); + +var out_path = path.join(process.argv[3], 'bin/style-fuzzed.min.js'); +mkdirp.sync(path.dirname(out_path)); +fs.writeFileSync(out_path, data); diff --git a/bin/package.json b/bin/package.json index 4431471e9..0eefafd26 100644 --- a/bin/package.json +++ b/bin/package.json @@ -1,7 +1,8 @@ { - "name": "llmr-native", - "version": "0.0.1", - "dependencies": { - "glsl-optimizer": "git://github.com/kkaefer/glsl-optimizer.git#amalgamation" - } + "name": "llmr-native", + "version": "0.0.1", + "dependencies": { + "fuzzer": "^0.2.0", + "glsl-optimizer": "git://github.com/kkaefer/glsl-optimizer.git#amalgamation" + } } diff --git a/llmr.gyp b/llmr.gyp index 2ffb3ae63..08c5163a1 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -55,6 +55,28 @@ ], } }, + { + 'target_name': 'fuzz_stylesheet', + 'type': 'none', + 'hard_dependency': 1, + 'actions': [ + { + 'action_name': 'Fuzz Stylesheet', + 'inputs': [ + 'bin/style.js', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/bin/style-fuzzed.min.js' + ], + 'action': ['<@(node)', 'bin/fuzz-style.js', '<@(_inputs)', '<(SHARED_INTERMEDIATE_DIR)'] + } + ], + 'direct_dependent_settings': { + 'sources': [ + '<(SHARED_INTERMEDIATE_DIR)/bin/style-fuzzed.min.js' + ], + } + }, { 'target_name': 'llmr-x86', 'product_name': 'llmr-x86', @@ -194,4 +216,4 @@ } } ] -} \ No newline at end of file +} diff --git a/test/style.cpp b/test/style.cpp new file mode 100644 index 000000000..5869bf787 --- /dev/null +++ b/test/style.cpp @@ -0,0 +1,26 @@ +#include "gtest/gtest.h" + +#include + +#include "../common/headless_view.hpp" + +#include +#include + +using namespace llmr; + +TEST(Style, Color) { + // Setup OpenGL + llmr::HeadlessView view; + llmr::Map map(view); + + std::ifstream stylefile("./style-fuzzed.min.js"); + ASSERT_TRUE(stylefile.good()); + std::stringstream stylejson; + stylejson << stylefile.rdbuf(); + + map.setStyleJSON(stylejson.str()); + + // ASSERT_EQ(std::string(""), styles[0]->clip.mask); + // ASSERT_EQ(3, styles[0]->clip.length); +} diff --git a/test/test.gyp b/test/test.gyp index 98effdfa9..00dd79331 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -80,6 +80,22 @@ "../llmr.gyp:llmr-x86" ] }, + { + "target_name": "style", + "product_name": "test_style", + "type": "executable", + "libraries": [ + "-lpthread", + ], + "sources": [ + "./main.cpp", + "./style.cpp", + ], + "dependencies": [ + "../deps/gtest/gtest.gyp:gtest", + "../llmr.gyp:llmr-x86" + ] + }, { "target_name": "variant", "product_name": "test_variant", From 5ae5d7cbc0ee6fc145315b8a357b635164df40d7 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Mon, 7 Jul 2014 18:12:33 -0700 Subject: [PATCH 02/52] run fuzzed stylesheet test with malformed color strings --- test/style.cpp | 5 +---- test/test.gyp | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/style.cpp b/test/style.cpp index 5869bf787..bed8f38ff 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -15,12 +15,9 @@ TEST(Style, Color) { llmr::Map map(view); std::ifstream stylefile("./style-fuzzed.min.js"); - ASSERT_TRUE(stylefile.good()); + ASSERT_FALSE(stylefile.good()); std::stringstream stylejson; stylejson << stylefile.rdbuf(); map.setStyleJSON(stylejson.str()); - - // ASSERT_EQ(std::string(""), styles[0]->clip.mask); - // ASSERT_EQ(3, styles[0]->clip.length); } diff --git a/test/test.gyp b/test/test.gyp index df38d1daa..4174c6897 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -95,10 +95,13 @@ "sources": [ "./main.cpp", "./style.cpp", + "../common/headless_view.hpp", + "../common/headless_view.cpp", ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", - "../llmr.gyp:llmr-x86" + "../llmr.gyp:llmr-x86", + "link_gl", ] }, { @@ -183,6 +186,7 @@ "tile", "functions", "headless", + "style", ], } ] From bc30a9b8cda6e150ae77c8b0f4da24d1aae5b970 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Mon, 7 Jul 2014 19:13:32 -0700 Subject: [PATCH 03/52] test Style.loadJSON directly, drop headless view --- test/style.cpp | 11 +++-------- test/test.gyp | 3 --- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/test/style.cpp b/test/style.cpp index bed8f38ff..a7e309c98 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -1,8 +1,6 @@ #include "gtest/gtest.h" -#include - -#include "../common/headless_view.hpp" +#include #include #include @@ -10,14 +8,11 @@ using namespace llmr; TEST(Style, Color) { - // Setup OpenGL - llmr::HeadlessView view; - llmr::Map map(view); - std::ifstream stylefile("./style-fuzzed.min.js"); ASSERT_FALSE(stylefile.good()); std::stringstream stylejson; stylejson << stylefile.rdbuf(); - map.setStyleJSON(stylejson.str()); + Style style; + style.loadJSON((const uint8_t *)stylejson.str().c_str()); } diff --git a/test/test.gyp b/test/test.gyp index 4174c6897..e3e08c3fd 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -95,13 +95,10 @@ "sources": [ "./main.cpp", "./style.cpp", - "../common/headless_view.hpp", - "../common/headless_view.cpp", ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", "../llmr.gyp:llmr-x86", - "link_gl", ] }, { From ab36059fdada88e91d8cb88434287d226db3b73e Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Tue, 8 Jul 2014 18:28:00 -0700 Subject: [PATCH 04/52] try breaking up build-style pipeline into pipeable files --- bin/build-style.js | 14 ++--- bin/fuzz-style.js | 32 +++++------ bin/load-style.js | 15 ++++++ bin/mkdirp.js | 102 ++++------------------------------- bin/package.json | 4 +- bin/parse.js | 28 ++++++++++ bin/stringify.js | 26 +++++++++ bin/{style.js => style.json} | 6 +-- 8 files changed, 106 insertions(+), 121 deletions(-) mode change 100644 => 100755 bin/fuzz-style.js create mode 100755 bin/load-style.js mode change 100644 => 100755 bin/mkdirp.js create mode 100755 bin/parse.js create mode 100755 bin/stringify.js rename bin/{style.js => style.json} (99%) mode change 100644 => 100755 diff --git a/bin/build-style.js b/bin/build-style.js index 9b931c811..0d8d09ade 100755 --- a/bin/build-style.js +++ b/bin/build-style.js @@ -1,11 +1,11 @@ #!/usr/bin/env node 'use strict'; -var path = require('path'); -var fs = require('fs'); -var mkdirp = require('./mkdirp'); -var data = JSON.stringify(require(path.join(process.cwd(), process.argv[2]))); +var load = require('./load-style.js'); +var JSONStream = require('JSONStream'); +var stringify = require('./stringify'); +var mkdirp = require('./mkdirp.js'); -var out_path = path.join(process.argv[3], 'bin/style.min.js'); -mkdirp.sync(path.dirname(out_path)); -fs.writeFileSync(out_path, data); +load(process.argv[2]) + .pipe(stringify()) + .pipe(mkdirp(process.argv[3])); diff --git a/bin/fuzz-style.js b/bin/fuzz-style.js old mode 100644 new mode 100755 index 8dae68e4a..79fe7e1cc --- a/bin/fuzz-style.js +++ b/bin/fuzz-style.js @@ -1,24 +1,24 @@ #!/usr/bin/env node 'use strict'; +var concat = require('concat-stream'); var fuzzer = require('fuzzer'); -var path = require('path'); -var fs = require('fs'); -var mkdirp = require('./mkdirp'); -var json = require(path.join(process.cwd(), process.argv[2])); - fuzzer.seed(0); -json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { - var value = json.constants[key]; - if (typeof value === 'string') { - obj[key] = fuzzer.mutate.string(value); - } - return obj; -}, {}); +var read = process.stdin; +var write = concat(function(buffer) { + var json = JSON.parse(buffer); -var data = JSON.stringify(json); + json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { + var value = json.constants[key]; + if (typeof value === 'string') { + obj[key] = fuzzer.mutate.string(value); + } + return obj; + }, {}); -var out_path = path.join(process.argv[3], 'bin/style-fuzzed.min.js'); -mkdirp.sync(path.dirname(out_path)); -fs.writeFileSync(out_path, data); + var data = JSON.stringify(json); + process.stdout.write(data); +}); + +read.pipe(write); diff --git a/bin/load-style.js b/bin/load-style.js new file mode 100755 index 000000000..48aa6ecc4 --- /dev/null +++ b/bin/load-style.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node +'use strict'; + +var fs = require('fs'); +var path = require('path'); +var brfs = require('brfs'); + +module.exports = function(file) { + var fromFile = file && file !== '-'; + var rs = fromFile ? fs.createReadStream(file) : process.stdin; + var fpath = fromFile ? file : path.join(process.cwd(), '-'); + return rs.pipe(brfs(fpath)); +}; + +if (!module.parent) module.exports(process.argv[2]).pipe(process.stdout); diff --git a/bin/mkdirp.js b/bin/mkdirp.js old mode 100644 new mode 100755 index a1742b206..25b3234ef --- a/bin/mkdirp.js +++ b/bin/mkdirp.js @@ -1,97 +1,13 @@ +#!/usr/bin/env node +'use strict'; + var path = require('path'); +var mkdirp = require('mkdirp'); var fs = require('fs'); -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, opts, f, made) { - if (typeof opts === 'function') { - f = opts; - opts = {}; - } - else if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - p = path.resolve(p); - - xfs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), opts, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, opts, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - p = path.resolve(p); - - try { - xfs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), opts, made); - sync(p, opts, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = xfs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; +module.exports = function(out) { + mkdirp.sync(path.dirname(out)); + return fs.createWriteStream(out); }; + +if (!module.parent) process.stdin.pipe(module.exports(process.argv[2])); diff --git a/bin/package.json b/bin/package.json index 0eefafd26..bb8783d99 100644 --- a/bin/package.json +++ b/bin/package.json @@ -2,7 +2,9 @@ "name": "llmr-native", "version": "0.0.1", "dependencies": { + "concat-stream": "^1.4.6", "fuzzer": "^0.2.0", - "glsl-optimizer": "git://github.com/kkaefer/glsl-optimizer.git#amalgamation" + "glsl-optimizer": "git://github.com/kkaefer/glsl-optimizer.git#amalgamation", + "mkdirp": "^0.5.0" } } diff --git a/bin/parse.js b/bin/parse.js new file mode 100755 index 000000000..15aad1016 --- /dev/null +++ b/bin/parse.js @@ -0,0 +1,28 @@ +#!/usr/bin/env node +'use strict'; + +var concat = require('concat-stream'); +var through = require('through2'); +var fuzzer = require('fuzzer'); +fuzzer.seed(0); + +module.exports = function() { + var read = through(); + var write = concat(function(buffer) { + var json = JSON.parse(buffer); + + json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { + var value = json.constants[key]; + if (typeof value === 'string') { + obj[key] = fuzzer.mutate.string(value); + } + return obj; + }, {}); + + var data = JSON.stringify(json); + process.stdout.write(data); + }); + read.pipe(write); +}; + +// if (!module.parent) module.exports().pipe(process.stdout); diff --git a/bin/stringify.js b/bin/stringify.js new file mode 100755 index 000000000..c65a54ed1 --- /dev/null +++ b/bin/stringify.js @@ -0,0 +1,26 @@ +#!/usr/bin/env node +'use strict'; + +var through = require('through2'); +var fuzzer = require('fuzzer'); +fuzzer.seed(0); + +module.exports = function() { + return through.obj(function(chunk, env, callback) { + var json = JSON.parse(chunk.toString()); + + json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { + var value = json.constants[key]; + if (typeof value === 'string') { + obj[key] = fuzzer.mutate.string(value); + } + return obj; + }, {}); + + var data = JSON.stringify(json); + this.push(data); + callback(); + }); +}; + +// if (!module.parent) module.exports().pipe(process.stdout); diff --git a/bin/style.js b/bin/style.json old mode 100644 new mode 100755 similarity index 99% rename from bin/style.js rename to bin/style.json index 21cca2af3..4044e4562 --- a/bin/style.js +++ b/bin/style.json @@ -1,6 +1,4 @@ -"use strict"; - -module.exports = { +{ "version": 3, "sprite": "https://www.mapbox.com/mapbox-gl-styles/sprites/outdoors", "glyphs": "https://mapbox.s3.amazonaws.com/gl-glyphs-256/{{fontstack}}/{{range}}.pbf", @@ -2473,4 +2471,4 @@ module.exports = { } } }] -}; +} From db9cba928bba0cca7aa12cef0762b4c2a4b3dec2 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 12:34:29 -0700 Subject: [PATCH 05/52] clean up pipes --- bin/build-style.js | 5 ++--- bin/{stringify.js => fuzz-colors.js} | 2 +- bin/fuzz-style.js | 24 ------------------------ bin/minify.js | 15 +++++++++++++++ bin/package.json | 1 - bin/parse.js | 28 ---------------------------- 6 files changed, 18 insertions(+), 57 deletions(-) rename bin/{stringify.js => fuzz-colors.js} (88%) delete mode 100755 bin/fuzz-style.js create mode 100755 bin/minify.js delete mode 100755 bin/parse.js diff --git a/bin/build-style.js b/bin/build-style.js index 0d8d09ade..9e131e05a 100755 --- a/bin/build-style.js +++ b/bin/build-style.js @@ -2,10 +2,9 @@ 'use strict'; var load = require('./load-style.js'); -var JSONStream = require('JSONStream'); -var stringify = require('./stringify'); +var minify = require('./minify'); var mkdirp = require('./mkdirp.js'); load(process.argv[2]) - .pipe(stringify()) + .pipe(minify()) .pipe(mkdirp(process.argv[3])); diff --git a/bin/stringify.js b/bin/fuzz-colors.js similarity index 88% rename from bin/stringify.js rename to bin/fuzz-colors.js index c65a54ed1..c3a64f9ac 100755 --- a/bin/stringify.js +++ b/bin/fuzz-colors.js @@ -23,4 +23,4 @@ module.exports = function() { }); }; -// if (!module.parent) module.exports().pipe(process.stdout); +if (!module.parent) process.stdin.pipe(module.exports()).pipe(process.stdout); diff --git a/bin/fuzz-style.js b/bin/fuzz-style.js deleted file mode 100755 index 79fe7e1cc..000000000 --- a/bin/fuzz-style.js +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var concat = require('concat-stream'); -var fuzzer = require('fuzzer'); -fuzzer.seed(0); - -var read = process.stdin; -var write = concat(function(buffer) { - var json = JSON.parse(buffer); - - json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { - var value = json.constants[key]; - if (typeof value === 'string') { - obj[key] = fuzzer.mutate.string(value); - } - return obj; - }, {}); - - var data = JSON.stringify(json); - process.stdout.write(data); -}); - -read.pipe(write); diff --git a/bin/minify.js b/bin/minify.js new file mode 100755 index 000000000..253b34001 --- /dev/null +++ b/bin/minify.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node +'use strict'; + +var through = require('through2'); + +module.exports = function() { + return through.obj(function(chunk, env, callback) { + var json = JSON.parse(chunk.toString()); + var data = JSON.stringify(json); + this.push(data); + callback(); + }); +}; + +if (!module.parent) process.stdin.pipe(module.exports()).pipe(process.stdout); diff --git a/bin/package.json b/bin/package.json index bb8783d99..4a428bde6 100644 --- a/bin/package.json +++ b/bin/package.json @@ -2,7 +2,6 @@ "name": "llmr-native", "version": "0.0.1", "dependencies": { - "concat-stream": "^1.4.6", "fuzzer": "^0.2.0", "glsl-optimizer": "git://github.com/kkaefer/glsl-optimizer.git#amalgamation", "mkdirp": "^0.5.0" diff --git a/bin/parse.js b/bin/parse.js deleted file mode 100755 index 15aad1016..000000000 --- a/bin/parse.js +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var concat = require('concat-stream'); -var through = require('through2'); -var fuzzer = require('fuzzer'); -fuzzer.seed(0); - -module.exports = function() { - var read = through(); - var write = concat(function(buffer) { - var json = JSON.parse(buffer); - - json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { - var value = json.constants[key]; - if (typeof value === 'string') { - obj[key] = fuzzer.mutate.string(value); - } - return obj; - }, {}); - - var data = JSON.stringify(json); - process.stdout.write(data); - }); - read.pipe(write); -}; - -// if (!module.parent) module.exports().pipe(process.stdout); From 172466301b20c299b2b7fd81078cb22153f11e37 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 13:03:56 -0700 Subject: [PATCH 06/52] fix gypfile --- bin/build-shaders.js | 2 +- llmr.gyp | 30 ++++-------------------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/bin/build-shaders.js b/bin/build-shaders.js index b5072c370..fd896af24 100755 --- a/bin/build-shaders.js +++ b/bin/build-shaders.js @@ -3,7 +3,7 @@ var fs = require('fs'); var path = require('path'); -var mkdirp = require('./mkdirp'); +var mkdirp = require('mkdirp'); try { var glsl = require('glsl-optimizer'); } catch(err) {} diff --git a/llmr.gyp b/llmr.gyp index 0983d23ce..8a656945e 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -41,12 +41,12 @@ { 'action_name': 'Build Stylesheet', 'inputs': [ - 'bin/style.js', + 'bin/style.json', ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js' ], - 'action': ['<@(node)', 'bin/build-style.js', '<@(_inputs)', '<(SHARED_INTERMEDIATE_DIR)'] + 'action': ['<@(node)', 'bin/build-style.js', '<@(_inputs)', '<@(_outputs)'] } ], 'direct_dependent_settings': { @@ -55,28 +55,6 @@ ], } }, - { - 'target_name': 'fuzz_stylesheet', - 'type': 'none', - 'hard_dependency': 1, - 'actions': [ - { - 'action_name': 'Fuzz Stylesheet', - 'inputs': [ - 'bin/style.js', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/bin/style-fuzzed.min.js' - ], - 'action': ['<@(node)', 'bin/fuzz-style.js', '<@(_inputs)', '<(SHARED_INTERMEDIATE_DIR)'] - } - ], - 'direct_dependent_settings': { - 'sources': [ - '<(SHARED_INTERMEDIATE_DIR)/bin/style-fuzzed.min.js' - ], - } - }, { 'target_name': 'copy_default_stylesheet', 'type': 'none', @@ -118,7 +96,7 @@ ' Date: Wed, 9 Jul 2014 13:12:42 -0700 Subject: [PATCH 07/52] change style assert --- test/style.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/style.cpp b/test/style.cpp index a7e309c98..6a482184d 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -7,9 +7,9 @@ using namespace llmr; -TEST(Style, Color) { - std::ifstream stylefile("./style-fuzzed.min.js"); - ASSERT_FALSE(stylefile.good()); +TEST(Style, Style) { + std::ifstream stylefile("./style.min.js"); + ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; stylejson << stylefile.rdbuf(); From e8dcb8af0001bf5486500340405faa0041adcd41 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 14:22:10 -0700 Subject: [PATCH 08/52] generate fuzzed color stylesheet, copy to product_dir --- bin/build-style.js | 17 +++++++++++++---- llmr.gyp | 13 +++++++++---- test/style.cpp | 10 ++++++++++ 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/bin/build-style.js b/bin/build-style.js index 9e131e05a..720a73990 100755 --- a/bin/build-style.js +++ b/bin/build-style.js @@ -2,9 +2,18 @@ 'use strict'; var load = require('./load-style.js'); -var minify = require('./minify'); var mkdirp = require('./mkdirp.js'); +var path = require('path'); -load(process.argv[2]) - .pipe(minify()) - .pipe(mkdirp(process.argv[3])); +var transforms = { + 'style.min.js': require('./minify.js'), + 'fuzz-colors.min.js': require('./fuzz-colors.js') +}; + +var source = load(process.argv[2]); + +Object.keys(transforms).forEach(function(key) { + load(process.argv[2]) + .pipe(transforms[key].call()) + .pipe(mkdirp(path.join(process.argv[3], key))); +}); diff --git a/llmr.gyp b/llmr.gyp index f19478aa1..2a2df44b0 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -44,14 +44,16 @@ 'bin/style.json', ], 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js' + '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', ], - 'action': ['<@(node)', 'bin/build-style.js', '<@(_inputs)', '<@(_outputs)'] + 'action': ['<@(node)', 'bin/build-style.js', '<@(_inputs)', '<(SHARED_INTERMEDIATE_DIR)/bin'] } ], 'direct_dependent_settings': { 'sources': [ - '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js' + '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', ], } }, @@ -64,7 +66,10 @@ ], 'copies': [ { - 'files': [ '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js' ], + 'files': [ + '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', + ], 'destination': '<(PRODUCT_DIR)' } ] diff --git a/test/style.cpp b/test/style.cpp index 6a482184d..a321fe835 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -16,3 +16,13 @@ TEST(Style, Style) { Style style; style.loadJSON((const uint8_t *)stylejson.str().c_str()); } + +TEST(Style, Colors) { + std::ifstream stylefile("./fuzz-colors.min.js"); + ASSERT_TRUE(stylefile.good()); + std::stringstream stylejson; + stylejson << stylefile.rdbuf(); + + Style style; + style.loadJSON((const uint8_t *)stylejson.str().c_str()); +} From b1bc1e1fc92789c1064fa52435ad2237b6e8a914 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 14:54:34 -0700 Subject: [PATCH 09/52] update bin/package.json --- bin/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/package.json b/bin/package.json index 4a428bde6..95752667a 100644 --- a/bin/package.json +++ b/bin/package.json @@ -2,8 +2,10 @@ "name": "llmr-native", "version": "0.0.1", "dependencies": { + "brfs": "^1.1.2", "fuzzer": "^0.2.0", "glsl-optimizer": "git://github.com/kkaefer/glsl-optimizer.git#amalgamation", - "mkdirp": "^0.5.0" + "mkdirp": "^0.5.0", + "through2": "^0.5.1" } } From 7365d1b2f479823151e7fa57147ae066e76b7ea1 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 15:06:28 -0700 Subject: [PATCH 10/52] fix stylesheet directory prefix --- test/style.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/style.cpp b/test/style.cpp index a321fe835..2205430b2 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -7,8 +7,10 @@ using namespace llmr; +std::string prefix = "./obj/gen/bin/"; + TEST(Style, Style) { - std::ifstream stylefile("./style.min.js"); + std::ifstream stylefile(prefix + "style.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; stylejson << stylefile.rdbuf(); @@ -18,7 +20,7 @@ TEST(Style, Style) { } TEST(Style, Colors) { - std::ifstream stylefile("./fuzz-colors.min.js"); + std::ifstream stylefile(prefix + "fuzz-colors.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; stylejson << stylefile.rdbuf(); From 9eb6b69cd440816457a2a07cb3b31e04b24d3f5a Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 15:23:42 -0700 Subject: [PATCH 11/52] only load and mkdirp once --- bin/build-style.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/build-style.js b/bin/build-style.js index 720a73990..5ef8d317d 100755 --- a/bin/build-style.js +++ b/bin/build-style.js @@ -2,8 +2,9 @@ 'use strict'; var load = require('./load-style.js'); -var mkdirp = require('./mkdirp.js'); +var mkdirp = require('mkdirp'); var path = require('path'); +var fs = require('fs'); var transforms = { 'style.min.js': require('./minify.js'), @@ -11,9 +12,10 @@ var transforms = { }; var source = load(process.argv[2]); +var out = process.argv[3]; +mkdirp.sync(out); Object.keys(transforms).forEach(function(key) { - load(process.argv[2]) - .pipe(transforms[key].call()) - .pipe(mkdirp(path.join(process.argv[3], key))); + source.pipe(transforms[key].call()) + .pipe(fs.createWriteStream(path.join(out, key))); }); From ce46f548062072418d6d76eae91a1d73a67a5bfb Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 15:52:14 -0700 Subject: [PATCH 12/52] gyp npm install --- llmr.gyp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/llmr.gyp b/llmr.gyp index 2a2df44b0..4b530d790 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -33,10 +33,30 @@ ] } }, + { + 'target_name': 'npm_install', + 'type': 'none', + 'hard_dependency': 1, + 'actions': [ + { + 'action_name': 'npm install', + 'inputs': [ + 'bin/package.json' + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/bin/node_modules', + ], + 'action': ['cd', 'bin/', 'npm', 'install'] + } + ], + }, { 'target_name': 'build_stylesheet', 'type': 'none', 'hard_dependency': 1, + 'dependencies': [ + 'npm_install' + ], 'actions': [ { 'action_name': 'Build Stylesheet', From ceb3439783ed00c8c310527980582f7a582955c7 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 16:16:16 -0700 Subject: [PATCH 13/52] npm install bin/ --- llmr.gyp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/llmr.gyp b/llmr.gyp index 4b530d790..6b0704ceb 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -46,16 +46,30 @@ 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/bin/node_modules', ], - 'action': ['cd', 'bin/', 'npm', 'install'] + 'action': ['npm', 'install', 'bin/'] } ], }, + { + 'target_name': 'copy_node_modules', + 'type': 'none', + 'hard_dependency': 1, + 'dependencies': [ + 'npm_install' + ], + 'copies': [ + { + 'files': ['<(SHARED_INTERMEDIATE_DIR)/bin/node_modules'], + 'destination': '<(PRODUCT_DIR)' + } + ] + }, { 'target_name': 'build_stylesheet', 'type': 'none', 'hard_dependency': 1, 'dependencies': [ - 'npm_install' + 'copy_node_modules' ], 'actions': [ { From 824994a5b2df8d628b89a88880c9ce87bc31eb69 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 17:24:55 -0700 Subject: [PATCH 14/52] copy node_modules --- bin/package.json | 2 +- llmr.gyp | 24 ++---------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/bin/package.json b/bin/package.json index 95752667a..77edcb9bf 100644 --- a/bin/package.json +++ b/bin/package.json @@ -4,7 +4,7 @@ "dependencies": { "brfs": "^1.1.2", "fuzzer": "^0.2.0", - "glsl-optimizer": "git://github.com/kkaefer/glsl-optimizer.git#amalgamation", + "glsl-optimizer": "kkaefer/glsl-optimizer#amalgamation", "mkdirp": "^0.5.0", "through2": "^0.5.1" } diff --git a/llmr.gyp b/llmr.gyp index 6b0704ceb..83c0d6c64 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -33,34 +33,14 @@ ] } }, - { - 'target_name': 'npm_install', - 'type': 'none', - 'hard_dependency': 1, - 'actions': [ - { - 'action_name': 'npm install', - 'inputs': [ - 'bin/package.json' - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/bin/node_modules', - ], - 'action': ['npm', 'install', 'bin/'] - } - ], - }, { 'target_name': 'copy_node_modules', 'type': 'none', 'hard_dependency': 1, - 'dependencies': [ - 'npm_install' - ], 'copies': [ { - 'files': ['<(SHARED_INTERMEDIATE_DIR)/bin/node_modules'], - 'destination': '<(PRODUCT_DIR)' + 'files': ['bin/node_modules'], + 'destination': '<(PRODUCT_DIR)/bin/node_modules' } ] }, From d96e2fc782603241421ac3a836442a3146d237df Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 18:16:28 -0700 Subject: [PATCH 15/52] npm_install.sh --- llmr.gyp | 18 ++++++++++++------ scripts/npm_install.sh | 4 ++++ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100755 scripts/npm_install.sh diff --git a/llmr.gyp b/llmr.gyp index 83c0d6c64..c9ed89473 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -34,22 +34,28 @@ } }, { - 'target_name': 'copy_node_modules', + 'target_name': 'npm_install', 'type': 'none', 'hard_dependency': 1, - 'copies': [ + 'actions': [ { - 'files': ['bin/node_modules'], - 'destination': '<(PRODUCT_DIR)/bin/node_modules' + 'action_name': 'npm install', + 'inputs': [ + 'bin/package.json', + ], + 'outputs': [ + 'bin/node_modules', + ], + 'action': ['./scripts/npm_install.sh'] } - ] + ], }, { 'target_name': 'build_stylesheet', 'type': 'none', 'hard_dependency': 1, 'dependencies': [ - 'copy_node_modules' + 'npm_install' ], 'actions': [ { diff --git a/scripts/npm_install.sh b/scripts/npm_install.sh new file mode 100755 index 000000000..04c1b7e63 --- /dev/null +++ b/scripts/npm_install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +cd bin +npm install From e3977fb5e5fcdd3a987dba9c8e39d17e1400296e Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 18:35:29 -0700 Subject: [PATCH 16/52] add npm_install dep to build-shaders --- llmr.gyp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llmr.gyp b/llmr.gyp index c9ed89473..392552310 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -8,6 +8,9 @@ 'target_name': 'shaders', 'type': 'none', 'hard_dependency': 1, + 'dependencies': [ + 'npm_install' + ], 'actions': [ { 'action_name': 'Build Shaders', From ece851f2169f00c0dadb6b7b4e484111588cce98 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Wed, 9 Jul 2014 18:48:57 -0700 Subject: [PATCH 17/52] fix test/style stylesheet paths --- test/style.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/style.cpp b/test/style.cpp index 2205430b2..a321fe835 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -7,10 +7,8 @@ using namespace llmr; -std::string prefix = "./obj/gen/bin/"; - TEST(Style, Style) { - std::ifstream stylefile(prefix + "style.min.js"); + std::ifstream stylefile("./style.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; stylejson << stylefile.rdbuf(); @@ -20,7 +18,7 @@ TEST(Style, Style) { } TEST(Style, Colors) { - std::ifstream stylefile(prefix + "fuzz-colors.min.js"); + std::ifstream stylefile("./fuzz-colors.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; stylejson << stylefile.rdbuf(); From 076dce563d0fe97e1ae7c70663d78b4aedbaa1fb Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 10 Jul 2014 10:27:10 -0700 Subject: [PATCH 18/52] clean up npm_install --- scripts/npm_install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/npm_install.sh b/scripts/npm_install.sh index 04c1b7e63..f72e63ded 100755 --- a/scripts/npm_install.sh +++ b/scripts/npm_install.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash +set -e +set -o pipefail + cd bin npm install +cd ../ From 5e85324c38c11188c284e1bc6183bf5ea75cd62c Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 10 Jul 2014 10:50:41 -0700 Subject: [PATCH 19/52] link_gl --- test/test.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test.gyp b/test/test.gyp index 1dce41053..2189bda75 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -104,6 +104,7 @@ "dependencies": [ "../deps/gtest/gtest.gyp:gtest", "../llmr.gyp:llmr-x86", + "link_gl", ] }, { From 1268fafe0bab09816d2373db8ca9abbcdb702fc3 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 10 Jul 2014 11:46:10 -0700 Subject: [PATCH 20/52] move sprite class to map directory --- include/llmr/{style => map}/sprite.hpp | 0 src/geometry/sprite_atlas.cpp | 2 +- src/map/map.cpp | 2 +- src/{style => map}/sprite.cpp | 2 +- src/renderer/icon_bucket.cpp | 2 +- src/renderer/painter_fill.cpp | 2 +- src/renderer/painter_icon.cpp | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename include/llmr/{style => map}/sprite.hpp (100%) rename src/{style => map}/sprite.cpp (99%) diff --git a/include/llmr/style/sprite.hpp b/include/llmr/map/sprite.hpp similarity index 100% rename from include/llmr/style/sprite.hpp rename to include/llmr/map/sprite.hpp diff --git a/src/geometry/sprite_atlas.cpp b/src/geometry/sprite_atlas.cpp index bb514502b..d76f24ebd 100644 --- a/src/geometry/sprite_atlas.cpp +++ b/src/geometry/sprite_atlas.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include diff --git a/src/map/map.cpp b/src/map/map.cpp index fd13c340f..69bee92dc 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/style/sprite.cpp b/src/map/sprite.cpp similarity index 99% rename from src/style/sprite.cpp rename to src/map/sprite.cpp index fecfb7a15..4b23b120c 100644 --- a/src/style/sprite.cpp +++ b/src/map/sprite.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/src/renderer/icon_bucket.cpp b/src/renderer/icon_bucket.cpp index 9cc1407e6..646634a45 100644 --- a/src/renderer/icon_bucket.cpp +++ b/src/renderer/icon_bucket.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/src/renderer/painter_fill.cpp b/src/renderer/painter_fill.cpp index f43ceed9f..9cec72af7 100644 --- a/src/renderer/painter_fill.cpp +++ b/src/renderer/painter_fill.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/renderer/painter_icon.cpp b/src/renderer/painter_icon.cpp index 59ae67746..46813fd73 100644 --- a/src/renderer/painter_icon.cpp +++ b/src/renderer/painter_icon.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include #include #include From 53e995acae1266131070252802cb3901880e3355 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 10 Jul 2014 16:29:49 -0700 Subject: [PATCH 21/52] break out StyleSource from Source, move getActiveSources and updateSources into Map::Map --- include/llmr/map/map.hpp | 6 ++++ include/llmr/map/source.hpp | 2 ++ include/llmr/style/style.hpp | 9 +----- include/llmr/style/style_bucket.hpp | 5 ++-- include/llmr/style/style_parser.hpp | 4 +-- include/llmr/style/style_source.hpp | 27 +++++++++++++++++ src/map/map.cpp | 42 ++++++++++++++++++++++----- src/map/source.cpp | 10 +++++-- src/renderer/painter_framebuffers.cpp | 2 +- src/style/style.cpp | 27 ----------------- src/style/style_layer.cpp | 5 ++-- src/style/style_parser.cpp | 4 +-- 12 files changed, 88 insertions(+), 55 deletions(-) create mode 100644 include/llmr/style/style_source.hpp diff --git a/include/llmr/map/map.hpp b/include/llmr/map/map.hpp index 1af6b3c54..1d64a124c 100644 --- a/include/llmr/map/map.hpp +++ b/include/llmr/map/map.hpp @@ -52,6 +52,7 @@ public: void resize(uint16_t width, uint16_t height, float ratio, uint16_t fb_width, uint16_t fb_height); // Styling + const std::set> getActiveSources() const; void setAppliedClasses(const std::vector &classes); void toggleClass(const std::string &name); const std::vector &getAppliedClasses() const; @@ -121,6 +122,9 @@ private: // Setup void setup(); + void updateSources(); + void updateSources(const std::shared_ptr &group); + void updateTiles(); void updateRenderState(); @@ -172,6 +176,8 @@ private: int indent = 0; + std::set> activeSources; + private: bool async = false; std::shared_ptr loop; diff --git a/include/llmr/map/source.hpp b/include/llmr/map/source.hpp index 2937a8f69..8ceb9ca07 100644 --- a/include/llmr/map/source.hpp +++ b/include/llmr/map/source.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -22,6 +23,7 @@ class Texturepool; class Source : public std::enable_shared_from_this, private util::noncopyable { public: + Source(StyleSource style_source); Source(SourceType type = SourceType::Vector, const std::string &url = "", uint32_t tile_size = 512, uint32_t min_zoom = 0, uint32_t max_zoom = 22); diff --git a/include/llmr/style/style.hpp b/include/llmr/style/style.hpp index 37a50485b..cf091ad81 100644 --- a/include/llmr/style/style.hpp +++ b/include/llmr/style/style.hpp @@ -2,6 +2,7 @@ #define LLMR_STYLE_STYLE #include +#include #include #include @@ -17,7 +18,6 @@ namespace llmr { class Sprite; -class Source; class StyleLayer; class StyleLayerGroup; struct BackgroundProperties; @@ -36,8 +36,6 @@ public: void setDefaultTransitionDuration(uint16_t duration_milliseconds = 0); - const std::set> getActiveSources() const; - void setAppliedClasses(const std::vector &classes); const std::vector &getAppliedClasses() const; void toggleClass(const std::string &name); @@ -57,13 +55,8 @@ public: std::string sprite_url; std::string glyph_url; -private: - void updateSources(); - void updateSources(const std::shared_ptr &group); - private: - std::set> activeSources; PropertyTransition defaultTransition; bool initial_render_complete = false; diff --git a/include/llmr/style/style_bucket.hpp b/include/llmr/style/style_bucket.hpp index 55ffeeb18..c8529fdd2 100644 --- a/include/llmr/style/style_bucket.hpp +++ b/include/llmr/style/style_bucket.hpp @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -11,8 +12,6 @@ namespace llmr { -class Source; - class StyleBucketFill { public: WindingType winding = WindingType::Default; @@ -74,7 +73,7 @@ public: StyleBucket(StyleLayerType type); std::string name; - std::shared_ptr source; + std::shared_ptr style_source; std::string source_layer; FilterExpression filter; StyleBucketRender render = std::false_type(); diff --git a/include/llmr/style/style_parser.hpp b/include/llmr/style/style_parser.hpp index 10cd3d2e8..da6f586a3 100644 --- a/include/llmr/style/style_parser.hpp +++ b/include/llmr/style/style_parser.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include @@ -94,7 +94,7 @@ private: private: std::unordered_map constants; - std::unordered_map> sources; + std::unordered_map> sources; // This stores the root layer. std::shared_ptr root; diff --git a/include/llmr/style/style_source.hpp b/include/llmr/style/style_source.hpp new file mode 100644 index 000000000..76a981a80 --- /dev/null +++ b/include/llmr/style/style_source.hpp @@ -0,0 +1,27 @@ +#ifndef LLMR_STYLE_STYLE_SOURCE +#define LLMR_STYLE_STYLE_SOURCE + +#include + +namespace llmr { + +struct StyleSource { + const SourceType type; + const std::string url; + const uint32_t tile_size; + const int32_t min_zoom; + const int32_t max_zoom; + + StyleSource(SourceType type = SourceType::Vector, + const std::string &url = "", + uint32_t tile_size = 512, uint32_t min_zoom = 0, + uint32_t max_zoom = 22) + : type(type), + url(url), + tile_size(tile_size), + min_zoom(min_zoom), + max_zoom(max_zoom) {}; + }; +}; + +#endif diff --git a/src/map/map.cpp b/src/map/map.cpp index 69bee92dc..6e57e50bd 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -405,8 +405,33 @@ void Map::setDefaultTransitionDuration(uint64_t duration_milliseconds) { style->setDefaultTransitionDuration(duration_milliseconds); } +void Map::updateSources() { + activeSources.clear(); + updateSources(style->layers); +} + +const std::set> Map::getActiveSources() const { + return activeSources; +} + +void Map::updateSources(const std::shared_ptr &group) { + if (!group) { + return; + } + for (const std::shared_ptr &layer : group->layers) { + if (!layer) continue; + if (layer->bucket) { + if (layer->bucket->style_source) { + activeSources.emplace(std::make_shared(*layer->bucket->style_source)); + } + } else if (layer->layers) { + updateSources(layer->layers); + } + } +} + void Map::updateTiles() { - for (const std::shared_ptr &source : style->getActiveSources()) { + for (const std::shared_ptr &source : getActiveSources()) { source->update(*this); } } @@ -414,14 +439,14 @@ void Map::updateTiles() { void Map::updateRenderState() { std::forward_list ids; - for (const std::shared_ptr &source : style->getActiveSources()) { + for (const std::shared_ptr &source : getActiveSources()) { ids.splice_after(ids.before_begin(), source->getIDs()); source->updateMatrices(painter.projMatrix, state); } const std::map clipIDs = computeClipIDs(ids); - for (const std::shared_ptr &source : style->getActiveSources()) { + for (const std::shared_ptr &source : getActiveSources()) { source->updateClipIDs(clipIDs); } } @@ -465,6 +490,7 @@ void Map::prepare() { } animationTime = util::now(); + updateSources(); style->updateProperties(state.getNormalizedZoom(), animationTime); // Allow the sprite atlas to potentially pull new sprite images if needed. @@ -489,7 +515,7 @@ void Map::render() { updateRenderState(); - painter.drawClippingMasks(style->getActiveSources()); + painter.drawClippingMasks(getActiveSources()); // Actually render the layers if (debug::renderTree) { std::cout << "{" << std::endl; indent++; } @@ -500,7 +526,7 @@ void Map::render() { // This guarantees that we have at least one function per tile called. // When only rendering layers via the stylesheet, it's possible that we don't // ever visit a tile during rendering. - for (const std::shared_ptr &source : style->getActiveSources()) { + for (const std::shared_ptr &source : getActiveSources()) { source->finishRender(painter); } @@ -593,7 +619,7 @@ void Map::renderLayer(std::shared_ptr layer_desc, RenderPass pass) { return; } - if (!layer_desc->bucket->source) { + if (!layer_desc->bucket->style_source) { fprintf(stderr, "[WARNING] can't find source for layer '%s'\n", layer_desc->id.c_str()); return; } @@ -629,6 +655,8 @@ void Map::renderLayer(std::shared_ptr layer_desc, RenderPass pass) { << layer_desc->type << ")" << std::endl; } - layer_desc->bucket->source->render(painter, layer_desc); + // TODO: THIS IS BAD, FIXME + Source source(*layer_desc->bucket->style_source); + source.render(painter, layer_desc); } } diff --git a/src/map/source.cpp b/src/map/source.cpp index 8d1593f76..c59a8fe2d 100644 --- a/src/map/source.cpp +++ b/src/map/source.cpp @@ -18,6 +18,13 @@ namespace llmr { +Source::Source(StyleSource style_source) + : type(style_source.type), + url(normalizeSourceURL(style_source.url)), + tile_size(style_source.tile_size), + min_zoom(style_source.min_zoom), + max_zoom(style_source.max_zoom) {} + Source::Source(SourceType type, const std::string &url, uint32_t tile_size, uint32_t min_zoom, uint32_t max_zoom) : type(type), @@ -33,8 +40,7 @@ std::string Source::normalizeSourceURL(const std::string &url) { } else { return url; } -} - +}; bool Source::update(Map &map) { if (map.getTime() > updated) { diff --git a/src/renderer/painter_framebuffers.cpp b/src/renderer/painter_framebuffers.cpp index c7d9059dd..36c97ed15 100644 --- a/src/renderer/painter_framebuffers.cpp +++ b/src/renderer/painter_framebuffers.cpp @@ -108,7 +108,7 @@ void Painter::pushFramebuffer() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); glColorMask(false, false, false, false); - drawClippingMasks(map.getStyle()->getActiveSources()); + drawClippingMasks(map.getActiveSources()); glColorMask(true, true, true, true); fbo_depth_stencil_valid = true; diff --git a/src/style/style.cpp b/src/style/style.cpp index 006376172..c5204720a 100644 --- a/src/style/style.cpp +++ b/src/style/style.cpp @@ -15,36 +15,9 @@ namespace llmr { Style::Style() { } -void Style::updateSources() { - activeSources.clear(); - updateSources(layers); -} - -const std::set> Style::getActiveSources() const { - return activeSources; -} - -void Style::updateSources(const std::shared_ptr &group) { - if (!group) { - return; - } - for (const std::shared_ptr &layer : group->layers) { - if (!layer) continue; - if (layer->bucket) { - if (layer->bucket->source) { - activeSources.emplace(layer->bucket->source); - } - } else if (layer->layers) { - updateSources(layer->layers); - } - } -} - void Style::updateProperties(float z, timestamp now) { uv::writelock lock(mtx); - updateSources(); - if (layers) { layers->updateProperties(z, now); } diff --git a/src/style/style_layer.cpp b/src/style/style_layer.cpp index 0c6287272..2cff19e47 100644 --- a/src/style/style_layer.cpp +++ b/src/style/style_layer.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include @@ -251,8 +250,8 @@ void StyleLayer::updateProperties(float z, const timestamp now) { } // Accomodate for different tile size. - if (bucket && bucket->source) { - z += std::log(bucket->source->tile_size / 256.0f) / M_LN2; + if (bucket && bucket->style_source) { + z += std::log(bucket->style_source->tile_size / 256.0f) / M_LN2; } cleanupAppliedStyleProperties(now); diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp index 1821a66bd..0d98fd8b2 100644 --- a/src/style/style_parser.cpp +++ b/src/style/style_parser.cpp @@ -169,7 +169,7 @@ void StyleParser::parseSources(JSVal value) { parseRenderProperty(itr->value, min_zoom, "minZoom"); parseRenderProperty(itr->value, max_zoom, "maxZoom"); - sources.emplace(std::move(name), std::make_shared(type, url, tile_size, min_zoom, max_zoom)); + sources.emplace(std::move(name), std::make_shared(type, url, tile_size, min_zoom, max_zoom)); } } else { throw Style::exception("sources must be an object"); @@ -731,7 +731,7 @@ void StyleParser::parseBucket(JSVal value, std::shared_ptr &layer) { const std::string source_name = { value_source.GetString(), value_source.GetStringLength() }; auto source_it = sources.find(source_name); if (source_it != sources.end()) { - layer->bucket->source = source_it->second; + layer->bucket->style_source = source_it->second; } else { fprintf(stderr, "[WARNING] can't find source '%s' required for layer '%s'\n", source_name.c_str(), layer->id.c_str()); From af7b5e06159088b93171029b94f8c52eab85d2df Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 10 Jul 2014 16:29:49 -0700 Subject: [PATCH 22/52] break out StyleSource from Source, move getActiveSources and updateSources into Map::Map, move getAccessToken from Style to Map Conflicts: include/llmr/style/style.hpp src/map/source.cpp src/style/style_layer.cpp src/style/style_parser.cpp Conflicts: include/llmr/map/source.hpp include/llmr/style/style_parser.hpp include/llmr/style/style_source.hpp src/map/map.cpp src/map/source.cpp src/style/style_parser.cpp --- include/llmr/map/source.hpp | 2 +- include/llmr/style/style_parser.hpp | 2 ++ include/llmr/style/style_source.hpp | 2 +- src/map/map.cpp | 4 ++-- src/map/source.cpp | 4 ++-- src/style/style_parser.cpp | 3 +++ 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/llmr/map/source.hpp b/include/llmr/map/source.hpp index 8ceb9ca07..a879b8099 100644 --- a/include/llmr/map/source.hpp +++ b/include/llmr/map/source.hpp @@ -23,7 +23,7 @@ class Texturepool; class Source : public std::enable_shared_from_this, private util::noncopyable { public: - Source(StyleSource style_source); + Source(StyleSource style_source, const std::string &access_token = ""); Source(SourceType type = SourceType::Vector, const std::string &url = "", uint32_t tile_size = 512, uint32_t min_zoom = 0, uint32_t max_zoom = 22); diff --git a/include/llmr/style/style_parser.hpp b/include/llmr/style/style_parser.hpp index da6f586a3..38ef343e5 100644 --- a/include/llmr/style/style_parser.hpp +++ b/include/llmr/style/style_parser.hpp @@ -24,6 +24,8 @@ class StyleParser { public: using JSVal = const rapidjson::Value&; + StyleParser(); + void parse(JSVal document); std::shared_ptr getLayers() { diff --git a/include/llmr/style/style_source.hpp b/include/llmr/style/style_source.hpp index 76a981a80..cf55e94be 100644 --- a/include/llmr/style/style_source.hpp +++ b/include/llmr/style/style_source.hpp @@ -20,7 +20,7 @@ struct StyleSource { url(url), tile_size(tile_size), min_zoom(min_zoom), - max_zoom(max_zoom) {}; + max_zoom(max_zoom) {} }; }; diff --git a/src/map/map.cpp b/src/map/map.cpp index 6e57e50bd..e1e252dd6 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -422,7 +422,7 @@ void Map::updateSources(const std::shared_ptr &group) { if (!layer) continue; if (layer->bucket) { if (layer->bucket->style_source) { - activeSources.emplace(std::make_shared(*layer->bucket->style_source)); + activeSources.emplace(std::make_shared(*layer->bucket->style_source, this->getAccessToken())); } } else if (layer->layers) { updateSources(layer->layers); @@ -656,7 +656,7 @@ void Map::renderLayer(std::shared_ptr layer_desc, RenderPass pass) { } // TODO: THIS IS BAD, FIXME - Source source(*layer_desc->bucket->style_source); + Source source(*layer_desc->bucket->style_source, this->getAccessToken()); source.render(painter, layer_desc); } } diff --git a/src/map/source.cpp b/src/map/source.cpp index c59a8fe2d..7ea715dd6 100644 --- a/src/map/source.cpp +++ b/src/map/source.cpp @@ -18,9 +18,9 @@ namespace llmr { -Source::Source(StyleSource style_source) +Source::Source(StyleSource style_source, const std::string &access_token) : type(style_source.type), - url(normalizeSourceURL(style_source.url)), + url(normalizeSourceURL(style_source.url, access_token)), tile_size(style_source.tile_size), min_zoom(style_source.min_zoom), max_zoom(style_source.max_zoom) {} diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp index 0d98fd8b2..0b3525819 100644 --- a/src/style/style_parser.cpp +++ b/src/style/style_parser.cpp @@ -8,6 +8,9 @@ namespace llmr { using JSVal = const rapidjson::Value&; +StyleParser::StyleParser() { +} + void StyleParser::parse(JSVal document) { if (document.HasMember("constants")) { parseConstants(document["constants"]); From d230b9a587f95ee3e1e624e2047994efda58bfc9 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 10 Jul 2014 17:29:07 -0700 Subject: [PATCH 23/52] remove link_gl from test/style gyp --- test/test.gyp | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test.gyp b/test/test.gyp index 2189bda75..1dce41053 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -104,7 +104,6 @@ "dependencies": [ "../deps/gtest/gtest.gyp:gtest", "../llmr.gyp:llmr-x86", - "link_gl", ] }, { From 935089c239ffd3428c6478ba74e147ab338910fe Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 11 Jul 2014 18:05:40 -0700 Subject: [PATCH 24/52] dont exit early from npm_install.sh --- scripts/npm_install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/npm_install.sh b/scripts/npm_install.sh index f72e63ded..987604136 100755 --- a/scripts/npm_install.sh +++ b/scripts/npm_install.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash -set -e set -o pipefail cd bin From 97ec3766141052e557a4eb8c39883fd1b7d6536f Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Mon, 14 Jul 2014 16:16:20 -0400 Subject: [PATCH 25/52] C++ exception with description "array value has unexpected number of elements" thrown in the test body. --- bin/build-style.js | 4 +++- bin/fuzz-functions.js | 27 +++++++++++++++++++++++++++ bin/fuzz-layers.js | 23 +++++++++++++++++++++++ llmr.gyp | 6 ++++++ test/style.cpp | 21 +++++++++++++++++++++ 5 files changed, 80 insertions(+), 1 deletion(-) create mode 100755 bin/fuzz-functions.js create mode 100755 bin/fuzz-layers.js diff --git a/bin/build-style.js b/bin/build-style.js index 5ef8d317d..4118faa3c 100755 --- a/bin/build-style.js +++ b/bin/build-style.js @@ -8,7 +8,9 @@ var fs = require('fs'); var transforms = { 'style.min.js': require('./minify.js'), - 'fuzz-colors.min.js': require('./fuzz-colors.js') + 'fuzz-colors.min.js': require('./fuzz-colors.js'), + 'fuzz-functions.min.js': require('./fuzz-functions.js'), + 'fuzz-layers.min.js': require('./fuzz-layers.js') }; var source = load(process.argv[2]); diff --git a/bin/fuzz-functions.js b/bin/fuzz-functions.js new file mode 100755 index 000000000..26a079d6d --- /dev/null +++ b/bin/fuzz-functions.js @@ -0,0 +1,27 @@ +#!/usr/bin/env node +'use strict'; + +var through = require('through2'); +var fuzzer = require('fuzzer'); +fuzzer.seed(0); + +module.exports = function() { + return through.obj(function(chunk, env, callback) { + var json = JSON.parse(chunk.toString()); + + json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { + var value = json.constants[key]; + if (typeof value === 'object' && value.hasOwnProperty('fn')) { + var mutator = fuzzer.mutate.object(value); + obj[key] = mutator(); + } + return obj; + }, {}); + + var data = JSON.stringify(json); + this.push(data); + callback(); + }); +}; + +if (!module.parent) process.stdin.pipe(module.exports()).pipe(process.stdout); diff --git a/bin/fuzz-layers.js b/bin/fuzz-layers.js new file mode 100755 index 000000000..547775799 --- /dev/null +++ b/bin/fuzz-layers.js @@ -0,0 +1,23 @@ +#!/usr/bin/env node +'use strict'; + +var through = require('through2'); +var fuzzer = require('fuzzer'); +fuzzer.seed(0); + +module.exports = function() { + return through.obj(function(chunk, env, callback) { + var json = JSON.parse(chunk.toString()); + + json.layers.map(function(value) { + var mutator = fuzzer.mutate.object(value); + return mutator(); + }); + + var data = JSON.stringify(json); + this.push(data); + callback(); + }); +}; + +if (!module.parent) process.stdin.pipe(module.exports()).pipe(process.stdout); diff --git a/llmr.gyp b/llmr.gyp index 392552310..2e17c2c6a 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -69,6 +69,8 @@ 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js', '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-functions.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-layers.min.js', ], 'action': ['<@(node)', 'bin/build-style.js', '<@(_inputs)', '<(SHARED_INTERMEDIATE_DIR)/bin'] } @@ -77,6 +79,8 @@ 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js', '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-functions.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-layers.min.js', ], } }, @@ -92,6 +96,8 @@ 'files': [ '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js', '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-functions.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-layers.min.js', ], 'destination': '<(PRODUCT_DIR)' } diff --git a/test/style.cpp b/test/style.cpp index a321fe835..3eb1644b0 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -26,3 +26,24 @@ TEST(Style, Colors) { Style style; style.loadJSON((const uint8_t *)stylejson.str().c_str()); } + +TEST(Style, Functions) { + std::ifstream stylefile("./fuzz-functions.min.js"); + ASSERT_TRUE(stylefile.good()); + std::stringstream stylejson; + stylejson << stylefile.rdbuf(); + + Style style; + style.loadJSON((const uint8_t *)stylejson.str().c_str()); +} + +TEST(Style, Layers) { + std::ifstream stylefile("./fuzz-layers.min.js"); + ASSERT_TRUE(stylefile.good()); + std::stringstream stylejson; + stylejson << stylefile.rdbuf(); + + Style style; + style.loadJSON((const uint8_t *)stylejson.str().c_str()); +} + From b327a2cb34b0977f03f6d7bb2d7fca4537192539 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Mon, 14 Jul 2014 18:46:34 -0400 Subject: [PATCH 26/52] hook up style_parser to new log backend --- src/style/style_parser.cpp | 98 +++++++++++++++++++------------------- test/style.cpp | 6 +++ test/test.gyp | 2 + 3 files changed, 57 insertions(+), 49 deletions(-) diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp index 434f07a72..fe84ffd54 100644 --- a/src/style/style_parser.cpp +++ b/src/style/style_parser.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include namespace llmr { @@ -45,7 +46,7 @@ void StyleParser::parseConstants(JSVal value) { } } } else { - throw Style::exception("constants must be an object"); + Log::Warning(Event::ParseStyle, "constants must be an object"); } } @@ -69,7 +70,7 @@ template<> bool StyleParser::parseRenderProperty(JSVal value, std::string &targe target = { property.GetString(), property.GetStringLength() }; return true; } else { - fprintf(stderr, "[WARNING] '%s' must be a string\n", name); + Log::Warning(Event::ParseStyle, "'%s' must be a string", name); } } return false; @@ -82,7 +83,7 @@ template<> bool StyleParser::parseRenderProperty(JSVal value, float &target, con target = property.GetDouble(); return true; } else { - fprintf(stderr, "[WARNING] '%s' must be a number\n", name); + Log::Warning(Event::ParseStyle, "'%s' must be a number", name); } } return false; @@ -94,14 +95,14 @@ template<> bool StyleParser::parseRenderProperty(JSVal value, uint16_t &target, if (property.IsUint()) { unsigned int value = property.GetUint(); if (value > std::numeric_limits::max()) { - fprintf(stderr, "[WARNING] values for %s that are larger than %d are not supported\n", name, std::numeric_limits::max()); + Log::Warning(Event::ParseStyle, "values for %s that are larger than %d are not supported", name, std::numeric_limits::max()); return false; } target = value; return true; } else { - fprintf(stderr, "[WARNING] %s must be an unsigned integer\n", name); + Log::Warning(Event::ParseStyle, "%s must be an unsigned integer", name); } } return false; @@ -114,7 +115,7 @@ template<> bool StyleParser::parseRenderProperty(JSVal value, int32_t &target, c target = property.GetInt(); return true; } else { - fprintf(stderr, "[WARNING] %s must be an integer\n", name); + Log::Warning(Event::ParseStyle, "%s must be an integer", name); } } return false; @@ -129,10 +130,10 @@ template<> bool StyleParser::parseRenderProperty(JSVal value, vec2 &targe target.y = property[(rapidjson::SizeType)1].GetDouble(); return true; } else { - fprintf(stderr, "[WARNING] %s must have at least two members\n", name); + Log::Warning(Event::ParseStyle, "%s must have at least two members", name); } } else { - fprintf(stderr, "[WARNING] %s must be a n array of numbers\n", name); + Log::Warning(Event::ParseStyle, "%s must be an array of numbers", name); } } return false; @@ -146,7 +147,7 @@ bool StyleParser::parseRenderProperty(JSVal value, T &target, const char *name, target = parser({ property.GetString(), property.GetStringLength() }); return true; } else { - fprintf(stderr, "[WARNING] %s must have one of the enum values\n", name); + Log::Warning(Event::ParseStyle, "%s must have one of the enum values", name); } } return false; @@ -177,7 +178,7 @@ void StyleParser::parseSources(JSVal value) { sources.emplace(std::move(name), std::make_shared(type, url, tile_size, min_zoom, max_zoom)); } } else { - throw Style::exception("sources must be an object"); + Log::Warning(Event::ParseStyle, "sources must be an object"); } } @@ -185,7 +186,7 @@ void StyleParser::parseSources(JSVal value) { Color parseColor(JSVal value) { if (!value.IsString()) { - fprintf(stderr, "[WARNING] color value must be a string\n"); + Log::Warning(Event::ParseStyle, "color value must be a string"); return Color{{ 0, 0, 0, 0 }}; } @@ -208,7 +209,7 @@ bool StyleParser::parseFunctionArgument(JSVal value) { } else if (rvalue.IsNumber()) { return rvalue.GetDouble(); } else { - fprintf(stderr, "[WARNING] function argument must be a boolean or numeric value"); + Log::Warning(Event::ParseStyle, "function argument must be a boolean or numeric value"); return false; } } @@ -219,7 +220,7 @@ float StyleParser::parseFunctionArgument(JSVal value) { if (rvalue.IsNumber()) { return rvalue.GetDouble(); } else { - fprintf(stderr, "[WARNING] function argument must be a numeric value"); + Log::Warning(Event::ParseStyle, "function argument must be a numeric value"); return 0.0f; } } @@ -233,13 +234,13 @@ Color StyleParser::parseFunctionArgument(JSVal value) { template std::tuple> StyleParser::parseFunction(JSVal value) { if (!value.HasMember("fn")) { - fprintf(stderr, "[WARNING] function must specify a function name\n"); + Log::Warning(Event::ParseStyle, "function must specify a function name"); return std::tuple> { false, ConstantFunction(T()) }; } JSVal value_fn = value["fn"]; if (!value_fn.IsString()) { - fprintf(stderr, "[WARNING] function must specify a function type\n"); + Log::Warning(Event::ParseStyle, "function must specify a function type"); return std::tuple> { false, ConstantFunction(T()) }; } @@ -247,11 +248,11 @@ std::tuple> StyleParser::parseFunction(JSVal value) { if (type == "linear") { if (!value.HasMember("z")) { - fprintf(stderr, "[WARNING] linear function must specify a base zoom level\n"); + Log::Warning(Event::ParseStyle, "linear function must specify a base zoom level"); return std::tuple> { false, ConstantFunction(T()) }; } if (!value.HasMember("val")) { - fprintf(stderr, "[WARNING] linear function must specify a base value\n"); + Log::Warning(Event::ParseStyle, "linear function must specify a base value"); return std::tuple> { false, ConstantFunction(T()) }; } const float z_base = parseFunctionArgument(value["z"]); @@ -263,11 +264,11 @@ std::tuple> StyleParser::parseFunction(JSVal value) { } else if (type == "exponential") { if (!value.HasMember("z")) { - fprintf(stderr, "[WARNING] exponential function must specify a base zoom level\n"); + Log::Warning(Event::ParseStyle, "exponential function must specify a base zoom level"); return std::tuple> { false, ConstantFunction(T()) }; } if (!value.HasMember("val")) { - fprintf(stderr, "[WARNING] exponential function must specify a base value\n"); + Log::Warning(Event::ParseStyle, "exponential function must specify a base value"); return std::tuple> { false, ConstantFunction(T()) }; } const float z_base = parseFunctionArgument(value["z"]); @@ -280,13 +281,13 @@ std::tuple> StyleParser::parseFunction(JSVal value) { } else if (type == "stops") { if (!value.HasMember("stops")) { - fprintf(stderr, "[WARNING] stops function must specify a stops array\n"); + Log::Warning(Event::ParseStyle, "stops function must specify a stops array"); return std::tuple> { false, ConstantFunction(T()) }; } JSVal value_stops = value["stops"]; if (!value_stops.IsArray()) { - fprintf(stderr, "[WARNING] stops function must specify a stops array\n"); + Log::Warning(Event::ParseStyle, "stops function must specify a stops array"); return std::tuple> { false, ConstantFunction(T()) }; } @@ -295,19 +296,19 @@ std::tuple> StyleParser::parseFunction(JSVal value) { JSVal stop = value_stops[i]; if (stop.IsArray()) { if (stop.Size() != 2) { - fprintf(stderr, "[WARNING] stop must have zoom level and value specification\n"); + Log::Warning(Event::ParseStyle, "stop must have zoom level and value specification"); return std::tuple> { false, ConstantFunction(T()) }; } JSVal z = stop[rapidjson::SizeType(0)]; if (!z.IsNumber()) { - fprintf(stderr, "[WARNING] zoom level in stop must be a number\n"); + Log::Warning(Event::ParseStyle, "zoom level in stop must be a number"); return std::tuple> { false, ConstantFunction(T()) }; } stops.emplace_back(z.GetDouble(), parseFunctionArgument(stop[rapidjson::SizeType(1)])); } else { - fprintf(stderr, "[WARNING] function argument must be a numeric value\n"); + Log::Warning(Event::ParseStyle, "function argument must be a numeric value"); return std::tuple> { false, ConstantFunction(T()) }; } } @@ -315,7 +316,7 @@ std::tuple> StyleParser::parseFunction(JSVal value) { return std::tuple> { true, StopsFunction(stops) }; } else { - fprintf(stderr, "[WARNING] function type '%s' is unknown\n", type.c_str()); + Log::Warning(Event::ParseStyle, "function type '%s' is unknown", type.c_str()); } return std::tuple> { false, ConstantFunction(T()) }; @@ -376,7 +377,7 @@ bool StyleParser::parseOptionalProperty(const char *property_name, T &target, JS template<> std::tuple StyleParser::parseProperty(JSVal value, const char *property_name) { if (!value.IsString()) { - fprintf(stderr, "[WARNING] value of '%s' must be a string\n", property_name); + Log::Warning(Event::ParseStyle, "value of '%s' must be a string", property_name); return std::tuple { false, std::string() }; } @@ -385,7 +386,7 @@ template<> std::tuple StyleParser::parseProperty(JSVal value, template<> std::tuple StyleParser::parseProperty(JSVal value, const char *property_name) { if (!value.IsString()) { - fprintf(stderr, "[WARNING] value of '%s' must be a string\n", property_name); + Log::Warning(Event::ParseStyle, "value of '%s' must be a string", property_name); return std::tuple { false, TranslateAnchorType::Default }; } @@ -394,7 +395,7 @@ template<> std::tuple StyleParser::parseProperty(JSVa template<> std::tuple StyleParser::parseProperty(JSVal value, const char *property_name) { if (!value.IsString()) { - fprintf(stderr, "[WARNING] value of '%s' must be a string\n", property_name); + Log::Warning(Event::ParseStyle, "value of '%s' must be a string", property_name); return std::tuple { false, RotateAnchorType::Default }; } @@ -427,7 +428,7 @@ template<> std::tuple> StyleParser::parseProperty(JSVal val } else if (value.IsBool()) { return std::tuple> { true, ConstantFunction(value.GetBool()) }; } else { - fprintf(stderr, "[WARNING] value of '%s' must be convertible to boolean, or a boolean function\n", property_name); + Log::Warning(Event::ParseStyle, "value of '%s' must be convertible to boolean, or a boolean function", property_name); return std::tuple> { false, ConstantFunction(false) }; } } @@ -440,7 +441,7 @@ template<> std::tuple> StyleParser::parseProperty(JSVal va } else if (value.IsBool()) { return std::tuple> { true, ConstantFunction(value.GetBool()) }; } else { - fprintf(stderr, "[WARNING] value of '%s' must be a number, or a number function\n", property_name); + Log::Warning(Event::ParseStyle, "value of '%s' must be a number, or a number function", property_name); return std::tuple> { false, ConstantFunction(0) }; } } @@ -451,7 +452,7 @@ template<> std::tuple> StyleParser::parseProperty(JSVal va } else if (value.IsString()) { return std::tuple> { true, ConstantFunction(parseColor(value)) }; } else { - fprintf(stderr, "[WARNING] value of '%s' must be a color, or a color function\n", property_name); + Log::Warning(Event::ParseStyle, "value of '%s' must be a color, or a color function", property_name); return std::tuple> { false, ConstantFunction(Color {{ 0, 0, 0, 0 }}) }; } } @@ -461,11 +462,11 @@ bool StyleParser::parseOptionalProperty(const char *property_name, const std::ve if (value.HasMember(property_name)) { JSVal rvalue = replaceConstant(value[property_name]); if (!rvalue.IsArray()) { - throw Style::exception("array value must be an array"); + Log::Warning(Event::ParseStyle, "array value must be an array"); } if (rvalue.Size() != keys.size()) { - throw Style::exception("array value has unexpected number of elements"); + Log::Warning(Event::ParseStyle, "array value has unexpected number of elements"); } for (uint16_t i = 0; i < keys.size(); i++) { @@ -488,27 +489,27 @@ std::unique_ptr StyleParser::createLayers(JSVal value) { } return group; } else { - throw Style::exception("layers must be an array"); + Log::Warning(Event::ParseStyle, "layers must be an array"); } } std::shared_ptr StyleParser::createLayer(JSVal value) { if (value.IsObject()) { if (!value.HasMember("id")) { - fprintf(stderr, "[WARNING] layer must have an id\n"); + Log::Warning(Event::ParseStyle, "layer must have an id"); return nullptr; } JSVal id = value["id"]; if (!id.IsString()) { - fprintf(stderr, "[WARNING] layer id must be a string\n"); + Log::Warning(Event::ParseStyle, "layer id must be a string"); return nullptr; } const std::string layer_id = { id.GetString(), id.GetStringLength() }; if (layers.find(layer_id) != layers.end()) { - fprintf(stderr, "[WARNING] duplicate layer id %s\n", layer_id.c_str()); + Log::Warning(Event::ParseStyle, "duplicate layer id %s", layer_id.c_str()); return nullptr; } @@ -534,7 +535,7 @@ std::shared_ptr StyleParser::createLayer(JSVal value) { return layer; } else { - fprintf(stderr, "[WARNING] layer must be an object\n"); + Log::Warning(Event::ParseStyle, "layer must be an object"); return nullptr; } } @@ -557,7 +558,7 @@ void StyleParser::parseLayer(std::pair> &pair if (value.HasMember("type")) { JSVal type = value["type"]; if (!type.IsString()) { - fprintf(stderr, "[WARNING] layer type of '%s' must be a string\n", layer->id.c_str()); + Log::Warning(Event::ParseStyle, "layer type of '%s' must be a string", layer->id.c_str()); } else { layer->type = parseStyleLayerType({ type.GetString(), type.GetStringLength() }); } @@ -565,7 +566,7 @@ void StyleParser::parseLayer(std::pair> &pair // Make sure we have not previously attempted to parse this layer. if (std::find(stack.begin(), stack.end(), layer.get()) != stack.end()) { - fprintf(stderr, "[WARNING] layer reference of '%s' is circular\n", layer->id.c_str()); + Log::Warning(Event::ParseStyle, "layer reference of '%s' is circular", layer->id.c_str()); return; } @@ -681,13 +682,13 @@ std::unique_ptr StyleParser::parseRasterize(JSVal value) { void StyleParser::parseReference(JSVal value, std::shared_ptr &layer) { if (!value.IsString()) { - fprintf(stderr, "[WARNING] layer ref of '%s' must be a string\n", layer->id.c_str()); + Log::Warning(Event::ParseStyle, "layer ref of '%s' must be a string", layer->id.c_str()); return; } const std::string ref { value.GetString(), value.GetStringLength() }; auto it = layers.find(ref); if (it == layers.end()) { - fprintf(stderr, "[WARNING] layer '%s' references unknown layer %s\n", layer->id.c_str(), ref.c_str()); + Log::Warning(Event::ParseStyle, "layer '%s' references unknown layer %s", layer->id.c_str(), ref.c_str()); // We cannot parse this layer further. return; } @@ -703,7 +704,7 @@ void StyleParser::parseReference(JSVal value, std::shared_ptr &layer layer->type = reference->type; if (reference->layers) { - fprintf(stderr, "[WARNING] layer '%s' references composite layer\n", layer->id.c_str()); + Log::Warning(Event::ParseStyle, "layer '%s' references composite layer", layer->id.c_str()); // We cannot parse this layer further. return; } else { @@ -727,11 +728,10 @@ void StyleParser::parseBucket(JSVal value, std::shared_ptr &layer) { if (source_it != sources.end()) { layer->bucket->style_source = source_it->second; } else { - fprintf(stderr, "[WARNING] can't find source '%s' required for layer '%s'\n", - source_name.c_str(), layer->id.c_str()); + Log::Warning(Event::ParseStyle, "can't find source '%s' required for layer '%s'", source_name.c_str(), layer->id.c_str()); } } else { - fprintf(stderr, "[WARNING] source of layer '%s' must be a string\n", layer->id.c_str()); + Log::Warning(Event::ParseStyle, "source of layer '%s' must be a string", layer->id.c_str()); } } @@ -740,7 +740,7 @@ void StyleParser::parseBucket(JSVal value, std::shared_ptr &layer) { if (value_source_layer.IsString()) { layer->bucket->source_layer = { value_source_layer.GetString(), value_source_layer.GetStringLength() }; } else { - fprintf(stderr, "[WARNING] source-layer of layer '%s' must be a string\n", layer->id.c_str()); + Log::Warning(Event::ParseStyle, "source-layer of layer '%s' must be a string", layer->id.c_str()); } } @@ -802,7 +802,7 @@ FilterExpression StyleParser::parseFilter(JSVal value, FilterExpression::Operato expression.add(parseFilter(replaceConstant(value[i]))); } } else { - fprintf(stderr, "[WARNING] expression must be either an array or an object\n"); + Log::Warning(Event::ParseStyle, "expression must be either an array or an object"); } return expression; @@ -845,7 +845,7 @@ std::forward_list StyleParser::parseValues(JSVal value) { void StyleParser::parseRender(JSVal value, std::shared_ptr &layer) { if (!value.IsObject()) { - fprintf(stderr, "[WARNING] render property of layer '%s' must be an object\n", layer->id.c_str()); + Log::Warning(Event::ParseStyle, "render property of layer '%s' must be an object", layer->id.c_str()); return; } diff --git a/test/style.cpp b/test/style.cpp index 3eb1644b0..ee59b26f6 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -1,6 +1,7 @@ #include "gtest/gtest.h" #include +#include "./fixtures/fixture_log.hpp" #include #include @@ -8,6 +9,7 @@ using namespace llmr; TEST(Style, Style) { + const FixtureLogBackend &log = Log::Set(); std::ifstream stylefile("./style.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; @@ -15,9 +17,11 @@ TEST(Style, Style) { Style style; style.loadJSON((const uint8_t *)stylejson.str().c_str()); + // ASSERT_EQ(0, log.count({ EventSeverity::Warning, Event::ParseStyle })); } TEST(Style, Colors) { + const FixtureLogBackend &log = Log::Set(); std::ifstream stylefile("./fuzz-colors.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; @@ -28,6 +32,7 @@ TEST(Style, Colors) { } TEST(Style, Functions) { + const FixtureLogBackend &log = Log::Set(); std::ifstream stylefile("./fuzz-functions.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; @@ -38,6 +43,7 @@ TEST(Style, Functions) { } TEST(Style, Layers) { + const FixtureLogBackend &log = Log::Set(); std::ifstream stylefile("./fuzz-layers.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; diff --git a/test/test.gyp b/test/test.gyp index 477413027..d68b4344c 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -100,6 +100,8 @@ "sources": [ "./main.cpp", "./style.cpp", + "./fixtures/fixture_log.hpp", + "./fixtures/fixture_log.cpp", ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", From c29883bb54205401e3ecce53018d49f9983e1eb6 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Tue, 15 Jul 2014 11:42:26 -0400 Subject: [PATCH 27/52] why u no write to FixtureLogBackend? --- test/style.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/style.cpp b/test/style.cpp index ee59b26f6..cadfec812 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -10,6 +10,7 @@ using namespace llmr; TEST(Style, Style) { const FixtureLogBackend &log = Log::Set(); + std::ifstream stylefile("./style.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; @@ -17,11 +18,11 @@ TEST(Style, Style) { Style style; style.loadJSON((const uint8_t *)stylejson.str().c_str()); - // ASSERT_EQ(0, log.count({ EventSeverity::Warning, Event::ParseStyle })); } TEST(Style, Colors) { const FixtureLogBackend &log = Log::Set(); + std::ifstream stylefile("./fuzz-colors.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; @@ -33,6 +34,7 @@ TEST(Style, Colors) { TEST(Style, Functions) { const FixtureLogBackend &log = Log::Set(); + std::ifstream stylefile("./fuzz-functions.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; @@ -40,10 +42,19 @@ TEST(Style, Functions) { Style style; style.loadJSON((const uint8_t *)stylejson.str().c_str()); + + const FixtureLogBackend::LogMessage number { + EventSeverityClass("WARNING"), + EventClass("ParseStyle"), + "value of 'line-width' must be a number, or a number function" + }; + + ASSERT_EQ(0, log.count(number)); } TEST(Style, Layers) { const FixtureLogBackend &log = Log::Set(); + std::ifstream stylefile("./fuzz-layers.min.js"); ASSERT_TRUE(stylefile.good()); std::stringstream stylejson; From 973a2f5550be011889b31360e606fa605886d85d Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Tue, 15 Jul 2014 14:00:38 -0400 Subject: [PATCH 28/52] fix quotes in log output --- test/fixtures/fixture_log.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/fixtures/fixture_log.cpp b/test/fixtures/fixture_log.cpp index 159f927e2..44e982144 100644 --- a/test/fixtures/fixture_log.cpp +++ b/test/fixtures/fixture_log.cpp @@ -37,10 +37,10 @@ std::vector FixtureLogBackend::unchecked() const } ::std::ostream& operator<<(::std::ostream& os, const FixtureLogBackend::LogMessage& message) { - os << "[\"" << message.severity.get() << "\", \"" << message.event.get(); - if (message.code) os << "\", " << message.code.get(); + os << "[\"" << message.severity.get() << "\", \"" << message.event.get() << "\""; + if (message.code) os << ", " << message.code.get(); if (message.msg) os << ", \"" << message.msg.get(); return os << "\"]" << std::endl; } -} \ No newline at end of file +} From fb915374660670fa698c37d874edfbc9c6ed0786 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Tue, 15 Jul 2014 14:01:08 -0400 Subject: [PATCH 29/52] print unchecked log messages --- test/style.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/style.cpp b/test/style.cpp index cadfec812..deddb6e34 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -50,6 +50,14 @@ TEST(Style, Functions) { }; ASSERT_EQ(0, log.count(number)); + + const auto &unchecked = log.unchecked(); + if (unchecked.size()) { + std::cerr << "Unchecked Log Messages: " << std::endl + << unchecked; + } + + ASSERT_EQ(0, unchecked.size()); } TEST(Style, Layers) { From 9437d0d7ccfccf8cf94e3f04d3fc4ea428ece0ab Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Tue, 15 Jul 2014 16:16:52 -0400 Subject: [PATCH 30/52] check log messages from style_parser --- test/style.cpp | 65 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/test/style.cpp b/test/style.cpp index deddb6e34..c9e6c08af 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -8,6 +8,29 @@ using namespace llmr; +typedef std::vector> Messages; + +void checkMessages(FixtureLogBackend log, Messages messages) { + for (auto &it : messages) { + const FixtureLogBackend::LogMessage message { + EventSeverityClass("WARNING"), + EventClass("ParseStyle"), + it.second + }; + + ASSERT_EQ(it.first, log.count(message)) << "Message: " + << message << std::endl; + } + + const auto &unchecked = log.unchecked(); + if (unchecked.size()) { + std::cerr << "Unchecked Log Messages: " << std::endl + << unchecked; + } + + ASSERT_EQ(0, unchecked.size()); +} + TEST(Style, Style) { const FixtureLogBackend &log = Log::Set(); @@ -18,6 +41,8 @@ TEST(Style, Style) { Style style; style.loadJSON((const uint8_t *)stylejson.str().c_str()); + + checkMessages(log, {}); } TEST(Style, Colors) { @@ -30,6 +55,12 @@ TEST(Style, Colors) { Style style; style.loadJSON((const uint8_t *)stylejson.str().c_str()); + + checkMessages(log, { + {84, "value of 'line-width' must be a number, or a number function"}, + {6, "value of 'line-opacity' must be a number, or a number function"}, + {12, "value of 'text-size' must be a number, or a number function"} + }); } TEST(Style, Functions) { @@ -43,21 +74,10 @@ TEST(Style, Functions) { Style style; style.loadJSON((const uint8_t *)stylejson.str().c_str()); - const FixtureLogBackend::LogMessage number { - EventSeverityClass("WARNING"), - EventClass("ParseStyle"), - "value of 'line-width' must be a number, or a number function" - }; - - ASSERT_EQ(0, log.count(number)); - - const auto &unchecked = log.unchecked(); - if (unchecked.size()) { - std::cerr << "Unchecked Log Messages: " << std::endl - << unchecked; - } - - ASSERT_EQ(0, unchecked.size()); + checkMessages(log, { + {48, "stop must have zoom level and value specification"}, + {10, "stops function must specify a stops array"} + }); } TEST(Style, Layers) { @@ -70,5 +90,18 @@ TEST(Style, Layers) { Style style; style.loadJSON((const uint8_t *)stylejson.str().c_str()); -} + checkMessages(log, { + {14, "stop must have zoom level and value specification"}, + {7, "function must specify a function name"}, + {6, "value of 'line-width' must be a number, or a number function"}, + {3, "stops function must specify a stops array"}, + {2, "function type 'ss' is unknown"}, + {1, "array value has unexpected number of elements"}, + {1, "function type 'spots' is unknown"}, + {1, "function type 'sItops' is unknown"}, + {1, "function type 'st1tops' is unknown"}, + {1, "function type 'sto' is unknown"}, + {1, "function type 'sRlix4tops' is unknown"} + }); +} From 056f9e88d5214ae5752ec946666c756e2bf3d72b Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Tue, 15 Jul 2014 17:12:37 -0400 Subject: [PATCH 31/52] noncopyable log --- test/style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/style.cpp b/test/style.cpp index c9e6c08af..1198b2a2e 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -10,7 +10,7 @@ using namespace llmr; typedef std::vector> Messages; -void checkMessages(FixtureLogBackend log, Messages messages) { +void checkMessages(const FixtureLogBackend &log, Messages messages) { for (auto &it : messages) { const FixtureLogBackend::LogMessage message { EventSeverityClass("WARNING"), From 7fab02d6bd1f10963231184fc37a975daa1fb05c Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 17 Jul 2014 16:49:30 -0400 Subject: [PATCH 32/52] split stylesheet fixtures into separate gyp action --- bin/build-fixtures.js | 22 ++++++++++++++++++++++ bin/build-style.js | 19 ++++--------------- bin/package.json | 2 +- mapboxgl.gyp | 44 ++++++++++++++++++++++++++++++++++++++++--- test/test.gyp | 19 ++++++++++--------- 5 files changed, 78 insertions(+), 28 deletions(-) create mode 100755 bin/build-fixtures.js diff --git a/bin/build-fixtures.js b/bin/build-fixtures.js new file mode 100755 index 000000000..142147ef8 --- /dev/null +++ b/bin/build-fixtures.js @@ -0,0 +1,22 @@ +#!/usr/bin/env node +'use strict'; + +var load = require('./load-style.js'); +var mkdirp = require('mkdirp'); +var path = require('path'); +var fs = require('fs'); + +var transforms = { + 'fuzz-colors.min.js': require('./fuzz-colors.js'), + 'fuzz-functions.min.js': require('./fuzz-functions.js'), + 'fuzz-layers.min.js': require('./fuzz-layers.js') +}; + +var source = load(process.argv[2]); +var out = process.argv[3]; +mkdirp.sync(out); + +Object.keys(transforms).forEach(function(key) { + source.pipe(transforms[key].call()) + .pipe(fs.createWriteStream(path.join(out, key))); +}); diff --git a/bin/build-style.js b/bin/build-style.js index 4118faa3c..06d4cc080 100755 --- a/bin/build-style.js +++ b/bin/build-style.js @@ -1,23 +1,12 @@ #!/usr/bin/env node 'use strict'; -var load = require('./load-style.js'); var mkdirp = require('mkdirp'); var path = require('path'); var fs = require('fs'); -var transforms = { - 'style.min.js': require('./minify.js'), - 'fuzz-colors.min.js': require('./fuzz-colors.js'), - 'fuzz-functions.min.js': require('./fuzz-functions.js'), - 'fuzz-layers.min.js': require('./fuzz-layers.js') -}; +var data = JSON.stringify(require(path.join(process.cwd(), process.argv[2]))); +var out = path.join(process.argv[3], 'style.min.js'); -var source = load(process.argv[2]); -var out = process.argv[3]; -mkdirp.sync(out); - -Object.keys(transforms).forEach(function(key) { - source.pipe(transforms[key].call()) - .pipe(fs.createWriteStream(path.join(out, key))); -}); +mkdirp.sync(path.dirname(out)); +fs.writeFileSync(out, data); diff --git a/bin/package.json b/bin/package.json index 50843fa4b..01fe883ab 100644 --- a/bin/package.json +++ b/bin/package.json @@ -4,7 +4,7 @@ "dependencies": { "brfs": "^1.1.2", "fuzzer": "^0.2.0", - "glsl-optimizer": "kkaefer/glsl-optimizer#amalgamation", + "glsl-optimizer": "mapbox/glsl-optimizer#amalgamation", "mkdirp": "^0.5.0", "through2": "^0.5.1" } diff --git a/mapboxgl.gyp b/mapboxgl.gyp index 9930cd3fb..e8a217a3f 100644 --- a/mapboxgl.gyp +++ b/mapboxgl.gyp @@ -68,9 +68,6 @@ ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js', - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-functions.min.js', - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-layers.min.js', ], 'action': ['<@(node)', 'bin/build-style.js', '<@(_inputs)', '<(SHARED_INTERMEDIATE_DIR)/bin'] } @@ -78,6 +75,32 @@ 'direct_dependent_settings': { 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js', + ], + } + }, + { + 'target_name': 'build_stylesheet_fixtures', + 'type': 'none', + 'hard_dependency': 1, + 'dependencies': [ + 'npm_install' + ], + 'actions': [ + { + 'action_name': 'Build Stylesheet Fixtures', + 'inputs': [ + 'bin/style.json', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-functions.min.js', + '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-layers.min.js', + ], + 'action': ['<@(node)', 'bin/build-fixtures.js', '<@(_inputs)', '<(SHARED_INTERMEDIATE_DIR)/bin'] + } + ], + 'direct_dependent_settings': { + 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-functions.min.js', '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-layers.min.js', @@ -95,6 +118,21 @@ { 'files': [ '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js', + ], + 'destination': '<(PRODUCT_DIR)' + } + ] + }, + { + 'target_name': 'copy_stylesheet_fixtures', + 'type': 'none', + 'hard_dependency': 1, + 'dependencies': [ + 'build_stylesheet_fixtures' + ], + 'copies': [ + { + 'files': [ '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-functions.min.js', '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-layers.min.js', diff --git a/test/test.gyp b/test/test.gyp index f27344330..8ecce6a32 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -71,7 +71,7 @@ ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", - "../mapboxgl.gyp:mapboxgl" + "../mapboxgl.gyp:mapboxgl", ] }, { @@ -87,7 +87,7 @@ ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", - "../mapboxgl.gyp:mapboxgl" + "../mapboxgl.gyp:mapboxgl", ] }, { @@ -103,7 +103,7 @@ ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", - "../mapboxgl.gyp:mapboxgl" + "../mapboxgl.gyp:mapboxgl", ] }, { @@ -121,7 +121,8 @@ ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", - "../mapboxgl.gyp:mapboxgl" + "../mapboxgl.gyp:mapboxgl", + "../mapboxgl.gyp:copy_stylesheet_fixtures", ] }, { @@ -137,7 +138,7 @@ ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", - "../mapboxgl.gyp:mapboxgl" + "../mapboxgl.gyp:mapboxgl", ] }, { @@ -153,7 +154,7 @@ ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", - "../mapboxgl.gyp:mapboxgl" + "../mapboxgl.gyp:mapboxgl", ] }, { @@ -169,7 +170,7 @@ ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", - "../mapboxgl.gyp:mapboxgl" + "../mapboxgl.gyp:mapboxgl", ] }, { @@ -185,7 +186,7 @@ ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", - "../mapboxgl.gyp:mapboxgl" + "../mapboxgl.gyp:mapboxgl", ] }, { @@ -207,8 +208,8 @@ "dependencies": [ "../deps/gtest/gtest.gyp:gtest", "../mapboxgl.gyp:mapboxgl", + "../mapboxgl.gyp:copy_default_stylesheet", "link_gl", - '../mapboxgl.gyp:copy_default_stylesheet', ] }, { From e052d847f979e978db042915957d65bacb54039c Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 17 Jul 2014 17:08:52 -0400 Subject: [PATCH 33/52] switch to mapbox-glsl-optimizer for node-pre-gyp --- bin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/package.json b/bin/package.json index 01fe883ab..06f3ccbe5 100644 --- a/bin/package.json +++ b/bin/package.json @@ -4,7 +4,7 @@ "dependencies": { "brfs": "^1.1.2", "fuzzer": "^0.2.0", - "glsl-optimizer": "mapbox/glsl-optimizer#amalgamation", + "mapbox-glsl-optimizer": "~0.1.0", "mkdirp": "^0.5.0", "through2": "^0.5.1" } From 4d4fd3155c9d649628f776ed298d3812f363b354 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Thu, 17 Jul 2014 17:58:29 -0400 Subject: [PATCH 34/52] update test fixtures --- bin/fuzz-functions.js | 2 +- test/style.cpp | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/bin/fuzz-functions.js b/bin/fuzz-functions.js index 26a079d6d..68f57a35d 100755 --- a/bin/fuzz-functions.js +++ b/bin/fuzz-functions.js @@ -11,7 +11,7 @@ module.exports = function() { json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { var value = json.constants[key]; - if (typeof value === 'object' && value.hasOwnProperty('fn')) { + if (typeof value === 'object' && value.hasOwnProperty('stops')) { var mutator = fuzzer.mutate.object(value); obj[key] = mutator(); } diff --git a/test/style.cpp b/test/style.cpp index a67ab0677..e98740e40 100644 --- a/test/style.cpp +++ b/test/style.cpp @@ -18,7 +18,7 @@ void checkMessages(const FixtureLogBackend &log, Messages messages) { it.second }; - ASSERT_EQ(it.first, log.count(message)) << "Message: " + EXPECT_EQ(it.first, log.count(message)) << "Message: " << message << std::endl; } @@ -75,8 +75,8 @@ TEST(Style, Functions) { style.loadJSON((const uint8_t *)stylejson.str().c_str()); checkMessages(log, { - {48, "stop must have zoom level and value specification"}, - {10, "stops function must specify a stops array"} + {28, "stop must have zoom level and value specification"}, + {12, "function must specify a function type"} }); } @@ -92,16 +92,10 @@ TEST(Style, Layers) { style.loadJSON((const uint8_t *)stylejson.str().c_str()); checkMessages(log, { - {14, "stop must have zoom level and value specification"}, - {7, "function must specify a function name"}, - {6, "value of 'line-width' must be a number, or a number function"}, - {3, "stops function must specify a stops array"}, - {2, "function type 'ss' is unknown"}, + {20, "stop must have zoom level and value specification"}, + {6, "function must specify a function type"}, + {1, "value of 'line-width' must be a number, or a number function"}, {1, "array value has unexpected number of elements"}, - {1, "function type 'spots' is unknown"}, - {1, "function type 'sItops' is unknown"}, - {1, "function type 'st1tops' is unknown"}, - {1, "function type 'sto' is unknown"}, - {1, "function type 'sRlix4tops' is unknown"} + {1, "value of 'line-opacity' must be a number, or a number function"} }); } From 54a81d0f9b9903213c55d89ee87eeacbadd5486c Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 14:09:33 -0400 Subject: [PATCH 35/52] migrate style_parser tests to use info and style json fixtures --- .gitignore | 1 + bin/{style.json => default.style.json} | 0 mapboxgl.gyp | 41 +------ test/fixtures/style_parser/default.info.json | 6 ++ test/style.cpp | 101 ------------------ test/style_parser.cpp | 106 +++++++++++++++++++ test/test.gyp | 10 +- 7 files changed, 123 insertions(+), 142 deletions(-) rename bin/{style.json => default.style.json} (100%) create mode 100644 test/fixtures/style_parser/default.info.json delete mode 100644 test/style.cpp create mode 100644 test/style_parser.cpp diff --git a/.gitignore b/.gitignore index c69b0331e..7eb63a125 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /src/shader/shaders_gles2.cpp /bin/style.bin.js /test/fixtures/styles/index.html +/test/fixtures/style_parser/default.style.json diff --git a/bin/style.json b/bin/default.style.json similarity index 100% rename from bin/style.json rename to bin/default.style.json diff --git a/mapboxgl.gyp b/mapboxgl.gyp index e8a217a3f..0c08989ce 100644 --- a/mapboxgl.gyp +++ b/mapboxgl.gyp @@ -64,7 +64,7 @@ { 'action_name': 'Build Stylesheet', 'inputs': [ - 'bin/style.json', + 'bin/default.style.json', ], 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/bin/style.min.js', @@ -78,35 +78,6 @@ ], } }, - { - 'target_name': 'build_stylesheet_fixtures', - 'type': 'none', - 'hard_dependency': 1, - 'dependencies': [ - 'npm_install' - ], - 'actions': [ - { - 'action_name': 'Build Stylesheet Fixtures', - 'inputs': [ - 'bin/style.json', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-functions.min.js', - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-layers.min.js', - ], - 'action': ['<@(node)', 'bin/build-fixtures.js', '<@(_inputs)', '<(SHARED_INTERMEDIATE_DIR)/bin'] - } - ], - 'direct_dependent_settings': { - 'sources': [ - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-functions.min.js', - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-layers.min.js', - ], - } - }, { 'target_name': 'copy_default_stylesheet', 'type': 'none', @@ -124,20 +95,18 @@ ] }, { - 'target_name': 'copy_stylesheet_fixtures', + 'target_name': 'copy_default_stylesheet_fixtures', 'type': 'none', 'hard_dependency': 1, 'dependencies': [ - 'build_stylesheet_fixtures' + 'build_stylesheet' ], 'copies': [ { 'files': [ - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-colors.min.js', - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-functions.min.js', - '<(SHARED_INTERMEDIATE_DIR)/bin/fuzz-layers.min.js', + 'bin/default.style.json', ], - 'destination': '<(PRODUCT_DIR)' + 'destination': 'test/fixtures/style_parser' } ] }, diff --git a/test/fixtures/style_parser/default.info.json b/test/fixtures/style_parser/default.info.json new file mode 100644 index 000000000..9c25a2f48 --- /dev/null +++ b/test/fixtures/style_parser/default.info.json @@ -0,0 +1,6 @@ +{ + "default": { + "log": [ + ] + } +} diff --git a/test/style.cpp b/test/style.cpp deleted file mode 100644 index e98740e40..000000000 --- a/test/style.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "gtest/gtest.h" - -#include -#include "./fixtures/fixture_log.hpp" - -#include -#include - -using namespace mbgl; - -typedef std::vector> Messages; - -void checkMessages(const FixtureLogBackend &log, Messages messages) { - for (auto &it : messages) { - const FixtureLogBackend::LogMessage message { - EventSeverityClass("WARNING"), - EventClass("ParseStyle"), - it.second - }; - - EXPECT_EQ(it.first, log.count(message)) << "Message: " - << message << std::endl; - } - - const auto &unchecked = log.unchecked(); - if (unchecked.size()) { - std::cerr << "Unchecked Log Messages: " << std::endl - << unchecked; - } - - ASSERT_EQ(0, unchecked.size()); -} - -TEST(Style, Style) { - const FixtureLogBackend &log = Log::Set(); - - std::ifstream stylefile("./style.min.js"); - ASSERT_TRUE(stylefile.good()); - std::stringstream stylejson; - stylejson << stylefile.rdbuf(); - - Style style; - style.loadJSON((const uint8_t *)stylejson.str().c_str()); - - checkMessages(log, {}); -} - -TEST(Style, Colors) { - const FixtureLogBackend &log = Log::Set(); - - std::ifstream stylefile("./fuzz-colors.min.js"); - ASSERT_TRUE(stylefile.good()); - std::stringstream stylejson; - stylejson << stylefile.rdbuf(); - - Style style; - style.loadJSON((const uint8_t *)stylejson.str().c_str()); - - checkMessages(log, { - {84, "value of 'line-width' must be a number, or a number function"}, - {6, "value of 'line-opacity' must be a number, or a number function"}, - {12, "value of 'text-size' must be a number, or a number function"} - }); -} - -TEST(Style, Functions) { - const FixtureLogBackend &log = Log::Set(); - - std::ifstream stylefile("./fuzz-functions.min.js"); - ASSERT_TRUE(stylefile.good()); - std::stringstream stylejson; - stylejson << stylefile.rdbuf(); - - Style style; - style.loadJSON((const uint8_t *)stylejson.str().c_str()); - - checkMessages(log, { - {28, "stop must have zoom level and value specification"}, - {12, "function must specify a function type"} - }); -} - -TEST(Style, Layers) { - const FixtureLogBackend &log = Log::Set(); - - std::ifstream stylefile("./fuzz-layers.min.js"); - ASSERT_TRUE(stylefile.good()); - std::stringstream stylejson; - stylejson << stylefile.rdbuf(); - - Style style; - style.loadJSON((const uint8_t *)stylejson.str().c_str()); - - checkMessages(log, { - {20, "stop must have zoom level and value specification"}, - {6, "function must specify a function type"}, - {1, "value of 'line-width' must be a number, or a number function"}, - {1, "array value has unexpected number of elements"}, - {1, "value of 'line-opacity' must be a number, or a number function"} - }); -} diff --git a/test/style_parser.cpp b/test/style_parser.cpp new file mode 100644 index 000000000..ccc1ec535 --- /dev/null +++ b/test/style_parser.cpp @@ -0,0 +1,106 @@ +#include "gtest/gtest.h" + +#include +#include + +#include + +#include "./fixtures/fixture_log.hpp" + +#include +#include + +#include + +const std::string base_directory = []{ + std::string fn = __FILE__; + fn.erase(fn.find_last_of("/")); + return fn + "/fixtures/style_parser"; +}(); + +using namespace mbgl; + +typedef std::pair Message; +typedef std::vector Messages; + +class StyleParserTest : public ::testing::TestWithParam {}; + +TEST_P(StyleParserTest, render) { + const std::string &base = base_directory + "/" + GetParam(); + + const std::string style_path = base + ".style.json"; + const std::string info = util::read_file(base + ".info.json"); + + // Parse settings. + rapidjson::Document doc; + doc.Parse<0>((const char *const)info.c_str()); + ASSERT_EQ(false, doc.HasParseError()); + ASSERT_EQ(true, doc.IsObject()); + + std::ifstream stylefile(style_path); + ASSERT_TRUE(stylefile.good()); + std::stringstream stylejson; + stylejson << stylefile.rdbuf(); + + Style style; + style.loadJSON((const uint8_t *)stylejson.str().c_str()); + + for (auto it = doc.MemberBegin(), end = doc.MemberEnd(); it != end; it++) { + const FixtureLogBackend &log = Log::Set(); + + const std::string name { it->name.GetString(), it->name.GetStringLength() }; + const rapidjson::Value &value = it->value; + ASSERT_EQ(true, value.IsObject()); + + if (value.HasMember("log")) { + const rapidjson::Value &js_log = value["log"]; + ASSERT_EQ(true, js_log.IsArray()); + for (rapidjson::SizeType i = 0; i < js_log.Size(); i++) { + const rapidjson::Value &js_entry = js_log[i]; + ASSERT_EQ(true, js_entry.IsArray()); + if (js_entry.Size() == 4) { + const uint32_t count = js_entry[rapidjson::SizeType(0)].GetUint(); + if (js_entry[rapidjson::SizeType(3)].IsString()) { + const FixtureLogBackend::LogMessage message { + EventSeverityClass(js_entry[rapidjson::SizeType(1)].GetString()), + EventClass(js_entry[rapidjson::SizeType(2)].GetString()), + js_entry[rapidjson::SizeType(3)].GetString() + }; + EXPECT_EQ(count, log.count(message)) << "Message: " << message << std::endl; + } + } else { + FAIL(); + } + } + } + + const auto &unchecked = log.unchecked(); + if (unchecked.size()) { + std::cerr << "Unchecked Log Messages (" << base << "): " + << std::endl << unchecked; + } + + ASSERT_EQ(0, unchecked.size()); + } +} + +INSTANTIATE_TEST_CASE_P(StyleParser, StyleParserTest, ::testing::ValuesIn([] { + std::vector names; + const std::string ending = ".info.json"; + + DIR *dir = opendir(base_directory.c_str()); + if (dir == nullptr) { + return names; + } + + for (dirent *dp = nullptr; (dp = readdir(dir)) != nullptr;) { + const std::string name = dp->d_name; + if (name.length() >= ending.length() && name.compare(name.length() - ending.length(), ending.length(), ending) == 0) { + names.push_back(name.substr(0, name.length() - ending.length())); + } + } + + closedir(dir); + + return names; +}())); diff --git a/test/test.gyp b/test/test.gyp index 8ecce6a32..f91f11808 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -107,22 +107,22 @@ ] }, { - "target_name": "style", - "product_name": "test_style", + "target_name": "style_parser", + "product_name": "test_style_parser", "type": "executable", "libraries": [ "-lpthread", ], "sources": [ "./main.cpp", - "./style.cpp", + "./style_parser.cpp", "./fixtures/fixture_log.hpp", "./fixtures/fixture_log.cpp", ], "dependencies": [ "../deps/gtest/gtest.gyp:gtest", "../mapboxgl.gyp:mapboxgl", - "../mapboxgl.gyp:copy_stylesheet_fixtures", + "../mapboxgl.gyp:copy_default_stylesheet_fixtures", ] }, { @@ -223,7 +223,7 @@ "tile", "functions", "headless", - "style", + "style_parser", "comparisons", ], } From db14cdbd1ad52ba7197ced977e98ef1aedfaa743 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 14:12:29 -0400 Subject: [PATCH 36/52] purge fuzz fixture pipeline --- bin/build-fixtures.js | 22 ---------------------- bin/fuzz-colors.js | 26 -------------------------- bin/fuzz-functions.js | 27 --------------------------- bin/fuzz-layers.js | 23 ----------------------- bin/load-style.js | 15 --------------- bin/minify.js | 15 --------------- bin/mkdirp.js | 13 ------------- 7 files changed, 141 deletions(-) delete mode 100755 bin/build-fixtures.js delete mode 100755 bin/fuzz-colors.js delete mode 100755 bin/fuzz-functions.js delete mode 100755 bin/fuzz-layers.js delete mode 100755 bin/load-style.js delete mode 100755 bin/minify.js delete mode 100755 bin/mkdirp.js diff --git a/bin/build-fixtures.js b/bin/build-fixtures.js deleted file mode 100755 index 142147ef8..000000000 --- a/bin/build-fixtures.js +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var load = require('./load-style.js'); -var mkdirp = require('mkdirp'); -var path = require('path'); -var fs = require('fs'); - -var transforms = { - 'fuzz-colors.min.js': require('./fuzz-colors.js'), - 'fuzz-functions.min.js': require('./fuzz-functions.js'), - 'fuzz-layers.min.js': require('./fuzz-layers.js') -}; - -var source = load(process.argv[2]); -var out = process.argv[3]; -mkdirp.sync(out); - -Object.keys(transforms).forEach(function(key) { - source.pipe(transforms[key].call()) - .pipe(fs.createWriteStream(path.join(out, key))); -}); diff --git a/bin/fuzz-colors.js b/bin/fuzz-colors.js deleted file mode 100755 index c3a64f9ac..000000000 --- a/bin/fuzz-colors.js +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var through = require('through2'); -var fuzzer = require('fuzzer'); -fuzzer.seed(0); - -module.exports = function() { - return through.obj(function(chunk, env, callback) { - var json = JSON.parse(chunk.toString()); - - json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { - var value = json.constants[key]; - if (typeof value === 'string') { - obj[key] = fuzzer.mutate.string(value); - } - return obj; - }, {}); - - var data = JSON.stringify(json); - this.push(data); - callback(); - }); -}; - -if (!module.parent) process.stdin.pipe(module.exports()).pipe(process.stdout); diff --git a/bin/fuzz-functions.js b/bin/fuzz-functions.js deleted file mode 100755 index 68f57a35d..000000000 --- a/bin/fuzz-functions.js +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var through = require('through2'); -var fuzzer = require('fuzzer'); -fuzzer.seed(0); - -module.exports = function() { - return through.obj(function(chunk, env, callback) { - var json = JSON.parse(chunk.toString()); - - json.constants = Object.keys(json.constants).reduce(function(obj, key, index) { - var value = json.constants[key]; - if (typeof value === 'object' && value.hasOwnProperty('stops')) { - var mutator = fuzzer.mutate.object(value); - obj[key] = mutator(); - } - return obj; - }, {}); - - var data = JSON.stringify(json); - this.push(data); - callback(); - }); -}; - -if (!module.parent) process.stdin.pipe(module.exports()).pipe(process.stdout); diff --git a/bin/fuzz-layers.js b/bin/fuzz-layers.js deleted file mode 100755 index 547775799..000000000 --- a/bin/fuzz-layers.js +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var through = require('through2'); -var fuzzer = require('fuzzer'); -fuzzer.seed(0); - -module.exports = function() { - return through.obj(function(chunk, env, callback) { - var json = JSON.parse(chunk.toString()); - - json.layers.map(function(value) { - var mutator = fuzzer.mutate.object(value); - return mutator(); - }); - - var data = JSON.stringify(json); - this.push(data); - callback(); - }); -}; - -if (!module.parent) process.stdin.pipe(module.exports()).pipe(process.stdout); diff --git a/bin/load-style.js b/bin/load-style.js deleted file mode 100755 index 48aa6ecc4..000000000 --- a/bin/load-style.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var fs = require('fs'); -var path = require('path'); -var brfs = require('brfs'); - -module.exports = function(file) { - var fromFile = file && file !== '-'; - var rs = fromFile ? fs.createReadStream(file) : process.stdin; - var fpath = fromFile ? file : path.join(process.cwd(), '-'); - return rs.pipe(brfs(fpath)); -}; - -if (!module.parent) module.exports(process.argv[2]).pipe(process.stdout); diff --git a/bin/minify.js b/bin/minify.js deleted file mode 100755 index 253b34001..000000000 --- a/bin/minify.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var through = require('through2'); - -module.exports = function() { - return through.obj(function(chunk, env, callback) { - var json = JSON.parse(chunk.toString()); - var data = JSON.stringify(json); - this.push(data); - callback(); - }); -}; - -if (!module.parent) process.stdin.pipe(module.exports()).pipe(process.stdout); diff --git a/bin/mkdirp.js b/bin/mkdirp.js deleted file mode 100755 index 25b3234ef..000000000 --- a/bin/mkdirp.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var path = require('path'); -var mkdirp = require('mkdirp'); -var fs = require('fs'); - -module.exports = function(out) { - mkdirp.sync(path.dirname(out)); - return fs.createWriteStream(out); -}; - -if (!module.parent) process.stdin.pipe(module.exports(process.argv[2])); From 1ba3c54abe59ce119a9b57f8dd917b44210dbe79 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 14:13:25 -0400 Subject: [PATCH 37/52] clean up package.json --- bin/package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/package.json b/bin/package.json index 06f3ccbe5..675f1fb16 100644 --- a/bin/package.json +++ b/bin/package.json @@ -2,10 +2,7 @@ "name": "mbgl-native", "version": "0.0.1", "dependencies": { - "brfs": "^1.1.2", - "fuzzer": "^0.2.0", "mapbox-glsl-optimizer": "~0.1.0", "mkdirp": "^0.5.0", - "through2": "^0.5.1" } } From d0f6a87c1cfc71ae719937850b485fa841df6077 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 14:15:15 -0400 Subject: [PATCH 38/52] stray comma --- bin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/package.json b/bin/package.json index 675f1fb16..1df845460 100644 --- a/bin/package.json +++ b/bin/package.json @@ -3,6 +3,6 @@ "version": "0.0.1", "dependencies": { "mapbox-glsl-optimizer": "~0.1.0", - "mkdirp": "^0.5.0", + "mkdirp": "^0.5.0" } } From 37056a43de9339cc8c9753b6e315f3bd6366d737 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 15:44:48 -0400 Subject: [PATCH 39/52] add fuzzed fixtures and fix FixtureLogBackend to capture log output --- .../style_parser/fuzz-colors.info.json | 9 ++++++ .../style_parser/fuzz-colors.style.json | 1 + .../style_parser/fuzz-functions.info.json | 8 +++++ .../style_parser/fuzz-functions.style.json | 1 + .../style_parser/fuzz-layers.info.json | 11 +++++++ .../style_parser/fuzz-layers.style.json | 1 + test/style_parser.cpp | 29 ++++++++----------- 7 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 test/fixtures/style_parser/fuzz-colors.info.json create mode 100644 test/fixtures/style_parser/fuzz-colors.style.json create mode 100644 test/fixtures/style_parser/fuzz-functions.info.json create mode 100644 test/fixtures/style_parser/fuzz-functions.style.json create mode 100644 test/fixtures/style_parser/fuzz-layers.info.json create mode 100644 test/fixtures/style_parser/fuzz-layers.style.json diff --git a/test/fixtures/style_parser/fuzz-colors.info.json b/test/fixtures/style_parser/fuzz-colors.info.json new file mode 100644 index 000000000..7e91ffe21 --- /dev/null +++ b/test/fixtures/style_parser/fuzz-colors.info.json @@ -0,0 +1,9 @@ +{ + "default": { + "log": [ + [84, "WARNING", "ParseStyle", "value of 'line-width' must be a number, or a number function"], + [6, "WARNING", "ParseStyle", "value of 'line-opacity' must be a number, or a number function"], + [12, "WARNING", "ParseStyle", "value of 'text-size' must be a number, or a number function"] + ] + } +} diff --git a/test/fixtures/style_parser/fuzz-colors.style.json b/test/fixtures/style_parser/fuzz-colors.style.json new file mode 100644 index 000000000..b8bb2dbbe --- /dev/null +++ b/test/fixtures/style_parser/fuzz-colors.style.json @@ -0,0 +1 @@ +{"version":3,"sprite":"https://www.mapbox.com/mapbox-gl-styles/sprites/outdoors","glyphs":"https://mapbox.s3.amazonaws.com/gl-glyphs-256/{fontstack}/{range}.pbf","sources":{"mapbox":{"type":"vector","url":"mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5","maxZoom":14}},"constants":{"@land":"r44,239,225)","@water":"#cKxgdd","@water_dark":"#185869","@crop":"#eerLznieed4","@grass":"#e6e6cc","@scrub":"#dfe5c8","@wood":"#cee2bd","@snow":"#f4f8foNGbjf","@rock":"#ddxd","@sand":"#ffdI","@cemetery":"#edf4eO0d","@pitch":"#ffF4bf","@park":"#d4e4bc","@piste":"blue","@school":"0efd85Qe#","@hospital":"#f8eee0","@builtup":"#f6faK0Off","@case":"#fff","@motorway":"#cda0a0","@main":"#ddc0b9","@street":"#fff","@text":"#666","@text_stroke":"rgba(255,25,0.8)","@country_text":"#22-a","@marine_text":"#a0bdc0","@water_text":"#185869","@land_night":"#017293","@water_night":"#10urYB3","@water_dark_night":"#003366w","@crop_night":"#aMt178","@grass_night":"#2394","@scrub_night":"#31a186EIRnW","@wood_night":"#45b581","@park_night":"#51bd8b","@snow_night":"#5ad9fe","@rock_night":"#999","@sand_night":"#4yDv37162","@cemetery_night":"#2tH96","@pitch_night":"rgba(255,25,255,0.2)","@school_night":"#01536","@hospital_night":"#015e7","@builtup_night":"#014bbF2Sy960","@admin_night":"#ffb680","@text_night":"#fff","@text_water_night":"#2a5b8a","@text_stroke_night":"#103","@text2_stroke_night":"rgba(1,L9CVOcBtzx1ZUu1Dd69,89,0.8)","@case_night":"#015e7a","@street_case_night":"#015b76","@motorway_night":"#bbdde7","@main_night":"#64b2c9","@street_night":"#0186ac","@contour_night":"08ffff#"},"layers":[{"id":"background","type":"background","style":{"background-color":"@land"},"style.night":{"background-color":"@land_night"}},{"id":"landcover_snow","source":"mapbox","source-layer":"landcover","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{"fill-color":"@snow_night"}},{"id":"landcover_crop","source":"mapbox","source-layer":"landcover","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night"}},{"id":"landcover_grass","source":"mapbox","source-layer":"landcover","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@grass_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landcover_scrub","source":"mapbox","source-layer":"landcover","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@scrub_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landcover_wood","source":"mapbox","source-layer":"landcover","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@wood_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landuse_wood","source":"mapbox","source-layer":"landuse","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood"},"style.night":{"fill-color":"@wood_night","fill-opacity":0.8}},{"id":"landuse_school","source":"mapbox","source-layer":"landuse","filter":{"class":"school"},"type":"fill","style":{"fill-color":"@school"},"style.night":{"fill-color":"@school_night"}},{"id":"landuse_sand","source":"mapbox","source-layer":"landuse","filter":{"class":"sand"},"type":"fill","style":{"fill-color":"@sand"},"style.night":{"fill-color":"@sand_night","fill-opacity":0.8}},{"id":"landuse_pitch","source":"mapbox","source-layer":"landuse","filter":{"class":"pitch"},"type":"fill","style":{"fill-color":"rgba(255,255,255,0.5)","fill-outline-color":"@pitch"},"style.night":{"fill-color":"@pitch_night","fill-outline-color":"@pitch"}},{"id":"landuse_park","source":"mapbox","source-layer":"landuse","filter":{"class":"park"},"type":"fill","style":{"fill-color":"@park"},"style.night":{"fill-color":"@park_night"}},{"id":"landuse_industrial","source":"mapbox","source-layer":"landuse","filter":{"class":"industrial"},"type":"fill","style":{"fill-color":"rgba(246,250,255,0.5)"},"style.night":{"fill-color":"@builtup_night"}},{"id":"landuse_scrub","source":"mapbox","source-layer":"landuse","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub"},"style.night":{"fill-color":"@scrub_night","fill-opacity":0.8}},{"id":"landuse_grass","source":"mapbox","source-layer":"landuse","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass"},"style.night":{"fill-color":"@grass_night","fill-opacity":0.8}},{"id":"landuse_crop","source":"mapbox","source-layer":"landuse","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night","fill-opacity":0.8}},{"id":"landuse_rock","source":"mapbox","source-layer":"landuse","filter":{"class":"rock"},"type":"fill","style":{"fill-color":"@rock"},"style.night":{"fill-color":"@rock_night","fill-opacity":0.8}},{"id":"landuse_snow","source":"mapbox","source-layer":"landuse","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{"fill-color":"@snow_night","fill-opacity":0.8}},{"id":"landuse_hospital","source":"mapbox","source-layer":"landuse","filter":{"class":"hospital"},"type":"fill","style":{"fill-color":"@hospital"},"style.night":{"fill-color":"@hospital_night"}},{"id":"landuse_cemetery","source":"mapbox","source-layer":"landuse","filter":{"class":"cemetery"},"type":"fill","style":{"fill-color":"@cemetery"},"style.night":{"fill-color":"@cemetery_night"}},{"id":"overlay_wetland","source":"mapbox","source-layer":"landuse_overlay","filter":{"class":["wetland","wetland_noveg"]},"type":"fill","style":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"},"style.night":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"}},{"id":"overlay_breakwater_pier","source":"mapbox","source-layer":"landuse_overlay","filter":{"class":["breakwater","pier"]},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"waterway_river_canal","source":"mapbox","source-layer":"waterway","filter":{"type":["river","canal"]},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@river_canal_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@river_canal_width"}},{"id":"waterway_stream","source":"mapbox","source-layer":"waterway","filter":{"type":"stream"},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@stream_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@stream_width"}},{"id":"building_shadow","source":"mapbox","source-layer":"building","type":"fill","style":{"fill-color":"#d5d1c6","fill-translate":[1,1],"fill-opacity":{"stops":[[15.5,0],[16,1]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#026688","fill-translate":[1,1],"fill-opacity":{"stops":[[15.5,0],[16,1]]},"fill-outline-color":"#026688"}},{"id":"building","ref":"building_shadow","style":{"fill-color":"#ebe7db"},"style.night":{"fill-color":"#027797"}},{"id":"building_wall","ref":"building_shadow","style":{"fill-color":"#ebe7db","fill-opacity":{"stops":[[15.5,0],[16,0.7]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#027797","fill-opacity":{"stops":[[15.5,0],[16,0.7]]},"fill-outline-color":"#026688"}},{"id":"hillshade_full_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#fffff3","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17,0.2],[18,0.1]]}},"style.night":{"fill-color":"#fdfdad","fill-antialias":false,"fill-opacity":{"stops":[[13,0.4],[14,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"hillshade_medium_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"medium_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#ffd","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17,0.2],[18,0.1]]}},"style.night":{"fill-color":"#ffe1b7","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[16,0.2],[17,0.15],[18,0.05]]}}},{"id":"hillshade_medium_shadow","source":"mapbox","source-layer":"hillshade","filter":{"class":"medium_shadow"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[15,0.075],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[15,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"hillshade_full_shadow","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_shadow"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[15,0.075],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[15,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"contour_line_loud","source":"mapbox","source-layer":"contour","filter":{"index":5},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#008","line-width":0.9,"line-opacity":{"stops":[[11,0.05],[12,0.11]]}},"style.night":{"line-color":"@contour_night","line-width":0.9,"line-opacity":{"stops":[[11,0.1],[12,0.2]]}}},{"id":"contour_line_regular","source":"mapbox","source-layer":"contour","type":"line","render":{"line-join":"round"},"style":{"line-color":"#008","line-width":0.5,"line-opacity":{"stops":[[11,0.05],[12,0.11]]}},"style.night":{"line-color":"@contour_night","line-width":0.5,"line-opacity":{"stops":[[11,0.1],[12,0.4]]}}},{"id":"barrier_line_gate","source":"mapbox","source-layer":"barrier_line","filter":{"class":"gate"},"type":"line","style":{"line-width":2.5,"line-color":"#aab"},"style.night":{"line-width":2.5,"line-color":"#59596f"}},{"id":"barrier_line_fence","source":"mapbox","source-layer":"barrier_line","filter":{"class":"fence"},"type":"line","style":{"line-color":"#aeada3","line-width":"@fence_width"},"style.night":{"line-color":"#014b61","line-width":"@fence_width"}},{"id":"barrier_line_hedge","source":"mapbox","source-layer":"barrier_line","filter":{"class":"hedge"},"type":"line","style":{"line-color":"#8de99b","line-width":"@hedge_width"},"style.night":{"line-color":"#2e7a57","line-width":"@hedge_width"}},{"id":"barrier_line_land","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"line","style":{"line-color":"@land","line-width":"@barrier_line_land_width"},"style.night":{"line-color":"@land_night","line-width":"@barrier_line_land_width"}},{"id":"barrier_line_land_fill","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"barrier_line_cliff","source":"mapbox","source-layer":"barrier_line","filter":{"class":"cliff"},"type":"line","style":{"line-color":"#987","line-width":4},"style.night":{"line-color":"#63574b","line-width":4}},{"id":"water","source":"mapbox","source-layer":"water","type":"fill","style":{"fill-color":"@water","fill-outline-color":"#a2bdc0"},"style.night":{"fill-color":"@water_night","fill-outline-color":"@water_dark_night"}},{"id":"aeroway_fill","source":"mapbox","source-layer":"aeroway","type":"fill","style":{"fill-color":"#ddd"},"style.night":{"fill-color":"#367"}},{"id":"aeroway_runway","source":"mapbox","source-layer":"aeroway","filter":{"type":"runway"},"type":"line","style":{"line-color":"#ddd","line-width":"@runway_width"},"style.night":{"line-color":"#367","line-width":"@runway_width"}},{"id":"aeroway_taxiway","source":"mapbox","source-layer":"aeroway","filter":{"type":"taxiway"},"type":"line","style":{"line-color":"#ddd","line-width":"@taxiway_width"},"style.night":{"line-color":"#367","line-width":"@taxiway_width"}},{"id":"tunnel_motorway_link_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"}},{"id":"tunnel_service_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"service"},"type":"line","style":{"line-color":"#000","line-opacity":0.04,"line-dasharray":[6,6],"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-dasharray":[6,6],"line-width":"@service_casing_width"}},{"id":"tunnel_main_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"tunnel_street_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":["street","street_limited"]},"type":"line","style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"tunnel_motorway_link","ref":"tunnel_motorway_link_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_link_width"},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_link_width"}},{"id":"tunnel_service","ref":"tunnel_service_casing","style":{"line-color":"#e6cec7","line-width":2},"style.night":{"line-color":"#017ca0","line-width":2}},{"id":"tunnel_street","ref":"tunnel_street_casing","style":{"line-color":"#d9d5c6","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"tunnel_main","ref":"tunnel_main_casing","style":{"line-color":"#e6cec7","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"#78b0c1","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"tunnel_motorway_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"tunnel_motorway","ref":"tunnel_motorway_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_path_case","source":"mapbox","source-layer":"road","filter":{"class":"path"},"type":"line","style":{"line-color":"#ffd","line-opacity":0.4,"line-width":{"stops":[[14,3],[15,4]]}},"style.night":{"line-color":"@land_night","line-opacity":0.2}},{"id":"road_path_footway","source":"mapbox","source-layer":"bridge","filter":{"type":"footway"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"#fff","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_path","source":"mapbox","source-layer":"bridge","filter":{"type":"path"},"type":"line","style":{"line-color":"#987","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,0.8],[14,0.9],[15,1.2]]}},"style.night":{"line-color":"#fff","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,0.8],[14,0.9],[15,1.2]]}}},{"id":"road_path_cycleway","source":"mapbox","source-layer":"bridge","filter":{"type":"cycleway"},"type":"line","style":{"line-color":"#488","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_mtb","source":"mapbox","source-layer":"bridge","filter":{"type":"mtb"},"type":"line","style":{"line-color":"#488","line-dasharray":[12,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[12,4],"line-width":"@path_width"}},{"id":"road_path_piste","source":"mapbox","source-layer":"bridge","filter":{"type":"piste"},"type":"line","style":{"line-color":"#87b","line-dasharray":[8,4],"line-width":"@path_width"},"style.night":{"line-color":"#715dae","line-dasharray":[8,4],"line-width":"@path_width"}},{"id":"road_path_steps","source":"mapbox","source-layer":"bridge","filter":{"type":"steps"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4],"line-width":4},"style.night":{"line-color":"#016684","line-dasharray":[10,4],"line-opacity":0.3,"line-width":6}},{"id":"road_major_rail","source":"mapbox","source-layer":"bridge","filter":{"class":"major_rail"},"type":"line","style":{"line-color":"#c8c4c0","line-width":0.8},"style.night":{"line-color":"#c8c4c0","line-width":0.8}},{"id":"road_motorway_link_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway_link"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"road_service_casing","source":"mapbox","source-layer":"road","filter":{"class":"service"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"road_main_casing","source":"mapbox","source-layer":"road","filter":{"class":"main"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"road_street_casing","source":"mapbox","source-layer":"road","filter":{"class":["street","street_limited"]},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"road_motorway_link","ref":"road_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_link_width"}},{"id":"road_service","ref":"road_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_night","line-width":2}},{"id":"road_street","ref":"road_street_casing","style":{"line-color":"@street","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"road_main","ref":"road_main_casing","style":{"line-color":"@main","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_motorway_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"road_motorway","ref":"road_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_major_rail_hatching","ref":"road_major_rail","style":{"line-color":"#c8c4c0","line-dasharray":[2,31],"line-width":5},"style.night":{"line-color":"#c8c4c0","line-dasharray":[2,31],"line-width":5}},{"id":"bridge_motorway_link_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"bridge_service_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"service"},"type":"line","style":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"bridge_main_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"bridge_street_casing","source":"mapbox","source-layer":"bridge","filter":{"class":["street","street_limited"]},"type":"line","style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"bridge_motorway_link","ref":"bridge_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_link_width"}},{"id":"bridge_service","ref":"bridge_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_night","line-width":2}},{"id":"bridge_street","ref":"bridge_street_casing","style":{"line-color":"@street","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"bridge_main","ref":"bridge_main_casing","style":{"line-color":"@main","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"bridge_motorway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"bridge_motorway","ref":"bridge_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"bridge_aerialway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"aerialway"},"type":"line","style":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"},"style.night":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"}},{"id":"bridge_aerialway","ref":"bridge_aerialway_casing","style":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"},"style.night":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"}},{"id":"admin_l3","source":"mapbox","source-layer":"admin","filter":{"admin_level":[3,4,5]},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#88a","line-dasharray":[60,20],"line-opacity":{"stops":[[3,0],[5,1]]},"line-width":"@admin_l3_width"},"style.night":{"line-color":"@admin_night","line-dasharray":[60,20],"line-opacity":{"stops":[[3,0],[5,1]]},"line-width":"@admin_l3_width"}},{"id":"admin_l2","source":"mapbox","source-layer":"admin","filter":{"admin_level":2},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#88a","line-width":"@admin_l2_width"},"style.night":{"line-color":"@admin_night","line-width":"@admin_l2_width"}},{"id":"admin_maritime_cover","source":"mapbox","source-layer":"admin","filter":{"maritime":1},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@water","line-width":5},"style.night":{"line-color":"@water_night","line-width":5}},{"id":"admin_maritime","ref":"admin_maritime_cover","style":{"line-color":"#c0d6d6","line-width":{"stops":[[5,1],[7,2],[11,3]]}},"style.night":{"line-color":"#0a1347","line-width":{"stops":[[5,1],[7,2],[11,3]]}}},{"id":"country_label_line","source":"mapbox","source-layer":"country_label_line","type":"line","render":{"text-max-width":5},"style":{"line-color":"@country_text","line-width":0.5,"line-opacity":0.5},"style.night":{"line-color":"@text_night","line-width":0.5,"line-opacity":0.5}},{"id":"country_label","source":"mapbox","source-layer":"country_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":5},"style":{"text-color":"@country_text","text-halo-color":"rgba(255,255,255,0.5)","text-halo-width":0.5,"text-size":"@country_label_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.4,"text-size":"@country_label_size"}},{"id":"marine_label_line_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":30,"text-max-angle":0.5,"text-letter-spacing":0.4},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":3},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":30,"text-max-width":8,"text-letter-spacing":0.4,"text-line-height":2},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8,"text-letter-spacing":0.2,"text-line-height":1.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":3},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.3},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.2},"style":{"text-color":"@marine_text","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water_night"}},{"id":"state_label","source":"mapbox","source-layer":"state_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-width":8},"style":{"text-color":"#333","text-halo-width":0.4,"text-halo-color":"rgba(244,239,225,0.8)","text-size":{"stops":[[2.99,0],[3,10],[8.99,16],[9,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-halo-color":"@land_night","text-size":{"stops":[[2.99,0],[3,10],[8.99,16],[9,0]]}}},{"id":"place_label_city","source":"mapbox","source-layer":"place_label","filter":{"type":"city","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":20,"text-max-width":8},"style":{"text-color":"#444","text-halo-width":0.4,"text-halo-color":"@text_stroke","text-size":{"stops":[[2.99,0],[3,10],[6,14],[13.99,20],[14,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[2.99,0],[3,10],[6,14],[13.99,20],[14,0]]}}},{"id":"place_label_town","source":"mapbox","source-layer":"place_label","filter":{"type":"town","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8},"style":{"text-color":"#716656","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{"stops":[[8,10],[11,13],[13,17],[15,22]]}},"style.night":{"text-color":"@text_night","text-halo-width":0.3,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[8,10],[11,13],[13,17],[15,22]]}}},{"id":"place_label_village","source":"mapbox","source-layer":"place_label","filter":{"type":"village","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":22,"text-max-width":8},"style":{"text-color":"#635644","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{"stops":[[8,8],[11,10],[13,14],[15,16],[16,20]]}},"style.night":{"text-color":"@text_night","text-halo-width":0.3,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[8,8],[11,10],[13,14],[15,16],[16,20]]}}},{"id":"place_label_other","source":"mapbox","source-layer":"place_label","filter":{"type":["hamlet","suburb","neighbourhood"],"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":18,"text-max-width":6},"style":{"text-color":"#7d6c55","text-halo-color":"@text_stroke","text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}}},{"id":"road_label_1","source":"mapbox","source-layer":"road_label","filter":{"class":["motorway","main"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_1_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_1_size"}},{"id":"road_label_2","source":"mapbox","source-layer":"road_label","filter":{"class":["street","street_limited"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_2_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_2_size"}},{"id":"road_label_3","source":"mapbox","source-layer":"road_label","filter":{"class":["service","driveway","path"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":14,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_3_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_3_size"}},{"id":"contour_label","source":"mapbox","source-layer":"contour","filter":{"index":[5,10],"$type":"LineString"},"type":"text","render":{"text-path":"curve","text-field":"{ele} m","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":10,"text-max-angle":0.5},"style":{"text-color":"@text","text-halo-color":"@land","text-halo-width":0.3,"text-size":10},"style.night":{"text-color":"@contour_night","text-halo-color":"@land_night","text-halo-width":0.3,"text-size":10}},{"id":"water_label","source":"mapbox","source-layer":"water_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-width":8},"style":{"text-color":"@water_dark","text-halo-color":"rgba(255,255,255,0.75)"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"waterway_label","source":"mapbox","source-layer":"waterway_label","filter":{"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-angle":0.5},"style":{"text-color":"@water_dark","text-halo-width":0.4,"text-halo-color":"@text_stroke"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"poi","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,2]},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style.night":{}},{"id":"poi_label_1-2","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,2],"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":12,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":"@poi_label_1-2_size","text-halo-color":"@land","text-halo-width":0.3},"style.night":{"text-color":"#fff","text-size":"@poi_label_1-2_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":3},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[15.5,0],[15.75,1]]}},"style.night":{"icon-opacity":{"stops":[[15.5,0],[15.75,1]]}}},{"id":"poi_label_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":3,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":11,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":"@poi_label_3_size","text-halo-color":"@land","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,1]]}},"style.night":{"text-color":"#fff","text-size":"@poi_label_3_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,1]]}}},{"id":"poi_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[17.5,0],[17.75,1]]}},"style.night":{"icon-opacity":{"stops":[[17.5,0],[17.75,1]]}}},{"id":"poi_label_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":10,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":10,"text-opacity":{"stops":[[17.5,0],[17.75,1]]},"text-halo-color":"@land","text-halo-width":0.3},"style.night":{"text-color":"#fff","text-size":10,"text-opacity":{"stops":[[17.5,0],[17.75,1]]},"text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_aerodrome","source":"mapbox","source-layer":"poi_label","filter":{"maki":"airport"},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[12,0],[12.25,1]]}},"style.night":{"icon-opacity":{"stops":[[12,0],[12.25,1]]}}}]} \ No newline at end of file diff --git a/test/fixtures/style_parser/fuzz-functions.info.json b/test/fixtures/style_parser/fuzz-functions.info.json new file mode 100644 index 000000000..d545454de --- /dev/null +++ b/test/fixtures/style_parser/fuzz-functions.info.json @@ -0,0 +1,8 @@ +{ + "default": { + "log": [ + [28, "WARNING", "ParseStyle", "stop must have zoom level and value specification"], + [12, "WARNING", "ParseStyle", "function must specify a function type"] + ] + } +} diff --git a/test/fixtures/style_parser/fuzz-functions.style.json b/test/fixtures/style_parser/fuzz-functions.style.json new file mode 100644 index 000000000..a21d1019b --- /dev/null +++ b/test/fixtures/style_parser/fuzz-functions.style.json @@ -0,0 +1 @@ +{"version":3,"sprite":"https://www.mapbox.com/mapbox-gl-styles/sprites/outdoors","glyphs":"https://mapbox.s3.amazonaws.com/gl-glyphs-256/{fontstack}/{range}.pbf","sources":{"mapbox":{"type":"vector","url":"mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5","maxZoom":14}},"constants":{"@river_canal_width":{"stops":[[10,0.5],[11,1],[13,2],[215.0631829347974,3]]},"@stream_width":{"stops":[[12,0.25],[13,0.5],[15,1.5],[17,2]]},"@motorway_width":{"stops":[[4,0],[5,0.5],[7,0.8],[9,-226.76532459808573],[10,-907.3729511670799],[11,2],[12,3],[13,4],[14,6],[15,9],[16,12],[17,14]]},"@motorway_casing_width":{"stops":[[6.5,0.6],[7,0.8],[9,2.8],[10,3],[11,4],[12,5],[13,6.5],[-2.2700181359942917,9],[15,12],[-576.2602715878918,15],[17,17]]},"@motorway_link_width":{"stops":[[11,1.2],[13,2],[15,3],[17]]},"@motorway_link_casing_width":{"stops":[[11,2.8],[13,3.5],[15,5],[17,6]]},"@main_width":{"stops":[[11,1],[12,1.5],[13,2],[14,3],[16,10],[17,12]]},"@main_casing_width":{},"@street_width":{"stops":[[13.5,0],[14,1.5],[15,3],[16,8]]},"@street_casing_width":{"stops":[[12,0.4],[13,1],[14,2.5],[15,-921.8049160360362],[16,10]]},"@street_casing_opacity":{"stops":[[13,0],[13.5,1]]},"@service_casing_width":{"stops":[[13,0.5],[14],[15],[16,4],[17],[18,6]]},"@runway_width":{"stops":[[9,1],[10,2],[11,3],[12,5],[7],[14,11],[15],[16,19],[-523.891732027855,476.553101803853]]},"@taxiway_width":{"stops":[[9,0.2],[11,-978.8929988089656],[12,1],[13,1.5],[14,2],[15,3],[16,4],[17,5]]},"@aerialway_width":{"stops":[[12.5,0.8],[13,1.4],[14,1.6],[15,2],[16,2.4],[17]]},"@aerialway_casing_width":{"stops":[[12.5,2],[13,2.5],[14,3],[686.563868623904,3.5],[16,4],[610.5452241055912,5]]},"@path_width":{"stops":[[13,1.2],[1.5],[15,1.8]]},"@admin_l2_width":{},"@admin_l3_width":{"stops":[[5,0.6],[7],[11,2]]},"@road_label_1_size":{"stops":[[-36.887448781534545,11],[13,12],[14,13],[15,14],[16,16],[17,18]]},"@road_label_2_size":{"stops":[[12,11],[-836.4470306284845,133.3541419127048],[15,14],[17,16]]},"@road_label_3_size":{"stops":[[14,75.34026277711928],[15,12],[17,14]]},"@fence_width":{"stops":[[16,0.6],[439.0131328469847,1]]},"@hedge_width":{},"@barrier_line_land_width":{},"@country_label_size":{"stops":[[0,14],[11,24]]},"@poi_label_1-2_size":{"stops":[[14,-446.474946114801],[15,11],[16]]},"@poi_label_3_size":{"stops":[[15,10],[16,11]]}},"layers":[{"id":"background","type":"background","style":{"background-color":"@land"},"style.night":{"background-color":"@land_night"}},{"id":"landcover_snow","source":"mapbox","source-layer":"landcover","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{"fill-color":"@snow_night"}},{"id":"landcover_crop","source":"mapbox","source-layer":"landcover","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night"}},{"id":"landcover_grass","source":"mapbox","source-layer":"landcover","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@grass_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landcover_scrub","source":"mapbox","source-layer":"landcover","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@scrub_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landcover_wood","source":"mapbox","source-layer":"landcover","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@wood_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landuse_wood","source":"mapbox","source-layer":"landuse","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood"},"style.night":{"fill-color":"@wood_night","fill-opacity":0.8}},{"id":"landuse_school","source":"mapbox","source-layer":"landuse","filter":{"class":"school"},"type":"fill","style":{"fill-color":"@school"},"style.night":{"fill-color":"@school_night"}},{"id":"landuse_sand","source":"mapbox","source-layer":"landuse","filter":{"class":"sand"},"type":"fill","style":{"fill-color":"@sand"},"style.night":{"fill-color":"@sand_night","fill-opacity":0.8}},{"id":"landuse_pitch","source":"mapbox","source-layer":"landuse","filter":{"class":"pitch"},"type":"fill","style":{"fill-color":"rgba(255,255,255,0.5)","fill-outline-color":"@pitch"},"style.night":{"fill-color":"@pitch_night","fill-outline-color":"@pitch"}},{"id":"landuse_park","source":"mapbox","source-layer":"landuse","filter":{"class":"park"},"type":"fill","style":{"fill-color":"@park"},"style.night":{"fill-color":"@park_night"}},{"id":"landuse_industrial","source":"mapbox","source-layer":"landuse","filter":{"class":"industrial"},"type":"fill","style":{"fill-color":"rgba(246,250,255,0.5)"},"style.night":{"fill-color":"@builtup_night"}},{"id":"landuse_scrub","source":"mapbox","source-layer":"landuse","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub"},"style.night":{"fill-color":"@scrub_night","fill-opacity":0.8}},{"id":"landuse_grass","source":"mapbox","source-layer":"landuse","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass"},"style.night":{"fill-color":"@grass_night","fill-opacity":0.8}},{"id":"landuse_crop","source":"mapbox","source-layer":"landuse","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night","fill-opacity":0.8}},{"id":"landuse_rock","source":"mapbox","source-layer":"landuse","filter":{"class":"rock"},"type":"fill","style":{"fill-color":"@rock"},"style.night":{"fill-color":"@rock_night","fill-opacity":0.8}},{"id":"landuse_snow","source":"mapbox","source-layer":"landuse","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{"fill-color":"@snow_night","fill-opacity":0.8}},{"id":"landuse_hospital","source":"mapbox","source-layer":"landuse","filter":{"class":"hospital"},"type":"fill","style":{"fill-color":"@hospital"},"style.night":{"fill-color":"@hospital_night"}},{"id":"landuse_cemetery","source":"mapbox","source-layer":"landuse","filter":{"class":"cemetery"},"type":"fill","style":{"fill-color":"@cemetery"},"style.night":{"fill-color":"@cemetery_night"}},{"id":"overlay_wetland","source":"mapbox","source-layer":"landuse_overlay","filter":{"class":["wetland","wetland_noveg"]},"type":"fill","style":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"},"style.night":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"}},{"id":"overlay_breakwater_pier","source":"mapbox","source-layer":"landuse_overlay","filter":{"class":["breakwater","pier"]},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"waterway_river_canal","source":"mapbox","source-layer":"waterway","filter":{"type":["river","canal"]},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@river_canal_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@river_canal_width"}},{"id":"waterway_stream","source":"mapbox","source-layer":"waterway","filter":{"type":"stream"},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@stream_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@stream_width"}},{"id":"building_shadow","source":"mapbox","source-layer":"building","type":"fill","style":{"fill-color":"#d5d1c6","fill-translate":[1,1],"fill-opacity":{"stops":[[15.5,0],[16,1]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#026688","fill-translate":[1,1],"fill-opacity":{"stops":[[15.5,0],[16,1]]},"fill-outline-color":"#026688"}},{"id":"building","ref":"building_shadow","style":{"fill-color":"#ebe7db"},"style.night":{"fill-color":"#027797"}},{"id":"building_wall","ref":"building_shadow","style":{"fill-color":"#ebe7db","fill-opacity":{"stops":[[15.5,0],[16,0.7]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#027797","fill-opacity":{"stops":[[15.5,0],[16,0.7]]},"fill-outline-color":"#026688"}},{"id":"hillshade_full_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#fffff3","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17,0.2],[18,0.1]]}},"style.night":{"fill-color":"#fdfdad","fill-antialias":false,"fill-opacity":{"stops":[[13,0.4],[14,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"hillshade_medium_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"medium_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#ffd","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17,0.2],[18,0.1]]}},"style.night":{"fill-color":"#ffe1b7","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[16,0.2],[17,0.15],[18,0.05]]}}},{"id":"hillshade_medium_shadow","source":"mapbox","source-layer":"hillshade","filter":{"class":"medium_shadow"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[15,0.075],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[15,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"hillshade_full_shadow","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_shadow"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[15,0.075],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[15,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"contour_line_loud","source":"mapbox","source-layer":"contour","filter":{"index":5},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#008","line-width":0.9,"line-opacity":{"stops":[[11,0.05],[12,0.11]]}},"style.night":{"line-color":"@contour_night","line-width":0.9,"line-opacity":{"stops":[[11,0.1],[12,0.2]]}}},{"id":"contour_line_regular","source":"mapbox","source-layer":"contour","type":"line","render":{"line-join":"round"},"style":{"line-color":"#008","line-width":0.5,"line-opacity":{"stops":[[11,0.05],[12,0.11]]}},"style.night":{"line-color":"@contour_night","line-width":0.5,"line-opacity":{"stops":[[11,0.1],[12,0.4]]}}},{"id":"barrier_line_gate","source":"mapbox","source-layer":"barrier_line","filter":{"class":"gate"},"type":"line","style":{"line-width":2.5,"line-color":"#aab"},"style.night":{"line-width":2.5,"line-color":"#59596f"}},{"id":"barrier_line_fence","source":"mapbox","source-layer":"barrier_line","filter":{"class":"fence"},"type":"line","style":{"line-color":"#aeada3","line-width":"@fence_width"},"style.night":{"line-color":"#014b61","line-width":"@fence_width"}},{"id":"barrier_line_hedge","source":"mapbox","source-layer":"barrier_line","filter":{"class":"hedge"},"type":"line","style":{"line-color":"#8de99b","line-width":"@hedge_width"},"style.night":{"line-color":"#2e7a57","line-width":"@hedge_width"}},{"id":"barrier_line_land","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"line","style":{"line-color":"@land","line-width":"@barrier_line_land_width"},"style.night":{"line-color":"@land_night","line-width":"@barrier_line_land_width"}},{"id":"barrier_line_land_fill","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"barrier_line_cliff","source":"mapbox","source-layer":"barrier_line","filter":{"class":"cliff"},"type":"line","style":{"line-color":"#987","line-width":4},"style.night":{"line-color":"#63574b","line-width":4}},{"id":"water","source":"mapbox","source-layer":"water","type":"fill","style":{"fill-color":"@water","fill-outline-color":"#a2bdc0"},"style.night":{"fill-color":"@water_night","fill-outline-color":"@water_dark_night"}},{"id":"aeroway_fill","source":"mapbox","source-layer":"aeroway","type":"fill","style":{"fill-color":"#ddd"},"style.night":{"fill-color":"#367"}},{"id":"aeroway_runway","source":"mapbox","source-layer":"aeroway","filter":{"type":"runway"},"type":"line","style":{"line-color":"#ddd","line-width":"@runway_width"},"style.night":{"line-color":"#367","line-width":"@runway_width"}},{"id":"aeroway_taxiway","source":"mapbox","source-layer":"aeroway","filter":{"type":"taxiway"},"type":"line","style":{"line-color":"#ddd","line-width":"@taxiway_width"},"style.night":{"line-color":"#367","line-width":"@taxiway_width"}},{"id":"tunnel_motorway_link_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"}},{"id":"tunnel_service_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"service"},"type":"line","style":{"line-color":"#000","line-opacity":0.04,"line-dasharray":[6,6],"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-dasharray":[6,6],"line-width":"@service_casing_width"}},{"id":"tunnel_main_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"tunnel_street_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":["street","street_limited"]},"type":"line","style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"tunnel_motorway_link","ref":"tunnel_motorway_link_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_link_width"},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_link_width"}},{"id":"tunnel_service","ref":"tunnel_service_casing","style":{"line-color":"#e6cec7","line-width":2},"style.night":{"line-color":"#017ca0","line-width":2}},{"id":"tunnel_street","ref":"tunnel_street_casing","style":{"line-color":"#d9d5c6","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"tunnel_main","ref":"tunnel_main_casing","style":{"line-color":"#e6cec7","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"#78b0c1","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"tunnel_motorway_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"tunnel_motorway","ref":"tunnel_motorway_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_path_case","source":"mapbox","source-layer":"road","filter":{"class":"path"},"type":"line","style":{"line-color":"#ffd","line-opacity":0.4,"line-width":{"stops":[[14,3],[15,4]]}},"style.night":{"line-color":"@land_night","line-opacity":0.2}},{"id":"road_path_footway","source":"mapbox","source-layer":"bridge","filter":{"type":"footway"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"#fff","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_path","source":"mapbox","source-layer":"bridge","filter":{"type":"path"},"type":"line","style":{"line-color":"#987","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,0.8],[14,0.9],[15,1.2]]}},"style.night":{"line-color":"#fff","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,0.8],[14,0.9],[15,1.2]]}}},{"id":"road_path_cycleway","source":"mapbox","source-layer":"bridge","filter":{"type":"cycleway"},"type":"line","style":{"line-color":"#488","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_mtb","source":"mapbox","source-layer":"bridge","filter":{"type":"mtb"},"type":"line","style":{"line-color":"#488","line-dasharray":[12,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[12,4],"line-width":"@path_width"}},{"id":"road_path_piste","source":"mapbox","source-layer":"bridge","filter":{"type":"piste"},"type":"line","style":{"line-color":"#87b","line-dasharray":[8,4],"line-width":"@path_width"},"style.night":{"line-color":"#715dae","line-dasharray":[8,4],"line-width":"@path_width"}},{"id":"road_path_steps","source":"mapbox","source-layer":"bridge","filter":{"type":"steps"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4],"line-width":4},"style.night":{"line-color":"#016684","line-dasharray":[10,4],"line-opacity":0.3,"line-width":6}},{"id":"road_major_rail","source":"mapbox","source-layer":"bridge","filter":{"class":"major_rail"},"type":"line","style":{"line-color":"#c8c4c0","line-width":0.8},"style.night":{"line-color":"#c8c4c0","line-width":0.8}},{"id":"road_motorway_link_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway_link"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"road_service_casing","source":"mapbox","source-layer":"road","filter":{"class":"service"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"road_main_casing","source":"mapbox","source-layer":"road","filter":{"class":"main"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"road_street_casing","source":"mapbox","source-layer":"road","filter":{"class":["street","street_limited"]},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"road_motorway_link","ref":"road_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_link_width"}},{"id":"road_service","ref":"road_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_night","line-width":2}},{"id":"road_street","ref":"road_street_casing","style":{"line-color":"@street","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"road_main","ref":"road_main_casing","style":{"line-color":"@main","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_motorway_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"road_motorway","ref":"road_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_major_rail_hatching","ref":"road_major_rail","style":{"line-color":"#c8c4c0","line-dasharray":[2,31],"line-width":5},"style.night":{"line-color":"#c8c4c0","line-dasharray":[2,31],"line-width":5}},{"id":"bridge_motorway_link_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"bridge_service_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"service"},"type":"line","style":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"bridge_main_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"bridge_street_casing","source":"mapbox","source-layer":"bridge","filter":{"class":["street","street_limited"]},"type":"line","style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"bridge_motorway_link","ref":"bridge_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_link_width"}},{"id":"bridge_service","ref":"bridge_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_night","line-width":2}},{"id":"bridge_street","ref":"bridge_street_casing","style":{"line-color":"@street","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"bridge_main","ref":"bridge_main_casing","style":{"line-color":"@main","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"bridge_motorway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"bridge_motorway","ref":"bridge_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"bridge_aerialway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"aerialway"},"type":"line","style":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"},"style.night":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"}},{"id":"bridge_aerialway","ref":"bridge_aerialway_casing","style":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"},"style.night":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"}},{"id":"admin_l3","source":"mapbox","source-layer":"admin","filter":{"admin_level":[3,4,5]},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#88a","line-dasharray":[60,20],"line-opacity":{"stops":[[3,0],[5,1]]},"line-width":"@admin_l3_width"},"style.night":{"line-color":"@admin_night","line-dasharray":[60,20],"line-opacity":{"stops":[[3,0],[5,1]]},"line-width":"@admin_l3_width"}},{"id":"admin_l2","source":"mapbox","source-layer":"admin","filter":{"admin_level":2},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#88a","line-width":"@admin_l2_width"},"style.night":{"line-color":"@admin_night","line-width":"@admin_l2_width"}},{"id":"admin_maritime_cover","source":"mapbox","source-layer":"admin","filter":{"maritime":1},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@water","line-width":5},"style.night":{"line-color":"@water_night","line-width":5}},{"id":"admin_maritime","ref":"admin_maritime_cover","style":{"line-color":"#c0d6d6","line-width":{"stops":[[5,1],[7,2],[11,3]]}},"style.night":{"line-color":"#0a1347","line-width":{"stops":[[5,1],[7,2],[11,3]]}}},{"id":"country_label_line","source":"mapbox","source-layer":"country_label_line","type":"line","render":{"text-max-width":5},"style":{"line-color":"@country_text","line-width":0.5,"line-opacity":0.5},"style.night":{"line-color":"@text_night","line-width":0.5,"line-opacity":0.5}},{"id":"country_label","source":"mapbox","source-layer":"country_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":5},"style":{"text-color":"@country_text","text-halo-color":"rgba(255,255,255,0.5)","text-halo-width":0.5,"text-size":"@country_label_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.4,"text-size":"@country_label_size"}},{"id":"marine_label_line_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":30,"text-max-angle":0.5,"text-letter-spacing":0.4},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":3},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":30,"text-max-width":8,"text-letter-spacing":0.4,"text-line-height":2},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8,"text-letter-spacing":0.2,"text-line-height":1.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":3},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.3},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.2},"style":{"text-color":"@marine_text","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water_night"}},{"id":"state_label","source":"mapbox","source-layer":"state_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-width":8},"style":{"text-color":"#333","text-halo-width":0.4,"text-halo-color":"rgba(244,239,225,0.8)","text-size":{"stops":[[2.99,0],[3,10],[8.99,16],[9,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-halo-color":"@land_night","text-size":{"stops":[[2.99,0],[3,10],[8.99,16],[9,0]]}}},{"id":"place_label_city","source":"mapbox","source-layer":"place_label","filter":{"type":"city","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":20,"text-max-width":8},"style":{"text-color":"#444","text-halo-width":0.4,"text-halo-color":"@text_stroke","text-size":{"stops":[[2.99,0],[3,10],[6,14],[13.99,20],[14,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[2.99,0],[3,10],[6,14],[13.99,20],[14,0]]}}},{"id":"place_label_town","source":"mapbox","source-layer":"place_label","filter":{"type":"town","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8},"style":{"text-color":"#716656","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{"stops":[[8,10],[11,13],[13,17],[15,22]]}},"style.night":{"text-color":"@text_night","text-halo-width":0.3,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[8,10],[11,13],[13,17],[15,22]]}}},{"id":"place_label_village","source":"mapbox","source-layer":"place_label","filter":{"type":"village","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":22,"text-max-width":8},"style":{"text-color":"#635644","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{"stops":[[8,8],[11,10],[13,14],[15,16],[16,20]]}},"style.night":{"text-color":"@text_night","text-halo-width":0.3,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[8,8],[11,10],[13,14],[15,16],[16,20]]}}},{"id":"place_label_other","source":"mapbox","source-layer":"place_label","filter":{"type":["hamlet","suburb","neighbourhood"],"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":18,"text-max-width":6},"style":{"text-color":"#7d6c55","text-halo-color":"@text_stroke","text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}}},{"id":"road_label_1","source":"mapbox","source-layer":"road_label","filter":{"class":["motorway","main"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_1_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_1_size"}},{"id":"road_label_2","source":"mapbox","source-layer":"road_label","filter":{"class":["street","street_limited"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_2_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_2_size"}},{"id":"road_label_3","source":"mapbox","source-layer":"road_label","filter":{"class":["service","driveway","path"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":14,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_3_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_3_size"}},{"id":"contour_label","source":"mapbox","source-layer":"contour","filter":{"index":[5,10],"$type":"LineString"},"type":"text","render":{"text-path":"curve","text-field":"{ele} m","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":10,"text-max-angle":0.5},"style":{"text-color":"@text","text-halo-color":"@land","text-halo-width":0.3,"text-size":10},"style.night":{"text-color":"@contour_night","text-halo-color":"@land_night","text-halo-width":0.3,"text-size":10}},{"id":"water_label","source":"mapbox","source-layer":"water_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-width":8},"style":{"text-color":"@water_dark","text-halo-color":"rgba(255,255,255,0.75)"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"waterway_label","source":"mapbox","source-layer":"waterway_label","filter":{"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-angle":0.5},"style":{"text-color":"@water_dark","text-halo-width":0.4,"text-halo-color":"@text_stroke"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"poi","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,2]},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style.night":{}},{"id":"poi_label_1-2","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,2],"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":12,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":"@poi_label_1-2_size","text-halo-color":"@land","text-halo-width":0.3},"style.night":{"text-color":"#fff","text-size":"@poi_label_1-2_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":3},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[15.5,0],[15.75,1]]}},"style.night":{"icon-opacity":{"stops":[[15.5,0],[15.75,1]]}}},{"id":"poi_label_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":3,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":11,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":"@poi_label_3_size","text-halo-color":"@land","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,1]]}},"style.night":{"text-color":"#fff","text-size":"@poi_label_3_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,1]]}}},{"id":"poi_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[17.5,0],[17.75,1]]}},"style.night":{"icon-opacity":{"stops":[[17.5,0],[17.75,1]]}}},{"id":"poi_label_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":10,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":10,"text-opacity":{"stops":[[17.5,0],[17.75,1]]},"text-halo-color":"@land","text-halo-width":0.3},"style.night":{"text-color":"#fff","text-size":10,"text-opacity":{"stops":[[17.5,0],[17.75,1]]},"text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_aerodrome","source":"mapbox","source-layer":"poi_label","filter":{"maki":"airport"},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[12,0],[12.25,1]]}},"style.night":{"icon-opacity":{"stops":[[12,0],[12.25,1]]}}}]} \ No newline at end of file diff --git a/test/fixtures/style_parser/fuzz-layers.info.json b/test/fixtures/style_parser/fuzz-layers.info.json new file mode 100644 index 000000000..8cf25752d --- /dev/null +++ b/test/fixtures/style_parser/fuzz-layers.info.json @@ -0,0 +1,11 @@ +{ + "default": { + "log": [ + [20, "WARNING", "ParseStyle", "stop must have zoom level and value specification"], + [6, "WARNING", "ParseStyle", "function must specify a function type"], + [1, "WARNING", "ParseStyle", "value of 'line-width' must be a number, or a number function"], + [1, "WARNING", "ParseStyle", "array value has unexpected number of elements"], + [1, "WARNING", "ParseStyle", "value of 'line-opacity' must be a number, or a number function"] + ] + } +} diff --git a/test/fixtures/style_parser/fuzz-layers.style.json b/test/fixtures/style_parser/fuzz-layers.style.json new file mode 100644 index 000000000..4e749bac7 --- /dev/null +++ b/test/fixtures/style_parser/fuzz-layers.style.json @@ -0,0 +1 @@ +{"version":3,"sprite":"https://www.mapbox.com/mapbox-gl-styles/sprites/outdoors","glyphs":"https://mapbox.s3.amazonaws.com/gl-glyphs-256/{fontstack}/{range}.pbf","sources":{"mapbox":{"type":"vector","url":"mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5","maxZoom":14}},"constants":{"@land":"rgb(244,239,225)","@water":"#cdd","@water_dark":"#185869","@crop":"#eeeed4","@grass":"#e6e6cc","@scrub":"#dfe5c8","@wood":"#cee2bd","@snow":"#f4f8ff","@rock":"#ddd","@sand":"#ffd","@cemetery":"#edf4ed","@pitch":"#fff","@park":"#d4e4bc","@piste":"blue","@school":"#e8dfe0","@hospital":"#f8eee0","@builtup":"#f6faff","@case":"#fff","@motorway":"#cda0a0","@main":"#ddc0b9","@street":"#fff","@text":"#666","@text_stroke":"rgba(255,255,255,0.8)","@country_text":"#222","@marine_text":"#a0bdc0","@water_text":"#185869","@land_night":"#017293","@water_night":"#103","@water_dark_night":"#003366","@crop_night":"#178d96","@grass_night":"#23948a","@scrub_night":"#31a186","@wood_night":"#45b581","@park_night":"#51bd8b","@snow_night":"#5ad9fe","@rock_night":"#999","@sand_night":"#437162","@cemetery_night":"#218c96","@pitch_night":"rgba(255,255,255,0.2)","@school_night":"#01536a","@hospital_night":"#015e7a","@builtup_night":"#014b60","@admin_night":"#ffb680","@text_night":"#fff","@text_water_night":"#2a5b8a","@text_stroke_night":"#103","@text2_stroke_night":"rgba(1,69,89,0.8)","@case_night":"#015e7a","@street_case_night":"#015b76","@motorway_night":"#bbdde7","@main_night":"#64b2c9","@street_night":"#0186ac","@contour_night":"#ffff80","@river_canal_width":{"stops":[[10,0.5],[11,1],[13,2],[15,3]]},"@stream_width":{"stops":[[12,0.25],[13,0.5],[15,1.5],[17,2]]},"@motorway_width":{"stops":[[4,0],[5,0.5],[7,0.8],[9,1],[10,1.2],[11,2],[12,3],[13,4],[14,6],[15,9],[16,12],[17,14]]},"@motorway_casing_width":{"stops":[[6.5,0.6],[7,0.8],[9,2.8],[10,3],[11,4],[12,5],[13,6.5],[14,9],[15,12],[16,15],[17,17]]},"@motorway_link_width":{"stops":[[11,1.2],[13,2],[15,3],[17,4]]},"@motorway_link_casing_width":{"stops":[[11,2.8],[13,3.5],[15,5],[17,6]]},"@main_width":{"stops":[[4,1],[11,1],[12,1.5],[13,2],[14,3],[15,6],[16,10],[17,12]]},"@main_casing_width":{"stops":[[8,2.9],[11,2.9],[12,3.5],[13,4],[14,5.5],[15,9],[16,12],[17,14]]},"@street_width":{"stops":[[13.5,0],[14,1.5],[15,3],[16,8]]},"@street_casing_width":{"stops":[[12,0.4],[13,1],[14,2.5],[15,4],[16,10]]},"@street_casing_opacity":{"stops":[[13,0],[13.5,1]]},"@service_casing_width":{"stops":[[13,0.5],[14,3],[15,3.5],[16,4],[17,5],[18,6]]},"@runway_width":{"stops":[[9,1],[10,2],[11,3],[12,5],[13,7],[14,11],[15,15],[16,19],[17,23]]},"@taxiway_width":{"stops":[[9,0.2],[11,0.2],[12,1],[13,1.5],[14,2],[15,3],[16,4],[17,5]]},"@aerialway_width":{"stops":[[12.5,0.8],[13,1.4],[14,1.6],[15,2],[16,2.4],[17,3]]},"@aerialway_casing_width":{"stops":[[12.5,2],[13,2.5],[14,3],[15,3.5],[16,4],[21,5]]},"@path_width":{"stops":[[13,1.2],[14,1.5],[15,1.8]]},"@admin_l2_width":{"stops":[[1,0.5],[2,0.7],[3,0.7],[4,0.8],[5,1],[7,2],[9,3]]},"@admin_l3_width":{"stops":[[5,0.6],[7,1],[11,2]]},"@road_label_1_size":{"stops":[[12,11],[13,12],[14,13],[15,14],[16,16],[17,18]]},"@road_label_2_size":{"stops":[[12,11],[13,12],[15,14],[17,16]]},"@road_label_3_size":{"stops":[[14,10],[15,12],[17,14]]},"@fence_width":{"stops":[[16,0.6],[18,1]]},"@hedge_width":{"stops":[[15,0.6],[16,1.2],[18,1.6]]},"@barrier_line_land_width":{"stops":[[13,0.4],[14,0.75],[15,1.5],[16,3],[17,6],[18,12],[19,24],[20,48]]},"@country_label_size":{"stops":[[0,14],[11,24]]},"@poi_label_1-2_size":{"stops":[[14,10],[15,11],[16,12]]},"@poi_label_3_size":{"stops":[[15,10],[16,11]]},"@hillshade_rasterize":{"enabled":{"stops":[[10,false],[11,true]]},"size":{"stops":[[10,1024],[11,512],[12,256]]},"blur":1}},"layers":[{"id":"background","type":"background","style":{"background-color":"@land"},"style.night":{"background-color":"@land_night"}},{"id":"landcover_snow","source":"mapbox","source-layer":"landcover","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{}},{"id":"landcover_crop","source":"mapbox","source-layer":"landcover","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night"}},{"id":"landcover_grass","source":"mapbox","source-layer":"landcover","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass","fill-opacity":{"stops":[[12,1],[13,0.8],[0.2]]}},"style.night":{"fill-color":"@grass_night","fill-opacity":{}}},{"id":"landcover_scrub","source":"mapbox","source-layer":"landcover","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub","fill-opacity":{"stops":[[12,1],[13,0.8],[16,-651.2916111752218]]}},"style.night":{"fill-color":"@scrub_night","fill-opacity":{"stops":[[12,1],[16,0.2]]}}},{"id":"landcover_wood","source":"mapbox","source-layer":"landcover","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood","fill-opacity":{"stops":[[12,379.53230217280634],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@wood_night","fill-opacity":{"stops":[[13,0.8],[-470.1907977840525,0.2]]}}},{"id":"landuse_wood","source":"mapbox","source-layer":"landuse","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood"},"style.night":{"fill-color":"@wood_night","fill-opacity":0.8}},{"id":"landuse_school","source":"mapbox","source-layer":"landuse","filter":{"class":"school"},"type":"fill","style":{"fill-color":"@school"},"style.night":{"fill-color":"@school_night"}},{"id":"landuse_sand","source":"mapbox","source-layer":"landuse","filter":{"class":"sand"},"type":"fill","style":{"fill-color":"@sand"},"style.night":{"fill-color":"@sand_night","fill-opacity":0.8}},{"id":"landuse_pitch","source":"mapbox","source-layer":"landuse","filter":{"class":"pitch"},"type":"fill","style":{"fill-color":"rgba(255,255,255,0.5)","fill-outline-color":"@pitch"},"style.night":{"fill-color":"@pitch_night","fill-outline-color":"@pitch"}},{"id":"landuse_park","source":"mapbox","source-layer":"landuse","filter":{"class":"park"},"type":"fill","style":{},"style.night":{"fill-color":"@park_night"}},{"id":"landuse_industrial","source":"mapbox","source-layer":"landuse","filter":{"class":"industrial"},"type":"fill","style":{"fill-color":"rgba(246,250,255,0.5)"},"style.night":{"fill-color":"@builtup_night"}},{"id":"landuse_scrub","source":"mapbox","source-layer":"landuse","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub"},"style.night":{"fill-color":"@scrub_night","fill-opacity":0.8}},{"id":"landuse_grass","source":"mapbox","source-layer":"landuse","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass"},"style.night":{"fill-opacity":0.8}},{"id":"landuse_crop","source":"mapbox","source-layer":"landuse","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night","fill-opacity":0.8}},{"id":"landuse_rock","source":"mapbox","source-layer":"landuse","filter":{"class":"rock"},"type":"fill","style":{"fill-color":"@rock"},"style.night":{"fill-color":"@rock_night","fill-opacity":0.8}},{"id":"landuse_snow","source":"mapbox","source-layer":"landuse","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{"fill-color":"@snow_night","fill-opacity":0.8}},{"id":"landuse_hospital","source":"mapbox","source-layer":"landuse","filter":{"class":"hospital"},"type":"fill","style":{"fill-color":"@hospital"},"style.night":{"fill-color":"@hospital_night"}},{"id":"landuse_cemetery","source":"mapbox","source-layer":"landuse","filter":{"class":"cemetery"},"type":"fill","style":{"fill-color":"@cemetery"},"style.night":{"fill-color":"@cemetery_night"}},{"id":"overlay_wetland","source":"mapbox","source-layer":"landuse_overlay","filter":{},"type":"fill","style":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"},"style.night":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"}},{"id":"overlay_breakwater_pier","source":"mapbox","source-layer":"landuse_overlay","filter":{"class":["pier"]},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"waterway_river_canal","source":"mapbox","source-layer":"waterway","filter":{"type":["river","canal"]},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@river_canal_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@river_canal_width"}},{"id":"waterway_stream","source":"mapbox","source-layer":"waterway","filter":{"type":"stream"},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@stream_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@stream_width"}},{"id":"building_shadow","source":"mapbox","source-layer":"building","type":"fill","style":{"fill-color":"#d5d1c6","fill-translate":[1,1],"fill-opacity":{"stops":[[15.5,0],[16,1]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#026688","fill-translate":[52.26142580813007,1],"fill-opacity":{"stops":[[15.5,508.5668652038494],[16,1]]},"fill-outline-color":"#026688"}},{"id":"building","ref":"building_shadow","style":{"fill-color":"#ebe7db"},"style.night":{"fill-color":"#027797"}},{"id":"building_wall","ref":"building_shadow","style":{"fill-color":"#ebe7db","fill-opacity":{"stops":[[716.8232720817857,0],[16,0.7]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#027797","fill-opacity":{},"fill-outline-color":"#026688"}},{"id":"hillshade_full_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#fffff3","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17],[18,0.1]]}},"style.night":{"fill-color":"dadfdf#","fill-antialias":false,"fill-opacity":{"stops":[[13,0.4],[14,160.68355704123093],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"hillshade_medium_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"medium_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#ffd","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17,0.2],[18,0.1]]}},"style.night":{"fill-color":"#ffe153KNb","fill-antialias":false,"fill-opacity":{"stops":[[14],[16,0.2],[17,0.15],[-156.9280405708529,0.05]]}}},{"id":"hillshade_medium_shadow","source":"mapbox","source-layer":"hillshade","filter":{},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[17,0.1],[16,0.2],[15,0.3]]}}},{"id":"hillshade_full_shadow","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_shadow"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[15,-573.6923878637594],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[15,0.3],[147.1643195091665,0.2],[17,0.1],[18,0.05]]}}},{"id":"contour_line_loud","source":"mapbox","source-layer":"contour","filter":{"index":5},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#008","line-width":0.9,"line-opacity":{"stops":[[0.05]]}},"style.night":{"line-color":"@contour_night","line-width":0.9,"line-opacity":{"stops":[[11,0.1],[12,-245.67758580137087]]}}},{"id":"contour_line_regular","source":"mapbox","source-layer":"contour","type":"line","render":{"line-join":"round"},"style":{"line-color":"#0b9R08","line-width":0.5,"line-opacity":{"stops":[[11,0.05],[12,0.11]]}},"style.night":{"line-color":"@contour_night","line-width":0.5,"line-opacity":{"stops":[[11,0.1],[12,0.4]]}}},{"id":"barrier_line_gate","source":"mapbox","source-layer":"barrier_line","filter":{"class":"gate"},"type":"line","style":{"line-width":2.5,"line-color":"#aab"},"style.night":{"line-width":2.5,"line-color":"#59596f"}},{"id":"barrier_line_fence","source":"mapbox","source-layer":"barrier_line","filter":{"class":"fence"},"type":"line","style":{"line-color":"#aeada3","line-width":"@fence_width"},"style.night":{"line-color":"#014b61","line-width":"@fence_width"}},{"id":"barrier_line_hedge","source":"mapbox","source-layer":"barrier_line","filter":{"class":"hedge"},"type":"line","style":{"line-color":"#8de99b","line-width":"@hedge_width"},"style.night":{"line-color":"#2e7a57","line-width":"@hedge_width"}},{"id":"barrier_line_land","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"line","style":{"line-color":"@land","line-width":"@barrier_line_land_width"},"style.night":{"line-color":"@land_night","line-width":"@barrier_line_land_width"}},{"id":"barrier_line_land_fill","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"barrier_line_cliff","source":"mapbox","source-layer":"barrier_line","filter":{"class":"cliff"},"type":"line","style":{"line-color":"#987","line-width":4},"style.night":{"line-color":"#63574b","line-width":4}},{"id":"water","source":"mapbox","source-layer":"water","type":"fill","style":{"fill-color":"@water","fill-outline-color":"#a2bdc0"},"style.night":{"fill-color":"@water_night","fill-outline-color":"@water_dark_night"}},{"id":"aeroway_fill","source":"mapbox","source-layer":"aeroway","type":"fill","style":{"fill-color":"#ddd"},"style.night":{"fill-color":"#367"}},{"id":"aeroway_runway","source":"mapbox","source-layer":"aeroway","filter":{"type":"runway"},"type":"line","style":{"line-color":"#ddd","line-width":"@runway_width"},"style.night":{"line-color":"#367","line-width":"@runway_width"}},{"id":"aeroway_taxiway","source":"mapbox","source-layer":"aeroway","filter":{"type":"taxiway"},"type":"line","style":{"line-color":"#ddd","line-width":"@taxiway_width"},"style.night":{"line-color":"#367"}},{"id":"tunnel_motorway_link_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"}},{"id":"tunnel_service_casing","source":"mapbox","source-layer":"tunnel","filter":{},"type":"line","style":{"line-opacity":0.04,"line-dasharray":[6,6],"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-dasharray":[6,6],"line-width":"@service_casing_width"}},{"id":"tunnel_main_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9]]}}},{"id":"tunnel_street_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":["stowptm9reet","street_limited"]},"type":"line","style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"tunnel_motorway_link","ref":"tunnel_motorway_link_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_link_width"},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_link_width"}},{"id":"tunnel_service","ref":"tunnel_service_casing","style":{"line-color":"#e6cec7","line-width":2},"style.night":{"line-color":"#017ca0","line-width":2}},{"id":"tunnel_street","ref":"tunnel_street_casing","style":{"line-color":"#d9d5c6","line-width":"@street_wid"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"tunnel_main","ref":"tunnel_main_casing","style":{"line-color":"#e6cec7","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"tunnel_motorway_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,403.0451750836803],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,486.40202701692624],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"tunnel_motorway","ref":"tunnel_motorway_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_width","line-opacity":{"stops":[[5.5],[6,1]]}}},{"id":"road_path_case","source":"mapbox","source-layer":"road","filter":{},"type":"line","style":{"line-opacity":0.4,"line-width":{"stops":[[14,3],[-240.2494063220447,4]]}},"style.night":{"line-color":"@land_night","line-opacity":-423.34438620169504}},{"id":"road_path_footway","source":"mapbox","source-layer":"bridge","filter":{"type":"footway"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"fUDff#","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_path","source":"mapbox","source-layer":"bridge","filter":{},"type":"line","style":{"line-color":"#987","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,0.8],[14,0.9],[15,1.2]]}},"style.night":{"line-color":"#","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,-901.4321643252003],[0.9],[612.8711228768491,1.2]]}}},{"id":"road_path_cycleway","source":"mapbox","source-layer":"bridge","filter":{"type":"cycleway"},"type":"line","style":{"line-color":"#488","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_mtb","source":"mapbox","source-layer":"bridge","filter":{"type":"mtb"},"type":"line","style":{"line-color":"#488","line-dasharray":[12,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[12,4],"line-width":"@path_width"}},{"id":"road_path_piste","source":"mapbox","source-layer":"bridge","filter":{"type":"piste"},"type":"line","style":{"line-color":"#87b","line-dasharray":[252.95689298416255,4],"line-width":"@path_width"},"style.night":{"line-color":"#715dae","line-dasharray":[8,4],"line-width":"@path_width"}},{"id":"road_path_steps","source":"mapbox","source-layer":"bridge","filter":{"type":"steps"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4]},"style.night":{"line-color":"#016684","line-dasharray":[4.284387809206692,4],"line-opacity":-233.09888909380237,"line-width":6}},{"id":"road_major_rail","source":"mapbox","source-layer":"bridge","filter":{"class":"major_rail"},"type":"line","style":{"line-color":"#c8c4c0","line-width":0.8},"style.night":{"line-color":"#c8c4c0","line-width":0.8}},{"id":"road_motorway_link_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway_link"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"road_service_casing","source":"mapbox","source-layer":"road","filter":{},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"road_main_casing","source":"mapbox","source-layer":"road","filter":{"class":"main"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8],[9,1]]}}},{"id":"road_street_casing","source":"mapbox","source-layer":"road","filter":{"class":["street","street_limited"]},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"road_motorway_link","ref":"road_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-width":"@motorway_link_width"}},{"id":"road_service","ref":"road_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_night","line-width":2}},{"id":"road_street","ref":"road_street_casing","style":{"line-width":"@street_width"},"style.night":{"line-color":"@stree","line-width":"@street_width"}},{"id":"road_main","ref":"road_main_casing","style":{"line-color":"@main"},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_motorway_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[-537.367775128165,-706.5904726180052]]}}},{"id":"road_motorway","ref":"road_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,-389.31582571423644],[6,1]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,-621.8493453290761],[6,1]]}}},{"id":"road_major_rail_hatching","ref":"road_major_rail","style":{"line-dasharray":[2],"line-width":482.4848485400844},"style.night":{"line-color":"#c8c4c0","line-dasharray":[2,31],"line-width":5}},{"id":"bridge_motorway_link_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"bridge_service_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"service"},"type":"line","style":{"line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"bridge_main_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-width":"@main_casing_width","line-opacity":{"stops":[[8,733.787231251463],[1]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"bridge_street_casing","source":"mapbox","source-layer":"bridge","filter":{"class":["street","street_limited"]},"type":"line","style":{"line-color":"#d9C1Yfbrd5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"yticapo_gnisac_teerts@"}},{"id":"bridge_motorway_link","ref":"bridge_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_link_width"}},{"id":"bridge_service","ref":"bridge_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_nightqR_xO_LV","line-width":2}},{"id":"bridge_street","ref":"bridge_street_casing","style":{"line-color":"@street","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"bridge_main","ref":"bridge_main_casing","style":{"line-color":"@main","line-width":"@main_width","line-opacity":{}},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[-168.20268950842035,0],[6,1]]}}},{"id":"bridge_motorway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[-648.4032122671647,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9]]}}},{"id":"bridge_motorway","ref":"bridge_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"bridge_aerialway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"aerialway"},"type":"line","style":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"},"style.night":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"}},{"id":"bridge_aerialway","ref":"bridge_aerialway_casing","style":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"},"style.night":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"}},{"id":"admin_l3","source":"mapbox","source-layer":"admin","filter":{"admin_level":[3,4,5]},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#88a","line-dasharray":[60,20],"line-opacity":{"stops":[[3,0],[5,1]]},"line-width":"@admin_l3_width"},"style.night":{"line-color":"@admin_night","line-dasharray":[60,20],"line-opacity":{"stops":[[-751.6265078818424,0],[5,1]]},"line-width":"@admin_l3_width"}},{"id":"admin_l2","source":"mapbox","source-layer":"admin","filter":{"admin_level":103.45629058061809},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#88a","line-width":"@admin_l2_width"},"style.night":{"line-color":"@admin_night","line-width":"@admin_l2_width"}},{"id":"admin_maritime_cover","source":"mapbox","source-layer":"admin","filter":{"maritime":1},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"@w","line-width":5},"style.night":{"line-color":"@water_night","line-width":5}},{"id":"admin_maritime","ref":"admin_maritime_cover","style":{"line-color":"#c0d6d6","line-width":{"stops":[[5,1],[7,2],[11,3]]}},"style.night":{"line-color":"#0a1347","line-width":{"stops":[[5,1],[2],[11,3]]}}},{"id":"country_label_line","source":"mapbox","source-layer":"country_label_line","type":"line","render":{"text-max-width":5},"style":{"line-color":"@country_text","line-width":0.5,"line-opacity":0.5},"style.night":{"line-color":"@text_night","line-width":0.5,"line-opacity":-74.38700251924251}},{"id":"country_label","source":"mapbox","source-layer":"country_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":5},"style":{"text-color":"@country_text","text-halo-color":"rgba(255,255,255,0.5)","text-halo-width":0.5,"text-size":"@country_label_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.4,"text-size":"@country_label_size"}},{"id":"marine_label_line_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":30,"text-max-angle":0.5,"text-letter-spacing":0.4},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,735.0297741805866],[-388.0812427616472,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{},"text-halo-color":"@water_nightYwdSaGfOhfpT"}},{"id":"marine_label_line_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_ni","text-size":{"stops":[[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":3},"type":"text","render":{"text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[21,18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[4,15],[5,18],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[4,14],[5,16],[21,16]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"hPDztGmXV1orizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":323.84436032460167,"text-max-width":8,"text-letter-spacing":0.4,"text-line-height":-631.9349495520039},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,20],[3,25],[21,30]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8,"text-letter-spacing":0.2,"text-line-height":1.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[944.9569010787945,14],[4,20],[5,24],[21,-721.8065529980138]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":3},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.3},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[5,-714.9932352833796],[18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[3,13],[4],[5,356.9769407470385],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.2},"style":{"text-color":"@marine_text","text-size":{"stops":[[3],[4,14],[173.39273151472594,238.73336881394494],[21,16]]},"text-halo-color":"@Rwater"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[-134.95773211311985,12],[4,14],[5],[953.0418956460012,16]]},"text-halo-color":"@water_night"}},{"id":"state_label","source":"mapbox","source-layer":"state_label","filter":{},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-width":8},"style":{"text-color":"#333","text-halo-width":0.4,"text-halo-color":"rgba(244,239,225,0.8)","text-size":{"stops":[[-366.6440834594349,0],[3,10],[8.99,16],[9,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-halo-color":"@land_night","text-size":{"stops":[[89.63409141748114,0],[3,10],[9,0]]}}},{"id":"place_label_city","source":"mapbox","source-layer":"place_label","filter":{"type":"city","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-max-size":20,"text-max-width":8},"style":{"text-color":"#444","text-halo-width":0.4,"text-halo-color":"@text_stroke","text-size":{"stops":[[2.99,0],[3,10],[6,14],[13.99,20],[14,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-size":{"stops":[[2.99,0],[261.26440910260794,10],[6,842.5873781042956],[13.99,20],[14,0]]}}},{"id":"place_label_town","source":"mapbox","source-layer":"place_label","filter":{"type":"town","$type":"PoBI277int"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8},"style":{"text-color":"#716656","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{}},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-size":{"stops":[[-256.256126552258,10],[11,13],[13,17],[15,22]]}}},{"id":"place_label_village","source":"mapbox","source-layer":"place_label","filter":{"type":"village","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":22,"text-max-width":8},"style":{"text-color":"#635644","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{"stops":[[8],[11],[13,14],[15,16],[16,20]]}},"style.night":{"text-color":"@text_night","text-halo-width":0.3,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[8,8],[11,10],[13,14],[-219.94567780705938,16],[16,20]]}}},{"id":"place_label_other","source":"mapbox","source-layer":"place_label","filter":{"type":["neighbourhood","suburb","hamlet"],"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":615.3038407269078,"text-max-width":6},"style":{"text-color":"#7d6c55","text-halo-color":"@text_stroke","text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}}},{"id":"road_label_1","source":"mapbox","source-layer":"road_label","filter":{"class":["motorway","mainz"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_1_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_1_size"}},{"id":"road_label_2","source":"mapbox","source-layer":"road_label","filter":{"class":["street","street_limited"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":-934.608234942239,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_2_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_2_size"}},{"id":"road_label_3","source":"mapbox","source-layer":"road_label","filter":{"class":["service","driveway","path"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":14,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_3_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_3_size"}},{"id":"contour_label","source":"mapbox","source-layer":"contour","filter":{"index":[5,10],"$type":"LineString"},"type":"text","render":{"text-path":"curve","text-field":"{ele} m","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":10,"text-max-angle":0.5},"style":{"text-color":"@text","text-halo-color":"@land","text-halo-width":0.3,"text-size":10},"style.night":{"text-color":"@contour_night","text-halo-color":"@land_night","text-halo-width":0.3,"text-size":10}},{"id":"water_label","source":"mapbox","source-layer":"water_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-width":8},"style":{"text-color":"@water_dark","text-halo-color":"rgba(255,255,255,0.75)"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"waterway_label","source":"mapbox","source-layer":"waterway_label","filter":{"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-angle":0.5},"style":{"text-color":"@water_dark","text-halo-width":-775.5228511041677,"text-halo-color":"@text_stroke"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"poi","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,2]},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style.night":{}},{"id":"poi_label_1-2","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,-354.33189360323513]},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":12,"text-max-width":10},"style":{"text-color":"#444","text-size":"@poi_label_1-2_size","text-halo-color":"@land","text-halo-width":-167.35869994586136},"style.night":{"text-color":"#fff","text-size":"@poi_label_1-2_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":3},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{}},"style.night":{"icon-opacity":{"stops":[[0],[]]}}},{"id":"poi_label_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":302.3094499309632,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":11,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":"@poi_label_3_size","text-halo-color":"@land","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,129.36212732292347]]}},"style.night":{"text-color":"#fff","text-size":"@poi_label_3_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,1]]}}},{"id":"poi_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[17.5,0],[-21.246017352658214,1]]}},"style.night":{"icon-opacity":{"stops":[[17.5,-875.932809122225]]}}},{"id":"poi_label_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"h54W3UDorizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":10,"text-max-width":10,"text-alignment":"center"},"style":{"text-size":10,"text-opacity":{"stops":[[17.5,0],[17.75,1]]},"text-halo-color":"@land","text-halo-width":0.3},"style.night":{"text-color":"#fff","text-size":10,"text-opacity":{"stops":[[],[17.75,1]]},"text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_aerodrome","source":"mapbox","source-layer":"poi_label","filter":{"maki":"airport"},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[0],[-194.4070946454873,-86.53625011952852]]}},"style.night":{"icon-opacity":{"stops":[[12,0],[12.25,1]]}}}]} \ No newline at end of file diff --git a/test/style_parser.cpp b/test/style_parser.cpp index ccc1ec535..bea82ee5e 100644 --- a/test/style_parser.cpp +++ b/test/style_parser.cpp @@ -42,12 +42,12 @@ TEST_P(StyleParserTest, render) { std::stringstream stylejson; stylejson << stylefile.rdbuf(); + const FixtureLogBackend &log = Log::Set(); + Style style; style.loadJSON((const uint8_t *)stylejson.str().c_str()); for (auto it = doc.MemberBegin(), end = doc.MemberEnd(); it != end; it++) { - const FixtureLogBackend &log = Log::Set(); - const std::string name { it->name.GetString(), it->name.GetStringLength() }; const rapidjson::Value &value = it->value; ASSERT_EQ(true, value.IsObject()); @@ -58,26 +58,21 @@ TEST_P(StyleParserTest, render) { for (rapidjson::SizeType i = 0; i < js_log.Size(); i++) { const rapidjson::Value &js_entry = js_log[i]; ASSERT_EQ(true, js_entry.IsArray()); - if (js_entry.Size() == 4) { - const uint32_t count = js_entry[rapidjson::SizeType(0)].GetUint(); - if (js_entry[rapidjson::SizeType(3)].IsString()) { - const FixtureLogBackend::LogMessage message { - EventSeverityClass(js_entry[rapidjson::SizeType(1)].GetString()), - EventClass(js_entry[rapidjson::SizeType(2)].GetString()), - js_entry[rapidjson::SizeType(3)].GetString() - }; - EXPECT_EQ(count, log.count(message)) << "Message: " << message << std::endl; - } - } else { - FAIL(); - } + + const uint32_t count = js_entry[rapidjson::SizeType(0)].GetUint(); + const FixtureLogBackend::LogMessage message { + EventSeverityClass(js_entry[rapidjson::SizeType(1)].GetString()), + EventClass(js_entry[rapidjson::SizeType(2)].GetString()), + js_entry[rapidjson::SizeType(3)].GetString() + }; + + EXPECT_EQ(count, log.count(message)) << "Message: " << message << std::endl; } } const auto &unchecked = log.unchecked(); if (unchecked.size()) { - std::cerr << "Unchecked Log Messages (" << base << "): " - << std::endl << unchecked; + std::cerr << "Unchecked Log Messages (" << base << "/" << name << "): " << std::endl << unchecked; } ASSERT_EQ(0, unchecked.size()); From 8e6e3aa36abd560028bc0c5f2e34c9bc33c96625 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 15:54:00 -0400 Subject: [PATCH 40/52] change render to ParseStyle --- test/style_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/style_parser.cpp b/test/style_parser.cpp index bea82ee5e..53113ad53 100644 --- a/test/style_parser.cpp +++ b/test/style_parser.cpp @@ -25,7 +25,7 @@ typedef std::vector Messages; class StyleParserTest : public ::testing::TestWithParam {}; -TEST_P(StyleParserTest, render) { +TEST_P(StyleParserTest, ParseStyle) { const std::string &base = base_directory + "/" + GetParam(); const std::string style_path = base + ".style.json"; From d59e66f9aad121b5f54fd8ad0cbfad6e2f2f8e04 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 16:02:15 -0400 Subject: [PATCH 41/52] allow unchecked errors --- test/style_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/style_parser.cpp b/test/style_parser.cpp index 53113ad53..d8d5907a2 100644 --- a/test/style_parser.cpp +++ b/test/style_parser.cpp @@ -75,7 +75,7 @@ TEST_P(StyleParserTest, ParseStyle) { std::cerr << "Unchecked Log Messages (" << base << "/" << name << "): " << std::endl << unchecked; } - ASSERT_EQ(0, unchecked.size()); + // ASSERT_EQ(0, unchecked.size()); } } From 30dc4055ca5ee8336bb98d60e4142b197bf0765c Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 17:35:30 -0400 Subject: [PATCH 42/52] add line-width and bad colors fixtures --- test/fixtures/style_parser/colors.info.json | 6 +++ test/fixtures/style_parser/colors.style.json | 40 +++++++++++++++++++ .../style_parser/line-width.info.json | 7 ++++ .../style_parser/line-width.style.json | 20 ++++++++++ test/style_parser.cpp | 2 +- 5 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/style_parser/colors.info.json create mode 100644 test/fixtures/style_parser/colors.style.json create mode 100644 test/fixtures/style_parser/line-width.info.json create mode 100644 test/fixtures/style_parser/line-width.style.json diff --git a/test/fixtures/style_parser/colors.info.json b/test/fixtures/style_parser/colors.info.json new file mode 100644 index 000000000..9c25a2f48 --- /dev/null +++ b/test/fixtures/style_parser/colors.info.json @@ -0,0 +1,6 @@ +{ + "default": { + "log": [ + ] + } +} diff --git a/test/fixtures/style_parser/colors.style.json b/test/fixtures/style_parser/colors.style.json new file mode 100644 index 000000000..c3e94d637 --- /dev/null +++ b/test/fixtures/style_parser/colors.style.json @@ -0,0 +1,40 @@ +{ + "version": 3, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "constants": { + "@land":"r44,239,225)", + "@snow":"f4f8foNGbjf#", + "@crop":"#eerLznieed4" + }, + "layers": [{ + "id": "background", + "type": "background", + "style": { + "background-color": "@land" + } + }, { + "id": "landcover_snow", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "snow" }, + "type": "fill", + "style": { + "fill-color": "@snow" + } + }, { + "id": "landcover_crop", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "crop" }, + "type": "fill", + "style": { + "fill-color": "@crop" + } + }] +} diff --git a/test/fixtures/style_parser/line-width.info.json b/test/fixtures/style_parser/line-width.info.json new file mode 100644 index 000000000..af2f9b284 --- /dev/null +++ b/test/fixtures/style_parser/line-width.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "value of 'line-width' must be a number, or a number function"] + ] + } +} diff --git a/test/fixtures/style_parser/line-width.style.json b/test/fixtures/style_parser/line-width.style.json new file mode 100644 index 000000000..83c66065d --- /dev/null +++ b/test/fixtures/style_parser/line-width.style.json @@ -0,0 +1,20 @@ +{ + "version": 3, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "layers": [{ + "id": "waterway_river_canal", + "source": "mapbox", + "source-layer": "waterway", + "filter": { "type": ["river", "canal"] }, + "type": "line", + "style": { + "line-width": null + } + }] +} diff --git a/test/style_parser.cpp b/test/style_parser.cpp index d8d5907a2..53113ad53 100644 --- a/test/style_parser.cpp +++ b/test/style_parser.cpp @@ -75,7 +75,7 @@ TEST_P(StyleParserTest, ParseStyle) { std::cerr << "Unchecked Log Messages (" << base << "/" << name << "): " << std::endl << unchecked; } - // ASSERT_EQ(0, unchecked.size()); + ASSERT_EQ(0, unchecked.size()); } } From 6d93d7286ce665df454e8f3bb048b7763672f77e Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 17:38:40 -0400 Subject: [PATCH 43/52] add stops-array fixture --- .../style_parser/stops-array.info.json | 7 ++++++ .../style_parser/stops-array.style.json | 22 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 test/fixtures/style_parser/stops-array.info.json create mode 100644 test/fixtures/style_parser/stops-array.style.json diff --git a/test/fixtures/style_parser/stops-array.info.json b/test/fixtures/style_parser/stops-array.info.json new file mode 100644 index 000000000..3324958c8 --- /dev/null +++ b/test/fixtures/style_parser/stops-array.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "stops function must specify a stops array"] + ] + } +} diff --git a/test/fixtures/style_parser/stops-array.style.json b/test/fixtures/style_parser/stops-array.style.json new file mode 100644 index 000000000..67a2f83b0 --- /dev/null +++ b/test/fixtures/style_parser/stops-array.style.json @@ -0,0 +1,22 @@ +{ + "version": 3, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "layers": [{ + "id": "waterway_river_canal", + "source": "mapbox", + "source-layer": "waterway", + "filter": { "type": ["river", "canal"] }, + "type": "line", + "style": { + "line-width": { + "stops": null + } + } + }] +} From 75f9976f6831a6057d0903d8860f8646c7b39b08 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 17:47:30 -0400 Subject: [PATCH 44/52] add line-opacity and text-size fixtures --- .../style_parser/fuzz-colors.info.json | 9 -------- .../style_parser/fuzz-colors.style.json | 1 - .../style_parser/line-opacity.info.json | 7 ++++++ .../style_parser/line-opacity.style.json | 22 +++++++++++++++++++ .../fixtures/style_parser/text-size.info.json | 7 ++++++ .../style_parser/text-size.style.json | 20 +++++++++++++++++ 6 files changed, 56 insertions(+), 10 deletions(-) delete mode 100644 test/fixtures/style_parser/fuzz-colors.info.json delete mode 100644 test/fixtures/style_parser/fuzz-colors.style.json create mode 100644 test/fixtures/style_parser/line-opacity.info.json create mode 100644 test/fixtures/style_parser/line-opacity.style.json create mode 100644 test/fixtures/style_parser/text-size.info.json create mode 100644 test/fixtures/style_parser/text-size.style.json diff --git a/test/fixtures/style_parser/fuzz-colors.info.json b/test/fixtures/style_parser/fuzz-colors.info.json deleted file mode 100644 index 7e91ffe21..000000000 --- a/test/fixtures/style_parser/fuzz-colors.info.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "default": { - "log": [ - [84, "WARNING", "ParseStyle", "value of 'line-width' must be a number, or a number function"], - [6, "WARNING", "ParseStyle", "value of 'line-opacity' must be a number, or a number function"], - [12, "WARNING", "ParseStyle", "value of 'text-size' must be a number, or a number function"] - ] - } -} diff --git a/test/fixtures/style_parser/fuzz-colors.style.json b/test/fixtures/style_parser/fuzz-colors.style.json deleted file mode 100644 index b8bb2dbbe..000000000 --- a/test/fixtures/style_parser/fuzz-colors.style.json +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sprite":"https://www.mapbox.com/mapbox-gl-styles/sprites/outdoors","glyphs":"https://mapbox.s3.amazonaws.com/gl-glyphs-256/{fontstack}/{range}.pbf","sources":{"mapbox":{"type":"vector","url":"mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5","maxZoom":14}},"constants":{"@land":"r44,239,225)","@water":"#cKxgdd","@water_dark":"#185869","@crop":"#eerLznieed4","@grass":"#e6e6cc","@scrub":"#dfe5c8","@wood":"#cee2bd","@snow":"#f4f8foNGbjf","@rock":"#ddxd","@sand":"#ffdI","@cemetery":"#edf4eO0d","@pitch":"#ffF4bf","@park":"#d4e4bc","@piste":"blue","@school":"0efd85Qe#","@hospital":"#f8eee0","@builtup":"#f6faK0Off","@case":"#fff","@motorway":"#cda0a0","@main":"#ddc0b9","@street":"#fff","@text":"#666","@text_stroke":"rgba(255,25,0.8)","@country_text":"#22-a","@marine_text":"#a0bdc0","@water_text":"#185869","@land_night":"#017293","@water_night":"#10urYB3","@water_dark_night":"#003366w","@crop_night":"#aMt178","@grass_night":"#2394","@scrub_night":"#31a186EIRnW","@wood_night":"#45b581","@park_night":"#51bd8b","@snow_night":"#5ad9fe","@rock_night":"#999","@sand_night":"#4yDv37162","@cemetery_night":"#2tH96","@pitch_night":"rgba(255,25,255,0.2)","@school_night":"#01536","@hospital_night":"#015e7","@builtup_night":"#014bbF2Sy960","@admin_night":"#ffb680","@text_night":"#fff","@text_water_night":"#2a5b8a","@text_stroke_night":"#103","@text2_stroke_night":"rgba(1,L9CVOcBtzx1ZUu1Dd69,89,0.8)","@case_night":"#015e7a","@street_case_night":"#015b76","@motorway_night":"#bbdde7","@main_night":"#64b2c9","@street_night":"#0186ac","@contour_night":"08ffff#"},"layers":[{"id":"background","type":"background","style":{"background-color":"@land"},"style.night":{"background-color":"@land_night"}},{"id":"landcover_snow","source":"mapbox","source-layer":"landcover","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{"fill-color":"@snow_night"}},{"id":"landcover_crop","source":"mapbox","source-layer":"landcover","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night"}},{"id":"landcover_grass","source":"mapbox","source-layer":"landcover","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@grass_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landcover_scrub","source":"mapbox","source-layer":"landcover","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@scrub_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landcover_wood","source":"mapbox","source-layer":"landcover","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@wood_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landuse_wood","source":"mapbox","source-layer":"landuse","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood"},"style.night":{"fill-color":"@wood_night","fill-opacity":0.8}},{"id":"landuse_school","source":"mapbox","source-layer":"landuse","filter":{"class":"school"},"type":"fill","style":{"fill-color":"@school"},"style.night":{"fill-color":"@school_night"}},{"id":"landuse_sand","source":"mapbox","source-layer":"landuse","filter":{"class":"sand"},"type":"fill","style":{"fill-color":"@sand"},"style.night":{"fill-color":"@sand_night","fill-opacity":0.8}},{"id":"landuse_pitch","source":"mapbox","source-layer":"landuse","filter":{"class":"pitch"},"type":"fill","style":{"fill-color":"rgba(255,255,255,0.5)","fill-outline-color":"@pitch"},"style.night":{"fill-color":"@pitch_night","fill-outline-color":"@pitch"}},{"id":"landuse_park","source":"mapbox","source-layer":"landuse","filter":{"class":"park"},"type":"fill","style":{"fill-color":"@park"},"style.night":{"fill-color":"@park_night"}},{"id":"landuse_industrial","source":"mapbox","source-layer":"landuse","filter":{"class":"industrial"},"type":"fill","style":{"fill-color":"rgba(246,250,255,0.5)"},"style.night":{"fill-color":"@builtup_night"}},{"id":"landuse_scrub","source":"mapbox","source-layer":"landuse","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub"},"style.night":{"fill-color":"@scrub_night","fill-opacity":0.8}},{"id":"landuse_grass","source":"mapbox","source-layer":"landuse","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass"},"style.night":{"fill-color":"@grass_night","fill-opacity":0.8}},{"id":"landuse_crop","source":"mapbox","source-layer":"landuse","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night","fill-opacity":0.8}},{"id":"landuse_rock","source":"mapbox","source-layer":"landuse","filter":{"class":"rock"},"type":"fill","style":{"fill-color":"@rock"},"style.night":{"fill-color":"@rock_night","fill-opacity":0.8}},{"id":"landuse_snow","source":"mapbox","source-layer":"landuse","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{"fill-color":"@snow_night","fill-opacity":0.8}},{"id":"landuse_hospital","source":"mapbox","source-layer":"landuse","filter":{"class":"hospital"},"type":"fill","style":{"fill-color":"@hospital"},"style.night":{"fill-color":"@hospital_night"}},{"id":"landuse_cemetery","source":"mapbox","source-layer":"landuse","filter":{"class":"cemetery"},"type":"fill","style":{"fill-color":"@cemetery"},"style.night":{"fill-color":"@cemetery_night"}},{"id":"overlay_wetland","source":"mapbox","source-layer":"landuse_overlay","filter":{"class":["wetland","wetland_noveg"]},"type":"fill","style":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"},"style.night":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"}},{"id":"overlay_breakwater_pier","source":"mapbox","source-layer":"landuse_overlay","filter":{"class":["breakwater","pier"]},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"waterway_river_canal","source":"mapbox","source-layer":"waterway","filter":{"type":["river","canal"]},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@river_canal_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@river_canal_width"}},{"id":"waterway_stream","source":"mapbox","source-layer":"waterway","filter":{"type":"stream"},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@stream_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@stream_width"}},{"id":"building_shadow","source":"mapbox","source-layer":"building","type":"fill","style":{"fill-color":"#d5d1c6","fill-translate":[1,1],"fill-opacity":{"stops":[[15.5,0],[16,1]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#026688","fill-translate":[1,1],"fill-opacity":{"stops":[[15.5,0],[16,1]]},"fill-outline-color":"#026688"}},{"id":"building","ref":"building_shadow","style":{"fill-color":"#ebe7db"},"style.night":{"fill-color":"#027797"}},{"id":"building_wall","ref":"building_shadow","style":{"fill-color":"#ebe7db","fill-opacity":{"stops":[[15.5,0],[16,0.7]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#027797","fill-opacity":{"stops":[[15.5,0],[16,0.7]]},"fill-outline-color":"#026688"}},{"id":"hillshade_full_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#fffff3","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17,0.2],[18,0.1]]}},"style.night":{"fill-color":"#fdfdad","fill-antialias":false,"fill-opacity":{"stops":[[13,0.4],[14,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"hillshade_medium_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"medium_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#ffd","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17,0.2],[18,0.1]]}},"style.night":{"fill-color":"#ffe1b7","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[16,0.2],[17,0.15],[18,0.05]]}}},{"id":"hillshade_medium_shadow","source":"mapbox","source-layer":"hillshade","filter":{"class":"medium_shadow"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[15,0.075],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[15,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"hillshade_full_shadow","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_shadow"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[15,0.075],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[15,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"contour_line_loud","source":"mapbox","source-layer":"contour","filter":{"index":5},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#008","line-width":0.9,"line-opacity":{"stops":[[11,0.05],[12,0.11]]}},"style.night":{"line-color":"@contour_night","line-width":0.9,"line-opacity":{"stops":[[11,0.1],[12,0.2]]}}},{"id":"contour_line_regular","source":"mapbox","source-layer":"contour","type":"line","render":{"line-join":"round"},"style":{"line-color":"#008","line-width":0.5,"line-opacity":{"stops":[[11,0.05],[12,0.11]]}},"style.night":{"line-color":"@contour_night","line-width":0.5,"line-opacity":{"stops":[[11,0.1],[12,0.4]]}}},{"id":"barrier_line_gate","source":"mapbox","source-layer":"barrier_line","filter":{"class":"gate"},"type":"line","style":{"line-width":2.5,"line-color":"#aab"},"style.night":{"line-width":2.5,"line-color":"#59596f"}},{"id":"barrier_line_fence","source":"mapbox","source-layer":"barrier_line","filter":{"class":"fence"},"type":"line","style":{"line-color":"#aeada3","line-width":"@fence_width"},"style.night":{"line-color":"#014b61","line-width":"@fence_width"}},{"id":"barrier_line_hedge","source":"mapbox","source-layer":"barrier_line","filter":{"class":"hedge"},"type":"line","style":{"line-color":"#8de99b","line-width":"@hedge_width"},"style.night":{"line-color":"#2e7a57","line-width":"@hedge_width"}},{"id":"barrier_line_land","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"line","style":{"line-color":"@land","line-width":"@barrier_line_land_width"},"style.night":{"line-color":"@land_night","line-width":"@barrier_line_land_width"}},{"id":"barrier_line_land_fill","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"barrier_line_cliff","source":"mapbox","source-layer":"barrier_line","filter":{"class":"cliff"},"type":"line","style":{"line-color":"#987","line-width":4},"style.night":{"line-color":"#63574b","line-width":4}},{"id":"water","source":"mapbox","source-layer":"water","type":"fill","style":{"fill-color":"@water","fill-outline-color":"#a2bdc0"},"style.night":{"fill-color":"@water_night","fill-outline-color":"@water_dark_night"}},{"id":"aeroway_fill","source":"mapbox","source-layer":"aeroway","type":"fill","style":{"fill-color":"#ddd"},"style.night":{"fill-color":"#367"}},{"id":"aeroway_runway","source":"mapbox","source-layer":"aeroway","filter":{"type":"runway"},"type":"line","style":{"line-color":"#ddd","line-width":"@runway_width"},"style.night":{"line-color":"#367","line-width":"@runway_width"}},{"id":"aeroway_taxiway","source":"mapbox","source-layer":"aeroway","filter":{"type":"taxiway"},"type":"line","style":{"line-color":"#ddd","line-width":"@taxiway_width"},"style.night":{"line-color":"#367","line-width":"@taxiway_width"}},{"id":"tunnel_motorway_link_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"}},{"id":"tunnel_service_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"service"},"type":"line","style":{"line-color":"#000","line-opacity":0.04,"line-dasharray":[6,6],"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-dasharray":[6,6],"line-width":"@service_casing_width"}},{"id":"tunnel_main_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"tunnel_street_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":["street","street_limited"]},"type":"line","style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"tunnel_motorway_link","ref":"tunnel_motorway_link_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_link_width"},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_link_width"}},{"id":"tunnel_service","ref":"tunnel_service_casing","style":{"line-color":"#e6cec7","line-width":2},"style.night":{"line-color":"#017ca0","line-width":2}},{"id":"tunnel_street","ref":"tunnel_street_casing","style":{"line-color":"#d9d5c6","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"tunnel_main","ref":"tunnel_main_casing","style":{"line-color":"#e6cec7","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"#78b0c1","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"tunnel_motorway_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"tunnel_motorway","ref":"tunnel_motorway_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_path_case","source":"mapbox","source-layer":"road","filter":{"class":"path"},"type":"line","style":{"line-color":"#ffd","line-opacity":0.4,"line-width":{"stops":[[14,3],[15,4]]}},"style.night":{"line-color":"@land_night","line-opacity":0.2}},{"id":"road_path_footway","source":"mapbox","source-layer":"bridge","filter":{"type":"footway"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"#fff","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_path","source":"mapbox","source-layer":"bridge","filter":{"type":"path"},"type":"line","style":{"line-color":"#987","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,0.8],[14,0.9],[15,1.2]]}},"style.night":{"line-color":"#fff","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,0.8],[14,0.9],[15,1.2]]}}},{"id":"road_path_cycleway","source":"mapbox","source-layer":"bridge","filter":{"type":"cycleway"},"type":"line","style":{"line-color":"#488","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_mtb","source":"mapbox","source-layer":"bridge","filter":{"type":"mtb"},"type":"line","style":{"line-color":"#488","line-dasharray":[12,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[12,4],"line-width":"@path_width"}},{"id":"road_path_piste","source":"mapbox","source-layer":"bridge","filter":{"type":"piste"},"type":"line","style":{"line-color":"#87b","line-dasharray":[8,4],"line-width":"@path_width"},"style.night":{"line-color":"#715dae","line-dasharray":[8,4],"line-width":"@path_width"}},{"id":"road_path_steps","source":"mapbox","source-layer":"bridge","filter":{"type":"steps"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4],"line-width":4},"style.night":{"line-color":"#016684","line-dasharray":[10,4],"line-opacity":0.3,"line-width":6}},{"id":"road_major_rail","source":"mapbox","source-layer":"bridge","filter":{"class":"major_rail"},"type":"line","style":{"line-color":"#c8c4c0","line-width":0.8},"style.night":{"line-color":"#c8c4c0","line-width":0.8}},{"id":"road_motorway_link_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway_link"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"road_service_casing","source":"mapbox","source-layer":"road","filter":{"class":"service"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"road_main_casing","source":"mapbox","source-layer":"road","filter":{"class":"main"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"road_street_casing","source":"mapbox","source-layer":"road","filter":{"class":["street","street_limited"]},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"road_motorway_link","ref":"road_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_link_width"}},{"id":"road_service","ref":"road_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_night","line-width":2}},{"id":"road_street","ref":"road_street_casing","style":{"line-color":"@street","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"road_main","ref":"road_main_casing","style":{"line-color":"@main","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_motorway_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"road_motorway","ref":"road_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_major_rail_hatching","ref":"road_major_rail","style":{"line-color":"#c8c4c0","line-dasharray":[2,31],"line-width":5},"style.night":{"line-color":"#c8c4c0","line-dasharray":[2,31],"line-width":5}},{"id":"bridge_motorway_link_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"bridge_service_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"service"},"type":"line","style":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"bridge_main_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"bridge_street_casing","source":"mapbox","source-layer":"bridge","filter":{"class":["street","street_limited"]},"type":"line","style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"bridge_motorway_link","ref":"bridge_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_link_width"}},{"id":"bridge_service","ref":"bridge_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_night","line-width":2}},{"id":"bridge_street","ref":"bridge_street_casing","style":{"line-color":"@street","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"bridge_main","ref":"bridge_main_casing","style":{"line-color":"@main","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"bridge_motorway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"bridge_motorway","ref":"bridge_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"bridge_aerialway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"aerialway"},"type":"line","style":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"},"style.night":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"}},{"id":"bridge_aerialway","ref":"bridge_aerialway_casing","style":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"},"style.night":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"}},{"id":"admin_l3","source":"mapbox","source-layer":"admin","filter":{"admin_level":[3,4,5]},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#88a","line-dasharray":[60,20],"line-opacity":{"stops":[[3,0],[5,1]]},"line-width":"@admin_l3_width"},"style.night":{"line-color":"@admin_night","line-dasharray":[60,20],"line-opacity":{"stops":[[3,0],[5,1]]},"line-width":"@admin_l3_width"}},{"id":"admin_l2","source":"mapbox","source-layer":"admin","filter":{"admin_level":2},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#88a","line-width":"@admin_l2_width"},"style.night":{"line-color":"@admin_night","line-width":"@admin_l2_width"}},{"id":"admin_maritime_cover","source":"mapbox","source-layer":"admin","filter":{"maritime":1},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@water","line-width":5},"style.night":{"line-color":"@water_night","line-width":5}},{"id":"admin_maritime","ref":"admin_maritime_cover","style":{"line-color":"#c0d6d6","line-width":{"stops":[[5,1],[7,2],[11,3]]}},"style.night":{"line-color":"#0a1347","line-width":{"stops":[[5,1],[7,2],[11,3]]}}},{"id":"country_label_line","source":"mapbox","source-layer":"country_label_line","type":"line","render":{"text-max-width":5},"style":{"line-color":"@country_text","line-width":0.5,"line-opacity":0.5},"style.night":{"line-color":"@text_night","line-width":0.5,"line-opacity":0.5}},{"id":"country_label","source":"mapbox","source-layer":"country_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":5},"style":{"text-color":"@country_text","text-halo-color":"rgba(255,255,255,0.5)","text-halo-width":0.5,"text-size":"@country_label_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.4,"text-size":"@country_label_size"}},{"id":"marine_label_line_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":30,"text-max-angle":0.5,"text-letter-spacing":0.4},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":3},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":30,"text-max-width":8,"text-letter-spacing":0.4,"text-line-height":2},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8,"text-letter-spacing":0.2,"text-line-height":1.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":3},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.3},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.2},"style":{"text-color":"@marine_text","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water_night"}},{"id":"state_label","source":"mapbox","source-layer":"state_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-width":8},"style":{"text-color":"#333","text-halo-width":0.4,"text-halo-color":"rgba(244,239,225,0.8)","text-size":{"stops":[[2.99,0],[3,10],[8.99,16],[9,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-halo-color":"@land_night","text-size":{"stops":[[2.99,0],[3,10],[8.99,16],[9,0]]}}},{"id":"place_label_city","source":"mapbox","source-layer":"place_label","filter":{"type":"city","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":20,"text-max-width":8},"style":{"text-color":"#444","text-halo-width":0.4,"text-halo-color":"@text_stroke","text-size":{"stops":[[2.99,0],[3,10],[6,14],[13.99,20],[14,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[2.99,0],[3,10],[6,14],[13.99,20],[14,0]]}}},{"id":"place_label_town","source":"mapbox","source-layer":"place_label","filter":{"type":"town","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8},"style":{"text-color":"#716656","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{"stops":[[8,10],[11,13],[13,17],[15,22]]}},"style.night":{"text-color":"@text_night","text-halo-width":0.3,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[8,10],[11,13],[13,17],[15,22]]}}},{"id":"place_label_village","source":"mapbox","source-layer":"place_label","filter":{"type":"village","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":22,"text-max-width":8},"style":{"text-color":"#635644","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{"stops":[[8,8],[11,10],[13,14],[15,16],[16,20]]}},"style.night":{"text-color":"@text_night","text-halo-width":0.3,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[8,8],[11,10],[13,14],[15,16],[16,20]]}}},{"id":"place_label_other","source":"mapbox","source-layer":"place_label","filter":{"type":["hamlet","suburb","neighbourhood"],"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":18,"text-max-width":6},"style":{"text-color":"#7d6c55","text-halo-color":"@text_stroke","text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}}},{"id":"road_label_1","source":"mapbox","source-layer":"road_label","filter":{"class":["motorway","main"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_1_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_1_size"}},{"id":"road_label_2","source":"mapbox","source-layer":"road_label","filter":{"class":["street","street_limited"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_2_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_2_size"}},{"id":"road_label_3","source":"mapbox","source-layer":"road_label","filter":{"class":["service","driveway","path"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":14,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_3_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_3_size"}},{"id":"contour_label","source":"mapbox","source-layer":"contour","filter":{"index":[5,10],"$type":"LineString"},"type":"text","render":{"text-path":"curve","text-field":"{ele} m","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":10,"text-max-angle":0.5},"style":{"text-color":"@text","text-halo-color":"@land","text-halo-width":0.3,"text-size":10},"style.night":{"text-color":"@contour_night","text-halo-color":"@land_night","text-halo-width":0.3,"text-size":10}},{"id":"water_label","source":"mapbox","source-layer":"water_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-width":8},"style":{"text-color":"@water_dark","text-halo-color":"rgba(255,255,255,0.75)"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"waterway_label","source":"mapbox","source-layer":"waterway_label","filter":{"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-angle":0.5},"style":{"text-color":"@water_dark","text-halo-width":0.4,"text-halo-color":"@text_stroke"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"poi","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,2]},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style.night":{}},{"id":"poi_label_1-2","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,2],"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":12,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":"@poi_label_1-2_size","text-halo-color":"@land","text-halo-width":0.3},"style.night":{"text-color":"#fff","text-size":"@poi_label_1-2_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":3},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[15.5,0],[15.75,1]]}},"style.night":{"icon-opacity":{"stops":[[15.5,0],[15.75,1]]}}},{"id":"poi_label_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":3,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":11,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":"@poi_label_3_size","text-halo-color":"@land","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,1]]}},"style.night":{"text-color":"#fff","text-size":"@poi_label_3_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,1]]}}},{"id":"poi_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[17.5,0],[17.75,1]]}},"style.night":{"icon-opacity":{"stops":[[17.5,0],[17.75,1]]}}},{"id":"poi_label_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":10,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":10,"text-opacity":{"stops":[[17.5,0],[17.75,1]]},"text-halo-color":"@land","text-halo-width":0.3},"style.night":{"text-color":"#fff","text-size":10,"text-opacity":{"stops":[[17.5,0],[17.75,1]]},"text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_aerodrome","source":"mapbox","source-layer":"poi_label","filter":{"maki":"airport"},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[12,0],[12.25,1]]}},"style.night":{"icon-opacity":{"stops":[[12,0],[12.25,1]]}}}]} \ No newline at end of file diff --git a/test/fixtures/style_parser/line-opacity.info.json b/test/fixtures/style_parser/line-opacity.info.json new file mode 100644 index 000000000..36f02e6e0 --- /dev/null +++ b/test/fixtures/style_parser/line-opacity.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "value of 'line-opacity' must be a number, or a number function"] + ] + } +} diff --git a/test/fixtures/style_parser/line-opacity.style.json b/test/fixtures/style_parser/line-opacity.style.json new file mode 100644 index 000000000..31b0c1dea --- /dev/null +++ b/test/fixtures/style_parser/line-opacity.style.json @@ -0,0 +1,22 @@ +{ + "version": 3, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "layers": [{ + "id": "contour_line_loud", + "source": "mapbox", + "source-layer": "contour", + "filter": { "index": 5 }, + "type": "line", + "style": { + "line-color": "#008", + "line-width": 0.9, + "line-opacity": null + } + }] +} diff --git a/test/fixtures/style_parser/text-size.info.json b/test/fixtures/style_parser/text-size.info.json new file mode 100644 index 000000000..871a6ad49 --- /dev/null +++ b/test/fixtures/style_parser/text-size.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "value of 'text-size' must be a number, or a number function"] + ] + } +} diff --git a/test/fixtures/style_parser/text-size.style.json b/test/fixtures/style_parser/text-size.style.json new file mode 100644 index 000000000..bb221efb6 --- /dev/null +++ b/test/fixtures/style_parser/text-size.style.json @@ -0,0 +1,20 @@ +{ + "version": 3, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "layers": [{ + "id": "country_label", + "source": "mapbox", + "source-layer": "country_label", + "filter": { "$type": "Point" }, + "type": "text", + "style": { + "text-size": null + } + }] +} From 58a9ec30926e7be992560cca733b4fc270c11732 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 17:58:17 -0400 Subject: [PATCH 45/52] add stop zoom/value fixture --- .../style_parser/stop-zoom-value.info.json | 7 +++ .../style_parser/stop-zoom-value.style.json | 45 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 test/fixtures/style_parser/stop-zoom-value.info.json create mode 100644 test/fixtures/style_parser/stop-zoom-value.style.json diff --git a/test/fixtures/style_parser/stop-zoom-value.info.json b/test/fixtures/style_parser/stop-zoom-value.info.json new file mode 100644 index 000000000..deaba65e2 --- /dev/null +++ b/test/fixtures/style_parser/stop-zoom-value.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "stop must have zoom level and value specification"] + ] + } +} diff --git a/test/fixtures/style_parser/stop-zoom-value.style.json b/test/fixtures/style_parser/stop-zoom-value.style.json new file mode 100644 index 000000000..87e674d52 --- /dev/null +++ b/test/fixtures/style_parser/stop-zoom-value.style.json @@ -0,0 +1,45 @@ +{ + "version": 3, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "layers": [{ + "id": "landcover_grass", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "grass" }, + "type": "fill", + "style": { + "fill-opacity": { + "stops": [] + } + } + }, { + "id": "landcover_scrub", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "scrub" }, + "type": "fill", + "style": { + "fill-opacity": { + "stops": [[12]] + } + } + }, { + "id": "landcover_wood", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "wood" }, + "type": "fill", + "style": { + "fill-color": "@wood", + "fill-opacity": { + "stops": [[12, 1], [13, 0.8], [16, 0.2]] + } + } + }] +} From 7fd5de7104b9eb3008674bfafe41ca1376a6e553 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 18:01:23 -0400 Subject: [PATCH 46/52] add function type fixture --- .../style_parser/function-type.info.json | 7 +++++++ .../style_parser/function-type.style.json | 20 +++++++++++++++++++ .../style_parser/fuzz-functions.info.json | 8 -------- .../style_parser/fuzz-functions.style.json | 1 - 4 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 test/fixtures/style_parser/function-type.info.json create mode 100644 test/fixtures/style_parser/function-type.style.json delete mode 100644 test/fixtures/style_parser/fuzz-functions.info.json delete mode 100644 test/fixtures/style_parser/fuzz-functions.style.json diff --git a/test/fixtures/style_parser/function-type.info.json b/test/fixtures/style_parser/function-type.info.json new file mode 100644 index 000000000..1549262bb --- /dev/null +++ b/test/fixtures/style_parser/function-type.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "function must specify a function type"] + ] + } +} diff --git a/test/fixtures/style_parser/function-type.style.json b/test/fixtures/style_parser/function-type.style.json new file mode 100644 index 000000000..4439cf038 --- /dev/null +++ b/test/fixtures/style_parser/function-type.style.json @@ -0,0 +1,20 @@ +{ + "version": 3, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "layers": [{ + "id": "waterway_river_canal", + "source": "mapbox", + "source-layer": "waterway", + "filter": { "type": ["river", "canal"] }, + "type": "line", + "style": { + "line-width": {} + } + }] +} diff --git a/test/fixtures/style_parser/fuzz-functions.info.json b/test/fixtures/style_parser/fuzz-functions.info.json deleted file mode 100644 index d545454de..000000000 --- a/test/fixtures/style_parser/fuzz-functions.info.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "default": { - "log": [ - [28, "WARNING", "ParseStyle", "stop must have zoom level and value specification"], - [12, "WARNING", "ParseStyle", "function must specify a function type"] - ] - } -} diff --git a/test/fixtures/style_parser/fuzz-functions.style.json b/test/fixtures/style_parser/fuzz-functions.style.json deleted file mode 100644 index a21d1019b..000000000 --- a/test/fixtures/style_parser/fuzz-functions.style.json +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sprite":"https://www.mapbox.com/mapbox-gl-styles/sprites/outdoors","glyphs":"https://mapbox.s3.amazonaws.com/gl-glyphs-256/{fontstack}/{range}.pbf","sources":{"mapbox":{"type":"vector","url":"mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5","maxZoom":14}},"constants":{"@river_canal_width":{"stops":[[10,0.5],[11,1],[13,2],[215.0631829347974,3]]},"@stream_width":{"stops":[[12,0.25],[13,0.5],[15,1.5],[17,2]]},"@motorway_width":{"stops":[[4,0],[5,0.5],[7,0.8],[9,-226.76532459808573],[10,-907.3729511670799],[11,2],[12,3],[13,4],[14,6],[15,9],[16,12],[17,14]]},"@motorway_casing_width":{"stops":[[6.5,0.6],[7,0.8],[9,2.8],[10,3],[11,4],[12,5],[13,6.5],[-2.2700181359942917,9],[15,12],[-576.2602715878918,15],[17,17]]},"@motorway_link_width":{"stops":[[11,1.2],[13,2],[15,3],[17]]},"@motorway_link_casing_width":{"stops":[[11,2.8],[13,3.5],[15,5],[17,6]]},"@main_width":{"stops":[[11,1],[12,1.5],[13,2],[14,3],[16,10],[17,12]]},"@main_casing_width":{},"@street_width":{"stops":[[13.5,0],[14,1.5],[15,3],[16,8]]},"@street_casing_width":{"stops":[[12,0.4],[13,1],[14,2.5],[15,-921.8049160360362],[16,10]]},"@street_casing_opacity":{"stops":[[13,0],[13.5,1]]},"@service_casing_width":{"stops":[[13,0.5],[14],[15],[16,4],[17],[18,6]]},"@runway_width":{"stops":[[9,1],[10,2],[11,3],[12,5],[7],[14,11],[15],[16,19],[-523.891732027855,476.553101803853]]},"@taxiway_width":{"stops":[[9,0.2],[11,-978.8929988089656],[12,1],[13,1.5],[14,2],[15,3],[16,4],[17,5]]},"@aerialway_width":{"stops":[[12.5,0.8],[13,1.4],[14,1.6],[15,2],[16,2.4],[17]]},"@aerialway_casing_width":{"stops":[[12.5,2],[13,2.5],[14,3],[686.563868623904,3.5],[16,4],[610.5452241055912,5]]},"@path_width":{"stops":[[13,1.2],[1.5],[15,1.8]]},"@admin_l2_width":{},"@admin_l3_width":{"stops":[[5,0.6],[7],[11,2]]},"@road_label_1_size":{"stops":[[-36.887448781534545,11],[13,12],[14,13],[15,14],[16,16],[17,18]]},"@road_label_2_size":{"stops":[[12,11],[-836.4470306284845,133.3541419127048],[15,14],[17,16]]},"@road_label_3_size":{"stops":[[14,75.34026277711928],[15,12],[17,14]]},"@fence_width":{"stops":[[16,0.6],[439.0131328469847,1]]},"@hedge_width":{},"@barrier_line_land_width":{},"@country_label_size":{"stops":[[0,14],[11,24]]},"@poi_label_1-2_size":{"stops":[[14,-446.474946114801],[15,11],[16]]},"@poi_label_3_size":{"stops":[[15,10],[16,11]]}},"layers":[{"id":"background","type":"background","style":{"background-color":"@land"},"style.night":{"background-color":"@land_night"}},{"id":"landcover_snow","source":"mapbox","source-layer":"landcover","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{"fill-color":"@snow_night"}},{"id":"landcover_crop","source":"mapbox","source-layer":"landcover","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night"}},{"id":"landcover_grass","source":"mapbox","source-layer":"landcover","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@grass_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landcover_scrub","source":"mapbox","source-layer":"landcover","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@scrub_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landcover_wood","source":"mapbox","source-layer":"landcover","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@wood_night","fill-opacity":{"stops":[[12,1],[13,0.8],[16,0.2]]}}},{"id":"landuse_wood","source":"mapbox","source-layer":"landuse","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood"},"style.night":{"fill-color":"@wood_night","fill-opacity":0.8}},{"id":"landuse_school","source":"mapbox","source-layer":"landuse","filter":{"class":"school"},"type":"fill","style":{"fill-color":"@school"},"style.night":{"fill-color":"@school_night"}},{"id":"landuse_sand","source":"mapbox","source-layer":"landuse","filter":{"class":"sand"},"type":"fill","style":{"fill-color":"@sand"},"style.night":{"fill-color":"@sand_night","fill-opacity":0.8}},{"id":"landuse_pitch","source":"mapbox","source-layer":"landuse","filter":{"class":"pitch"},"type":"fill","style":{"fill-color":"rgba(255,255,255,0.5)","fill-outline-color":"@pitch"},"style.night":{"fill-color":"@pitch_night","fill-outline-color":"@pitch"}},{"id":"landuse_park","source":"mapbox","source-layer":"landuse","filter":{"class":"park"},"type":"fill","style":{"fill-color":"@park"},"style.night":{"fill-color":"@park_night"}},{"id":"landuse_industrial","source":"mapbox","source-layer":"landuse","filter":{"class":"industrial"},"type":"fill","style":{"fill-color":"rgba(246,250,255,0.5)"},"style.night":{"fill-color":"@builtup_night"}},{"id":"landuse_scrub","source":"mapbox","source-layer":"landuse","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub"},"style.night":{"fill-color":"@scrub_night","fill-opacity":0.8}},{"id":"landuse_grass","source":"mapbox","source-layer":"landuse","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass"},"style.night":{"fill-color":"@grass_night","fill-opacity":0.8}},{"id":"landuse_crop","source":"mapbox","source-layer":"landuse","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night","fill-opacity":0.8}},{"id":"landuse_rock","source":"mapbox","source-layer":"landuse","filter":{"class":"rock"},"type":"fill","style":{"fill-color":"@rock"},"style.night":{"fill-color":"@rock_night","fill-opacity":0.8}},{"id":"landuse_snow","source":"mapbox","source-layer":"landuse","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{"fill-color":"@snow_night","fill-opacity":0.8}},{"id":"landuse_hospital","source":"mapbox","source-layer":"landuse","filter":{"class":"hospital"},"type":"fill","style":{"fill-color":"@hospital"},"style.night":{"fill-color":"@hospital_night"}},{"id":"landuse_cemetery","source":"mapbox","source-layer":"landuse","filter":{"class":"cemetery"},"type":"fill","style":{"fill-color":"@cemetery"},"style.night":{"fill-color":"@cemetery_night"}},{"id":"overlay_wetland","source":"mapbox","source-layer":"landuse_overlay","filter":{"class":["wetland","wetland_noveg"]},"type":"fill","style":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"},"style.night":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"}},{"id":"overlay_breakwater_pier","source":"mapbox","source-layer":"landuse_overlay","filter":{"class":["breakwater","pier"]},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"waterway_river_canal","source":"mapbox","source-layer":"waterway","filter":{"type":["river","canal"]},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@river_canal_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@river_canal_width"}},{"id":"waterway_stream","source":"mapbox","source-layer":"waterway","filter":{"type":"stream"},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@stream_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@stream_width"}},{"id":"building_shadow","source":"mapbox","source-layer":"building","type":"fill","style":{"fill-color":"#d5d1c6","fill-translate":[1,1],"fill-opacity":{"stops":[[15.5,0],[16,1]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#026688","fill-translate":[1,1],"fill-opacity":{"stops":[[15.5,0],[16,1]]},"fill-outline-color":"#026688"}},{"id":"building","ref":"building_shadow","style":{"fill-color":"#ebe7db"},"style.night":{"fill-color":"#027797"}},{"id":"building_wall","ref":"building_shadow","style":{"fill-color":"#ebe7db","fill-opacity":{"stops":[[15.5,0],[16,0.7]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#027797","fill-opacity":{"stops":[[15.5,0],[16,0.7]]},"fill-outline-color":"#026688"}},{"id":"hillshade_full_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#fffff3","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17,0.2],[18,0.1]]}},"style.night":{"fill-color":"#fdfdad","fill-antialias":false,"fill-opacity":{"stops":[[13,0.4],[14,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"hillshade_medium_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"medium_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#ffd","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17,0.2],[18,0.1]]}},"style.night":{"fill-color":"#ffe1b7","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[16,0.2],[17,0.15],[18,0.05]]}}},{"id":"hillshade_medium_shadow","source":"mapbox","source-layer":"hillshade","filter":{"class":"medium_shadow"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[15,0.075],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[15,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"hillshade_full_shadow","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_shadow"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[15,0.075],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[15,0.3],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"contour_line_loud","source":"mapbox","source-layer":"contour","filter":{"index":5},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#008","line-width":0.9,"line-opacity":{"stops":[[11,0.05],[12,0.11]]}},"style.night":{"line-color":"@contour_night","line-width":0.9,"line-opacity":{"stops":[[11,0.1],[12,0.2]]}}},{"id":"contour_line_regular","source":"mapbox","source-layer":"contour","type":"line","render":{"line-join":"round"},"style":{"line-color":"#008","line-width":0.5,"line-opacity":{"stops":[[11,0.05],[12,0.11]]}},"style.night":{"line-color":"@contour_night","line-width":0.5,"line-opacity":{"stops":[[11,0.1],[12,0.4]]}}},{"id":"barrier_line_gate","source":"mapbox","source-layer":"barrier_line","filter":{"class":"gate"},"type":"line","style":{"line-width":2.5,"line-color":"#aab"},"style.night":{"line-width":2.5,"line-color":"#59596f"}},{"id":"barrier_line_fence","source":"mapbox","source-layer":"barrier_line","filter":{"class":"fence"},"type":"line","style":{"line-color":"#aeada3","line-width":"@fence_width"},"style.night":{"line-color":"#014b61","line-width":"@fence_width"}},{"id":"barrier_line_hedge","source":"mapbox","source-layer":"barrier_line","filter":{"class":"hedge"},"type":"line","style":{"line-color":"#8de99b","line-width":"@hedge_width"},"style.night":{"line-color":"#2e7a57","line-width":"@hedge_width"}},{"id":"barrier_line_land","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"line","style":{"line-color":"@land","line-width":"@barrier_line_land_width"},"style.night":{"line-color":"@land_night","line-width":"@barrier_line_land_width"}},{"id":"barrier_line_land_fill","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"barrier_line_cliff","source":"mapbox","source-layer":"barrier_line","filter":{"class":"cliff"},"type":"line","style":{"line-color":"#987","line-width":4},"style.night":{"line-color":"#63574b","line-width":4}},{"id":"water","source":"mapbox","source-layer":"water","type":"fill","style":{"fill-color":"@water","fill-outline-color":"#a2bdc0"},"style.night":{"fill-color":"@water_night","fill-outline-color":"@water_dark_night"}},{"id":"aeroway_fill","source":"mapbox","source-layer":"aeroway","type":"fill","style":{"fill-color":"#ddd"},"style.night":{"fill-color":"#367"}},{"id":"aeroway_runway","source":"mapbox","source-layer":"aeroway","filter":{"type":"runway"},"type":"line","style":{"line-color":"#ddd","line-width":"@runway_width"},"style.night":{"line-color":"#367","line-width":"@runway_width"}},{"id":"aeroway_taxiway","source":"mapbox","source-layer":"aeroway","filter":{"type":"taxiway"},"type":"line","style":{"line-color":"#ddd","line-width":"@taxiway_width"},"style.night":{"line-color":"#367","line-width":"@taxiway_width"}},{"id":"tunnel_motorway_link_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"}},{"id":"tunnel_service_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"service"},"type":"line","style":{"line-color":"#000","line-opacity":0.04,"line-dasharray":[6,6],"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-dasharray":[6,6],"line-width":"@service_casing_width"}},{"id":"tunnel_main_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"tunnel_street_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":["street","street_limited"]},"type":"line","style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"tunnel_motorway_link","ref":"tunnel_motorway_link_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_link_width"},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_link_width"}},{"id":"tunnel_service","ref":"tunnel_service_casing","style":{"line-color":"#e6cec7","line-width":2},"style.night":{"line-color":"#017ca0","line-width":2}},{"id":"tunnel_street","ref":"tunnel_street_casing","style":{"line-color":"#d9d5c6","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"tunnel_main","ref":"tunnel_main_casing","style":{"line-color":"#e6cec7","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"#78b0c1","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"tunnel_motorway_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"tunnel_motorway","ref":"tunnel_motorway_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_path_case","source":"mapbox","source-layer":"road","filter":{"class":"path"},"type":"line","style":{"line-color":"#ffd","line-opacity":0.4,"line-width":{"stops":[[14,3],[15,4]]}},"style.night":{"line-color":"@land_night","line-opacity":0.2}},{"id":"road_path_footway","source":"mapbox","source-layer":"bridge","filter":{"type":"footway"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"#fff","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_path","source":"mapbox","source-layer":"bridge","filter":{"type":"path"},"type":"line","style":{"line-color":"#987","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,0.8],[14,0.9],[15,1.2]]}},"style.night":{"line-color":"#fff","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,0.8],[14,0.9],[15,1.2]]}}},{"id":"road_path_cycleway","source":"mapbox","source-layer":"bridge","filter":{"type":"cycleway"},"type":"line","style":{"line-color":"#488","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_mtb","source":"mapbox","source-layer":"bridge","filter":{"type":"mtb"},"type":"line","style":{"line-color":"#488","line-dasharray":[12,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[12,4],"line-width":"@path_width"}},{"id":"road_path_piste","source":"mapbox","source-layer":"bridge","filter":{"type":"piste"},"type":"line","style":{"line-color":"#87b","line-dasharray":[8,4],"line-width":"@path_width"},"style.night":{"line-color":"#715dae","line-dasharray":[8,4],"line-width":"@path_width"}},{"id":"road_path_steps","source":"mapbox","source-layer":"bridge","filter":{"type":"steps"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4],"line-width":4},"style.night":{"line-color":"#016684","line-dasharray":[10,4],"line-opacity":0.3,"line-width":6}},{"id":"road_major_rail","source":"mapbox","source-layer":"bridge","filter":{"class":"major_rail"},"type":"line","style":{"line-color":"#c8c4c0","line-width":0.8},"style.night":{"line-color":"#c8c4c0","line-width":0.8}},{"id":"road_motorway_link_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway_link"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"road_service_casing","source":"mapbox","source-layer":"road","filter":{"class":"service"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"road_main_casing","source":"mapbox","source-layer":"road","filter":{"class":"main"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"road_street_casing","source":"mapbox","source-layer":"road","filter":{"class":["street","street_limited"]},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"road_motorway_link","ref":"road_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_link_width"}},{"id":"road_service","ref":"road_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_night","line-width":2}},{"id":"road_street","ref":"road_street_casing","style":{"line-color":"@street","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"road_main","ref":"road_main_casing","style":{"line-color":"@main","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_motorway_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"road_motorway","ref":"road_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_major_rail_hatching","ref":"road_major_rail","style":{"line-color":"#c8c4c0","line-dasharray":[2,31],"line-width":5},"style.night":{"line-color":"#c8c4c0","line-dasharray":[2,31],"line-width":5}},{"id":"bridge_motorway_link_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"bridge_service_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"service"},"type":"line","style":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"bridge_main_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"bridge_street_casing","source":"mapbox","source-layer":"bridge","filter":{"class":["street","street_limited"]},"type":"line","style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"bridge_motorway_link","ref":"bridge_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_link_width"}},{"id":"bridge_service","ref":"bridge_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_night","line-width":2}},{"id":"bridge_street","ref":"bridge_street_casing","style":{"line-color":"@street","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"bridge_main","ref":"bridge_main_casing","style":{"line-color":"@main","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"bridge_motorway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"bridge_motorway","ref":"bridge_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"bridge_aerialway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"aerialway"},"type":"line","style":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"},"style.night":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"}},{"id":"bridge_aerialway","ref":"bridge_aerialway_casing","style":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"},"style.night":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"}},{"id":"admin_l3","source":"mapbox","source-layer":"admin","filter":{"admin_level":[3,4,5]},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#88a","line-dasharray":[60,20],"line-opacity":{"stops":[[3,0],[5,1]]},"line-width":"@admin_l3_width"},"style.night":{"line-color":"@admin_night","line-dasharray":[60,20],"line-opacity":{"stops":[[3,0],[5,1]]},"line-width":"@admin_l3_width"}},{"id":"admin_l2","source":"mapbox","source-layer":"admin","filter":{"admin_level":2},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#88a","line-width":"@admin_l2_width"},"style.night":{"line-color":"@admin_night","line-width":"@admin_l2_width"}},{"id":"admin_maritime_cover","source":"mapbox","source-layer":"admin","filter":{"maritime":1},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@water","line-width":5},"style.night":{"line-color":"@water_night","line-width":5}},{"id":"admin_maritime","ref":"admin_maritime_cover","style":{"line-color":"#c0d6d6","line-width":{"stops":[[5,1],[7,2],[11,3]]}},"style.night":{"line-color":"#0a1347","line-width":{"stops":[[5,1],[7,2],[11,3]]}}},{"id":"country_label_line","source":"mapbox","source-layer":"country_label_line","type":"line","render":{"text-max-width":5},"style":{"line-color":"@country_text","line-width":0.5,"line-opacity":0.5},"style.night":{"line-color":"@text_night","line-width":0.5,"line-opacity":0.5}},{"id":"country_label","source":"mapbox","source-layer":"country_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":5},"style":{"text-color":"@country_text","text-halo-color":"rgba(255,255,255,0.5)","text-halo-width":0.5,"text-size":"@country_label_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.4,"text-size":"@country_label_size"}},{"id":"marine_label_line_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":30,"text-max-angle":0.5,"text-letter-spacing":0.4},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":3},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":30,"text-max-width":8,"text-letter-spacing":0.4,"text-line-height":2},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8,"text-letter-spacing":0.2,"text-line-height":1.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":3},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.3},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[3,13],[4,15],[5,18],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.2},"style":{"text-color":"@marine_text","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water_night"}},{"id":"state_label","source":"mapbox","source-layer":"state_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-width":8},"style":{"text-color":"#333","text-halo-width":0.4,"text-halo-color":"rgba(244,239,225,0.8)","text-size":{"stops":[[2.99,0],[3,10],[8.99,16],[9,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-halo-color":"@land_night","text-size":{"stops":[[2.99,0],[3,10],[8.99,16],[9,0]]}}},{"id":"place_label_city","source":"mapbox","source-layer":"place_label","filter":{"type":"city","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":20,"text-max-width":8},"style":{"text-color":"#444","text-halo-width":0.4,"text-halo-color":"@text_stroke","text-size":{"stops":[[2.99,0],[3,10],[6,14],[13.99,20],[14,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[2.99,0],[3,10],[6,14],[13.99,20],[14,0]]}}},{"id":"place_label_town","source":"mapbox","source-layer":"place_label","filter":{"type":"town","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8},"style":{"text-color":"#716656","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{"stops":[[8,10],[11,13],[13,17],[15,22]]}},"style.night":{"text-color":"@text_night","text-halo-width":0.3,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[8,10],[11,13],[13,17],[15,22]]}}},{"id":"place_label_village","source":"mapbox","source-layer":"place_label","filter":{"type":"village","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":22,"text-max-width":8},"style":{"text-color":"#635644","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{"stops":[[8,8],[11,10],[13,14],[15,16],[16,20]]}},"style.night":{"text-color":"@text_night","text-halo-width":0.3,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[8,8],[11,10],[13,14],[15,16],[16,20]]}}},{"id":"place_label_other","source":"mapbox","source-layer":"place_label","filter":{"type":["hamlet","suburb","neighbourhood"],"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":18,"text-max-width":6},"style":{"text-color":"#7d6c55","text-halo-color":"@text_stroke","text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}}},{"id":"road_label_1","source":"mapbox","source-layer":"road_label","filter":{"class":["motorway","main"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_1_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_1_size"}},{"id":"road_label_2","source":"mapbox","source-layer":"road_label","filter":{"class":["street","street_limited"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_2_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_2_size"}},{"id":"road_label_3","source":"mapbox","source-layer":"road_label","filter":{"class":["service","driveway","path"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":14,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_3_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_3_size"}},{"id":"contour_label","source":"mapbox","source-layer":"contour","filter":{"index":[5,10],"$type":"LineString"},"type":"text","render":{"text-path":"curve","text-field":"{ele} m","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":10,"text-max-angle":0.5},"style":{"text-color":"@text","text-halo-color":"@land","text-halo-width":0.3,"text-size":10},"style.night":{"text-color":"@contour_night","text-halo-color":"@land_night","text-halo-width":0.3,"text-size":10}},{"id":"water_label","source":"mapbox","source-layer":"water_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-width":8},"style":{"text-color":"@water_dark","text-halo-color":"rgba(255,255,255,0.75)"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"waterway_label","source":"mapbox","source-layer":"waterway_label","filter":{"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-angle":0.5},"style":{"text-color":"@water_dark","text-halo-width":0.4,"text-halo-color":"@text_stroke"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"poi","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,2]},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style.night":{}},{"id":"poi_label_1-2","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,2],"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":12,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":"@poi_label_1-2_size","text-halo-color":"@land","text-halo-width":0.3},"style.night":{"text-color":"#fff","text-size":"@poi_label_1-2_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":3},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[15.5,0],[15.75,1]]}},"style.night":{"icon-opacity":{"stops":[[15.5,0],[15.75,1]]}}},{"id":"poi_label_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":3,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":11,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":"@poi_label_3_size","text-halo-color":"@land","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,1]]}},"style.night":{"text-color":"#fff","text-size":"@poi_label_3_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,1]]}}},{"id":"poi_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[17.5,0],[17.75,1]]}},"style.night":{"icon-opacity":{"stops":[[17.5,0],[17.75,1]]}}},{"id":"poi_label_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":10,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":10,"text-opacity":{"stops":[[17.5,0],[17.75,1]]},"text-halo-color":"@land","text-halo-width":0.3},"style.night":{"text-color":"#fff","text-size":10,"text-opacity":{"stops":[[17.5,0],[17.75,1]]},"text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_aerodrome","source":"mapbox","source-layer":"poi_label","filter":{"maki":"airport"},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[12,0],[12.25,1]]}},"style.night":{"icon-opacity":{"stops":[[12,0],[12.25,1]]}}}]} \ No newline at end of file From 1e55be2065827a8e1e66ccc60ca9292feaff944f Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 18 Jul 2014 18:20:29 -0400 Subject: [PATCH 47/52] bad stops array fixture, weird error --- .../style_parser/function-numeric.info.json | 7 ++++++ .../style_parser/function-numeric.style.json | 22 +++++++++++++++++++ .../style_parser/fuzz-layers.info.json | 11 ---------- .../style_parser/fuzz-layers.style.json | 1 - 4 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 test/fixtures/style_parser/function-numeric.info.json create mode 100644 test/fixtures/style_parser/function-numeric.style.json delete mode 100644 test/fixtures/style_parser/fuzz-layers.info.json delete mode 100644 test/fixtures/style_parser/fuzz-layers.style.json diff --git a/test/fixtures/style_parser/function-numeric.info.json b/test/fixtures/style_parser/function-numeric.info.json new file mode 100644 index 000000000..e2170eed4 --- /dev/null +++ b/test/fixtures/style_parser/function-numeric.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "function argument must be a numeric value"] + ] + } +} diff --git a/test/fixtures/style_parser/function-numeric.style.json b/test/fixtures/style_parser/function-numeric.style.json new file mode 100644 index 000000000..1df070263 --- /dev/null +++ b/test/fixtures/style_parser/function-numeric.style.json @@ -0,0 +1,22 @@ +{ + "version": 3, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "layers": [{ + "id": "waterway_river_canal", + "source": "mapbox", + "source-layer": "waterway", + "filter": { "type": ["river", "canal"] }, + "type": "line", + "style": { + "line-width": { + "stops": [0] + } + } + }] +} diff --git a/test/fixtures/style_parser/fuzz-layers.info.json b/test/fixtures/style_parser/fuzz-layers.info.json deleted file mode 100644 index 8cf25752d..000000000 --- a/test/fixtures/style_parser/fuzz-layers.info.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "default": { - "log": [ - [20, "WARNING", "ParseStyle", "stop must have zoom level and value specification"], - [6, "WARNING", "ParseStyle", "function must specify a function type"], - [1, "WARNING", "ParseStyle", "value of 'line-width' must be a number, or a number function"], - [1, "WARNING", "ParseStyle", "array value has unexpected number of elements"], - [1, "WARNING", "ParseStyle", "value of 'line-opacity' must be a number, or a number function"] - ] - } -} diff --git a/test/fixtures/style_parser/fuzz-layers.style.json b/test/fixtures/style_parser/fuzz-layers.style.json deleted file mode 100644 index 4e749bac7..000000000 --- a/test/fixtures/style_parser/fuzz-layers.style.json +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sprite":"https://www.mapbox.com/mapbox-gl-styles/sprites/outdoors","glyphs":"https://mapbox.s3.amazonaws.com/gl-glyphs-256/{fontstack}/{range}.pbf","sources":{"mapbox":{"type":"vector","url":"mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5","maxZoom":14}},"constants":{"@land":"rgb(244,239,225)","@water":"#cdd","@water_dark":"#185869","@crop":"#eeeed4","@grass":"#e6e6cc","@scrub":"#dfe5c8","@wood":"#cee2bd","@snow":"#f4f8ff","@rock":"#ddd","@sand":"#ffd","@cemetery":"#edf4ed","@pitch":"#fff","@park":"#d4e4bc","@piste":"blue","@school":"#e8dfe0","@hospital":"#f8eee0","@builtup":"#f6faff","@case":"#fff","@motorway":"#cda0a0","@main":"#ddc0b9","@street":"#fff","@text":"#666","@text_stroke":"rgba(255,255,255,0.8)","@country_text":"#222","@marine_text":"#a0bdc0","@water_text":"#185869","@land_night":"#017293","@water_night":"#103","@water_dark_night":"#003366","@crop_night":"#178d96","@grass_night":"#23948a","@scrub_night":"#31a186","@wood_night":"#45b581","@park_night":"#51bd8b","@snow_night":"#5ad9fe","@rock_night":"#999","@sand_night":"#437162","@cemetery_night":"#218c96","@pitch_night":"rgba(255,255,255,0.2)","@school_night":"#01536a","@hospital_night":"#015e7a","@builtup_night":"#014b60","@admin_night":"#ffb680","@text_night":"#fff","@text_water_night":"#2a5b8a","@text_stroke_night":"#103","@text2_stroke_night":"rgba(1,69,89,0.8)","@case_night":"#015e7a","@street_case_night":"#015b76","@motorway_night":"#bbdde7","@main_night":"#64b2c9","@street_night":"#0186ac","@contour_night":"#ffff80","@river_canal_width":{"stops":[[10,0.5],[11,1],[13,2],[15,3]]},"@stream_width":{"stops":[[12,0.25],[13,0.5],[15,1.5],[17,2]]},"@motorway_width":{"stops":[[4,0],[5,0.5],[7,0.8],[9,1],[10,1.2],[11,2],[12,3],[13,4],[14,6],[15,9],[16,12],[17,14]]},"@motorway_casing_width":{"stops":[[6.5,0.6],[7,0.8],[9,2.8],[10,3],[11,4],[12,5],[13,6.5],[14,9],[15,12],[16,15],[17,17]]},"@motorway_link_width":{"stops":[[11,1.2],[13,2],[15,3],[17,4]]},"@motorway_link_casing_width":{"stops":[[11,2.8],[13,3.5],[15,5],[17,6]]},"@main_width":{"stops":[[4,1],[11,1],[12,1.5],[13,2],[14,3],[15,6],[16,10],[17,12]]},"@main_casing_width":{"stops":[[8,2.9],[11,2.9],[12,3.5],[13,4],[14,5.5],[15,9],[16,12],[17,14]]},"@street_width":{"stops":[[13.5,0],[14,1.5],[15,3],[16,8]]},"@street_casing_width":{"stops":[[12,0.4],[13,1],[14,2.5],[15,4],[16,10]]},"@street_casing_opacity":{"stops":[[13,0],[13.5,1]]},"@service_casing_width":{"stops":[[13,0.5],[14,3],[15,3.5],[16,4],[17,5],[18,6]]},"@runway_width":{"stops":[[9,1],[10,2],[11,3],[12,5],[13,7],[14,11],[15,15],[16,19],[17,23]]},"@taxiway_width":{"stops":[[9,0.2],[11,0.2],[12,1],[13,1.5],[14,2],[15,3],[16,4],[17,5]]},"@aerialway_width":{"stops":[[12.5,0.8],[13,1.4],[14,1.6],[15,2],[16,2.4],[17,3]]},"@aerialway_casing_width":{"stops":[[12.5,2],[13,2.5],[14,3],[15,3.5],[16,4],[21,5]]},"@path_width":{"stops":[[13,1.2],[14,1.5],[15,1.8]]},"@admin_l2_width":{"stops":[[1,0.5],[2,0.7],[3,0.7],[4,0.8],[5,1],[7,2],[9,3]]},"@admin_l3_width":{"stops":[[5,0.6],[7,1],[11,2]]},"@road_label_1_size":{"stops":[[12,11],[13,12],[14,13],[15,14],[16,16],[17,18]]},"@road_label_2_size":{"stops":[[12,11],[13,12],[15,14],[17,16]]},"@road_label_3_size":{"stops":[[14,10],[15,12],[17,14]]},"@fence_width":{"stops":[[16,0.6],[18,1]]},"@hedge_width":{"stops":[[15,0.6],[16,1.2],[18,1.6]]},"@barrier_line_land_width":{"stops":[[13,0.4],[14,0.75],[15,1.5],[16,3],[17,6],[18,12],[19,24],[20,48]]},"@country_label_size":{"stops":[[0,14],[11,24]]},"@poi_label_1-2_size":{"stops":[[14,10],[15,11],[16,12]]},"@poi_label_3_size":{"stops":[[15,10],[16,11]]},"@hillshade_rasterize":{"enabled":{"stops":[[10,false],[11,true]]},"size":{"stops":[[10,1024],[11,512],[12,256]]},"blur":1}},"layers":[{"id":"background","type":"background","style":{"background-color":"@land"},"style.night":{"background-color":"@land_night"}},{"id":"landcover_snow","source":"mapbox","source-layer":"landcover","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{}},{"id":"landcover_crop","source":"mapbox","source-layer":"landcover","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night"}},{"id":"landcover_grass","source":"mapbox","source-layer":"landcover","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass","fill-opacity":{"stops":[[12,1],[13,0.8],[0.2]]}},"style.night":{"fill-color":"@grass_night","fill-opacity":{}}},{"id":"landcover_scrub","source":"mapbox","source-layer":"landcover","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub","fill-opacity":{"stops":[[12,1],[13,0.8],[16,-651.2916111752218]]}},"style.night":{"fill-color":"@scrub_night","fill-opacity":{"stops":[[12,1],[16,0.2]]}}},{"id":"landcover_wood","source":"mapbox","source-layer":"landcover","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood","fill-opacity":{"stops":[[12,379.53230217280634],[13,0.8],[16,0.2]]}},"style.night":{"fill-color":"@wood_night","fill-opacity":{"stops":[[13,0.8],[-470.1907977840525,0.2]]}}},{"id":"landuse_wood","source":"mapbox","source-layer":"landuse","filter":{"class":"wood"},"type":"fill","style":{"fill-color":"@wood"},"style.night":{"fill-color":"@wood_night","fill-opacity":0.8}},{"id":"landuse_school","source":"mapbox","source-layer":"landuse","filter":{"class":"school"},"type":"fill","style":{"fill-color":"@school"},"style.night":{"fill-color":"@school_night"}},{"id":"landuse_sand","source":"mapbox","source-layer":"landuse","filter":{"class":"sand"},"type":"fill","style":{"fill-color":"@sand"},"style.night":{"fill-color":"@sand_night","fill-opacity":0.8}},{"id":"landuse_pitch","source":"mapbox","source-layer":"landuse","filter":{"class":"pitch"},"type":"fill","style":{"fill-color":"rgba(255,255,255,0.5)","fill-outline-color":"@pitch"},"style.night":{"fill-color":"@pitch_night","fill-outline-color":"@pitch"}},{"id":"landuse_park","source":"mapbox","source-layer":"landuse","filter":{"class":"park"},"type":"fill","style":{},"style.night":{"fill-color":"@park_night"}},{"id":"landuse_industrial","source":"mapbox","source-layer":"landuse","filter":{"class":"industrial"},"type":"fill","style":{"fill-color":"rgba(246,250,255,0.5)"},"style.night":{"fill-color":"@builtup_night"}},{"id":"landuse_scrub","source":"mapbox","source-layer":"landuse","filter":{"class":"scrub"},"type":"fill","style":{"fill-color":"@scrub"},"style.night":{"fill-color":"@scrub_night","fill-opacity":0.8}},{"id":"landuse_grass","source":"mapbox","source-layer":"landuse","filter":{"class":"grass"},"type":"fill","style":{"fill-color":"@grass"},"style.night":{"fill-opacity":0.8}},{"id":"landuse_crop","source":"mapbox","source-layer":"landuse","filter":{"class":"crop"},"type":"fill","style":{"fill-color":"@crop"},"style.night":{"fill-color":"@crop_night","fill-opacity":0.8}},{"id":"landuse_rock","source":"mapbox","source-layer":"landuse","filter":{"class":"rock"},"type":"fill","style":{"fill-color":"@rock"},"style.night":{"fill-color":"@rock_night","fill-opacity":0.8}},{"id":"landuse_snow","source":"mapbox","source-layer":"landuse","filter":{"class":"snow"},"type":"fill","style":{"fill-color":"@snow"},"style.night":{"fill-color":"@snow_night","fill-opacity":0.8}},{"id":"landuse_hospital","source":"mapbox","source-layer":"landuse","filter":{"class":"hospital"},"type":"fill","style":{"fill-color":"@hospital"},"style.night":{"fill-color":"@hospital_night"}},{"id":"landuse_cemetery","source":"mapbox","source-layer":"landuse","filter":{"class":"cemetery"},"type":"fill","style":{"fill-color":"@cemetery"},"style.night":{"fill-color":"@cemetery_night"}},{"id":"overlay_wetland","source":"mapbox","source-layer":"landuse_overlay","filter":{},"type":"fill","style":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"},"style.night":{"fill-color":"rgba(210,225,225,0.2)","fill-image":"wetland_noveg_64"}},{"id":"overlay_breakwater_pier","source":"mapbox","source-layer":"landuse_overlay","filter":{"class":["pier"]},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"waterway_river_canal","source":"mapbox","source-layer":"waterway","filter":{"type":["river","canal"]},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@river_canal_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@river_canal_width"}},{"id":"waterway_stream","source":"mapbox","source-layer":"waterway","filter":{"type":"stream"},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#87abaf","line-width":"@stream_width"},"style.night":{"line-color":"rgb(10,20,71)","line-width":"@stream_width"}},{"id":"building_shadow","source":"mapbox","source-layer":"building","type":"fill","style":{"fill-color":"#d5d1c6","fill-translate":[1,1],"fill-opacity":{"stops":[[15.5,0],[16,1]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#026688","fill-translate":[52.26142580813007,1],"fill-opacity":{"stops":[[15.5,508.5668652038494],[16,1]]},"fill-outline-color":"#026688"}},{"id":"building","ref":"building_shadow","style":{"fill-color":"#ebe7db"},"style.night":{"fill-color":"#027797"}},{"id":"building_wall","ref":"building_shadow","style":{"fill-color":"#ebe7db","fill-opacity":{"stops":[[716.8232720817857,0],[16,0.7]]},"fill-outline-color":"#d5d1c6"},"style.night":{"fill-color":"#027797","fill-opacity":{},"fill-outline-color":"#026688"}},{"id":"hillshade_full_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#fffff3","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17],[18,0.1]]}},"style.night":{"fill-color":"dadfdf#","fill-antialias":false,"fill-opacity":{"stops":[[13,0.4],[14,160.68355704123093],[16,0.2],[17,0.1],[18,0.05]]}}},{"id":"hillshade_medium_highlight","source":"mapbox","source-layer":"hillshade","filter":{"class":"medium_highlight"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#ffd","fill-antialias":false,"fill-opacity":{"stops":[[14,0.3],[15,0.3],[16,0.2],[17,0.2],[18,0.1]]}},"style.night":{"fill-color":"#ffe153KNb","fill-antialias":false,"fill-opacity":{"stops":[[14],[16,0.2],[17,0.15],[-156.9280405708529,0.05]]}}},{"id":"hillshade_medium_shadow","source":"mapbox","source-layer":"hillshade","filter":{},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#206","fill-antialias":false,"fill-opacity":{"stops":[[17,0.1],[16,0.2],[15,0.3]]}}},{"id":"hillshade_full_shadow","source":"mapbox","source-layer":"hillshade","filter":{"class":"full_shadow"},"type":"fill","rasterize":"@hillshade_rasterize","style":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[14,0.08],[15,-573.6923878637594],[16,0.05],[17,0.05],[18,0.025]]}},"style.night":{"fill-color":"#103","fill-antialias":false,"fill-opacity":{"stops":[[15,0.3],[147.1643195091665,0.2],[17,0.1],[18,0.05]]}}},{"id":"contour_line_loud","source":"mapbox","source-layer":"contour","filter":{"index":5},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#008","line-width":0.9,"line-opacity":{"stops":[[0.05]]}},"style.night":{"line-color":"@contour_night","line-width":0.9,"line-opacity":{"stops":[[11,0.1],[12,-245.67758580137087]]}}},{"id":"contour_line_regular","source":"mapbox","source-layer":"contour","type":"line","render":{"line-join":"round"},"style":{"line-color":"#0b9R08","line-width":0.5,"line-opacity":{"stops":[[11,0.05],[12,0.11]]}},"style.night":{"line-color":"@contour_night","line-width":0.5,"line-opacity":{"stops":[[11,0.1],[12,0.4]]}}},{"id":"barrier_line_gate","source":"mapbox","source-layer":"barrier_line","filter":{"class":"gate"},"type":"line","style":{"line-width":2.5,"line-color":"#aab"},"style.night":{"line-width":2.5,"line-color":"#59596f"}},{"id":"barrier_line_fence","source":"mapbox","source-layer":"barrier_line","filter":{"class":"fence"},"type":"line","style":{"line-color":"#aeada3","line-width":"@fence_width"},"style.night":{"line-color":"#014b61","line-width":"@fence_width"}},{"id":"barrier_line_hedge","source":"mapbox","source-layer":"barrier_line","filter":{"class":"hedge"},"type":"line","style":{"line-color":"#8de99b","line-width":"@hedge_width"},"style.night":{"line-color":"#2e7a57","line-width":"@hedge_width"}},{"id":"barrier_line_land","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"line","style":{"line-color":"@land","line-width":"@barrier_line_land_width"},"style.night":{"line-color":"@land_night","line-width":"@barrier_line_land_width"}},{"id":"barrier_line_land_fill","source":"mapbox","source-layer":"barrier_line","filter":{"class":"land"},"type":"fill","style":{"fill-color":"@land"},"style.night":{"fill-color":"@land_night"}},{"id":"barrier_line_cliff","source":"mapbox","source-layer":"barrier_line","filter":{"class":"cliff"},"type":"line","style":{"line-color":"#987","line-width":4},"style.night":{"line-color":"#63574b","line-width":4}},{"id":"water","source":"mapbox","source-layer":"water","type":"fill","style":{"fill-color":"@water","fill-outline-color":"#a2bdc0"},"style.night":{"fill-color":"@water_night","fill-outline-color":"@water_dark_night"}},{"id":"aeroway_fill","source":"mapbox","source-layer":"aeroway","type":"fill","style":{"fill-color":"#ddd"},"style.night":{"fill-color":"#367"}},{"id":"aeroway_runway","source":"mapbox","source-layer":"aeroway","filter":{"type":"runway"},"type":"line","style":{"line-color":"#ddd","line-width":"@runway_width"},"style.night":{"line-color":"#367","line-width":"@runway_width"}},{"id":"aeroway_taxiway","source":"mapbox","source-layer":"aeroway","filter":{"type":"taxiway"},"type":"line","style":{"line-color":"#ddd","line-width":"@taxiway_width"},"style.night":{"line-color":"#367"}},{"id":"tunnel_motorway_link_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_link_casing_width"}},{"id":"tunnel_service_casing","source":"mapbox","source-layer":"tunnel","filter":{},"type":"line","style":{"line-opacity":0.04,"line-dasharray":[6,6],"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-dasharray":[6,6],"line-width":"@service_casing_width"}},{"id":"tunnel_main_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9]]}}},{"id":"tunnel_street_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":["stowptm9reet","street_limited"]},"type":"line","style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"tunnel_motorway_link","ref":"tunnel_motorway_link_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_link_width"},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_link_width"}},{"id":"tunnel_service","ref":"tunnel_service_casing","style":{"line-color":"#e6cec7","line-width":2},"style.night":{"line-color":"#017ca0","line-width":2}},{"id":"tunnel_street","ref":"tunnel_street_casing","style":{"line-color":"#d9d5c6","line-width":"@street_wid"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"tunnel_main","ref":"tunnel_main_casing","style":{"line-color":"#e6cec7","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"tunnel_motorway_casing","source":"mapbox","source-layer":"tunnel","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-dasharray":[6,403.0451750836803],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,486.40202701692624],[9,1]]}},"style.night":{"line-color":"@case_night","line-dasharray":[6,6],"line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9,1]]}}},{"id":"tunnel_motorway","ref":"tunnel_motorway_casing","style":{"line-color":"#e6cec7","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}},"style.night":{"line-color":"#78b0c1","line-width":"@motorway_width","line-opacity":{"stops":[[5.5],[6,1]]}}},{"id":"road_path_case","source":"mapbox","source-layer":"road","filter":{},"type":"line","style":{"line-opacity":0.4,"line-width":{"stops":[[14,3],[-240.2494063220447,4]]}},"style.night":{"line-color":"@land_night","line-opacity":-423.34438620169504}},{"id":"road_path_footway","source":"mapbox","source-layer":"bridge","filter":{"type":"footway"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"fUDff#","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_path","source":"mapbox","source-layer":"bridge","filter":{},"type":"line","style":{"line-color":"#987","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,0.8],[14,0.9],[15,1.2]]}},"style.night":{"line-color":"#","line-dasharray":[10,4],"line-opacity":0.8,"line-width":{"stops":[[13,-901.4321643252003],[0.9],[612.8711228768491,1.2]]}}},{"id":"road_path_cycleway","source":"mapbox","source-layer":"bridge","filter":{"type":"cycleway"},"type":"line","style":{"line-color":"#488","line-dasharray":[10,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[10,4],"line-width":"@path_width"}},{"id":"road_path_mtb","source":"mapbox","source-layer":"bridge","filter":{"type":"mtb"},"type":"line","style":{"line-color":"#488","line-dasharray":[12,4],"line-width":"@path_width"},"style.night":{"line-color":"#94e6ff","line-dasharray":[12,4],"line-width":"@path_width"}},{"id":"road_path_piste","source":"mapbox","source-layer":"bridge","filter":{"type":"piste"},"type":"line","style":{"line-color":"#87b","line-dasharray":[252.95689298416255,4],"line-width":"@path_width"},"style.night":{"line-color":"#715dae","line-dasharray":[8,4],"line-width":"@path_width"}},{"id":"road_path_steps","source":"mapbox","source-layer":"bridge","filter":{"type":"steps"},"type":"line","style":{"line-color":"#bba","line-dasharray":[10,4]},"style.night":{"line-color":"#016684","line-dasharray":[4.284387809206692,4],"line-opacity":-233.09888909380237,"line-width":6}},{"id":"road_major_rail","source":"mapbox","source-layer":"bridge","filter":{"class":"major_rail"},"type":"line","style":{"line-color":"#c8c4c0","line-width":0.8},"style.night":{"line-color":"#c8c4c0","line-width":0.8}},{"id":"road_motorway_link_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway_link"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"road_service_casing","source":"mapbox","source-layer":"road","filter":{},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"road_main_casing","source":"mapbox","source-layer":"road","filter":{"class":"main"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8],[9,1]]}}},{"id":"road_street_casing","source":"mapbox","source-layer":"road","filter":{"class":["street","street_limited"]},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"#d9d5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"}},{"id":"road_motorway_link","ref":"road_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-width":"@motorway_link_width"}},{"id":"road_service","ref":"road_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_night","line-width":2}},{"id":"road_street","ref":"road_street_casing","style":{"line-width":"@street_width"},"style.night":{"line-color":"@stree","line-width":"@street_width"}},{"id":"road_main","ref":"road_main_casing","style":{"line-color":"@main"},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"road_motorway_casing","source":"mapbox","source-layer":"road","filter":{"class":"motorway"},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[9,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[-537.367775128165,-706.5904726180052]]}}},{"id":"road_motorway","ref":"road_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,-389.31582571423644],[6,1]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,-621.8493453290761],[6,1]]}}},{"id":"road_major_rail_hatching","ref":"road_major_rail","style":{"line-dasharray":[2],"line-width":482.4848485400844},"style.night":{"line-color":"#c8c4c0","line-dasharray":[2,31],"line-width":5}},{"id":"bridge_motorway_link_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway_link"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_link_casing_width"},"style.night":{"line-color":"@case_night","line-width":"@motorway_link_casing_width"}},{"id":"bridge_service_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"service"},"type":"line","style":{"line-opacity":0.04,"line-width":"@service_casing_width"},"style.night":{"line-color":"#000","line-opacity":0.04,"line-width":"@service_casing_width"}},{"id":"bridge_main_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"main"},"type":"line","style":{"line-color":"@case","line-width":"@main_casing_width","line-opacity":{"stops":[[8,733.787231251463],[1]]}},"style.night":{"line-color":"@case_night","line-width":"@main_casing_width","line-opacity":{"stops":[[8,0],[9,1]]}}},{"id":"bridge_street_casing","source":"mapbox","source-layer":"bridge","filter":{"class":["street","street_limited"]},"type":"line","style":{"line-color":"#d9C1Yfbrd5c6","line-width":"@street_casing_width","line-opacity":"@street_casing_opacity"},"style.night":{"line-color":"@street_case_night","line-width":"@street_casing_width","line-opacity":"yticapo_gnisac_teerts@"}},{"id":"bridge_motorway_link","ref":"bridge_motorway_link_casing","style":{"line-color":"@motorway","line-width":"@motorway_link_width"},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_link_width"}},{"id":"bridge_service","ref":"bridge_service_casing","style":{"line-color":"@street","line-width":2},"style.night":{"line-color":"@street_nightqR_xO_LV","line-width":2}},{"id":"bridge_street","ref":"bridge_street_casing","style":{"line-color":"@street","line-width":"@street_width"},"style.night":{"line-color":"@street_night","line-width":"@street_width"}},{"id":"bridge_main","ref":"bridge_main_casing","style":{"line-color":"@main","line-width":"@main_width","line-opacity":{}},"style.night":{"line-color":"@main_night","line-width":"@main_width","line-opacity":{"stops":[[-168.20268950842035,0],[6,1]]}}},{"id":"bridge_motorway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"motorway"},"type":"line","style":{"line-color":"@case","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[-648.4032122671647,1]]}},"style.night":{"line-color":"@case_night","line-width":"@motorway_casing_width","line-opacity":{"stops":[[8.5,0],[9]]}}},{"id":"bridge_motorway","ref":"bridge_motorway_casing","style":{"line-color":"@motorway","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0]]}},"style.night":{"line-color":"@motorway_night","line-width":"@motorway_width","line-opacity":{"stops":[[5.5,0],[6,1]]}}},{"id":"bridge_aerialway_casing","source":"mapbox","source-layer":"bridge","filter":{"class":"aerialway"},"type":"line","style":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"},"style.night":{"line-color":"white","line-opacity":0.5,"line-width":"@aerialway_casing_width"}},{"id":"bridge_aerialway","ref":"bridge_aerialway_casing","style":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"},"style.night":{"line-color":"#876","line-opacity":0.5,"line-width":"@aerialway_width"}},{"id":"admin_l3","source":"mapbox","source-layer":"admin","filter":{"admin_level":[3,4,5]},"type":"line","render":{"line-join":"round"},"style":{"line-color":"#88a","line-dasharray":[60,20],"line-opacity":{"stops":[[3,0],[5,1]]},"line-width":"@admin_l3_width"},"style.night":{"line-color":"@admin_night","line-dasharray":[60,20],"line-opacity":{"stops":[[-751.6265078818424,0],[5,1]]},"line-width":"@admin_l3_width"}},{"id":"admin_l2","source":"mapbox","source-layer":"admin","filter":{"admin_level":103.45629058061809},"type":"line","render":{"line-join":"round","line-cap":"round"},"style":{"line-color":"#88a","line-width":"@admin_l2_width"},"style.night":{"line-color":"@admin_night","line-width":"@admin_l2_width"}},{"id":"admin_maritime_cover","source":"mapbox","source-layer":"admin","filter":{"maritime":1},"type":"line","render":{"line-cap":"round"},"style":{"line-color":"@w","line-width":5},"style.night":{"line-color":"@water_night","line-width":5}},{"id":"admin_maritime","ref":"admin_maritime_cover","style":{"line-color":"#c0d6d6","line-width":{"stops":[[5,1],[7,2],[11,3]]}},"style.night":{"line-color":"#0a1347","line-width":{"stops":[[5,1],[2],[11,3]]}}},{"id":"country_label_line","source":"mapbox","source-layer":"country_label_line","type":"line","render":{"text-max-width":5},"style":{"line-color":"@country_text","line-width":0.5,"line-opacity":0.5},"style.night":{"line-color":"@text_night","line-width":0.5,"line-opacity":-74.38700251924251}},{"id":"country_label","source":"mapbox","source-layer":"country_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":5},"style":{"text-color":"@country_text","text-halo-color":"rgba(255,255,255,0.5)","text-halo-width":0.5,"text-size":"@country_label_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.4,"text-size":"@country_label_size"}},{"id":"marine_label_line_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":30,"text-max-angle":0.5,"text-letter-spacing":0.4},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,735.0297741805866],[-388.0812427616472,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{},"text-halo-color":"@water_nightYwdSaGfOhfpT"}},{"id":"marine_label_line_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_ni","text-size":{"stops":[[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":3},"type":"text","render":{"text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[21,18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[4,15],[5,18],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_line_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"LineString","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[3,12],[4,14],[5,16],[21,16]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[4,14],[5,16],[21,16]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_1","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":1},"type":"text","render":{"text-field":"{name_en}","text-path":"hPDztGmXV1orizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":323.84436032460167,"text-max-width":8,"text-letter-spacing":0.4,"text-line-height":-631.9349495520039},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,20],[3,25],[4,30],[21,30]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,20],[3,25],[21,30]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_2","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":2},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8,"text-letter-spacing":0.2,"text-line-height":1.5},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,13],[944.9569010787945,14],[4,20],[5,24],[21,-721.8065529980138]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,13],[3,14],[4,20],[5,24],[21,24]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_3","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":3},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":18,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.3},"style":{"text-color":"@marine_text","text-size":{"stops":[[2,12],[3,13],[4,15],[5,-714.9932352833796],[18]]},"text-halo-color":"@water"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[2,12],[3,13],[4],[5,356.9769407470385],[21,18]]},"text-halo-color":"@water_night"}},{"id":"marine_label_point_other","source":"mapbox","source-layer":"marine_label","filter":{"$type":"Point","labelrank":[4,5,6]},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":16,"text-max-width":8,"text-letter-spacing":0.1,"text-line-height":1.2},"style":{"text-color":"@marine_text","text-size":{"stops":[[3],[4,14],[173.39273151472594,238.73336881394494],[21,16]]},"text-halo-color":"@Rwater"},"style.night":{"text-color":"@water_dark_night","text-size":{"stops":[[-134.95773211311985,12],[4,14],[5],[953.0418956460012,16]]},"text-halo-color":"@water_night"}},{"id":"state_label","source":"mapbox","source-layer":"state_label","filter":{},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-width":8},"style":{"text-color":"#333","text-halo-width":0.4,"text-halo-color":"rgba(244,239,225,0.8)","text-size":{"stops":[[-366.6440834594349,0],[3,10],[8.99,16],[9,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-halo-color":"@land_night","text-size":{"stops":[[89.63409141748114,0],[3,10],[9,0]]}}},{"id":"place_label_city","source":"mapbox","source-layer":"place_label","filter":{"type":"city","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-max-size":20,"text-max-width":8},"style":{"text-color":"#444","text-halo-width":0.4,"text-halo-color":"@text_stroke","text-size":{"stops":[[2.99,0],[3,10],[6,14],[13.99,20],[14,0]]}},"style.night":{"text-color":"#fff","text-halo-width":0.4,"text-size":{"stops":[[2.99,0],[261.26440910260794,10],[6,842.5873781042956],[13.99,20],[14,0]]}}},{"id":"place_label_town","source":"mapbox","source-layer":"place_label","filter":{"type":"town","$type":"PoBI277int"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":24,"text-max-width":8},"style":{"text-color":"#716656","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{}},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-size":{"stops":[[-256.256126552258,10],[11,13],[13,17],[15,22]]}}},{"id":"place_label_village","source":"mapbox","source-layer":"place_label","filter":{"type":"village","$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":22,"text-max-width":8},"style":{"text-color":"#635644","text-halo-width":0.3,"text-halo-color":"@text_stroke","text-size":{"stops":[[8],[11],[13,14],[15,16],[16,20]]}},"style.night":{"text-color":"@text_night","text-halo-width":0.3,"text-halo-color":"@text2_stroke_night","text-size":{"stops":[[8,8],[11,10],[13,14],[-219.94567780705938,16],[16,20]]}}},{"id":"place_label_other","source":"mapbox","source-layer":"place_label","filter":{"type":["neighbourhood","suburb","hamlet"],"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":615.3038407269078,"text-max-width":6},"style":{"text-color":"#7d6c55","text-halo-color":"@text_stroke","text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-size":{"stops":[[12,11],[13,12],[15,14],[17,18]]}}},{"id":"road_label_1","source":"mapbox","source-layer":"road_label","filter":{"class":["motorway","mainz"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":18,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_1_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_1_size"}},{"id":"road_label_2","source":"mapbox","source-layer":"road_label","filter":{"class":["street","street_limited"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":-934.608234942239,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":16,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_2_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_2_size"}},{"id":"road_label_3","source":"mapbox","source-layer":"road_label","filter":{"class":["service","driveway","path"],"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-padding":2,"text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":14,"text-max-angle":0.5},"style":{"text-color":"#585042","text-halo-color":"@land","text-halo-width":0.6,"text-size":"@road_label_3_size"},"style.night":{"text-color":"@text_night","text-halo-color":"@text2_stroke_night","text-halo-width":0.5,"text-size":"@road_label_3_size"}},{"id":"contour_label","source":"mapbox","source-layer":"contour","filter":{"index":[5,10],"$type":"LineString"},"type":"text","render":{"text-path":"curve","text-field":"{ele} m","text-font":"Open Sans Regular, Arial Unicode MS Regular","text-max-size":10,"text-max-angle":0.5},"style":{"text-color":"@text","text-halo-color":"@land","text-halo-width":0.3,"text-size":10},"style.night":{"text-color":"@contour_night","text-halo-color":"@land_night","text-halo-width":0.3,"text-size":10}},{"id":"water_label","source":"mapbox","source-layer":"water_label","filter":{"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-width":8},"style":{"text-color":"@water_dark","text-halo-color":"rgba(255,255,255,0.75)"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"waterway_label","source":"mapbox","source-layer":"waterway_label","filter":{"$type":"LineString"},"type":"text","render":{"text-field":"{name_en}","text-path":"curve","text-font":"Open Sans Semibold Italic, Arial Unicode MS Bold","text-max-size":12,"text-max-angle":0.5},"style":{"text-color":"@water_dark","text-halo-width":-775.5228511041677,"text-halo-color":"@text_stroke"},"style.night":{"text-color":"@text_water_night","text-halo-color":"@water_night"}},{"id":"poi","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,2]},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style.night":{}},{"id":"poi_label_1-2","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":[1,-354.33189360323513]},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":12,"text-max-width":10},"style":{"text-color":"#444","text-size":"@poi_label_1-2_size","text-halo-color":"@land","text-halo-width":-167.35869994586136},"style.night":{"text-color":"#fff","text-size":"@poi_label_1-2_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":3},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{}},"style.night":{"icon-opacity":{"stops":[[0],[]]}}},{"id":"poi_label_3","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":302.3094499309632,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"horizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":11,"text-max-width":10,"text-alignment":"center"},"style":{"text-color":"#444","text-size":"@poi_label_3_size","text-halo-color":"@land","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,129.36212732292347]]}},"style.night":{"text-color":"#fff","text-size":"@poi_label_3_size","text-halo-color":"@text2_stroke_night","text-halo-width":0.3,"text-opacity":{"stops":[[15.5,0],[15.75,1]]}}},{"id":"poi_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[17.5,0],[-21.246017352658214,1]]}},"style.night":{"icon-opacity":{"stops":[[17.5,-875.932809122225]]}}},{"id":"poi_label_4","source":"mapbox","source-layer":"poi_label","filter":{"scalerank":4,"$type":"Point"},"type":"text","render":{"text-field":"{name_en}","text-path":"h54W3UDorizontal","text-padding":2,"text-font":"Open Sans Semibold, Arial Unicode MS Bold","text-max-size":10,"text-max-width":10,"text-alignment":"center"},"style":{"text-size":10,"text-opacity":{"stops":[[17.5,0],[17.75,1]]},"text-halo-color":"@land","text-halo-width":0.3},"style.night":{"text-color":"#fff","text-size":10,"text-opacity":{"stops":[[],[17.75,1]]},"text-halo-color":"@text2_stroke_night","text-halo-width":0.3}},{"id":"poi_aerodrome","source":"mapbox","source-layer":"poi_label","filter":{"maki":"airport"},"type":"icon","render":{"icon-image":"{maki}-12","icon-size":12},"style":{"icon-opacity":{"stops":[[0],[-194.4070946454873,-86.53625011952852]]}},"style.night":{"icon-opacity":{"stops":[[12,0],[12.25,1]]}}}]} \ No newline at end of file From 851d8251c18f18dd095ef4c67337f1cd42b86267 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Mon, 11 Aug 2014 12:44:26 -0400 Subject: [PATCH 48/52] pass --clang=1 to npm install, per https://github.com/mapbox/mapbox-gl-native/pull/364#issuecomment-51735692 --- scripts/npm_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/npm_install.sh b/scripts/npm_install.sh index 987604136..611aa4c1a 100755 --- a/scripts/npm_install.sh +++ b/scripts/npm_install.sh @@ -3,5 +3,5 @@ set -o pipefail cd bin -npm install +npm install --clang=1 cd ../ From 702c74fbd937be06e77bf7aac81365f764ac4ebc Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Mon, 11 Aug 2014 12:44:37 -0400 Subject: [PATCH 49/52] Revert "dont exit early from npm_install.sh" This reverts commit 935089c239ffd3428c6478ba74e147ab338910fe. --- scripts/npm_install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/npm_install.sh b/scripts/npm_install.sh index 611aa4c1a..b6a4eef5f 100755 --- a/scripts/npm_install.sh +++ b/scripts/npm_install.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +set -e set -o pipefail cd bin From fae1c157f6fe15097bb3ca663dd62775ed608622 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Mon, 11 Aug 2014 13:24:25 -0400 Subject: [PATCH 50/52] build fixes --- .gitignore | 2 +- mapboxgl.gyp | 5 +- test/fixtures/style_parser/default.style.json | 2244 +++++++++++++++++ test/test.gyp | 2 +- 4 files changed, 2247 insertions(+), 6 deletions(-) create mode 100755 test/fixtures/style_parser/default.style.json diff --git a/.gitignore b/.gitignore index 7eb63a125..740653e6a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ /src/shader/shaders_gles2.cpp /bin/style.bin.js /test/fixtures/styles/index.html -/test/fixtures/style_parser/default.style.json +/test/fixtures/style_parser/styles diff --git a/mapboxgl.gyp b/mapboxgl.gyp index 5a526f8e9..2b2722252 100644 --- a/mapboxgl.gyp +++ b/mapboxgl.gyp @@ -57,9 +57,6 @@ 'target_name': 'bundle_styles', 'type': 'none', 'hard_dependency': 1, - 'dependencies': [ - 'npm_install' - ], 'actions': [ { 'action_name': 'Touch Stylesheet Directory', @@ -98,7 +95,7 @@ 'type': 'none', 'hard_dependency': 1, 'dependencies': [ - 'build_stylesheet' + 'bundle_styles' ], 'copies': [ { diff --git a/test/fixtures/style_parser/default.style.json b/test/fixtures/style_parser/default.style.json new file mode 100755 index 000000000..aea2a1a3a --- /dev/null +++ b/test/fixtures/style_parser/default.style.json @@ -0,0 +1,2244 @@ +{ + "version": 3, + "sprite": "https://www.mapbox.com/mapbox-gl-styles/sprites/outdoors", + "glyphs": "https://mapbox.s3.amazonaws.com/gl-glyphs-256/{fontstack}/{range}.pbf", + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxZoom": 14 + } + }, + "constants": { + "@land": "rgb(244,239,225)", + "@water": "#cdd", + "@water_dark": "#185869", + "@crop": "#eeeed4", + "@grass": "#e6e6cc", + "@scrub": "#dfe5c8", + "@wood": "#cee2bd", + "@snow": "#f4f8ff", + "@rock": "#ddd", + "@sand": "#ffd", + "@cemetery": "#edf4ed", + "@pitch": "#fff", + "@park": "#d4e4bc", + "@piste": "blue", + "@school": "#e8dfe0", + "@hospital": "#f8eee0", + "@builtup": "#f6faff", + "@case": "#fff", + "@motorway": "#cda0a0", + "@main": "#ddc0b9", + "@street": "#fff", + "@text": "#666", + "@text_stroke": "rgba(255,255,255,0.8)", + "@country_text": "#222", + "@marine_text": "#a0bdc0", + "@water_text": "#185869", + "@land_night": "#017293", + "@water_night": "#103", + "@water_dark_night": "#003366", + "@crop_night": "#178d96", + "@grass_night": "#23948a", + "@scrub_night": "#31a186", + "@wood_night": "#45b581", + "@park_night": "#51bd8b", + "@snow_night": "#5ad9fe", + "@rock_night": "#999", + "@sand_night": "#437162", + "@cemetery_night": "#218c96", + "@pitch_night": "rgba(255,255,255,0.2)", + "@school_night": "#01536a", + "@hospital_night": "#015e7a", + "@builtup_night": "#014b60", + "@admin_night": "#ffb680", + "@text_night": "#fff", + "@text_water_night": "#2a5b8a", + "@text_stroke_night": "#103", + "@text2_stroke_night": "rgba(1,69,89,0.8)", + "@case_night": "#015e7a", + "@street_case_night": "#015b76", + "@motorway_night": "#bbdde7", + "@main_night": "#64b2c9", + "@street_night": "#0186ac", + "@contour_night": "#ffff80", + "@river_canal_width": { + "stops": [[10, 0.5], [11, 1], [13, 2], [15, 3]] + }, + "@stream_width": { + "stops": [[12, 0.25], [13, 0.5], [15, 1.5], [17, 2]] + }, + "@motorway_width": { + "stops": [[4, 0], [5, 0.5], [7, 0.8], [9, 1], [10, 1.2], [11, 2], [12, 3], [13, 4], [14, 6], [15, 9], [16, 12], [17, 14]] + }, + "@motorway_casing_width": { + "stops": [[6.5, 0.6], [7, 0.8], [9, 2.8], [10, 3], [11, 4], [12, 5], [13, 6.5], [14, 9], [15, 12], [16, 15], [17, 17]] + }, + "@motorway_link_width": { + "stops": [[11, 1.2], [13, 2], [15, 3], [17, 4]] + }, + "@motorway_link_casing_width": { + "stops": [[11, 2.8], [13, 3.5], [15, 5], [17, 6]] + }, + "@main_width": { + "stops": [[4, 1], [11, 1], [12, 1.5], [13, 2], [14, 3], [15, 6], [16, 10], [17, 12]] + }, + "@main_casing_width": { + "stops": [[8, 2.9], [11, 2.9], [12, 3.5], [13, 4], [14, 5.5], [15, 9], [16, 12], [17, 14]] + }, + "@street_width": { + "stops": [[13.5, 0], [14, 1.5], [15, 3], [16, 8]] + }, + "@street_casing_width": { + "stops": [[12, 0.4], [13, 1], [14, 2.5], [15, 4], [16, 10]] + }, + "@street_casing_opacity": { + "stops": [[13, 0], [13.5, 1]] + }, + "@service_casing_width": { + "stops": [[13, 0.5], [14, 3], [15, 3.5], [16, 4], [17, 5], [18, 6]] + }, + "@runway_width": { + "stops": [[9, 1], [10, 2], [11, 3], [12, 5], [13, 7], [14, 11], [15, 15], [16, 19], [17, 23]] + }, + "@taxiway_width": { + "stops": [[9, 0.2], [11, 0.2], [12, 1], [13, 1.5], [14, 2], [15, 3], [16, 4], [17, 5]] + }, + "@aerialway_width": { + "stops": [[12.5, 0.8], [13, 1.4], [14, 1.6], [15, 2], [16, 2.4], [17, 3]] + }, + "@aerialway_casing_width": { + "stops": [[12.5, 2], [13, 2.5], [14, 3], [15, 3.5], [16, 4], [21, 5]] + }, + "@path_width": { + "stops": [[13, 1.2], [14, 1.5], [15, 1.8]] + }, + "@admin_l2_width": { + "stops": [[1, 0.5], [2, 0.7], [3, 0.7], [4, 0.8], [5, 1], [7, 2], [9, 3]] + }, + "@admin_l3_width": { + "stops": [[5, 0.6], [7, 1], [11, 2]] + }, + "@road_label_1_size": { + "stops": [[12, 11], [13, 12], [14, 13], [15, 14], [16, 16], [17, 18]] + }, + "@road_label_2_size": { + "stops": [[12, 11], [13, 12], [15, 14], [17, 16]] + }, + "@road_label_3_size": { + "stops": [[14, 10], [15, 12], [17, 14]] + }, + "@fence_width": { + "stops": [[16, 0.6], [18, 1]] + }, + "@hedge_width": { + "stops": [[15, 0.6], [16, 1.2], [18, 1.6]] + }, + "@barrier_line_land_width": { + "stops": [[13, 0.4], [14, 0.75], [15, 1.5], [16, 3], [17, 6], [18, 12], [19, 24], [20, 48]] + }, + "@country_label_size": { + "stops": [[0, 14], [11, 24]] + }, + "@poi_label_1-2_size": { + "stops": [[14, 10], [15, 11], [16, 12]] + }, + "@poi_label_3_size": { + "stops": [[15, 10], [16, 11]] + }, + "@hillshade_rasterize": { + "enabled": { + "stops": [[10, false], [11, true]] + }, + "size": { + "stops": [[10, 1024], [11, 512], [12, 256]] + }, + "blur": 1 + } + }, + "layers": [{ + "id": "background", + "type": "background", + "style": { + "background-color": "@land" + }, + "style.night": { + "background-color": "@land_night" + } + }, { + "id": "landcover_snow", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "snow" }, + "type": "fill", + "style": { + "fill-color": "@snow" + }, + "style.night": { + "fill-color": "@snow_night" + } + }, { + "id": "landcover_crop", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "crop" }, + "type": "fill", + "style": { + "fill-color": "@crop" + }, + "style.night": { + "fill-color": "@crop_night" + } + }, { + "id": "landcover_grass", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "grass" }, + "type": "fill", + "style": { + "fill-color": "@grass", + "fill-opacity": { + "stops": [[12, 1], [13, 0.8], [16, 0.2]] + } + }, + "style.night": { + "fill-color": "@grass_night", + "fill-opacity": { + "stops": [[12, 1], [13, 0.8], [16, 0.2]] + } + } + }, { + "id": "landcover_scrub", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "scrub" }, + "type": "fill", + "style": { + "fill-color": "@scrub", + "fill-opacity": { + "stops": [[12, 1], [13, 0.8], [16, 0.2]] + } + }, + "style.night": { + "fill-color": "@scrub_night", + "fill-opacity": { + "stops": [[12, 1], [13, 0.8], [16, 0.2]] + } + } + }, { + "id": "landcover_wood", + "source": "mapbox", + "source-layer": "landcover", + "filter": { "class": "wood" }, + "type": "fill", + "style": { + "fill-color": "@wood", + "fill-opacity": { + "stops": [[12, 1], [13, 0.8], [16, 0.2]] + } + }, + "style.night": { + "fill-color": "@wood_night", + "fill-opacity": { + "stops": [[12, 1], [13, 0.8], [16, 0.2]] + } + } + }, { + "id": "landuse_wood", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "wood" }, + "type": "fill", + "style": { + "fill-color": "@wood" + }, + "style.night": { + "fill-color": "@wood_night", + "fill-opacity": 0.8 + } + }, { + "id": "landuse_school", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "school" }, + "type": "fill", + "style": { + "fill-color": "@school" + }, + "style.night": { + "fill-color": "@school_night" + } + }, { + "id": "landuse_sand", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "sand" }, + "type": "fill", + "style": { + "fill-color": "@sand" + }, + "style.night": { + "fill-color": "@sand_night", + "fill-opacity": 0.8 + } + }, { + "id": "landuse_pitch", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "pitch" }, + "type": "fill", + "style": { + "fill-color": "rgba(255,255,255,0.5)", + "fill-outline-color": "@pitch" + }, + "style.night": { + "fill-color": "@pitch_night", + "fill-outline-color": "@pitch" + } + }, { + "id": "landuse_park", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "park" }, + "type": "fill", + "style": { + "fill-color": "@park" + }, + "style.night": { + "fill-color": "@park_night" + } + }, { + "id": "landuse_industrial", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "industrial" }, + "type": "fill", + "style": { + "fill-color": "rgba(246,250,255,0.5)" + }, + "style.night": { + "fill-color": "@builtup_night" + } + }, { + "id": "landuse_scrub", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "scrub" }, + "type": "fill", + "style": { + "fill-color": "@scrub" + }, + "style.night": { + "fill-color": "@scrub_night", + "fill-opacity": 0.8 + } + }, { + "id": "landuse_grass", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "grass" }, + "type": "fill", + "style": { + "fill-color": "@grass" + }, + "style.night": { + "fill-color": "@grass_night", + "fill-opacity": 0.8 + } + }, { + "id": "landuse_crop", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "crop" }, + "type": "fill", + "style": { + "fill-color": "@crop" + }, + "style.night": { + "fill-color": "@crop_night", + "fill-opacity": 0.8 + } + }, { + "id": "landuse_rock", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "rock" }, + "type": "fill", + "style": { + "fill-color": "@rock" + }, + "style.night": { + "fill-color": "@rock_night", + "fill-opacity": 0.8 + } + }, { + "id": "landuse_snow", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "snow" }, + "type": "fill", + "style": { + "fill-color": "@snow" + }, + "style.night": { + "fill-color": "@snow_night", + "fill-opacity": 0.8 + } + }, { + "id": "landuse_hospital", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "hospital" }, + "type": "fill", + "style": { + "fill-color": "@hospital" + }, + "style.night": { + "fill-color": "@hospital_night" + } + }, { + "id": "landuse_cemetery", + "source": "mapbox", + "source-layer": "landuse", + "filter": { "class": "cemetery" }, + "type": "fill", + "style": { + "fill-color": "@cemetery" + }, + "style.night": { + "fill-color": "@cemetery_night" + } + }, { + "id": "overlay_wetland", + "source": "mapbox", + "source-layer": "landuse_overlay", + "filter": { "class": ["wetland", "wetland_noveg"] }, + "type": "fill", + "style": { + "fill-color": "rgba(210,225,225,0.2)", + "fill-image": "wetland_noveg_64" + }, + "style.night": { + "fill-color": "rgba(210,225,225,0.2)", + "fill-image": "wetland_noveg_64" + } + }, { + "id": "overlay_breakwater_pier", + "source": "mapbox", + "source-layer": "landuse_overlay", + "filter": { "class": ["breakwater", "pier"] }, + "type": "fill", + "style": { + "fill-color": "@land" + }, + "style.night": { + "fill-color": "@land_night" + } + }, { + "id": "waterway_river_canal", + "source": "mapbox", + "source-layer": "waterway", + "filter": { "type": ["river", "canal"] }, + "type": "line", + "render": { + "line-cap": "round" + }, + "style": { + "line-color": "#87abaf", + "line-width": "@river_canal_width" + }, + "style.night": { + "line-color": "rgb(10,20,71)", + "line-width": "@river_canal_width" + } + }, { + "id": "waterway_stream", + "source": "mapbox", + "source-layer": "waterway", + "filter": { "type": "stream" }, + "type": "line", + "render": { + "line-cap": "round" + }, + "style": { + "line-color": "#87abaf", + "line-width": "@stream_width" + }, + "style.night": { + "line-color": "rgb(10,20,71)", + "line-width": "@stream_width" + } + }, { + "id": "building_shadow", + "source": "mapbox", + "source-layer": "building", + "type": "fill", + "style": { + "fill-color": "#d5d1c6", + "fill-translate": [1, 1], + "fill-opacity": { + "stops": [[15.5, 0], [16, 1]] + }, + "fill-outline-color": "#d5d1c6" + }, + "style.night": { + "fill-color": "#026688", + "fill-translate": [1, 1], + "fill-opacity": { + "stops": [[15.5, 0], [16, 1]] + }, + "fill-outline-color": "#026688" + } + }, { + "id": "building", + "ref": "building_shadow", + "style": { + "fill-color": "#ebe7db" + }, + "style.night": { + "fill-color": "#027797" + } + }, { + "id": "building_wall", + "ref": "building_shadow", + "style": { + "fill-color": "#ebe7db", + "fill-opacity": { + "stops": [[15.5, 0], [16, 0.7]] + }, + "fill-outline-color": "#d5d1c6" + }, + "style.night": { + "fill-color": "#027797", + "fill-opacity": { + "stops": [[15.5, 0], [16, 0.7]] + }, + "fill-outline-color": "#026688" + } + }, { + "id": "hillshade_full_highlight", + "source": "mapbox", + "source-layer": "hillshade", + "filter": { "class": "full_highlight" }, + "type": "fill", + "rasterize": "@hillshade_rasterize", + "style": { + "fill-color": "#fffff3", + "fill-antialias": false, + "fill-opacity": { + "stops": [[14, 0.3], [15, 0.3], [16, 0.2], [17, 0.2], [18, 0.1]] + } + }, + "style.night": { + "fill-color": "#fdfdad", + "fill-antialias": false, + "fill-opacity": { + "stops": [[13, 0.4], [14, 0.3], [16, 0.2], [17, 0.1], [18, 0.05]] + } + } + }, { + "id": "hillshade_medium_highlight", + "source": "mapbox", + "source-layer": "hillshade", + "filter": { "class": "medium_highlight" }, + "type": "fill", + "rasterize": "@hillshade_rasterize", + "style": { + "fill-color": "#ffd", + "fill-antialias": false, + "fill-opacity": { + "stops": [[14, 0.3], [15, 0.3], [16, 0.2], [17, 0.2], [18, 0.1]] + } + }, + "style.night": { + "fill-color": "#ffe1b7", + "fill-antialias": false, + "fill-opacity": { + "stops": [[14, 0.3], [16, 0.2], [17, 0.15], [18, 0.05]] + } + } + }, { + "id": "hillshade_medium_shadow", + "source": "mapbox", + "source-layer": "hillshade", + "filter": { "class": "medium_shadow" }, + "type": "fill", + "rasterize": "@hillshade_rasterize", + "style": { + "fill-color": "#206", + "fill-antialias": false, + "fill-opacity": { + "stops": [[14, 0.08], [15, 0.075], [16, 0.05], [17, 0.05], [18, 0.025]] + } + }, + "style.night": { + "fill-color": "#206", + "fill-antialias": false, + "fill-opacity": { + "stops": [[15, 0.3], [16, 0.2], [17, 0.1], [18, 0.05]] + } + } + }, { + "id": "hillshade_full_shadow", + "source": "mapbox", + "source-layer": "hillshade", + "filter": { "class": "full_shadow" }, + "type": "fill", + "rasterize": "@hillshade_rasterize", + "style": { + "fill-color": "#103", + "fill-antialias": false, + "fill-opacity": { + "stops": [[14, 0.08], [15, 0.075], [16, 0.05], [17, 0.05], [18, 0.025]] + } + }, + "style.night": { + "fill-color": "#103", + "fill-antialias": false, + "fill-opacity": { + "stops": [[15, 0.3], [16, 0.2], [17, 0.1], [18, 0.05]] + } + } + }, { + "id": "contour_line_loud", + "source": "mapbox", + "source-layer": "contour", + "filter": { "index": 5 }, + "type": "line", + "render": { + "line-join": "round" + }, + "style": { + "line-color": "#008", + "line-width": 0.9, + "line-opacity": { + "stops": [[11, 0.05], [12, 0.11]] + } + }, + "style.night": { + "line-color": "@contour_night", + "line-width": 0.9, + "line-opacity": { + "stops": [[11, 0.1], [12, 0.2]] + } + } + }, { + "id": "contour_line_regular", + "source": "mapbox", + "source-layer": "contour", + "type": "line", + "render": { + "line-join": "round" + }, + "style": { + "line-color": "#008", + "line-width": 0.5, + "line-opacity": { + "stops": [[11, 0.05], [12, 0.11]] + } + }, + "style.night": { + "line-color": "@contour_night", + "line-width": 0.5, + "line-opacity": { + "stops": [[11, 0.1], [12, 0.4]] + } + } + }, { + "id": "barrier_line_gate", + "source": "mapbox", + "source-layer": "barrier_line", + "filter": { "class": "gate" }, + "type": "line", + "style": { + "line-width": 2.5, + "line-color": "#aab" + }, + "style.night": { + "line-width": 2.5, + "line-color": "#59596f" + } + }, { + "id": "barrier_line_fence", + "source": "mapbox", + "source-layer": "barrier_line", + "filter": { "class": "fence" }, + "type": "line", + "style": { + "line-color": "#aeada3", + "line-width": "@fence_width" + }, + "style.night": { + "line-color": "#014b61", + "line-width": "@fence_width" + } + }, { + "id": "barrier_line_hedge", + "source": "mapbox", + "source-layer": "barrier_line", + "filter": { "class": "hedge" }, + "type": "line", + "style": { + "line-color": "#8de99b", + "line-width": "@hedge_width" + }, + "style.night": { + "line-color": "#2e7a57", + "line-width": "@hedge_width" + } + }, { + "id": "barrier_line_land", + "source": "mapbox", + "source-layer": "barrier_line", + "filter": { "class": "land" }, + "type": "line", + "style": { + "line-color": "@land", + "line-width": "@barrier_line_land_width" + }, + "style.night": { + "line-color": "@land_night", + "line-width": "@barrier_line_land_width" + } + }, { + "id": "barrier_line_land_fill", + "source": "mapbox", + "source-layer": "barrier_line", + "filter": { "class": "land" }, + "type": "fill", + "style": { + "fill-color": "@land" + }, + "style.night": { + "fill-color": "@land_night" + } + }, { + "id": "barrier_line_cliff", + "source": "mapbox", + "source-layer": "barrier_line", + "filter": { "class": "cliff" }, + "type": "line", + "style": { + "line-color": "#987", + "line-width": 4 + }, + "style.night": { + "line-color": "#63574b", + "line-width": 4 + } + }, { + "id": "water", + "source": "mapbox", + "source-layer": "water", + "type": "fill", + "style": { + "fill-color": "@water", + "fill-outline-color": "#a2bdc0" + }, + "style.night": { + "fill-color": "@water_night", + "fill-outline-color": "@water_dark_night" + } + }, { + "id": "aeroway_fill", + "source": "mapbox", + "source-layer": "aeroway", + "type": "fill", + "style": { + "fill-color": "#ddd" + }, + "style.night": { + "fill-color": "#367" + } + }, { + "id": "aeroway_runway", + "source": "mapbox", + "source-layer": "aeroway", + "filter": { "type": "runway" }, + "type": "line", + "style": { + "line-color": "#ddd", + "line-width": "@runway_width" + }, + "style.night": { + "line-color": "#367", + "line-width": "@runway_width" + } + }, { + "id": "aeroway_taxiway", + "source": "mapbox", + "source-layer": "aeroway", + "filter": { "type": "taxiway" }, + "type": "line", + "style": { + "line-color": "#ddd", + "line-width": "@taxiway_width" + }, + "style.night": { + "line-color": "#367", + "line-width": "@taxiway_width" + } + }, { + "id": "tunnel_motorway_link_casing", + "source": "mapbox", + "source-layer": "tunnel", + "filter": { "class": "motorway_link" }, + "type": "line", + "style": { + "line-color": "@case", + "line-dasharray": [6, 6], + "line-width": "@motorway_link_casing_width" + }, + "style.night": { + "line-color": "@case_night", + "line-dasharray": [6, 6], + "line-width": "@motorway_link_casing_width" + } + }, { + "id": "tunnel_service_casing", + "source": "mapbox", + "source-layer": "tunnel", + "filter": { "class": "service" }, + "type": "line", + "style": { + "line-color": "#000", + "line-opacity": 0.04, + "line-dasharray": [6, 6], + "line-width": "@service_casing_width" + }, + "style.night": { + "line-color": "#000", + "line-opacity": 0.04, + "line-dasharray": [6, 6], + "line-width": "@service_casing_width" + } + }, { + "id": "tunnel_main_casing", + "source": "mapbox", + "source-layer": "tunnel", + "filter": { "class": "main" }, + "type": "line", + "style": { + "line-color": "@case", + "line-dasharray": [6, 6], + "line-width": "@main_casing_width", + "line-opacity": { + "stops": [[8, 0], [9, 1]] + } + }, + "style.night": { + "line-color": "@case_night", + "line-dasharray": [6, 6], + "line-width": "@main_casing_width", + "line-opacity": { + "stops": [[8, 0], [9, 1]] + } + } + }, { + "id": "tunnel_street_casing", + "source": "mapbox", + "source-layer": "tunnel", + "filter": { "class": ["street", "street_limited"] }, + "type": "line", + "style": { + "line-color": "#d9d5c6", + "line-width": "@street_casing_width", + "line-opacity": "@street_casing_opacity" + }, + "style.night": { + "line-color": "@street_case_night", + "line-width": "@street_casing_width", + "line-opacity": "@street_casing_opacity" + } + }, { + "id": "tunnel_motorway_link", + "ref": "tunnel_motorway_link_casing", + "style": { + "line-color": "#e6cec7", + "line-width": "@motorway_link_width" + }, + "style.night": { + "line-color": "#78b0c1", + "line-width": "@motorway_link_width" + } + }, { + "id": "tunnel_service", + "ref": "tunnel_service_casing", + "style": { + "line-color": "#e6cec7", + "line-width": 2 + }, + "style.night": { + "line-color": "#017ca0", + "line-width": 2 + } + }, { + "id": "tunnel_street", + "ref": "tunnel_street_casing", + "style": { + "line-color": "#d9d5c6", + "line-width": "@street_width" + }, + "style.night": { + "line-color": "@street_night", + "line-width": "@street_width" + } + }, { + "id": "tunnel_main", + "ref": "tunnel_main_casing", + "style": { + "line-color": "#e6cec7", + "line-width": "@main_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + }, + "style.night": { + "line-color": "#78b0c1", + "line-width": "@main_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + } + }, { + "id": "tunnel_motorway_casing", + "source": "mapbox", + "source-layer": "tunnel", + "filter": { "class": "motorway" }, + "type": "line", + "style": { + "line-color": "@case", + "line-dasharray": [6, 6], + "line-width": "@motorway_casing_width", + "line-opacity": { + "stops": [[8.5, 0], [9, 1]] + } + }, + "style.night": { + "line-color": "@case_night", + "line-dasharray": [6, 6], + "line-width": "@motorway_casing_width", + "line-opacity": { + "stops": [[8.5, 0], [9, 1]] + } + } + }, { + "id": "tunnel_motorway", + "ref": "tunnel_motorway_casing", + "style": { + "line-color": "#e6cec7", + "line-width": "@motorway_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + }, + "style.night": { + "line-color": "#78b0c1", + "line-width": "@motorway_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + } + }, { + "id": "road_path_case", + "source": "mapbox", + "source-layer": "road", + "filter": { "class": "path" }, + "type": "line", + "style": { + "line-color": "#ffd", + "line-opacity": 0.4, + "line-width": { + "stops": [[14, 3], [15, 4]] + } + }, + "style.night": { + "line-color": "@land_night", + "line-opacity": 0.2 + } + }, { + "id": "road_path_footway", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "type": "footway" }, + "type": "line", + "style": { + "line-color": "#bba", + "line-dasharray": [10, 4], + "line-width": "@path_width" + }, + "style.night": { + "line-color": "#fff", + "line-dasharray": [10, 4], + "line-width": "@path_width" + } + }, { + "id": "road_path_path", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "type": "path" }, + "type": "line", + "style": { + "line-color": "#987", + "line-dasharray": [10, 4], + "line-opacity": 0.8, + "line-width": { + "stops": [[13, 0.8], [14, 0.9], [15, 1.2]] + } + }, + "style.night": { + "line-color": "#fff", + "line-dasharray": [10, 4], + "line-opacity": 0.8, + "line-width": { + "stops": [[13, 0.8], [14, 0.9], [15, 1.2]] + } + } + }, { + "id": "road_path_cycleway", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "type": "cycleway" }, + "type": "line", + "style": { + "line-color": "#488", + "line-dasharray": [10, 4], + "line-width": "@path_width" + }, + "style.night": { + "line-color": "#94e6ff", + "line-dasharray": [10, 4], + "line-width": "@path_width" + } + }, { + "id": "road_path_mtb", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "type": "mtb" }, + "type": "line", + "style": { + "line-color": "#488", + "line-dasharray": [12, 4], + "line-width": "@path_width" + }, + "style.night": { + "line-color": "#94e6ff", + "line-dasharray": [12, 4], + "line-width": "@path_width" + } + }, { + "id": "road_path_piste", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "type": "piste" }, + "type": "line", + "style": { + "line-color": "#87b", + "line-dasharray": [8, 4], + "line-width": "@path_width" + }, + "style.night": { + "line-color": "#715dae", + "line-dasharray": [8, 4], + "line-width": "@path_width" + } + }, { + "id": "road_path_steps", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "type": "steps" }, + "type": "line", + "style": { + "line-color": "#bba", + "line-dasharray": [10, 4], + "line-width": 4 + }, + "style.night": { + "line-color": "#016684", + "line-dasharray": [10, 4], + "line-opacity": 0.3, + "line-width": 6 + } + }, { + "id": "road_major_rail", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "class": "major_rail" }, + "type": "line", + "style": { + "line-color": "#c8c4c0", + "line-width": 0.8 + }, + "style.night": { + "line-color": "#c8c4c0", + "line-width": 0.8 + } + }, { + "id": "road_motorway_link_casing", + "source": "mapbox", + "source-layer": "road", + "filter": { "class": "motorway_link" }, + "type": "line", + "render": { + "line-join": "round", + "line-cap": "round" + }, + "style": { + "line-color": "@case", + "line-width": "@motorway_link_casing_width" + }, + "style.night": { + "line-color": "@case_night", + "line-width": "@motorway_link_casing_width" + } + }, { + "id": "road_service_casing", + "source": "mapbox", + "source-layer": "road", + "filter": { "class": "service" }, + "type": "line", + "render": { + "line-join": "round", + "line-cap": "round" + }, + "style": { + "line-color": "#000", + "line-opacity": 0.04, + "line-width": "@service_casing_width" + }, + "style.night": { + "line-color": "#000", + "line-opacity": 0.04, + "line-width": "@service_casing_width" + } + }, { + "id": "road_main_casing", + "source": "mapbox", + "source-layer": "road", + "filter": { "class": "main" }, + "type": "line", + "render": { + "line-join": "round", + "line-cap": "round" + }, + "style": { + "line-color": "@case", + "line-width": "@main_casing_width", + "line-opacity": { + "stops": [[8, 0], [9, 1]] + } + }, + "style.night": { + "line-color": "@case_night", + "line-width": "@main_casing_width", + "line-opacity": { + "stops": [[8, 0], [9, 1]] + } + } + }, { + "id": "road_street_casing", + "source": "mapbox", + "source-layer": "road", + "filter": { "class": ["street", "street_limited"] }, + "type": "line", + "render": { + "line-join": "round", + "line-cap": "round" + }, + "style": { + "line-color": "#d9d5c6", + "line-width": "@street_casing_width", + "line-opacity": "@street_casing_opacity" + }, + "style.night": { + "line-color": "@street_case_night", + "line-width": "@street_casing_width", + "line-opacity": "@street_casing_opacity" + } + }, { + "id": "road_motorway_link", + "ref": "road_motorway_link_casing", + "style": { + "line-color": "@motorway", + "line-width": "@motorway_link_width" + }, + "style.night": { + "line-color": "@motorway_night", + "line-width": "@motorway_link_width" + } + }, { + "id": "road_service", + "ref": "road_service_casing", + "style": { + "line-color": "@street", + "line-width": 2 + }, + "style.night": { + "line-color": "@street_night", + "line-width": 2 + } + }, { + "id": "road_street", + "ref": "road_street_casing", + "style": { + "line-color": "@street", + "line-width": "@street_width" + }, + "style.night": { + "line-color": "@street_night", + "line-width": "@street_width" + } + }, { + "id": "road_main", + "ref": "road_main_casing", + "style": { + "line-color": "@main", + "line-width": "@main_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + }, + "style.night": { + "line-color": "@main_night", + "line-width": "@main_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + } + }, { + "id": "road_motorway_casing", + "source": "mapbox", + "source-layer": "road", + "filter": { "class": "motorway" }, + "type": "line", + "render": { + "line-join": "round", + "line-cap": "round" + }, + "style": { + "line-color": "@case", + "line-width": "@motorway_casing_width", + "line-opacity": { + "stops": [[8.5, 0], [9, 1]] + } + }, + "style.night": { + "line-color": "@case_night", + "line-width": "@motorway_casing_width", + "line-opacity": { + "stops": [[8.5, 0], [9, 1]] + } + } + }, { + "id": "road_motorway", + "ref": "road_motorway_casing", + "style": { + "line-color": "@motorway", + "line-width": "@motorway_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + }, + "style.night": { + "line-color": "@motorway_night", + "line-width": "@motorway_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + } + }, { + "id": "road_major_rail_hatching", + "ref": "road_major_rail", + "style": { + "line-color": "#c8c4c0", + "line-dasharray": [2, 31], + "line-width": 5 + }, + "style.night": { + "line-color": "#c8c4c0", + "line-dasharray": [2, 31], + "line-width": 5 + } + }, { + "id": "bridge_motorway_link_casing", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "class": "motorway_link" }, + "type": "line", + "style": { + "line-color": "@case", + "line-width": "@motorway_link_casing_width" + }, + "style.night": { + "line-color": "@case_night", + "line-width": "@motorway_link_casing_width" + } + }, { + "id": "bridge_service_casing", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "class": "service" }, + "type": "line", + "style": { + "line-color": "#000", + "line-opacity": 0.04, + "line-width": "@service_casing_width" + }, + "style.night": { + "line-color": "#000", + "line-opacity": 0.04, + "line-width": "@service_casing_width" + } + }, { + "id": "bridge_main_casing", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "class": "main" }, + "type": "line", + "style": { + "line-color": "@case", + "line-width": "@main_casing_width", + "line-opacity": { + "stops": [[8, 0], [9, 1]] + } + }, + "style.night": { + "line-color": "@case_night", + "line-width": "@main_casing_width", + "line-opacity": { + "stops": [[8, 0], [9, 1]] + } + } + }, { + "id": "bridge_street_casing", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "class": ["street", "street_limited"] }, + "type": "line", + "style": { + "line-color": "#d9d5c6", + "line-width": "@street_casing_width", + "line-opacity": "@street_casing_opacity" + }, + "style.night": { + "line-color": "@street_case_night", + "line-width": "@street_casing_width", + "line-opacity": "@street_casing_opacity" + } + }, { + "id": "bridge_motorway_link", + "ref": "bridge_motorway_link_casing", + "style": { + "line-color": "@motorway", + "line-width": "@motorway_link_width" + }, + "style.night": { + "line-color": "@motorway_night", + "line-width": "@motorway_link_width" + } + }, { + "id": "bridge_service", + "ref": "bridge_service_casing", + "style": { + "line-color": "@street", + "line-width": 2 + }, + "style.night": { + "line-color": "@street_night", + "line-width": 2 + } + }, { + "id": "bridge_street", + "ref": "bridge_street_casing", + "style": { + "line-color": "@street", + "line-width": "@street_width" + }, + "style.night": { + "line-color": "@street_night", + "line-width": "@street_width" + } + }, { + "id": "bridge_main", + "ref": "bridge_main_casing", + "style": { + "line-color": "@main", + "line-width": "@main_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + }, + "style.night": { + "line-color": "@main_night", + "line-width": "@main_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + } + }, { + "id": "bridge_motorway_casing", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "class": "motorway" }, + "type": "line", + "style": { + "line-color": "@case", + "line-width": "@motorway_casing_width", + "line-opacity": { + "stops": [[8.5, 0], [9, 1]] + } + }, + "style.night": { + "line-color": "@case_night", + "line-width": "@motorway_casing_width", + "line-opacity": { + "stops": [[8.5, 0], [9, 1]] + } + } + }, { + "id": "bridge_motorway", + "ref": "bridge_motorway_casing", + "style": { + "line-color": "@motorway", + "line-width": "@motorway_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + }, + "style.night": { + "line-color": "@motorway_night", + "line-width": "@motorway_width", + "line-opacity": { + "stops": [[5.5, 0], [6, 1]] + } + } + }, { + "id": "bridge_aerialway_casing", + "source": "mapbox", + "source-layer": "bridge", + "filter": { "class": "aerialway" }, + "type": "line", + "style": { + "line-color": "white", + "line-opacity": 0.5, + "line-width": "@aerialway_casing_width" + }, + "style.night": { + "line-color": "white", + "line-opacity": 0.5, + "line-width": "@aerialway_casing_width" + } + }, { + "id": "bridge_aerialway", + "ref": "bridge_aerialway_casing", + "style": { + "line-color": "#876", + "line-opacity": 0.5, + "line-width": "@aerialway_width" + }, + "style.night": { + "line-color": "#876", + "line-opacity": 0.5, + "line-width": "@aerialway_width" + } + }, { + "id": "admin_l3", + "source": "mapbox", + "source-layer": "admin", + "filter": { "admin_level": [3, 4, 5] }, + "type": "line", + "render": { + "line-join": "round" + }, + "style": { + "line-color": "#88a", + "line-dasharray": [60, 20], + "line-opacity": { + "stops": [[3, 0], [5, 1]] + }, + "line-width": "@admin_l3_width" + }, + "style.night": { + "line-color": "@admin_night", + "line-dasharray": [60, 20], + "line-opacity": { + "stops": [[3, 0], [5, 1]] + }, + "line-width": "@admin_l3_width" + } + }, { + "id": "admin_l2", + "source": "mapbox", + "source-layer": "admin", + "filter": { "admin_level": 2 }, + "type": "line", + "render": { + "line-join": "round", + "line-cap": "round" + }, + "style": { + "line-color": "#88a", + "line-width": "@admin_l2_width" + }, + "style.night": { + "line-color": "@admin_night", + "line-width": "@admin_l2_width" + } + }, { + "id": "admin_maritime_cover", + "source": "mapbox", + "source-layer": "admin", + "filter": { "maritime": 1 }, + "type": "line", + "render": { + "line-join": "round", + "line-cap": "round" + }, + "style": { + "line-color": "@water", + "line-width": 5 + }, + "style.night": { + "line-color": "@water_night", + "line-width": 5 + } + }, { + "id": "admin_maritime", + "ref": "admin_maritime_cover", + "style": { + "line-color": "#c0d6d6", + "line-width": { + "stops": [[5, 1], [7, 2], [11, 3]] + } + }, + "style.night": { + "line-color": "#0a1347", + "line-width": { + "stops": [[5, 1], [7, 2], [11, 3]] + } + } + }, { + "id": "country_label_line", + "source": "mapbox", + "source-layer": "country_label_line", + "type": "line", + "render": { + "text-max-width": 5 + }, + "style": { + "line-color": "@country_text", + "line-width": 0.5, + "line-opacity": 0.5 + }, + "style.night": { + "line-color": "@text_night", + "line-width": 0.5, + "line-opacity": 0.5 + } + }, { + "id": "country_label", + "source": "mapbox", + "source-layer": "country_label", + "filter": { "$type": "Point" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Semibold, Arial Unicode MS Bold", + "text-max-size": 24, + "text-max-width": 5 + }, + "style": { + "text-color": "@country_text", + "text-halo-color": "rgba(255,255,255,0.5)", + "text-halo-width": 0.5, + "text-size": "@country_label_size" + }, + "style.night": { + "text-color": "@text_night", + "text-halo-color": "@text2_stroke_night", + "text-halo-width": 0.4, + "text-size": "@country_label_size" + } + }, { + "id": "marine_label_line_1", + "source": "mapbox", + "source-layer": "marine_label", + "filter": { "$type": "LineString", "labelrank": 1 }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "curve", + "text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold", + "text-max-size": 30, + "text-max-angle": 0.5, + "text-letter-spacing": 0.4 + }, + "style": { + "text-color": "@marine_text", + "text-size": { + "stops": [[2, 20], [3, 25], [4, 30], [21, 30]] + }, + "text-halo-color": "@water" + }, + "style.night": { + "text-color": "@water_dark_night", + "text-size": { + "stops": [[2, 20], [3, 25], [4, 30], [21, 30]] + }, + "text-halo-color": "@water_night" + } + }, { + "id": "marine_label_line_2", + "source": "mapbox", + "source-layer": "marine_label", + "filter": { "$type": "LineString", "labelrank": 2 }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "curve", + "text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold", + "text-max-size": 24, + "text-max-angle": 0.5 + }, + "style": { + "text-color": "@marine_text", + "text-size": { + "stops": [[2, 13], [3, 14], [4, 20], [5, 24], [21, 24]] + }, + "text-halo-color": "@water" + }, + "style.night": { + "text-color": "@water_dark_night", + "text-size": { + "stops": [[2, 13], [3, 14], [4, 20], [5, 24], [21, 24]] + }, + "text-halo-color": "@water_night" + } + }, { + "id": "marine_label_line_3", + "source": "mapbox", + "source-layer": "marine_label", + "filter": { "$type": "LineString", "labelrank": 3 }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "curve", + "text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold", + "text-max-size": 18, + "text-max-angle": 0.5 + }, + "style": { + "text-color": "@marine_text", + "text-size": { + "stops": [[2, 12], [3, 13], [4, 15], [5, 18], [21, 18]] + }, + "text-halo-color": "@water" + }, + "style.night": { + "text-color": "@water_dark_night", + "text-size": { + "stops": [[2, 12], [3, 13], [4, 15], [5, 18], [21, 18]] + }, + "text-halo-color": "@water_night" + } + }, { + "id": "marine_label_line_other", + "source": "mapbox", + "source-layer": "marine_label", + "filter": { "$type": "LineString", "labelrank": [4, 5, 6] }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "curve", + "text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold", + "text-max-size": 16, + "text-max-angle": 0.5 + }, + "style": { + "text-color": "@marine_text", + "text-size": { + "stops": [[3, 12], [4, 14], [5, 16], [21, 16]] + }, + "text-halo-color": "@water" + }, + "style.night": { + "text-color": "@water_dark_night", + "text-size": { + "stops": [[3, 12], [4, 14], [5, 16], [21, 16]] + }, + "text-halo-color": "@water_night" + } + }, { + "id": "marine_label_point_1", + "source": "mapbox", + "source-layer": "marine_label", + "filter": { "$type": "Point", "labelrank": 1 }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold", + "text-max-size": 30, + "text-max-width": 8, + "text-letter-spacing": 0.4, + "text-line-height": 2 + }, + "style": { + "text-color": "@marine_text", + "text-size": { + "stops": [[2, 20], [3, 25], [4, 30], [21, 30]] + }, + "text-halo-color": "@water" + }, + "style.night": { + "text-color": "@water_dark_night", + "text-size": { + "stops": [[2, 20], [3, 25], [4, 30], [21, 30]] + }, + "text-halo-color": "@water_night" + } + }, { + "id": "marine_label_point_2", + "source": "mapbox", + "source-layer": "marine_label", + "filter": { "$type": "Point", "labelrank": 2 }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold", + "text-max-size": 24, + "text-max-width": 8, + "text-letter-spacing": 0.2, + "text-line-height": 1.5 + }, + "style": { + "text-color": "@marine_text", + "text-size": { + "stops": [[2, 13], [3, 14], [4, 20], [5, 24], [21, 24]] + }, + "text-halo-color": "@water" + }, + "style.night": { + "text-color": "@water_dark_night", + "text-size": { + "stops": [[2, 13], [3, 14], [4, 20], [5, 24], [21, 24]] + }, + "text-halo-color": "@water_night" + } + }, { + "id": "marine_label_point_3", + "source": "mapbox", + "source-layer": "marine_label", + "filter": { "$type": "Point", "labelrank": 3 }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold", + "text-max-size": 18, + "text-max-width": 8, + "text-letter-spacing": 0.1, + "text-line-height": 1.3 + }, + "style": { + "text-color": "@marine_text", + "text-size": { + "stops": [[2, 12], [3, 13], [4, 15], [5, 18], [21, 18]] + }, + "text-halo-color": "@water" + }, + "style.night": { + "text-color": "@water_dark_night", + "text-size": { + "stops": [[2, 12], [3, 13], [4, 15], [5, 18], [21, 18]] + }, + "text-halo-color": "@water_night" + } + }, { + "id": "marine_label_point_other", + "source": "mapbox", + "source-layer": "marine_label", + "filter": { "$type": "Point", "labelrank": [4, 5, 6] }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold", + "text-max-size": 16, + "text-max-width": 8, + "text-letter-spacing": 0.1, + "text-line-height": 1.2 + }, + "style": { + "text-color": "@marine_text", + "text-size": { + "stops": [[3, 12], [4, 14], [5, 16], [21, 16]] + }, + "text-halo-color": "@water" + }, + "style.night": { + "text-color": "@water_dark_night", + "text-size": { + "stops": [[3, 12], [4, 14], [5, 16], [21, 16]] + }, + "text-halo-color": "@water_night" + } + }, { + "id": "state_label", + "source": "mapbox", + "source-layer": "state_label", + "filter": { "$type": "Point" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Regular, Arial Unicode MS Regular", + "text-max-size": 16, + "text-max-width": 8 + }, + "style": { + "text-color": "#333", + "text-halo-width": 0.4, + "text-halo-color": "rgba(244,239,225,0.8)", + "text-size": { + "stops": [[2.99, 0], [3, 10], [8.99, 16], [9, 0]] + } + }, + "style.night": { + "text-color": "#fff", + "text-halo-width": 0.4, + "text-halo-color": "@land_night", + "text-size": { + "stops": [[2.99, 0], [3, 10], [8.99, 16], [9, 0]] + } + } + }, { + "id": "place_label_city", + "source": "mapbox", + "source-layer": "place_label", + "filter": { "type": "city", "$type": "Point" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Semibold, Arial Unicode MS Bold", + "text-max-size": 20, + "text-max-width": 8 + }, + "style": { + "text-color": "#444", + "text-halo-width": 0.4, + "text-halo-color": "@text_stroke", + "text-size": { + "stops": [[2.99, 0], [3, 10], [6, 14], [13.99, 20], [14, 0]] + } + }, + "style.night": { + "text-color": "#fff", + "text-halo-width": 0.4, + "text-halo-color": "@text2_stroke_night", + "text-size": { + "stops": [[2.99, 0], [3, 10], [6, 14], [13.99, 20], [14, 0]] + } + } + }, { + "id": "place_label_town", + "source": "mapbox", + "source-layer": "place_label", + "filter": { "type": "town", "$type": "Point" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Semibold, Arial Unicode MS Bold", + "text-max-size": 24, + "text-max-width": 8 + }, + "style": { + "text-color": "#716656", + "text-halo-width": 0.3, + "text-halo-color": "@text_stroke", + "text-size": { + "stops": [[8, 10], [11, 13], [13, 17], [15, 22]] + } + }, + "style.night": { + "text-color": "@text_night", + "text-halo-width": 0.3, + "text-halo-color": "@text2_stroke_night", + "text-size": { + "stops": [[8, 10], [11, 13], [13, 17], [15, 22]] + } + } + }, { + "id": "place_label_village", + "source": "mapbox", + "source-layer": "place_label", + "filter": { "type": "village", "$type": "Point" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Semibold, Arial Unicode MS Bold", + "text-max-size": 22, + "text-max-width": 8 + }, + "style": { + "text-color": "#635644", + "text-halo-width": 0.3, + "text-halo-color": "@text_stroke", + "text-size": { + "stops": [[8, 8], [11, 10], [13, 14], [15, 16], [16, 20]] + } + }, + "style.night": { + "text-color": "@text_night", + "text-halo-width": 0.3, + "text-halo-color": "@text2_stroke_night", + "text-size": { + "stops": [[8, 8], [11, 10], [13, 14], [15, 16], [16, 20]] + } + } + }, { + "id": "place_label_other", + "source": "mapbox", + "source-layer": "place_label", + "filter": { "type": ["hamlet", "suburb", "neighbourhood"], "$type": "Point" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Semibold, Arial Unicode MS Bold", + "text-max-size": 18, + "text-max-width": 6 + }, + "style": { + "text-color": "#7d6c55", + "text-halo-color": "@text_stroke", + "text-size": { + "stops": [[12, 11], [13, 12], [15, 14], [17, 18]] + } + }, + "style.night": { + "text-color": "@text_night", + "text-halo-color": "@text2_stroke_night", + "text-halo-width": 0.3, + "text-size": { + "stops": [[12, 11], [13, 12], [15, 14], [17, 18]] + } + } + }, { + "id": "road_label_1", + "source": "mapbox", + "source-layer": "road_label", + "filter": { "class": ["motorway", "main"], "$type": "LineString" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "curve", + "text-padding": 2, + "text-font": "Open Sans Regular, Arial Unicode MS Regular", + "text-max-size": 18, + "text-max-angle": 0.5 + }, + "style": { + "text-color": "#585042", + "text-halo-color": "@land", + "text-halo-width": 0.6, + "text-size": "@road_label_1_size" + }, + "style.night": { + "text-color": "@text_night", + "text-halo-color": "@text2_stroke_night", + "text-halo-width": 0.5, + "text-size": "@road_label_1_size" + } + }, { + "id": "road_label_2", + "source": "mapbox", + "source-layer": "road_label", + "filter": { "class": ["street", "street_limited"], "$type": "LineString" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "curve", + "text-padding": 2, + "text-font": "Open Sans Regular, Arial Unicode MS Regular", + "text-max-size": 16, + "text-max-angle": 0.5 + }, + "style": { + "text-color": "#585042", + "text-halo-color": "@land", + "text-halo-width": 0.6, + "text-size": "@road_label_2_size" + }, + "style.night": { + "text-color": "@text_night", + "text-halo-color": "@text2_stroke_night", + "text-halo-width": 0.5, + "text-size": "@road_label_2_size" + } + }, { + "id": "road_label_3", + "source": "mapbox", + "source-layer": "road_label", + "filter": { "class": ["service", "driveway", "path"], "$type": "LineString" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "curve", + "text-padding": 2, + "text-font": "Open Sans Regular, Arial Unicode MS Regular", + "text-max-size": 14, + "text-max-angle": 0.5 + }, + "style": { + "text-color": "#585042", + "text-halo-color": "@land", + "text-halo-width": 0.6, + "text-size": "@road_label_3_size" + }, + "style.night": { + "text-color": "@text_night", + "text-halo-color": "@text2_stroke_night", + "text-halo-width": 0.5, + "text-size": "@road_label_3_size" + } + }, { + "id": "contour_label", + "source": "mapbox", + "source-layer": "contour", + "filter": { "index": [5, 10], "$type": "LineString" }, + "type": "text", + "render": { + "text-path": "curve", + "text-field": "{ele} m", + "text-font": "Open Sans Regular, Arial Unicode MS Regular", + "text-max-size": 10, + "text-max-angle": 0.5 + }, + "style": { + "text-color": "@text", + "text-halo-color": "@land", + "text-halo-width": 0.3, + "text-size": 10 + }, + "style.night": { + "text-color": "@contour_night", + "text-halo-color": "@land_night", + "text-halo-width": 0.3, + "text-size": 10 + } + }, { + "id": "water_label", + "source": "mapbox", + "source-layer": "water_label", + "filter": { "$type": "Point" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold", + "text-max-size": 12, + "text-max-width": 8 + }, + "style": { + "text-color": "@water_dark", + "text-halo-color": "rgba(255,255,255,0.75)" + }, + "style.night": { + "text-color": "@text_water_night", + "text-halo-color": "@water_night" + } + }, { + "id": "waterway_label", + "source": "mapbox", + "source-layer": "waterway_label", + "filter": { "$type": "LineString" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "curve", + "text-font": "Open Sans Semibold Italic, Arial Unicode MS Bold", + "text-max-size": 12, + "text-max-angle": 0.5 + }, + "style": { + "text-color": "@water_dark", + "text-halo-width": 0.4, + "text-halo-color": "@text_stroke" + }, + "style.night": { + "text-color": "@text_water_night", + "text-halo-color": "@water_night" + } + }, { + "id": "poi", + "source": "mapbox", + "source-layer": "poi_label", + "filter": { "scalerank": [1, 2] }, + "type": "icon", + "render": { + "icon-image": "{maki}-12", + "icon-size": 12 + }, + "style.night": {} + }, { + "id": "poi_label_1-2", + "source": "mapbox", + "source-layer": "poi_label", + "filter": { "scalerank": [1, 2], "$type": "Point" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-padding": 2, + "text-font": "Open Sans Semibold, Arial Unicode MS Bold", + "text-max-size": 12, + "text-max-width": 10, + "text-alignment": "center" + }, + "style": { + "text-color": "#444", + "text-size": "@poi_label_1-2_size", + "text-halo-color": "@land", + "text-halo-width": 0.3 + }, + "style.night": { + "text-color": "#fff", + "text-size": "@poi_label_1-2_size", + "text-halo-color": "@text2_stroke_night", + "text-halo-width": 0.3 + } + }, { + "id": "poi_3", + "source": "mapbox", + "source-layer": "poi_label", + "filter": { "scalerank": 3 }, + "type": "icon", + "render": { + "icon-image": "{maki}-12", + "icon-size": 12 + }, + "style": { + "icon-opacity": { + "stops": [[15.5, 0], [15.75, 1]] + } + }, + "style.night": { + "icon-opacity": { + "stops": [[15.5, 0], [15.75, 1]] + } + } + }, { + "id": "poi_label_3", + "source": "mapbox", + "source-layer": "poi_label", + "filter": { "scalerank": 3, "$type": "Point" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-padding": 2, + "text-font": "Open Sans Semibold, Arial Unicode MS Bold", + "text-max-size": 11, + "text-max-width": 10, + "text-alignment": "center" + }, + "style": { + "text-color": "#444", + "text-size": "@poi_label_3_size", + "text-halo-color": "@land", + "text-halo-width": 0.3, + "text-opacity": { + "stops": [[15.5, 0], [15.75, 1]] + } + }, + "style.night": { + "text-color": "#fff", + "text-size": "@poi_label_3_size", + "text-halo-color": "@text2_stroke_night", + "text-halo-width": 0.3, + "text-opacity": { + "stops": [[15.5, 0], [15.75, 1]] + } + } + }, { + "id": "poi_4", + "source": "mapbox", + "source-layer": "poi_label", + "filter": { "scalerank": 4 }, + "type": "icon", + "render": { + "icon-image": "{maki}-12", + "icon-size": 12 + }, + "style": { + "icon-opacity": { + "stops": [[17.5, 0], [17.75, 1]] + } + }, + "style.night": { + "icon-opacity": { + "stops": [[17.5, 0], [17.75, 1]] + } + } + }, { + "id": "poi_label_4", + "source": "mapbox", + "source-layer": "poi_label", + "filter": { "scalerank": 4, "$type": "Point" }, + "type": "text", + "render": { + "text-field": "{name_en}", + "text-path": "horizontal", + "text-padding": 2, + "text-font": "Open Sans Semibold, Arial Unicode MS Bold", + "text-max-size": 10, + "text-max-width": 10, + "text-alignment": "center" + }, + "style": { + "text-color": "#444", + "text-size": 10, + "text-opacity": { + "stops": [[17.5, 0], [17.75, 1]] + }, + "text-halo-color": "@land", + "text-halo-width": 0.3 + }, + "style.night": { + "text-color": "#fff", + "text-size": 10, + "text-opacity": { + "stops": [[17.5, 0], [17.75, 1]] + }, + "text-halo-color": "@text2_stroke_night", + "text-halo-width": 0.3 + } + }, { + "id": "poi_aerodrome", + "source": "mapbox", + "source-layer": "poi_label", + "filter": { "maki": "airport" }, + "type": "icon", + "render": { + "icon-image": "{maki}-12", + "icon-size": 12 + }, + "style": { + "icon-opacity": { + "stops": [[12, 0], [12.25, 1]] + } + }, + "style.night": { + "icon-opacity": { + "stops": [[12, 0], [12.25, 1]] + } + } + }] +} diff --git a/test/test.gyp b/test/test.gyp index 75ab26a51..3bf8b5b33 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -122,7 +122,7 @@ "dependencies": [ "../deps/gtest/gtest.gyp:gtest", "../mapboxgl.gyp:mapboxgl", - "../mapboxgl.gyp:copy_default_stylesheet_fixtures", + "../mapboxgl.gyp:copy_fixtures", ] }, { From 52939ce2fa7b1aaf4b4f649ea0c9ec26e132ee34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 12 Aug 2014 13:29:26 +0200 Subject: [PATCH 51/52] pass absolute path to npm executable --- configure | 9 +++++++++ mapboxgl.gyp | 2 +- scripts/npm_install.sh | 2 +- setup-libraries.sh | 9 +++++++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/configure b/configure index f1a39cbbc..a38c587d6 100755 --- a/configure +++ b/configure @@ -22,6 +22,11 @@ parser.add_option("--node", dest="node", help="Name of the node executable (defaults to node)") +parser.add_option("--npm", + action="store", + dest="npm", + help="Name of the npm executable (defaults to npm)") + parser.add_option("--pkg-config-root", action="store", dest="pkgconfig_root", @@ -59,6 +64,10 @@ def configure_mbgl(o): o['variables']['node'] = options.node else: o['variables']['node'] = 'node' + if options.npm: + o['variables']['npm'] = options.npm + else: + o['variables']['npm'] = 'npm' o['target_defaults']['default_configuration'] = 'Debug' if options.debug else 'Release' diff --git a/mapboxgl.gyp b/mapboxgl.gyp index 5af90fbc9..5682d7e02 100644 --- a/mapboxgl.gyp +++ b/mapboxgl.gyp @@ -49,7 +49,7 @@ 'outputs': [ 'bin/node_modules', ], - 'action': ['./scripts/npm_install.sh'] + 'action': ['./scripts/npm_install.sh', '<@(npm)'] } ], }, diff --git a/scripts/npm_install.sh b/scripts/npm_install.sh index b6a4eef5f..7437af961 100755 --- a/scripts/npm_install.sh +++ b/scripts/npm_install.sh @@ -4,5 +4,5 @@ set -e set -o pipefail cd bin -npm install --clang=1 +$1 install --clang=1 cd ../ diff --git a/setup-libraries.sh b/setup-libraries.sh index aa0360d98..3e5e897a7 100755 --- a/setup-libraries.sh +++ b/setup-libraries.sh @@ -40,6 +40,9 @@ if [[ $MISSING_DEPS != "" ]]; then exit 1 fi +NODE=`which node` +NPM=`which npm` + if [ ! -d 'mapnik-packaging/.git' ]; then git clone --depth=1 https://github.com/mapnik/mapnik-packaging.git fi @@ -92,7 +95,8 @@ cd ../../ ./configure \ --pkg-config-root=`pwd`/mapnik-packaging/osx/out/build-cpp11-libcpp-universal/lib/pkgconfig \ --boost=`pwd`/mapnik-packaging/osx/out/build-cpp11-libcpp-universal \ ---node=`which node` +--npm=$NPM \ +--node=$NODE elif [ ${UNAME} = 'Linux' ]; then @@ -122,5 +126,6 @@ cd ../../ ./configure \ --pkg-config-root=`pwd`/mapnik-packaging/osx/out/build-cpp11-libstdcpp-gcc-x86_64-linux/lib/pkgconfig \ --boost=`pwd`/mapnik-packaging/osx/out/build-cpp11-libstdcpp-gcc-x86_64-linux \ ---node=`which node` +--npm=$NPM \ +--node=$NODE fi From df47a7be9078802c694231e6e8fa6336601bd4f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 12 Aug 2014 13:35:04 +0200 Subject: [PATCH 52/52] explicitly define destructor to avoid destructing with forward declaration --- include/mbgl/style/style.hpp | 1 + src/style/style.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/mbgl/style/style.hpp b/include/mbgl/style/style.hpp index 1f24674e4..6acb5d0cb 100644 --- a/include/mbgl/style/style.hpp +++ b/include/mbgl/style/style.hpp @@ -28,6 +28,7 @@ public: public: Style(); + ~Style(); void loadJSON(const uint8_t *const data); diff --git a/src/style/style.cpp b/src/style/style.cpp index 22c761010..ee930751e 100644 --- a/src/style/style.cpp +++ b/src/style/style.cpp @@ -19,6 +19,11 @@ Style::Style() : mtx(std::make_unique()) { } +// Note: This constructor is seemingly empty, but we need to declare it anyway +// because this file includes uv_detail.hpp, which has the declarations necessary +// for deleting the std::unique_ptr. +Style::~Style() {} + void Style::updateProperties(float z, timestamp now) { uv::writelock lock(mtx);