{ "$schema": "https://vega.github.io/schema/vega-lite/v5.8.0.json", "config": {"view": {"continuousHeight": 300, "continuousWidth": 300}}, "datasets": {"empty": [{}]}, "height": 600, "layer": [ { "data": { "name": "tile_list", "sequence": {"as": "a", "start": 0, "stop": 4} }, "encoding": { "url": {"field": "url", "type": "nominal"}, "x": {"field": "x", "scale": null, "type": "quantitative"}, "y": {"field": "y", "scale": null, "type": "quantitative"} }, "mark": { "clip": true, "height": {"expr": "tile_size - 10"}, "type": "image", "width": {"expr": "tile_size - 10"} }, "projection": { "center": [0, 50], "rotate": [-10, 0, 0], "scale": 400, "type": "mercator" }, "transform": [ {"as": "b", "calculate": "sequence(0, 4)"}, {"flatten": ["b"]}, { "as": "url", "calculate": "'https://tile.openstreetmap.org/' + zoom_ceil + '/' + ((datum.a + dii_floor + tiles_count) % tiles_count) + '/' + (datum.b + djj_floor) + '.png'" }, {"as": "x", "calculate": "datum.a * tile_size + dx + (tile_size / 2)"}, {"as": "y", "calculate": "datum.b * tile_size + dy + (tile_size / 2)"}, { "filter": "((datum.a + dii_floor + tiles_count) % tiles_count) >= 0 && (datum.b + djj_floor) >= 0 && ((datum.a + dii_floor + tiles_count) % tiles_count) <= (tiles_count - 1) && (datum.b + djj_floor) <= (tiles_count - 1)" }, { "filter": "datum.x < (width + tile_size / 2) && datum.y < (height + tile_size / 2)" } ] }, { "data": { "format": {"feature": "countries", "type": "topojson"}, "url": "https://cdn.jsdelivr.net/npm/vega-datasets@v1.29.0/data/world-110m.json" }, "encoding": { "fill": {"field": "id", "legend": null, "type": "quantitative"} }, "mark": { "fillOpacity": 0.1, "stroke": "orange", "strokeWidth": 2, "type": "geoshape" }, "projection": { "center": [0, 50], "rotate": [-10, 0, 0], "scale": 400, "type": "mercator" } }, { "data": {"name": "empty"}, "encoding": {"x": {"value": 0}, "y": {"value": {"expr": "height"}}}, "mark": { "align": "left", "dx": 3, "dy": -8, "text": "(C) OpenStreetMap contributors", "type": "text" } } ], "params": [ { "expr": "(2 * PI * pr_scale) / pow(2, zoom_level)", "name": "base_tile_size" }, {"expr": "400", "name": "pr_scale"}, {"name": "zoom_level", "value": 1}, {"expr": "ceil(zoom_level)", "name": "zoom_ceil"}, {"expr": "pow(2, zoom_ceil)", "name": "tiles_count"}, { "expr": "base_tile_size * pow(2, zoom_level - zoom_ceil)", "name": "tile_size" }, {"expr": "invert('projection', [0, 0])", "name": "base_point"}, {"expr": "(base_point[0] + 180) / 360 * tiles_count", "name": "dii"}, {"expr": "floor(dii)", "name": "dii_floor"}, {"expr": "(dii_floor - dii) * tile_size", "name": "dx"}, { "expr": "(1 - log(tan(base_point[1] * PI / 180) + 1 / cos(base_point[1] * PI / 180)) / PI) / 2 * tiles_count", "name": "djj" }, {"expr": "floor(djj)", "name": "djj_floor"}, {"expr": "round((djj_floor - djj) * tile_size)", "name": "dy"} ], "width": 600 }