geostyler / geostyler-mapfile-parser

GeoStyler Style Parser implementation for MapServer Mapfiles
BSD 2-Clause "Simplified" License
8 stars 5 forks source link

Improve typings and add tests #8

Closed marcjansen closed 4 years ago

marcjansen commented 4 years ago

This PR tries to improve typings of the parser methods a bit and adds a bunch of tests.

Since npm test currently fails on master due to unrelated things, the tests herein need to be run e.g. with jest -t check; they all pass locally for me.

This also revealed a tiny bug where hexcolors with alpha channel (e.g. #rrggbbaa) wouldn't be detected properly. These are allowed according to https://mapserver.org/mapfile/style.html

ger-benjamin commented 4 years ago

I'm not sure that having the alpha channel in the hexcolor is correct. If you look here: https://geostyler.github.io/geostyler-demo/ or here https://github.com/geostyler/geostyler-style/blob/master/index.d.ts#L115-L123 The alpha part is in an opacity property. Not in the Hex color.

That can be changed in another PR

marcjansen commented 4 years ago

Thanks for the reviews. I'll merge and then you can go on with the opacity as you think it fits best.