combine martin calls

This commit is contained in:
Shautvast 2026-04-03 21:11:38 +02:00
parent 05e9a9b688
commit 31cfd59b92
3 changed files with 18 additions and 28 deletions

View file

@ -77,7 +77,9 @@ services:
- "3001:3001" - "3001:3001"
environment: environment:
DATABASE_URL: "postgres://maps:maps@postgres:5432/maps" DATABASE_URL: "postgres://maps:maps@postgres:5432/maps"
command: ["--listen-addresses", "0.0.0.0:3001"] volumes:
- ./martin-config.yaml:/config.yaml:ro
command: ["--config", "/config.yaml"]
depends_on: depends_on:
- postgres - postgres

View file

@ -20,6 +20,7 @@ const VALID_LAYERS: &[&str] = &[
"planet_osm_line", "planet_osm_line",
"planet_osm_point", "planet_osm_point",
"planet_osm_roads", "planet_osm_roads",
"osm_all",
"pois", "pois",
]; ];
@ -99,27 +100,9 @@ pub async fn get_style(
"version": 8, "version": 8,
"name": "Privacy Maps", "name": "Privacy Maps",
"sources": { "sources": {
"planet_osm_polygon": { "osm_all": {
"type": "vector", "type": "vector",
"tiles": [format!("{base}/tiles/planet_osm_polygon/{{z}}/{{x}}/{{y}}.pbf")], "tiles": [format!("{base}/tiles/osm_all/{{z}}/{{x}}/{{y}}.pbf")],
"minzoom": 0,
"maxzoom": 14
},
"planet_osm_line": {
"type": "vector",
"tiles": [format!("{base}/tiles/planet_osm_line/{{z}}/{{x}}/{{y}}.pbf")],
"minzoom": 0,
"maxzoom": 14
},
"planet_osm_point": {
"type": "vector",
"tiles": [format!("{base}/tiles/planet_osm_point/{{z}}/{{x}}/{{y}}.pbf")],
"minzoom": 0,
"maxzoom": 14
},
"planet_osm_roads": {
"type": "vector",
"tiles": [format!("{base}/tiles/planet_osm_roads/{{z}}/{{x}}/{{y}}.pbf")],
"minzoom": 0, "minzoom": 0,
"maxzoom": 14 "maxzoom": 14
} }
@ -127,24 +110,24 @@ pub async fn get_style(
"layers": [ "layers": [
{ "id": "background", "type": "background", { "id": "background", "type": "background",
"paint": { "background-color": "#f0ebe3" } }, "paint": { "background-color": "#f0ebe3" } },
{ "id": "landuse", "type": "fill", "source": "planet_osm_polygon", { "id": "landuse", "type": "fill", "source": "osm_all",
"source-layer": "planet_osm_polygon", "source-layer": "planet_osm_polygon",
"paint": { "fill-color": "#d4e5c9", "fill-opacity": 0.6 } }, "paint": { "fill-color": "#d4e5c9", "fill-opacity": 0.6 } },
{ "id": "water", "type": "fill", "source": "planet_osm_polygon", { "id": "water", "type": "fill", "source": "osm_all",
"source-layer": "planet_osm_polygon", "source-layer": "planet_osm_polygon",
"filter": ["==", "natural", "water"], "filter": ["==", "natural", "water"],
"paint": { "fill-color": "#a0c8f0" } }, "paint": { "fill-color": "#a0c8f0" } },
{ "id": "roads-minor", "type": "line", "source": "planet_osm_line", { "id": "roads-minor", "type": "line", "source": "osm_all",
"source-layer": "planet_osm_line", "source-layer": "planet_osm_line",
"paint": { "line-color": "#ccc", "line-width": 1 } }, "paint": { "line-color": "#ccc", "line-width": 1 } },
{ "id": "roads-main", "type": "line", "source": "planet_osm_roads", { "id": "roads-main", "type": "line", "source": "osm_all",
"source-layer": "planet_osm_roads", "source-layer": "planet_osm_roads",
"paint": { "line-color": "#f5a623", "line-width": 2 } }, "paint": { "line-color": "#f5a623", "line-width": 2 } },
{ "id": "buildings", "type": "fill", "source": "planet_osm_polygon", { "id": "buildings", "type": "fill", "source": "osm_all",
"source-layer": "planet_osm_polygon", "source-layer": "planet_osm_polygon",
"filter": ["has", "building"], "filter": ["has", "building"],
"paint": { "fill-color": "#d9d0c7", "fill-outline-color": "#bbb" } }, "paint": { "fill-color": "#d9d0c7", "fill-outline-color": "#bbb" } },
{ "id": "road-names", "type": "symbol", "source": "planet_osm_line", { "id": "road-names", "type": "symbol", "source": "osm_all",
"source-layer": "planet_osm_line", "source-layer": "planet_osm_line",
"minzoom": 13, "minzoom": 13,
"filter": ["has", "name"], "filter": ["has", "name"],
@ -162,7 +145,7 @@ pub async fn get_style(
"text-halo-width": 1.5 "text-halo-width": 1.5
} }
}, },
{ "id": "place-names", "type": "symbol", "source": "planet_osm_point", { "id": "place-names", "type": "symbol", "source": "osm_all",
"source-layer": "planet_osm_point", "source-layer": "planet_osm_point",
"minzoom": 10, "minzoom": 10,
"filter": ["all", ["has", "name"], ["has", "place"]], "filter": ["all", ["has", "name"], ["has", "place"]],

View file

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart'; import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:path_provider/path_provider.dart';
import 'package:vector_map_tiles/vector_map_tiles.dart'; import 'package:vector_map_tiles/vector_map_tiles.dart';
import '../../../../core/api/api_client.dart'; import '../../../../core/api/api_client.dart';
import '../../providers/map_provider.dart'; import '../../providers/map_provider.dart';
@ -76,6 +77,10 @@ class _MapScreenState extends ConsumerState<MapScreen> {
tileProviders: style.providers, tileProviders: style.providers,
theme: style.theme, theme: style.theme,
concurrency: 4, concurrency: 4,
memoryTileCacheMaxSize: 20 * 1024 * 1024, // 20 MB raw tiles
memoryTileDataCacheMaxSize: 50, // 50 parsed tiles
fileCacheMaximumSizeInBytes: 50 * 1024 * 1024, // 50 MB on disk
cacheFolder: () => getApplicationCacheDirectory(),
), ),
loading: () => const SizedBox.shrink(), loading: () => const SizedBox.shrink(),
error: (e, _) => const SizedBox.shrink(), error: (e, _) => const SizedBox.shrink(),