ignore anchor if in default position

This commit is contained in:
Ron Young
2017-07-14 13:16:42 +01:00
parent b7b2ee0c57
commit f61bd6352d

View File

@@ -2260,7 +2260,7 @@ ol.format.KML.writeIconStyle_ = function(node, style, objectStack) {
iconProperties['y'] = iconImageSize[1] - (origin[1] + size[1]);
}
if (anchor && anchor[0] !== 0 && anchor[1] !== size[1]) {
if (anchor && (anchor[0] !== size[0] / 2 || anchor[1] !== size[1] / 2)) {
var /** @type {ol.KMLVec2_} */ hotSpot = {
x: anchor[0],
xunits: ol.style.IconAnchorUnits.PIXELS,