ConservationMetrics / mapgl-tile-renderer

Headless Node.js Maplibre-GL renderer for generating MBTiles with styled raster tiles.
MIT License
12 stars 3 forks source link

New CLI api proposal #14

Closed luandro closed 9 months ago

luandro commented 9 months ago

Goal

Reduce redundant options in the cli API.

What I changed

The documentation been updated to clarify the usage of the --style option. Previously, the option required a "yes" or "no" answer to indicate whether the user was providing their own style. Now, the option has been expanded to allow users to specify the source of the style directly.

Users can indicate a self-provided style with self or choose from a list of supported online sources. Additionally, the parameters for specifying the location of a self-provided style and its sources have been streamlined from -l or --stylelocation and -i or --stylesources to --stylelocation and --stylesources respectively, and are now grouped under the condition of using a self-provided style.

For online sources, the options to provide an overlay and an API key remain, but the previous -O or --onlinesource option has been removed, as the source is now directly specified with the --style option. The Mapbox style ID format is also now included under the --style option, eliminating the need for a separate condition.

What I'm not doing here

Still just a proposal, no code for change to work has been checked.

rudokemper commented 9 months ago

Thanks for your contributions to this tool @luandro!

Your changes are sensible, I agree about the redundancy and vagueness of current style: yes/no.

What gave me pause before is that "style" is mostly a MapGL-specific term; the other services don't always describe their different basemap options in terms of style. But I think it's a tradeoff worth living with for a more coherent CLI / API.

I can collaborate with you on this PR. Later on I'll push up a commit later to implement your proposal (maybe with a few changes here and there).