Support image rotation

This commit is contained in:
Éric Lemoine
2014-11-06 15:27:25 +01:00
parent 43756a2d59
commit fb24c68b9c
2 changed files with 53 additions and 16 deletions

View File

@@ -8,11 +8,25 @@ goog.require('ol.style.Icon');
goog.require('ol.style.Style');
var iconInfo = [
{size: [55, 55], offset: [0, 0], opacity: 1.0, scale: 1.0},
{size: [55, 55], offset: [110, 86], opacity: 0.75, scale: 1.25},
{size: [55, 86], offset: [55, 0], opacity: 0.5, scale: 1.5}
];
var iconInfo = [{
size: [55, 55],
offset: [0, 0],
opacity: 1.0,
scale: 1.0,
rotation: 0.0
}, {
size: [55, 55],
offset: [110, 86],
opacity: 0.75,
scale: 1.25,
rotation: Math.PI / 2.0
}, {
size: [55, 86],
offset: [55, 0],
opacity: 0.5,
scale: 1.5,
rotation: Math.PI / 3.0
}];
var i;
@@ -25,7 +39,8 @@ for (i = 0; i < iconCount; ++i) {
size: info.size,
offset: info.offset,
opacity: info.opacity,
scale: info.scale
scale: info.scale,
rotation: info.rotation
});
}