Skip to content

Commit

Permalink
Updated support for 'icon-anchor'
Browse files Browse the repository at this point in the history
  • Loading branch information
orangemug committed Dec 14, 2023
1 parent caec805 commit ab69d6f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@
],
"sdk-support": {
"basic functionality": {
"ol": "UNKNOWN",
"ol": "12.1.1",
"js": "0.40.0",
"android": "5.2.0",
"ios": "3.7.0",
Expand Down
45 changes: 44 additions & 1 deletion src/test-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,50 @@ const testStyles: Record<string, StyleSpecificationExt[]> = {
],
},
],
"layout_symbol.icon-anchor": [],
"layout_symbol.icon-anchor": [
...([
"center",
"left",
"right",
"top",
"bottom",
"top-left",
"top-right",
"bottom-left",
"bottom-right"
] as const).map(propValue => {
const out: StyleSpecificationExt = {
version: 8,
name: "test",
metadata: {
description: `icon-anchor=${propValue}`
},
sources: {
points: {
type: "geojson",
data: PointsGeoJSON,
},
},
sprite: "https://maputnik.github.io/osm-liberty/sprites/osm-liberty",
glyphs:
"https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf",
layers: [
{
id: "test",
type: "symbol",
source: "points",
layout: {
"text-field": "a",
"text-font": ["Roboto Regular"],
"icon-image": "zoo",
"icon-anchor": propValue,
}
},
],
};
return out;
})
],
"layout_symbol.icon-ignore-placement": [],
"layout_symbol.icon-image": [
{
Expand Down

0 comments on commit ab69d6f

Please sign in to comment.