Lets ol.style.Icon to define default values

This commit is contained in:
oterral
2014-01-27 14:46:07 +01:00
parent 0ff229eb2c
commit 63c321b980
2 changed files with 40 additions and 6 deletions

View File

@@ -476,25 +476,22 @@ ol.format.KML.IconStyleParser_ = function(node, objectStack) {
anchor = [0.5, 1];
anchorXUnits = ol.style.IconAnchorUnits.FRACTION;
anchorYUnits = ol.style.IconAnchorUnits.FRACTION;
} else {
anchor = null;
}
var rotation;
var heading = /** @type {number|undefined} */
(goog.object.get(object, 'heading'));
if (goog.isDef(heading)) {
rotation = goog.math.toRadians(heading);
} else {
rotation = 0;
}
var scale = /** @type {number|undefined} */
(goog.object.get(object, 'scale'));
var size;
if (src == ol.format.KML.DEFAULT_IMAGE_STYLE_SRC_) {
size = ol.format.KML.DEFAULT_IMAGE_STYLE_SIZE_;
} else {
size = null;
}
var imageStyle = new ol.style.Icon({
anchor: anchor,
anchorXUnits: anchorXUnits,