Skip to content

Commit

Permalink
feat: add support for Sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Volland committed Dec 1, 2023
1 parent 748d468 commit 785aee9
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 75 deletions.
13 changes: 13 additions & 0 deletions data/olStyles/point_icon_sprite.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import OlStyle from 'ol/style/Style';
import OlStyleIcon from 'ol/style/Icon';

const olIconSpritePoint = new OlStyle({
image: new OlStyleIcon({
src: 'https://testurl.com/sprites/mysprite',
offset: [20, 20],
offsetOrigin: 'top-left',
size: [10, 10]
})
});

export default olIconSpritePoint;
21 changes: 21 additions & 0 deletions data/styles/point_icon_sprite.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Style } from 'geostyler-style';

const pointSpritePoint: Style = {
name: 'OL Style',
rules: [
{
name: 'OL Style Rule 0',
symbolizers: [{
kind: 'Icon',
image: {
source: 'https://testurl.com/sprites/mysprite',
position: [20, 20],
size: [10, 10]
},
size: 10
}]
}
]
};

export default pointSpritePoint;

0 comments on commit 785aee9

Please sign in to comment.