Skip to content

Commit

Permalink
Fix build added placement styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
orangemug committed Dec 14, 2023
1 parent 23ff574 commit f4b01af
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1115,14 +1115,14 @@
"doc": "Label placement relative to its geometry.",
"sdk-support": {
"basic functionality": {
"ol": "UNKNOWN",
"ol": "999.9.9",
"js": "0.10.0",
"android": "2.0.1",
"ios": "2.0.0",
"macos": "0.1.0"
},
"`line-center` value": {
"ol": "UNKNOWN",
"ol": "999.9.9",
"js": "0.47.0",
"android": "6.4.0",
"ios": "4.3.0",
Expand Down Expand Up @@ -1150,7 +1150,7 @@
],
"sdk-support": {
"basic functionality": {
"ol": "UNKNOWN",
"ol": "999.9.9",
"js": "0.10.0",
"android": "2.0.1",
"ios": "2.0.0",
Expand Down
89 changes: 86 additions & 3 deletions src/test-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ const testStyles: Record<string, StyleSpecificationExt[]> = {
"bevel",
"miter",
"round",
] as const).map((propValue, index) => {
] as const).map((propValue) => {
const out: StyleSpecificationExt = {
version: 8,
name: "test",
Expand Down Expand Up @@ -1237,7 +1237,50 @@ const testStyles: Record<string, StyleSpecificationExt[]> = {
})
],
"layout_symbol.symbol-avoid-edges": [],
"layout_symbol.symbol-placement": [],
"layout_symbol.symbol-placement": [
...(["line", "point", "line-center"] as const).map((propValue) => {
const out: StyleSpecificationExt = {
version: 8,
name: "test",
metadata: {
description: `symbol-placement=${propValue}`
},
sources: {
lines: {
type: "geojson",
data: LineGeoJSON,
}
},
sprite: "https://maputnik.github.io/osm-liberty/sprites/osm-liberty",
glyphs:
"https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf",
layers: [
{
id: "line",
type: "line",
source: "lines",
paint: {
"line-color": "red",
"line-width": 2,
},
},
{
id: "test",
type: "symbol",
source: "lines",
layout: {
"symbol-placement": propValue,
"icon-image": "zoo",
"icon-allow-overlap": true,
},
paint: {
}
},
],
}
return out;
})
],
"layout_symbol.symbol-sort-key": [
{
version: 8,
Expand Down Expand Up @@ -1286,7 +1329,47 @@ const testStyles: Record<string, StyleSpecificationExt[]> = {
],
},
],
"layout_symbol.symbol-spacing": [],
"layout_symbol.symbol-spacing": [
{
version: 8,
name: "test",
metadata: {
description: "basic"
},
sources: {
lines: {
type: "geojson",
data: LineGeoJSON,
}
},
sprite: "https://maputnik.github.io/osm-liberty/sprites/osm-liberty",
glyphs:
"https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf",
layers: [
{
id: "line",
type: "line",
source: "lines",
paint: {
"line-color": "red",
"line-width": 2,
},
},
{
id: "test",
type: "symbol",
source: "lines",
layout: {
"symbol-placement": "line",
"icon-image": "zoo",
"symbol-spacing": 10,
},
paint: {
}
},
],
},
],
"layout_symbol.symbol-z-order": [],
"layout_symbol.text-allow-overlap": [],
"layout_symbol.text-anchor": [],
Expand Down

0 comments on commit f4b01af

Please sign in to comment.