Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduces "format" property for the IconSymbolizer #280

Merged
merged 1 commit into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const sampleStyle: Style = {
visibility: false,
allowOverlap: true,
optional: false,
rotationAlignment: 'map'
rotationAlignment: 'map',
image: 'http://myserver/getImage',
format: 'image/png'
}, {
kind: 'Line',
blur: 3,
Expand Down Expand Up @@ -95,7 +97,8 @@ const sampleStyle: Style = {
kind: 'Fill',
color: '#FF0000',
graphicFill: {
kind: 'Icon'
kind: 'Icon',
image: '/myimage.png'
}
}, {
kind: 'Raster',
Expand Down
109 changes: 107 additions & 2 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,53 @@
"type": "array"
},
{
"description": "A ComparisonFilter compares a value of an object (by key) with an expected\nvalue.",
"description": "A Filter that checks if a property is in a range of two values (inclusive).",
"items": [
{
"enum": [
"<=x<="
],
"type": "string"
},
{
"anyOf": [
{
"description": "A FunctionFilter that expects a string (propertyName) as second argument and\na regular expression as third argument. An actual parser implementation has to\nreturn a value for this function expression.",
"items": [
{
"enum": [
"FN_strMatches"
],
"type": "string"
},
{
"type": "string"
},
{
"$ref": "http://geostyler/geostyler-style.json#/definitions/RegExp"
}
],
"maxItems": 3,
"minItems": 3,
"type": "array"
},
{
"type": "string"
}
]
},
{
"type": "number"
},
{
"type": "number"
}
],
"maxItems": 4,
"minItems": 4,
"type": "array"
},
{
"items": [
{
"description": "The possible Operators used for comparison Filters.",
Expand All @@ -200,6 +246,7 @@
"*=",
"<",
"<=",
"<=x<=",
"==",
">",
">="
Expand Down Expand Up @@ -308,6 +355,17 @@
"description": "A color defined as a hex-color string.",
"type": "string"
},
"format": {
"description": "An optional configuration for the image format as MIME type.\nThis might be needed if the image(path) has no filending specified. e.g. http://myserver/getImage",
"enum": [
"image/gif",
"image/jpeg",
"image/jpg",
"image/png",
"image/svg+xml"
],
"type": "string"
},
"haloBlur": {
"description": "The halo's fadeout distance towards the outside.",
"type": "number"
Expand Down Expand Up @@ -881,7 +939,53 @@
"type": "array"
},
{
"description": "A ComparisonFilter compares a value of an object (by key) with an expected\nvalue.",
"description": "A Filter that checks if a property is in a range of two values (inclusive).",
"items": [
{
"enum": [
"<=x<="
],
"type": "string"
},
{
"anyOf": [
{
"description": "A FunctionFilter that expects a string (propertyName) as second argument and\na regular expression as third argument. An actual parser implementation has to\nreturn a value for this function expression.",
"items": [
{
"enum": [
"FN_strMatches"
],
"type": "string"
},
{
"type": "string"
},
{
"$ref": "http://geostyler/geostyler-style.json#/definitions/RegExp"
}
],
"maxItems": 3,
"minItems": 3,
"type": "array"
},
{
"type": "string"
}
]
},
{
"type": "number"
},
{
"type": "number"
}
],
"maxItems": 4,
"minItems": 4,
"type": "array"
},
{
"items": [
{
"description": "The possible Operators used for comparison Filters.",
Expand All @@ -890,6 +994,7 @@
"*=",
"<",
"<=",
"<=x<=",
"==",
">",
">="
Expand Down
5 changes: 5 additions & 0 deletions style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ export interface IconSymbolizer extends BasePointSymbolizer {
* A path/URL to the icon image file.
*/
image?: string;
/**
* An optional configuration for the image format as MIME type.
* This might be needed if the image(path) has no filending specified. e.g. http://myserver/getImage
*/
format?: `image/${'png' | 'jpg' | 'jpeg' | 'gif' | 'svg+xml'}`;
/**
* If true, the icon will be kept upright.
*/
Expand Down