Skip to content

Commit d2c9f67

Browse files
committed
3.0.9 bug fix for 3.0.8
1 parent aa2b8a0 commit d2c9f67

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ The GeoPackage JavaScript library currently provides the ability to read GeoPack
3838

3939
### Changelog
4040

41+
##### 3.0.9
42+
43+
- Bug fix for null colors
44+
4145
##### 3.0.8
4246

4347
- If a null color is set on the FeatureTiles class, the color will be reset to the initial default of #000000FF

lib/tiles/features/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export class FeatureTiles {
6969
public maxFeaturesTileDraw: CustomFeaturesTile = null;
7070
widthOverlap: number;
7171
heightOverlap: number;
72+
private _defaultStroke = '#000000FF';
73+
private _defaultFill = '#00000011';
7274
constructor(
7375
public featureDao: FeatureDao<FeatureRow>,
7476
public tileWidth: number = 256,
@@ -77,7 +79,7 @@ export class FeatureTiles {
7779
this.projection = featureDao.projection;
7880
this.linePaint.strokeWidth = 2.0;
7981
this.polygonPaint.strokeWidth = 2.0;
80-
this.polygonFillPaint.color = '#00000011';
82+
this.polygonFillPaint.color = this._defaultFill;
8183
this.geoPackage = this.featureDao.geoPackage;
8284
if (this.geoPackage != null) {
8385
this.featureTableStyles = new FeatureTableStyles(this.geoPackage, featureDao.table);
@@ -390,6 +392,7 @@ export class FeatureTiles {
390392
this._overrideGeoPackagePointPaint = true;
391393
} else {
392394
this._overrideGeoPackagePointPaint = false;
395+
pointColor = this._defaultStroke;
393396
}
394397
this.pointPaint.color = pointColor;
395398
}
@@ -429,6 +432,7 @@ export class FeatureTiles {
429432
this._overrideGeoPackageLinePaint = true;
430433
} else {
431434
this._overrideGeoPackageLinePaint = false;
435+
lineColor = this._defaultStroke;
432436
}
433437
this.linePaint.color = lineColor;
434438
}
@@ -468,6 +472,7 @@ export class FeatureTiles {
468472
this._overrideGeoPackagePolygonPaint = true;
469473
} else {
470474
this._overrideGeoPackagePolygonPaint = false;
475+
polygonColor = this._defaultStroke;
471476
}
472477
this.polygonPaint.color = polygonColor;
473478
}
@@ -487,6 +492,7 @@ export class FeatureTiles {
487492
this._overrideGeoPackagePolygonFillPaint = true;
488493
} else {
489494
this._overrideGeoPackagePolygonFillPaint = false;
495+
polygonFillColor = this._defaultFill;
490496
}
491497
this.polygonFillPaint.color = polygonFillColor;
492498
}

lib/tiles/features/paint.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ export class Paint {
1818
* @param {String} color String color in the format #RRGGBB or #RRGGBBAA
1919
*/
2020
set color(color: string) {
21-
if (!color) {
22-
color = '#000000FF';
23-
}
2421
this._color = color;
2522
}
2623
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngageoint/geopackage",
3-
"version": "3.0.8",
3+
"version": "3.0.9",
44
"description": "GeoPackage JavaScript Library",
55
"keywords": [
66
"NGA",

0 commit comments

Comments
 (0)