Merge branch 'globe' of github.com:wipfli/maputnik into globe

This commit is contained in:
Oliver Wipfli
2025-01-04 19:49:21 +01:00
12 changed files with 68 additions and 12 deletions

View File

@@ -4,6 +4,8 @@
- Add german translation
- Use same version number for web and desktop versions
- Add scheme type options for vector/raster tile
- Add `tileSize` field for raster and raster-dem tile sources
- Update Protomaps Light gallery style to v4
- _...Add new stuff here..._
### 🐞 Bug fixes

View File

@@ -82,6 +82,21 @@ describe("modals", () => {
scheme: "tms",
});
});
it("add new raster source", () => {
let sourceId = "rastertest";
when.setValue("modal:sources.add.source_id", sourceId);
when.select("modal:sources.add.source_type", "tile_raster");
when.select("modal:sources.add.scheme_type", "xyz");
when.setValue("modal:sources.add.tile_size", "128");
when.click("modal:sources.add.add_source");
when.wait(200);
then(
get.styleFromLocalStorage().then((style) => style.sources[sourceId])
).shouldInclude({
tileSize: 128,
});
});
});
describe("inspect", () => {

View File

@@ -32,9 +32,9 @@ $(GOBIN)/rice:
# Embed the current version number in the executable by writing version.go
.PHONY: version.go
version.go:
@echo "// DO NOT EDIT: Autogenerated by Makefile\n" > version.go
@echo "package main\n" >> version.go
@echo "const Version = \"$(VERSION)\"" >> version.go
@printf "// DO NOT EDIT: Autogenerated by Makefile\n" > version.go
@printf "package main\n" >> version.go
@printf "const Version = \"$(VERSION)\"\n" >> version.go
rice-box.go: $(GOBIN)/rice editor/pull_release
$(GOBIN)/rice embed-go

6
package-lock.json generated
View File

@@ -3797,9 +3797,9 @@
}
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true,
"dependencies": {
"path-key": "^3.1.0",

View File

@@ -155,10 +155,11 @@ class AddSource extends React.Component<AddSourceProps, AddSourceState> {
}
case 'tile_raster': return {
type: 'raster',
tiles: (source as RasterSourceSpecification).tiles || [`${protocol}//localhost:3000/{x}/{y}/{z}.pbf`],
tiles: (source as RasterSourceSpecification).tiles || [`${protocol}//localhost:3000/{x}/{y}/{z}.png`],
minzoom: (source as RasterSourceSpecification).minzoom || 0,
maxzoom: (source as RasterSourceSpecification).maxzoom || 14,
scheme: (source as RasterSourceSpecification).scheme || 'xyz'
scheme: (source as RasterSourceSpecification).scheme || 'xyz',
tileSize: (source as RasterSourceSpecification).tileSize || 512,
}
case 'tilejson_raster-dem': return {
type: 'raster-dem',
@@ -166,9 +167,10 @@ class AddSource extends React.Component<AddSourceProps, AddSourceState> {
}
case 'tilexyz_raster-dem': return {
type: 'raster-dem',
tiles: (source as RasterDEMSourceSpecification).tiles || [`${protocol}//localhost:3000/{x}/{y}/{z}.pbf`],
tiles: (source as RasterDEMSourceSpecification).tiles || [`${protocol}//localhost:3000/{x}/{y}/{z}.png`],
minzoom: (source as RasterDEMSourceSpecification).minzoom || 0,
maxzoom: (source as RasterDEMSourceSpecification).maxzoom || 14
maxzoom: (source as RasterDEMSourceSpecification).maxzoom || 14,
tileSize: (source as RasterDEMSourceSpecification).tileSize || 512
}
case 'image': return {
type: 'image',

View File

@@ -308,9 +308,30 @@ class ModalSourcesTypeEditorInternal extends React.Component<ModalSourcesTypeEdi
case 'tilejson_vector': return <TileJSONSourceEditor {...commonProps} />
case 'tile_vector': return <TileURLSourceEditor {...commonProps} />
case 'tilejson_raster': return <TileJSONSourceEditor {...commonProps} />
case 'tile_raster': return <TileURLSourceEditor {...commonProps} />
case 'tile_raster': return <TileURLSourceEditor {...commonProps}>
<FieldNumber
label={t("Tile Size")}
fieldSpec={latest.source_raster.tileSize}
onChange={tileSize => this.props.onChange({
...this.props.source,
tileSize: tileSize
})}
value={this.props.source.tileSize || latest.source_raster.tileSize.default}
data-wd-key="modal:sources.add.tile_size"
/>
</TileURLSourceEditor>
case 'tilejson_raster-dem': return <TileJSONSourceEditor {...commonProps} />
case 'tilexyz_raster-dem': return <TileURLSourceEditor {...commonProps}>
<FieldNumber
label={t("Tile Size")}
fieldSpec={latest.source_raster_dem.tileSize}
onChange={tileSize => this.props.onChange({
...this.props.source,
tileSize: tileSize
})}
value={this.props.source.tileSize || latest.source_raster_dem.tileSize.default}
data-wd-key="modal:sources.add.tile_size"
/>
<FieldSelect
label={t("Encoding")}
fieldSpec={latest.source_raster_dem.encoding}

View File

@@ -65,6 +65,12 @@
"url": "https://maputnik.github.io/osm-liberty/style.json",
"thumbnail": "https://maputnik.github.io/thumbnails/osm-liberty.png"
},
{
"id": "osm-openmaptiles",
"title": "OSM OpenMapTiles",
"url": "https://api.maptiler.com/maps/openstreetmap/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL",
"thumbnail": "https://openmaptiles.org/img/styles/openmaptiles.png"
},
{
"id": "positron",
"title": "Positron",
@@ -74,7 +80,7 @@
{
"id": "protomaps-light",
"title": "Protomaps Light",
"url": "https://api.protomaps.com/styles/v2/light.json?key=d828297496b11844",
"url": "https://api.protomaps.com/styles/v4/light/en.json?key=d828297496b11844",
"thumbnail": "https://github.com/user-attachments/assets/911f9765-4a7d-4736-9ec0-f2d4c90ae587"
},
{

View File

@@ -163,6 +163,7 @@
"Add a new source to your style. You can only choose the source type and id at creation time!": "Füge eine neue Quelle zu deinem Stil hinzu. Du kannst den Quellentyp und die ID nur bei der Erstellung auswählen!",
"TileJSON URL": "TileJSON URL",
"Tile URL": "Kachel-URL",
"Scheme Type": "Schema-Typ",
"Coord top left": "Koordinate oben links",
"Coord top right": "Koordinate oben rechts",
"Coord bottom right": "Koordinate unten rechts",
@@ -172,6 +173,7 @@
"GeoJSON URL": "GeoJSON URL",
"GeoJSON": "GeoJSON",
"Cluster": "Cluster",
"Tile Size": "Kachelgröße",
"Encoding": "Kodierung",
"Error:": "Fehler:",
"MapTiler Access Token": "MapTiler Zugriffstoken",

View File

@@ -163,6 +163,7 @@
"Add a new source to your style. You can only choose the source type and id at creation time!": "Ajoutez une nouvelle source à votre style. Vous ne pouvez choisir le type et l'ID de la source qu'au moment de la création !",
"TileJSON URL": "URL TileJSON",
"Tile URL": "URL de la tuile",
"Scheme Type": "Type de schéma",
"Coord top left": "Coordonnée en haut à gauche",
"Coord top right": "Coordonnée en haut à droite",
"Coord bottom right": "Coordonnée en bas à droite",
@@ -172,6 +173,7 @@
"GeoJSON URL": "URL GeoJSON",
"GeoJSON": "GeoJSON",
"Cluster": "Cluster",
"Tile Size": "Dimension d'une tuile",
"Encoding": "Encodage",
"Error:": "Erreur :",
"MapTiler Access Token": "Jeton d'accès MapTiler",

View File

@@ -162,6 +162,7 @@
"Add a new source to your style. You can only choose the source type and id at creation time!": "הוספת מקור לסטייל, ביכולתכם לעשות זאת רק בזמן מסויים",
"TileJSON URL": "כתובת TileJSON",
"Tile URL": "כתובת אריחים",
"Scheme Type": "סוג סכמה",
"Coord top left": "מיקום שמאלי עליון",
"Coord top right": "מיקום ימני עליון",
"Coord bottom right": "מיקום ימני תחתון",
@@ -171,6 +172,7 @@
"GeoJSON URL": "כתובת GeoJSON",
"GeoJSON": "GeoJSON",
"Cluster": "קיבוץ",
"Tile Size": "גודל אריח",
"Encoding": "קידוד",
"Error:": "שגיאה",
"MapTiler Access Token": "MapTiler Access Token",

View File

@@ -162,6 +162,7 @@
"Add a new source to your style. You can only choose the source type and id at creation time!": "スタイルに新規ソースを追加します。注意: 作成時にソースタイプとIDのみを選択できます。",
"TileJSON URL": "TileJSON URL",
"Tile URL": "タイルURL",
"Scheme Type": "スキーマ",
"Coord top left": "左上座標",
"Coord top right": "右上座標",
"Coord bottom right": "右下座標",
@@ -171,6 +172,7 @@
"GeoJSON URL": "GeoJSON URL",
"GeoJSON": "GeoJSON",
"Cluster": "クラスタ",
"Tile Size": "タイルサイズ",
"Encoding": "エンコーディング",
"Error:": "エラー:",
"MapTiler Access Token": "MapTiler アクセストークン",

View File

@@ -162,6 +162,7 @@
"Add a new source to your style. You can only choose the source type and id at creation time!": "向您的样式添加新源。在创建时您只能选择源类型和ID",
"TileJSON URL": "TileJSON URL",
"Tile URL": "瓦片URL",
"Scheme Type": "__STRING_NOT_TRANSLATED__",
"Coord top left": "左上角坐标",
"Coord top right": "右上角坐标",
"Coord bottom right": "右下角坐标",
@@ -171,6 +172,7 @@
"GeoJSON URL": "GeoJSON URL",
"GeoJSON": "GeoJSON",
"Cluster": "聚合",
"Tile Size": "__STRING_NOT_TRANSLATED__",
"Encoding": "编码",
"Error:": "错误:",
"MapTiler Access Token": "MapTiler 访问令牌",