Skip to content

Commit

Permalink
Merge branch 'main' into feature/upgrade-styled-components
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Dec 6, 2023
2 parents daef924 + 0f500cf commit e7d14c3
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 66 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Demo

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths:
- 'demo/**'
release:
types: [ published ]
workflow_dispatch:

jobs:
demo:
name: Demo
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v4

- run: |
cd demo/frontend
docker-compose build
96 changes: 39 additions & 57 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/src/run-with-docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: '3'

services:
martin:
image: ghcr.io/maplibre/martin:v0.11.1
image: ghcr.io/maplibre/martin:v0.11.2
restart: unless-stopped
ports:
- "3000:3000"
Expand Down
2 changes: 1 addition & 1 deletion martin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ lints.workspace = true
[package]
name = "martin"
# Once the release is published with the hash, update https://github.com/maplibre/homebrew-martin
version = "0.11.2"
version = "0.11.3"
authors = ["Stepan Kuzmin <[email protected]>", "Yuri Astrakhan <[email protected]>", "MapLibre contributors"]
description = "Blazing fast and lightweight tile server with PostGIS, MBTiles, and PMTiles support"
keywords = ["maps", "tiles", "mbtiles", "pmtiles", "postgis"]
Expand Down
21 changes: 21 additions & 0 deletions martin/src/bin/martin-cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@ pub struct CopyArgs {
/// Skip generating a global hash for mbtiles validation. By default, `martin-cp` will compute and update `agg_tiles_hash` metadata value.
#[arg(long)]
pub skip_agg_tiles_hash: bool,
/// Set additional metadata values. Must be set as "key=value" pairs. Can be specified multiple times.
#[arg(long, value_name="KEY=VALUE", value_parser = parse_key_value)]
pub set_meta: Vec<(String, String)>,
}

fn parse_key_value(s: &str) -> Result<(String, String), String> {
let mut parts = s.splitn(2, '=');
let key = parts.next().unwrap();
let value = parts
.next()
.ok_or_else(|| format!("Invalid key=value pair: {s}"))?;
if key.is_empty() || value.is_empty() {
Err(format!("Invalid key=value pair: {s}"))
} else {
Ok((key.to_string(), value.to_string()))
}
}

async fn start(copy_args: CopierArgs) -> MartinCpResult<()> {
Expand Down Expand Up @@ -336,6 +352,11 @@ async fn run_tile_copy(args: CopyArgs, state: ServerState) -> MartinCpResult<()>

info!("{progress}");

for (key, value) in args.set_meta {
info!("Setting metadata key={key} value={value}");
mbt.set_metadata_value(&mut conn, &key, value).await?;
}

if !args.skip_agg_tiles_hash {
if progress.non_empty.load(Ordering::Relaxed) == 0 {
info!("No tiles were copied, skipping agg_tiles_hash computation");
Expand Down
2 changes: 1 addition & 1 deletion mbtiles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lints.workspace = true

[package]
name = "mbtiles"
version = "0.8.1"
version = "0.8.2"
authors = ["Yuri Astrakhan <[email protected]>", "MapLibre contributors"]
description = "A simple low-level MbTiles access and processing library, with some tile format detection and other relevant heuristics."
keywords = ["mbtiles", "maps", "tiles", "mvt", "tilejson"]
Expand Down
2 changes: 1 addition & 1 deletion tests/expected/martin-cp/flat-with-hash_metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ tilejson:
description: public.function_zxy_query_test
name: function_zxy_query_test
format: mvt
generator: martin-cp v0.11.2
generator: martin-cp v0.11.3
agg_tiles_hash: 9B931A386D6075D1DA55323BD4DBEDAE

2 changes: 1 addition & 1 deletion tests/expected/martin-cp/flat_metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ tilejson:
name: table_source
foo: '{"bar":"foo"}'
format: mvt
generator: martin-cp v0.11.2
generator: martin-cp v0.11.3
agg_tiles_hash: EF19FCBCE73ADE1C85E856E6BBA9B4C7

6 changes: 3 additions & 3 deletions tests/expected/martin-cp/normalized_metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tilejson:
- 85.0511
center:
- 0.0
- 20.0
- 0.0
- 0
description: 'One of the example maps that comes with TileMill - a bright & colorful world map that blends retro and high-tech with its folded paper texture and interactive flag tooltips. '
legend: |-
Expand All @@ -25,7 +25,7 @@ tilejson:
</div>
maxzoom: 1
minzoom: 0
name: Geography Class
name: normalized
template: |-
{{#__location__}}{{/__location__}}{{#__teaser__}}<div style="text-align:center;">

Expand All @@ -35,6 +35,6 @@ tilejson:
</div>{{/__teaser__}}{{#__full__}}{{/__full__}}
version: 1.0.0
format: png
generator: martin-cp v0.11.2
generator: martin-cp v0.11.3
agg_tiles_hash: A85C80BA1CE047E2D93DAC25C5179775

Loading

0 comments on commit e7d14c3

Please sign in to comment.