Skip to content

Commit

Permalink
Upgrade GeoPackge JS dependency to support styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
newmanw committed Nov 23, 2020
1 parent 6af09e8 commit 12acb9e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ MAGE adheres to [Semantic Versioning](http://semver.org/).
##### Features

##### Bug Fixes
* Change Graphics Magick call to orient image attachments such that exif metadata is not lost.
* Web should not prompt for device uid, if device admin approval is not enabled.
* Fix bug in 3rd party authentication which was not properly adding authenticated users.

## [5.4.4](https://github.com/ngageoint/mage-server/releases/tag/5.4.4)

##### Features
* Support for "Feature Style" extension, upgrade to newest version of GeoPackage JS.

##### Bug Fixes
* Change Graphics Magick call to orient image attachments such that exif metadata is not lost.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@mapbox/togeojson": "0.16.0",
"@ngageoint/geopackage": "3.0.0-beta.1",
"@ngageoint/geopackage": "3.0.7",
"@turf/centroid": "4.3.0",
"@turf/kinks": "4.3.0",
"adm-zip": "0.4.9",
Expand Down
13 changes: 6 additions & 7 deletions routes/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ module.exports = function(app, security) {
};

const style = {
stroke: req.query.stroke || '#000000FF',
fill: req.query.fill || '#00000011',
width: req.query.width || 1
stroke: req.query.stroke,
fill: req.query.fill,
width: req.query.width
};

const table = req.layer.tables.find(table => table.name === req.params.tableName);
Expand Down Expand Up @@ -375,11 +375,10 @@ module.exports = function(app, security) {
z: Number(req.params.z)
};

console.log('query width', req.query.width);
const style = {
stroke: req.query.stroke || '#000000FF',
fill: req.query.fill || '#00000011',
width: req.query.width || 1
stroke: req.query.stroke,
fill: req.query.fill,
width: req.query.width
};

const table = req.layer.tables.find(table => table.name === req.params.tableName);
Expand Down
22 changes: 11 additions & 11 deletions utilities/geopackage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const fs = require('fs-extra'),
path = require('path'),
GP = require('@ngageoint/geopackage'),
GeoPackageAPI = require('@ngageoint/geopackage').GeoPackage,
GeoPackageAPI = require('@ngageoint/geopackage').GeoPackageAPI,
FeatureTile = require('@ngageoint/geopackage').FeatureTiles,
ShadedFeaturesTile = require('@ngageoint/geopackage').ShadedFeaturesTile,
environment = require('../environment/env');
Expand Down Expand Up @@ -101,21 +100,22 @@ async function tile(layer, tableName, { stroke, width: lineWidth, fill }, { x, y
if (!featureDao) return;
const ft = new FeatureTile(featureDao, width, height);

ft.setPointColor(stroke)
ft.setLineColor(stroke);
ft.setPolygonColor(stroke);
ft.pointColor = stroke;
ft.lineColor = stroke;
ft.polygonColor = stroke;

ft.setPolygonFillColor(fill);
ft.polygonFillColor = fill;

ft.setPointRadius(lineWidth);
ft.setPolygonStrokeWidth(lineWidth);
ft.setLineStrokeWidth(lineWidth);
ft.pointRadius = lineWidth;
ft.polygonStrokeWidth = lineWidth;
ft.lineStrokeWidth = lineWidth;

ft.setMaxFeaturesPerTile(10000);
ft.maxFeaturesPerTile = 10000;

const shadedFeaturesTile = new ShadedFeaturesTile();
ft.setMaxFeaturesTileDraw(shadedFeaturesTile);
ft.maxFeaturesTileDraw = shadedFeaturesTile;
tile = await ft.drawTile(x, y, z);

break;
}

Expand Down

0 comments on commit 12acb9e

Please sign in to comment.