maplibre / maplibre-rs

Experimental Maps for Web, Mobile and Desktop
Apache License 2.0
1.34k stars 77 forks source link

Styleparser #265

Closed kimpham54 closed 2 months ago

kimpham54 commented 1 year ago

Working on the style parser that can parse jsons based on the maplibre style specification https://maplibre.org/maplibre-gl-js-docs/style-spec/ and https://github.com/maplibre/maplibre-gl-js/blob/main/src/style-spec/reference/v8.json.

💻 Examples

🚨 Test instructions

cargo test --package maplibre --lib -- style::style::tests shows that 30 tests are passing, 2 are failing. I need to work on getting those two tests to pass - currently the two styles that fail have an array with a mix of integers and floats, they need to be parsed in a way that can accept both types

✔️ PR Todo

maxammann commented 1 year ago

@kimpham54 I removed the proprietary files and removed the tests. We can create those tests in some other repository hosted outside of maplibre.

For that we need to expose the style parsing functionality. Either through a new maplibre-style crate or by exporting the functions from the existing maplibre crate.

Reviewing now :)

nyurik commented 1 year ago

Lots of amazing work on this PR, thanks @kimpham54 ! I wonder if we can point this work to https://github.com/maplibre/maplibre-gl-js/tree/main/test/integration/render/tests -- it has a lot of MapLibre style files that could be used for testing? Also, any let me know if I can help moving this along.

P.S. I guess this should be a maplibre-style crate that lives inside the maplibre-rs monorepo

HarelM commented 1 year ago

I think this is a great step forward! The way I imagined it was that all the parsing and validation of the style spec would be in the maplibre-style-spec repo, creating a packages for every platform. This way all the style.json files that needs to be tested are there as well. Later on, if we decide for example to change the underlying architecture to use json scheme it will all be in the same place. This is just an initial thought though...

maxammann commented 12 months ago

@kimpham54 Hi! are you still interested in pushing this forward? :)