-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: parse placement of TextSymbolizer (#292)
* feat: parse placement of TextSymbolizer * Apply suggestions from code review Co-authored-by: Jan Suleiman <[email protected]> --------- Co-authored-by: Faouzi Homsani <[email protected]> Co-authored-by: Jan Suleiman <[email protected]>
- Loading branch information
1 parent
075b77a
commit 9acb43f
Showing
11 changed files
with
318 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { MbStyle } from '../../src/MapboxStyleParser'; | ||
|
||
const textPlacement: MbStyle = { | ||
version: 8, | ||
name: 'symbol placement', | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
layers: [ | ||
{ | ||
id: 'Simple Text', | ||
type: 'symbol', | ||
source: 'testsource', | ||
'source-layer': 'foo', | ||
layout: { | ||
'symbol-placement': 'line' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export default textPlacement; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { MbStyle } from '../../src/MapboxStyleParser'; | ||
|
||
const textPlacementLineCenter: MbStyle = { | ||
version: 8, | ||
name: 'symbol placement', | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
layers: [ | ||
{ | ||
id: 'Simple Text', | ||
type: 'symbol', | ||
source: 'testsource', | ||
'source-layer': 'foo', | ||
layout: { | ||
'symbol-placement': 'line-center' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export default textPlacementLineCenter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { MbStyle } from '../../src/MapboxStyleParser'; | ||
|
||
const textPlacementPoint: MbStyle = { | ||
version: 8, | ||
name: 'symbol placement', | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
layers: [ | ||
{ | ||
id: 'Simple Text', | ||
source: 'testsource', | ||
type: 'symbol', | ||
'source-layer': 'foo', | ||
layout: { | ||
'symbol-placement': 'point' | ||
} | ||
} | ||
] | ||
}; | ||
|
||
export default textPlacementPoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { MbStyle } from '../../src/MapboxStyleParser'; | ||
|
||
const textPlacementLine: MbStyle = { | ||
version: 8, | ||
name: 'symbol placement', | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
layers: [ | ||
{ | ||
id: 'r0_sy0_st0', | ||
source: 'testsource', | ||
'source-layer': 'foo', | ||
type: 'symbol', | ||
layout: { | ||
'symbol-placement': 'line' | ||
} | ||
} | ||
], | ||
metadata: { | ||
'geostyler:ref': { | ||
rules: [{ | ||
name: 'Simple Text', | ||
symbolizers: [ | ||
[ | ||
'r0_sy0_st0' | ||
] | ||
] | ||
}] | ||
} | ||
} | ||
}; | ||
|
||
export default textPlacementLine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { MbStyle } from '../../src/MapboxStyleParser'; | ||
|
||
const textPlacementLineCenter: MbStyle = { | ||
version: 8, | ||
name: 'symbol placement', | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
layers: [ | ||
{ | ||
id: 'r0_sy0_st0', | ||
source: 'testsource', | ||
'source-layer': 'foo', | ||
type: 'symbol', | ||
layout: { | ||
'symbol-placement': 'line-center' | ||
} | ||
} | ||
], | ||
metadata: { | ||
'geostyler:ref': { | ||
rules: [{ | ||
name: 'Simple Text', | ||
symbolizers: [ | ||
[ | ||
'r0_sy0_st0' | ||
] | ||
] | ||
}] | ||
} | ||
} | ||
}; | ||
|
||
export default textPlacementLineCenter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { MbStyle } from '../../src/MapboxStyleParser'; | ||
|
||
const textPlacementPoint: MbStyle = { | ||
version: 8, | ||
name: 'symbol placement', | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
layers: [ | ||
{ | ||
id: 'r0_sy0_st0', | ||
source: 'testsource', | ||
'source-layer': 'foo', | ||
type: 'symbol', | ||
layout: { | ||
'symbol-placement': 'point' | ||
} | ||
} | ||
], | ||
metadata: { | ||
'geostyler:ref': { | ||
rules: [{ | ||
name: 'Simple Text', | ||
symbolizers: [ | ||
[ | ||
'r0_sy0_st0' | ||
] | ||
] | ||
}] | ||
} | ||
} | ||
}; | ||
|
||
export default textPlacementPoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Style } from 'geostyler-style'; | ||
|
||
const textPlacement: Style = { | ||
name: 'symbol placement', | ||
rules: [{ | ||
name: 'Simple Text', | ||
symbolizers: [{ | ||
kind: 'Text', | ||
placement: 'line' | ||
}] | ||
}], | ||
metadata: { | ||
'mapbox:ref': { | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
sourceMapping: { | ||
testsource: [0] | ||
}, | ||
sourceLayerMapping: { | ||
foo: [0] | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export default textPlacement; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Style } from 'geostyler-style'; | ||
|
||
const textPlacementLineCenter: Style = { | ||
name: 'symbol placement', | ||
rules: [{ | ||
name: 'Simple Text', | ||
symbolizers: [{ | ||
kind: 'Text', | ||
placement: 'line-center' | ||
}] | ||
}], | ||
metadata: { | ||
'mapbox:ref': { | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
sourceMapping: { | ||
testsource: [0] | ||
}, | ||
sourceLayerMapping: { | ||
foo: [0] | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export default textPlacementLineCenter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Style } from 'geostyler-style'; | ||
|
||
const textPlacementPoint: Style = { | ||
name: 'symbol placement', | ||
rules: [{ | ||
name: 'Simple Text', | ||
symbolizers: [{ | ||
kind: 'Text', | ||
placement: 'point' | ||
}] | ||
}], | ||
metadata: { | ||
'mapbox:ref': { | ||
sources: { | ||
testsource: { | ||
type: 'vector' | ||
} | ||
}, | ||
sourceMapping: { | ||
testsource: [0] | ||
}, | ||
sourceLayerMapping: { | ||
foo: [0] | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export default textPlacementPoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters