Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ol5 upgrade #77

Merged
merged 7 commits into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Please provide related issues here https://github.com/terrestris/geostyler/issue
ES6:
```js
import OpenLayersParser from "geostyler-openlayers-parser";
import OlLayerVector from "ol/layer/vector";
import OlLayerVector from "ol/layer/Vector";

const pointSimplePoint = {
name: "OL Style",
Expand Down
4 changes: 2 additions & 2 deletions data/olStyles/line_simpleline.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import OlStyle from 'ol/style/style';
import OlStyleStroke from 'ol/style/stroke';
import OlStyle from 'ol/style/Style';
import OlStyleStroke from 'ol/style/Stroke';

const olSimpleLine = new OlStyle({
stroke: new OlStyleStroke({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/multi_simplefillSimpleline.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleStroke from 'ol/style/stroke';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleStroke from 'ol/style/Stroke';
import OlStyleFill from 'ol/style/Fill';

const olSimpleFill = new OlStyle({
fill: new OlStyleFill({
Expand Down
10 changes: 5 additions & 5 deletions data/olStyles/multi_simplelineLabel.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import OlStyle from 'ol/style/style';
import OlStyleStroke from 'ol/style/stroke';
import OlStyleFill from 'ol/style/fill';
import OlStyleText from 'ol/style/text';
import OlStyle from 'ol/style/Style';
import OlStyleStroke from 'ol/style/Stroke';
import OlStyleFill from 'ol/style/Fill';
import OlStyleText from 'ol/style/Text';

const olSimpleLine = new OlStyle({
stroke: new OlStyleStroke({
Expand All @@ -23,7 +23,7 @@ const olStyledLabel = new OlStyle({
}),
offsetX: 0,
offsetY: 5
})
})
});

export default [olSimpleLine, olStyledLabel];
6 changes: 3 additions & 3 deletions data/olStyles/multi_twoRulesSimplepoint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleCircle from 'ol/style/circle';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleCircle from 'ol/style/Circle';
import OlStyleFill from 'ol/style/Fill';

const olSimplePoint1 = new OlStyle({
image: new OlStyleCircle({
Expand Down
4 changes: 2 additions & 2 deletions data/olStyles/point_icon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import OlStyle from 'ol/style/style';
import OlStyleIcon from 'ol/style/icon';
import OlStyle from 'ol/style/Style';
import OlStyleIcon from 'ol/style/Icon';

const olIconPoint = new OlStyle({
image: new OlStyleIcon({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simplebackslash.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleSlash = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simplecarrow.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleCarrow = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simplecross.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleCross = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simpledot.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleCircle from 'ol/style/circle';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleCircle from 'ol/style/Circle';
import OlStyleFill from 'ol/style/Fill';

const olSimpleDot = new OlStyle({
image: new OlStyleCircle({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simplehorline.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleHorline = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simpleoarrow.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleOarrow = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simpleplus.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimplePlus = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simplepoint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleCircle from 'ol/style/circle';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleCircle from 'ol/style/Circle';
import OlStyleFill from 'ol/style/Fill';

const olSimplePoint = new OlStyle({
image: new OlStyleCircle({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simpleslash.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleSlash = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simplesquare.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleSquare = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simplestar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleStar = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simpletimes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleTimes = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simpletriangle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleTriangle = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simplevertline.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleVertline = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
6 changes: 3 additions & 3 deletions data/olStyles/point_simplex.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlStyleFill from 'ol/style/Fill';

const olSimpleX = new OlStyle({
image: new OlStyleRegularshape({
Expand Down
8 changes: 4 additions & 4 deletions data/olStyles/point_styledLabel_static.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import OlStyleText from 'ol/style/text';
import OlStyleStroke from 'ol/style/stroke';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/style';
import OlStyleText from 'ol/style/Text';
import OlStyleStroke from 'ol/style/Stroke';
import OlStyleFill from 'ol/style/Fill';
import OlStyle from 'ol/style/Style';

const olPointStyledLabel = new OlStyle({
text: new OlStyleText({
Expand Down
8 changes: 4 additions & 4 deletions data/olStyles/point_styledlabel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyleText from 'ol/style/text';
import OlStyleStroke from 'ol/style/stroke';
import OlStyleFill from 'ol/style/fill';
import OlStyleText from 'ol/style/Text';
import OlStyleStroke from 'ol/style/Stroke';
import OlStyleFill from 'ol/style/Fill';

const olPointStyledLabel = (feature: ol.Feature, res: number) => {
return new OlStyleText({
Expand All @@ -18,7 +18,7 @@ const olPointStyledLabel = (feature: ol.Feature, res: number) => {
offsetX: 0,
offsetY: 5,
rotation: Math.PI / 4
});
});
};

export default olPointStyledLabel;
6 changes: 3 additions & 3 deletions data/olStyles/polygon_transparentpolygon.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OlStyle from 'ol/style/style';
import OlStyleStroke from 'ol/style/stroke';
import OlStyleFill from 'ol/style/fill';
import OlStyle from 'ol/style/Style';
import OlStyleStroke from 'ol/style/Stroke';
import OlStyleFill from 'ol/style/Fill';

const olPolygonTransparentPolygon = new OlStyle({
stroke: new OlStyleStroke({
Expand Down
26 changes: 13 additions & 13 deletions dev-build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ module.exports = {
},
externals: [
{
'ol/style/style': 'ol.style.Style',
'ol/style/Style': 'ol.style.Style',
'ol/style': 'ol.style',
'ol/style/image': 'ol.style.Image',
'ol/style/stroke': 'ol.style.Stroke',
'ol/style/text': 'ol.style.Text',
'ol/style/circle': 'ol.style.Circle',
'ol/style/icon': 'ol.style.Icon',
'ol/style/regularshape': 'ol.style.RegularShape',
'ol/style/fill': 'ol.style.Fill',
'ol/map': 'ol.Map',
'ol/source/tilewms': 'ol.source.TileWMS',
'ol/source/imagewms': 'ol.source.ImageWMS',
'ol/layer/group': 'ol.layer.Group',
'ol/layer/base': 'ol.layer.Base',
'ol/style/Image': 'ol.style.Image',
'ol/style/Stroke': 'ol.style.Stroke',
'ol/style/Text': 'ol.style.Text',
'ol/style/Circle': 'ol.style.Circle',
'ol/style/Icon': 'ol.style.Icon',
'ol/style/RegularShape': 'ol.style.RegularShape',
'ol/style/Fill': 'ol.style.Fill',
'ol/Map': 'ol.Map',
'ol/source/TileWMS': 'ol.source.TileWMS',
'ol/source/ImageWMS': 'ol.source.ImageWMS',
'ol/layer/Group': 'ol.layer.Group',
'ol/layer/Base': 'ol.layer.Base',
'ol/proj': 'ol.proj'
}
],
Expand Down
11 changes: 11 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
declare module 'geostyler-openlayers-parser';
declare module '@terrestris/ol-util/dist/MapUtil/MapUtil';

declare module 'ol/Feature';
declare module 'ol/geom/Point';
declare module 'ol/style/Circle';
declare module 'ol/style/Fill';
declare module 'ol/style/Icon';
declare module 'ol/style/Image';
declare module 'ol/style/RegularShape';
declare module 'ol/style/Stroke';
declare module 'ol/style/Style';
declare module 'ol/style/Text';
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
},
"homepage": "https://github.com/terrestris/geostyler-openlayers-parser#readme",
"dependencies": {
"@terrestris/ol-util": "0.5.0",
"@terrestris/ol-util": "1.6.0",
"geostyler-style": "0.14.2",
"lodash": "4.17.11"
},
"peerDependencies": {
"ol": "4.6.5"
"ol": "~5.0"
},
"scripts": {
"build": "tsc -p tsconfig.build.json && npm run build:browser",
Expand All @@ -46,10 +46,8 @@
},
"devDependencies": {
"@babel/polyfill": "7.2.5",
"@terrestris/ol-util": "0.5.0",
"@types/jest": "23.3.11",
"@types/node": "10.12.18",
"@types/ol": "4.6.3",
"awesome-typescript-loader": "4.0.1",
"babel-core": "6.26.3",
"babel-jest": "23.6.0",
Expand All @@ -59,7 +57,7 @@
"jest": "23.6.0",
"jest-preset-typescript": "1.2.0",
"np": "3.1.0",
"ol": "4.6.5",
"ol": "5.3.0",
"ts-jest": "22.4.6",
"tslint": "5.11.0",
"typescript": "3.1.2",
Expand Down
16 changes: 8 additions & 8 deletions src/OlStyleParser.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import OlStyle from 'ol/style/style';
import OlStyleText from 'ol/style/text';
import OlStyleFill from 'ol/style/fill';
import OlStyleCircle from 'ol/style/circle';
import OlStyleIcon from 'ol/style/icon';
import OlStyleRegularshape from 'ol/style/regularshape';
import OlFeature from 'ol/feature';
import OlStyle from 'ol/style/Style';
import OlStyleText from 'ol/style/Text';
import OlStyleFill from 'ol/style/Fill';
import OlStyleCircle from 'ol/style/Circle';
import OlStyleIcon from 'ol/style/Icon';
import OlStyleRegularshape from 'ol/style/RegularShape';
import OlFeature from 'ol/Feature';
import ol from 'ol';

import OlStyleParser, { OlParserStyleFct } from './OlStyleParser';
Expand Down Expand Up @@ -919,7 +919,7 @@ describe('OlStyleParser implements StyleParser', () => {

const expecSymb1 = multi_twoRulesSimplepoint.rules[0].symbolizers[0] as MarkSymbolizer;
const expecSymb2 = multi_twoRulesSimplepoint.rules[1].symbolizers[0] as MarkSymbolizer;

const olCircle1 = styles[0].getImage() as OlStyleCircle;
expect(olCircle1).toBeDefined();
expect(olCircle1.getRadius()).toBeCloseTo(expecSymb1.radius);
Expand Down
Loading