Skip to content

Commit

Permalink
Merge 05ec15f into 27af45f
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap committed Jun 22, 2020
2 parents 27af45f + 05ec15f commit 17f4108
Show file tree
Hide file tree
Showing 37 changed files with 12,239 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitignore
@@ -0,0 +1,22 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# production
/build
/browser

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*

index.html
11 changes: 11 additions & 0 deletions .travis.yml
@@ -0,0 +1,11 @@
language: node_js
node_js:
- "10"
- "12"
script:
- npm run test -- --coverage
cache:
directories:
- node_modules
after_script:
- cat ./coverage/lcov.info | ./node_modules/.bin/coveralls
34 changes: 34 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,34 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"port": 9230,
"runtimeArgs": [
"--inspect-brk=9230",
"${workspaceRoot}/node_modules/.bin/jest",
"--runInBand",
"--watch"
],
"runtimeExecutable": null,
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "Debug Jest Tests Windows",
"program": "${workspaceRoot}/node_modules/jest/bin/jest",
"args": [
"-i",
"--watch"
],
"internalConsoleOptions": "openOnSessionStart",
"console": "integratedTerminal",
"outFiles": [
"${workspaceRoot}/build/dist/**/*"
]
}
]
}
12 changes: 12 additions & 0 deletions babel.config.js
@@ -0,0 +1,12 @@
module.exports = {
"presets": [
["@babel/env", {
"useBuiltIns": "usage"
}],
"@babel/preset-typescript"
],
"plugins": [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread"
]
};
34 changes: 34 additions & 0 deletions browser-build.config.js
@@ -0,0 +1,34 @@
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
module.exports = {
entry: ['@babel/polyfill', './src/GeoCSSStyleParser.ts'],
mode: 'production',
output: {
filename: 'geoCSSStyleParser.js',
path:path.join(__dirname, 'browser'),
library: 'GeoStylerGeoCSSParser'
},
resolve: {
// Add '.ts' as resolvable extensions.
extensions: ['.ts', '.js', '.json']
},
optimization: {
minimizer: [
new TerserPlugin()
]
},
module: {
rules: [
// All files with a '.ts'
{
test: /\.ts$/,
include: path.join(__dirname, 'src'),
use: [
{
loader: require.resolve('ts-loader'),
},
],
}
]
}
};
14 changes: 14 additions & 0 deletions data/geocsss/line_graphicStroke.css
@@ -0,0 +1,14 @@
@mode 'Flat';
@styleTitle 'Line with symbol';

* {
stroke: symbol('circle');
stroke-width: 3;
stroke-dasharray: 13 37;
stroke-linecap: round;
stroke-linejoin: miter;
:stroke {
fill: #FF0000;
size: 7;
}
}
12 changes: 12 additions & 0 deletions data/geocsss/line_graphicStroke_externalGraphic.css
@@ -0,0 +1,12 @@
@mode 'Flat';
@styleTitle 'Line with external graphic';

* {
stroke: url('http://geoserver.org/img/geoserver-logo.png');
stroke-rotation: 90;
stroke-size: 10;
stroke-width: 3;
stroke-dasharray: 13 37;
stroke-linecap: round;
stroke-linejoin: miter;
}
11 changes: 11 additions & 0 deletions data/geocsss/line_perpendicularOffset.css
@@ -0,0 +1,11 @@
@mode 'Flat';
@styleTitle 'Line with offset';

* {
stroke: #000000;
stroke-width: 3;
stroke-dasharray: 13 37;
stroke-linecap: round;
stroke-linejoin: miter;
stroke-offset: 3;
}
11 changes: 11 additions & 0 deletions data/geocsss/line_simpleline.css
@@ -0,0 +1,11 @@
@mode 'Flat';
@styleTitle 'Simple line';

* {
stroke: #000000;
stroke-width: 3;
stroke-dasharray: 13 37;
stroke-linecap: round;
stroke-linejoin: miter;
stroke-dashoffset: 10;
}
15 changes: 15 additions & 0 deletions data/geocsss/multi_simplelineLabel.css
@@ -0,0 +1,15 @@
@mode 'Flat';
@styleTitle 'Simple line with label';

* {
stroke: #000000;
stroke-width: 3;
stroke-dasharray: 13 37;
label: [name];
label-offset: 0 5;
font-family: 'Arial';
font-fill: #000000;
font-size: 12;
font-style: normal;
font-weight: bold;
}
8 changes: 8 additions & 0 deletions data/geocsss/point_externalgraphic.css
@@ -0,0 +1,8 @@
@mode 'Flat';
@styleTitle 'External graphic';

* {
mark: url('http://geoserver.org/img/geoserver-logo.png');
mark-size: 10;
mark-rotation: 90;
}
21 changes: 21 additions & 0 deletions data/geocsss/point_simplepoint_filter.css
@@ -0,0 +1,21 @@
@mode 'Flat';
@styleTitle 'Simple Point Filter';

/* @title Small populated New Yorks */
[NAME = 'New York']
[TEST_BOOL = true]
[TEST is null]
[TEST2 like '*York*']
[TEST1 like '*New*']
[POPULATION <= 100000]
[TEST2 = '1' or TEST2 = '2']
[@sd > 10000][@sd < 20000] {
mark: symbol('circle');
:mark {
fill: #FF0000;
stroke: #000000;
stroke-width: 2;
size: 6;
};
}

12 changes: 12 additions & 0 deletions data/geocsss/polygon_graphicFill.css
@@ -0,0 +1,12 @@
@mode 'Flat';
@styleTitle 'Polygon Graphic Fill';

* {
stroke: #FFFFFF;
stroke-width: 2;
stroke-dasharray: 1 0;
fill: symbol('circle');
:fill {
fill: #FF0000;
};
}
11 changes: 11 additions & 0 deletions data/geocsss/polygon_transparentpolygon.css
@@ -0,0 +1,11 @@
@mode 'Flat';
@styleTitle 'Transparent Polygon';

* {
fill: #000080;
fill-opacity: 0.5;
stroke: #FFFFFF;
stroke-width: 2;
stroke-opacity: 0.9;
stroke-dasharray: 1 0;
}
12 changes: 12 additions & 0 deletions data/geocsss/raster_autoChannel.css
@@ -0,0 +1,12 @@
@mode 'Flat';
@styleTitle 'Raster auto channel';

/* @title Raster style */
* {
raster-channels: auto;
raster-contrast-enhancement: normalize;
raster-gamma: 0.5;
raster-opacity: 0.5;
raster-color-map-type: intervals;
raster-color-map: color-map-entry(#00ffff, 64, 0.4, 'label1') color-map-entry(#ff00ff, 256, 0.8, 'label2');
}
12 changes: 12 additions & 0 deletions data/geocsss/raster_grayChannel.css
@@ -0,0 +1,12 @@
@mode 'Flat';
@styleTitle 'Raster gray channel';

/* @title Raster style */
* {
raster-channels: 0;
raster-contrast-enhancement: normalize;
raster-gamma: 0.5;
raster-opacity: 0.5;
raster-color-map-type: intervals;
raster-color-map: color-map-entry(#00ffff, 64, 0.4, 'label1') color-map-entry(#ff00ff, 256, 0.8, 'label2');
}
12 changes: 12 additions & 0 deletions data/geocsss/raster_rgbChannels.css
@@ -0,0 +1,12 @@
@mode 'Flat';
@styleTitle 'Raster rgb channels';

/* @title Raster style */
* {
raster-channels: 0 1 2;
raster-contrast-enhancement: histogram histogram histogram;
raster-gamma: 0.5 0.5 0.5;
raster-opacity: 0.5;
raster-color-map-type: ramp;
raster-color-map: color-map-entry(#00ffff, 64, 0.4, 'label1') color-map-entry(#ff00ff, 256, 0.8, 'label2');
}
23 changes: 23 additions & 0 deletions data/styles/line_graphicStroke.ts
@@ -0,0 +1,23 @@
import { Style } from 'geostyler-style';

const lineSimpleLine: Style = {
name: 'Line with symbol',
rules: [{
name: '',
symbolizers: [{
kind: 'Line',
width: 3,
dasharray: [13, 37],
cap: 'round',
join: 'miter',
graphicStroke: {
kind: 'Mark',
wellKnownName: 'Circle',
color: '#FF0000',
radius: 3.5
}
}]
}]
};

export default lineSimpleLine;
23 changes: 23 additions & 0 deletions data/styles/line_graphicStroke_externalGraphic.ts
@@ -0,0 +1,23 @@
import { Style } from 'geostyler-style';

const lineSimpleLine: Style = {
name: 'Line with external graphic',
rules: [{
name: '',
symbolizers: [{
kind: 'Line',
width: 3,
dasharray: [13, 37],
cap: 'round',
join: 'miter',
graphicStroke: {
kind: 'Icon',
image: 'http://geoserver.org/img/geoserver-logo.png',
size: 10,
rotate: 90
}
}]
}]
};

export default lineSimpleLine;
19 changes: 19 additions & 0 deletions data/styles/line_perpendicularOffset.ts
@@ -0,0 +1,19 @@
import { Style } from 'geostyler-style';

const lineSimpleLine: Style = {
name: 'Line with offset',
rules: [{
name: '',
symbolizers: [{
kind: 'Line',
color: '#000000',
width: 3,
dasharray: [13, 37],
cap: 'round',
join: 'miter',
perpendicularOffset: 3
}]
}]
};

export default lineSimpleLine;
19 changes: 19 additions & 0 deletions data/styles/line_simpleline.ts
@@ -0,0 +1,19 @@
import { Style } from 'geostyler-style';

const lineSimpleLine: Style = {
name: 'Simple line',
rules: [{
name: '',
symbolizers: [{
kind: 'Line',
color: '#000000',
width: 3,
dasharray: [13, 37],
cap: 'round',
join: 'miter',
dashOffset: 10
}]
}]
};

export default lineSimpleLine;
25 changes: 25 additions & 0 deletions data/styles/multi_simplelineLabel.ts
@@ -0,0 +1,25 @@
import { Style } from 'geostyler-style';

const multiSimplelineLabel: Style = {
name: 'Simple line with label',
rules: [{
name: '',
symbolizers: [{
kind: 'Line',
color: '#000000',
width: 3,
dasharray: [13, 37]
}, {
kind: 'Text',
color: '#000000',
label: '{{name}}',
font: ['Arial'],
size: 12,
offset: [0, 5],
fontStyle: 'normal',
fontWeight: 'bold'
}]
}]
};

export default multiSimplelineLabel;

0 comments on commit 17f4108

Please sign in to comment.