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

Enhance unsupported properties test #827

Merged
merged 4 commits into from
Dec 2, 2024
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
11 changes: 9 additions & 2 deletions data/olStyles/unsupported_properties.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import OlStyle from 'ol/style/Style';
import OlStyleFill from 'ol/style/Fill';
import OlStyleIcon from 'ol/style/Icon';

const olUnsupportedProperties = new OlStyle({
const unsupportedFill = new OlStyle({
fill: new OlStyleFill({
color: '#F1337F'
})
});
const unsupportedImage = new OlStyle({
image: new OlStyleIcon({
src: 'peter.png',
crossOrigin: 'anonymous'
})
});

export default olUnsupportedProperties;
export default [unsupportedFill, unsupportedImage];
4 changes: 4 additions & 0 deletions data/styles/unsupported_properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const unsupportedProperties: Style = {
kind: 'Fill',
color: '#F1337F',
opacity: 0.5
}, {
kind: 'Icon',
image: 'peter.png',
anchor: 'bottom-left'
}]
}
]
Expand Down
5 changes: 4 additions & 1 deletion src/OlStyleParser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,10 @@ describe('OlStyleParser implements StyleParser', () => {
info: 'Use fillOpacity instead.',
support: 'none'
}
}
},
IconSymbolizer: {
anchor: 'none',
},
}
};
const warningsGot = ['Your style contains unsupportedProperties!'];
Expand Down
1 change: 1 addition & 0 deletions src/OlStyleParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export class OlStyleParser implements StyleParser<OlStyleLike> {
},
RasterSymbolizer: 'none',
TextSymbolizer: {
anchor: 'none',
placement: {
support:'partial',
info: 'point and line supported. line-center will be mapped to line.'
Expand Down