From d2c9f67ee4ff95a4ea334094d5b1dc71646b2516 Mon Sep 17 00:00:00 2001 From: Dan Barela Date: Wed, 13 Jan 2021 13:24:23 -0700 Subject: [PATCH] 3.0.9 bug fix for 3.0.8 --- README.md | 4 ++++ lib/tiles/features/index.ts | 8 +++++++- lib/tiles/features/paint.ts | 3 --- package.json | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ff425417f..4d826d962 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,10 @@ The GeoPackage JavaScript library currently provides the ability to read GeoPack ### Changelog +##### 3.0.9 + +- Bug fix for null colors + ##### 3.0.8 - If a null color is set on the FeatureTiles class, the color will be reset to the initial default of #000000FF diff --git a/lib/tiles/features/index.ts b/lib/tiles/features/index.ts index 94b3d6eab..d401b699a 100644 --- a/lib/tiles/features/index.ts +++ b/lib/tiles/features/index.ts @@ -69,6 +69,8 @@ export class FeatureTiles { public maxFeaturesTileDraw: CustomFeaturesTile = null; widthOverlap: number; heightOverlap: number; + private _defaultStroke = '#000000FF'; + private _defaultFill = '#00000011'; constructor( public featureDao: FeatureDao, public tileWidth: number = 256, @@ -77,7 +79,7 @@ export class FeatureTiles { this.projection = featureDao.projection; this.linePaint.strokeWidth = 2.0; this.polygonPaint.strokeWidth = 2.0; - this.polygonFillPaint.color = '#00000011'; + this.polygonFillPaint.color = this._defaultFill; this.geoPackage = this.featureDao.geoPackage; if (this.geoPackage != null) { this.featureTableStyles = new FeatureTableStyles(this.geoPackage, featureDao.table); @@ -390,6 +392,7 @@ export class FeatureTiles { this._overrideGeoPackagePointPaint = true; } else { this._overrideGeoPackagePointPaint = false; + pointColor = this._defaultStroke; } this.pointPaint.color = pointColor; } @@ -429,6 +432,7 @@ export class FeatureTiles { this._overrideGeoPackageLinePaint = true; } else { this._overrideGeoPackageLinePaint = false; + lineColor = this._defaultStroke; } this.linePaint.color = lineColor; } @@ -468,6 +472,7 @@ export class FeatureTiles { this._overrideGeoPackagePolygonPaint = true; } else { this._overrideGeoPackagePolygonPaint = false; + polygonColor = this._defaultStroke; } this.polygonPaint.color = polygonColor; } @@ -487,6 +492,7 @@ export class FeatureTiles { this._overrideGeoPackagePolygonFillPaint = true; } else { this._overrideGeoPackagePolygonFillPaint = false; + polygonFillColor = this._defaultFill; } this.polygonFillPaint.color = polygonFillColor; } diff --git a/lib/tiles/features/paint.ts b/lib/tiles/features/paint.ts index 9c00b2981..a6ffe4796 100644 --- a/lib/tiles/features/paint.ts +++ b/lib/tiles/features/paint.ts @@ -18,9 +18,6 @@ export class Paint { * @param {String} color String color in the format #RRGGBB or #RRGGBBAA */ set color(color: string) { - if (!color) { - color = '#000000FF'; - } this._color = color; } /** diff --git a/package.json b/package.json index 66ca2bb74..09d51540a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ngageoint/geopackage", - "version": "3.0.8", + "version": "3.0.9", "description": "GeoPackage JavaScript Library", "keywords": [ "NGA",