-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update sprite handling #308
Conversation
BREAKING CHANGE: use geostyler-style Sprite instead of string syntax
85790d3
to
9d883be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a remark about the fetch. I am not that into the geostyler code, but the tests look sensible so I'd argue the code does the correct thing.
I created an issue for refactoring as coding/reviewing is already getting difficult: #309 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, if I like moving the metadata to a class member. IMHO, this only introduces not needed state handling, just for the benefit of not passing an additional argument to the methods.
I agree that this parser needs some refactoring, but I don't think that this approach is the solution to it.
const { output: geoStylerStyle } = await styleParser.readStyle(mb_line_simpleline); | ||
expect(geoStylerStyle).toBeDefined(); | ||
expect(geoStylerStyle).toEqual(line_simpleline); | ||
}); | ||
|
||
it('can read a mapbox Line style with fill pattern', async () => { | ||
expect.assertions(2); | ||
mockFetchResult({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to put this into a beforeEach
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is only needed for certain tests, so I would say it is not needed in a beforeEach
.
@@ -204,8 +230,16 @@ export class MapboxStyleParser implements StyleParser<Omit<MbStyle, 'sources'>> | |||
'geostyler:ref': GeoStylerRef; | |||
}; | |||
|
|||
private gsMetadata: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this into a separate PR for better code review?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to refactor this in a followup. See #309
Co-authored-by: Jan Suleiman <[email protected]>
🎉 This PR is included in version 5.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This updates the handling of mapbox sprites to make use of the geostyler
Sprite
.❗ breaking change