Skip to content

Commit

Permalink
Fixed color conversion bug in Microsoft v7 API
Browse files Browse the repository at this point in the history
There were a couple naming problems with the variables. Also added
reasonable defaults for the stroke and fill colors (i.e., black) - it
won't break anything because they're also fully transparent by default.
  • Loading branch information
minitech committed May 12, 2012
1 parent 966a674 commit 7a229ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/mxn.microsoft7.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,18 +410,18 @@ Polyline: {
points.push(this.points[i].toProprietary(this.api));
}

var strokeColor = Microsoft.Maps.Color.fromHex(this.color);
var strokeColor = Microsoft.Maps.Color.fromHex(this.color || '#000000');
strokeColor.a = this.opacity * 255;
var fillColor = Microsoft.Maps.Color.fromHex(this.fillColor);
var fillColor = Microsoft.Maps.Color.fromHex(this.fillColor || '#000000');
fillColor.a = this.fillOpacity * 255;

var polyOptions = {
strokeColor: _strokeColor,
strokeColor: strokeColor,
strokeThickness: this.width
};

if (this.closed) {
polyOptions.fillColor = _fillColor;
polyOptions.fillColor = fillColor;
points.push(this.points[0].toProprietary(this.api));
return new Microsoft.Maps.Polygon(points, polyOptions);
}
Expand Down

0 comments on commit 7a229ad

Please sign in to comment.