Skip to content

Commit

Permalink
Merge pull request geostyler#583 from KaiVolland/sprite
Browse files Browse the repository at this point in the history
Add support for image sprites
  • Loading branch information
KaiVolland committed Nov 29, 2023
2 parents e672c2e + f264c83 commit b4cf892
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,24 @@ export interface TextSymbolizer extends BasePointSymbolizer {
placement?: Expression<'point' | 'line' | 'line-center'>;
}

/**
* Configuration for a sprite image.
*/
export type Sprite = {
/**
* A path/URL to the sprite image file.
*/
source: Expression<string>;
/**
* The starting position of the sprite to cut out. Origing [0, 0] is top left in pixels.
*/
position: [Expression<number>, Expression<number>];
/**
* The size of the sprite [width, height] in pixels.
*/
size: [Expression<number>, Expression<number>];
};

/**
* An IconSymbolizer describes the style representation of POINT data if styled
* with a specific icon.
Expand Down Expand Up @@ -425,9 +443,9 @@ export interface IconSymbolizer extends BasePointSymbolizer {
*/
haloOpacity?: Expression<number>;
/**
* A path/URL to the icon image file.
* A path/URL to the icon image file or a {@link Sprite} configuration.
*/
image?: Expression<string>;
image?: Expression<string> | Sprite;
/**
* 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
Expand Down

0 comments on commit b4cf892

Please sign in to comment.