Skip to content

Commit

Permalink
Merge pull request #218 from geostyler/beta-4
Browse files Browse the repository at this point in the history
Merge beta branch into master
  • Loading branch information
KaiVolland committed May 30, 2023
2 parents f6eb604 + 4d71bb7 commit 8d3bff8
Show file tree
Hide file tree
Showing 58 changed files with 3,274 additions and 830 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
4 changes: 3 additions & 1 deletion data/mapbox/circle_simplecircle.ts
@@ -1,4 +1,6 @@
const circleSimpleCircle: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const circleSimpleCircle: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Circle',
layers: [
Expand Down
31 changes: 31 additions & 0 deletions data/mapbox/expression_case.ts
@@ -0,0 +1,31 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MbStyle } from '../../src/MapboxStyleParser';

const expression_case: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Expression Case',
layers: [
{
id: 'earthquake_circle',
type: 'circle',
paint: {
'circle-color': [
'case',
['<', ['get', 'mag'], 2],
'#fed976',
['all', ['>=', ['get', 'mag'], 2], ['<', ['get', 'mag'], 3]],
'#feb24c',
['all', ['>=', ['get', 'mag'], 3], ['<', ['get', 'mag'], 4]],
'#fd8d3c',
['all', ['>=', ['get', 'mag'], 4], ['<', ['get', 'mag'], 5]],
'#fc4e2a',
'#e31a1c'
],
'circle-opacity': 0.6,
'circle-radius': 12
}
}
]
};

export default expression_case;
23 changes: 23 additions & 0 deletions data/mapbox/expression_get.ts
@@ -0,0 +1,23 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MbStyle } from '../../src/MapboxStyleParser';

const expression_get: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Expression Get',
layers: [
{
id: 'Expression Get',
type: 'circle',
paint: {
'circle-color': '#000000',
'circle-radius': ['get', 'population'],
'circle-opacity': ['get', 'population_density'],
'circle-stroke-width': 2,
'circle-stroke-color': '#FF0000',
'circle-stroke-opacity': 0.5
}
}
]
};

export default expression_get;
4 changes: 3 additions & 1 deletion data/mapbox/fill_patternfill.ts
@@ -1,4 +1,6 @@
const fillSimpleFill: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const fillSimpleFill: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Pattern Fill',
sprite: 'https://testurl.com',
Expand Down
28 changes: 28 additions & 0 deletions data/mapbox/fill_simple_outline.ts
@@ -0,0 +1,28 @@
import { MbStyle } from '../../src/MapboxStyleParser';

const fillSimpleFillOutline: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Fill With outline',
layers: [{
id: 'r0_sy0_st0',
type: 'fill',
paint: {
'fill-color': '#ff0000'
}
},
{
id: 'r0_sy0_st1',
type: 'line',
paint: {
'line-opacity': 0.5,
'line-color': '#00ff00',
'line-width': 2
},
layout: {
'line-cap': 'butt',
'line-join': 'round'
}
}]
};

export default fillSimpleFillOutline;
4 changes: 3 additions & 1 deletion data/mapbox/fill_simplefill.ts
@@ -1,4 +1,6 @@
const fillSimpleFill: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const fillSimpleFill: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Fill',
layers: [
Expand Down
4 changes: 3 additions & 1 deletion data/mapbox/icon_simpleicon.ts
@@ -1,4 +1,6 @@
const iconSimpleIcon: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const iconSimpleIcon: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Icon',
sprite: 'https://testurl.com',
Expand Down
4 changes: 3 additions & 1 deletion data/mapbox/icon_simpleicon_mapboxapi.ts
@@ -1,4 +1,6 @@
const iconSimpleIcon: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const iconSimpleIcon: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Icon',
sprite: 'mapbox://sprites/mapbox/streets-v8',
Expand Down
4 changes: 3 additions & 1 deletion data/mapbox/line_patternline.ts
@@ -1,4 +1,6 @@
const linePatternLine: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const linePatternLine: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Pattern Line',
sprite: 'https://testurl.com',
Expand Down
4 changes: 3 additions & 1 deletion data/mapbox/line_simpleline.ts
@@ -1,4 +1,6 @@
const lineSimpleLine: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const lineSimpleLine: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Line',
layers: [
Expand Down
4 changes: 3 additions & 1 deletion data/mapbox/line_simpleline_basefilter.ts
@@ -1,4 +1,6 @@
const lineSimpleLine: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const lineSimpleLine: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Small populated New Yorks',
layers: [{
Expand Down
21 changes: 21 additions & 0 deletions data/mapbox/line_simpleline_expression.ts
@@ -0,0 +1,21 @@
import { MbStyle } from '../../src/MapboxStyleParser';

const lineSimpleLine: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Line Filter',
layers: [{
id: 'Small populated New Yorks',
type: 'line',
paint: {
'line-color': '#FF0000',
'line-width': ['case',
['==', 'DENSITY', 20],
3,
['!=', 'DENSITY', 20],
5
]
}
}]
};

export default lineSimpleLine;
4 changes: 3 additions & 1 deletion data/mapbox/line_simpleline_zoom.ts
@@ -1,4 +1,6 @@
const lineSimpleLine: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const lineSimpleLine: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Line Filter',
layers: [{
Expand Down
4 changes: 3 additions & 1 deletion data/mapbox/multi_rule_line_fill.ts
@@ -1,4 +1,6 @@
const multiRuleLineFill: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const multiRuleLineFill: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Rule Line Fill',
layers: [
Expand Down
4 changes: 3 additions & 1 deletion data/mapbox/multi_simpleline_simplefill.ts
@@ -1,4 +1,6 @@
const multiSimpleLineSimpleFill: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const multiSimpleLineSimpleFill: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Line Simple Fill',
layers: [
Expand Down
4 changes: 3 additions & 1 deletion data/mapbox/point_placeholderText.ts
@@ -1,4 +1,6 @@
const pointPlaceholderText: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const pointPlaceholderText: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Placeholder Text',
layers: [
Expand Down
4 changes: 3 additions & 1 deletion data/mapbox/point_placeholderText_simple.ts
@@ -1,4 +1,6 @@
const pointPlaceholderText: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const pointPlaceholderText: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Placeholder Text',
layers: [
Expand Down
4 changes: 3 additions & 1 deletion data/mapbox/point_simpletext.ts
@@ -1,4 +1,6 @@
const pointSimpleText: any = {
import { MbStyle } from '../../src/MapboxStyleParser';

const pointSimpleText: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Text',
layers: [
Expand Down
34 changes: 34 additions & 0 deletions data/mapbox_metadata/circle_simplecircle.ts
@@ -0,0 +1,34 @@
import { MbStyle } from '../../src/MapboxStyleParser';

const circleSimpleCircle: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Simple Circle',
layers: [
{
id: 'r0_sy0_st0',
type: 'circle',
paint: {
'circle-color': '#000000',
'circle-radius': 5,
'circle-opacity': 1,
'circle-stroke-width': 2,
'circle-stroke-color': '#FF0000',
'circle-stroke-opacity': 0.5
}
}
],
metadata: {
'geostyler:ref': {
rules: [{
name: 'Simple Circle',
symbolizers: [
[
'r0_sy0_st0'
]
]
}]
}
}
};

export default circleSimpleCircle;
43 changes: 43 additions & 0 deletions data/mapbox_metadata/expression_case.ts
@@ -0,0 +1,43 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MbStyle } from '../../src/MapboxStyleParser';

const expression_case: Omit<MbStyle, 'sources'> = {
version: 8,
name: 'Expression Case',
layers: [
{
id: 'r0_sy0_st0',
type: 'circle',
paint: {
'circle-color': [
'case',
['<', ['get', 'mag'], 2],
'#fed976',
['all', ['>=', ['get', 'mag'], 2], ['<', ['get', 'mag'], 3]],
'#feb24c',
['all', ['>=', ['get', 'mag'], 3], ['<', ['get', 'mag'], 4]],
'#fd8d3c',
['all', ['>=', ['get', 'mag'], 4], ['<', ['get', 'mag'], 5]],
'#fc4e2a',
'#e31a1c'
],
'circle-opacity': 0.6,
'circle-radius': 12
}
}
],
metadata: {
'geostyler:ref': {
rules: [{
name: 'earthquake_circle',
symbolizers: [
[
'r0_sy0_st0'
]
]
}]
}
}
};

export default expression_case;

0 comments on commit 8d3bff8

Please sign in to comment.