-
Notifications
You must be signed in to change notification settings - Fork 5
Update style builder tool for Standard style support #24
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
Conversation
| .optional() | ||
| .describe( | ||
| 'Layer slot for Mapbox Standard styles. Controls layer stacking order. ' + | ||
| 'Bottom: below most map features, Middle: between base and labels, Top: above all base map features (default)' |
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.
| 'streets-v11', | ||
| 'light-v10', | ||
| 'dark-v10', | ||
| 'satellite-v9', | ||
| 'satellite-streets-v11', | ||
| 'outdoors-v11' |
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.
We have a newer version of those styles.
https://docs.mapbox.com/api/maps/styles/#classic-mapbox-styles
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.
fixed with new versions
| // 'dark', | ||
| // 'satellite', | ||
| // 'outdoors' | ||
| // ].includes(baseStyle); |
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.
[nit] Consider to remove the comment.
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.
👍 removed
| class: { | ||
| description: 'Waterway classification', | ||
| description: 'class field', |
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.
[nit] if those description are only <key> field, it will not help with the context, consider to remove them.
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.
removed these fields, indeed, they are not useful for context
| waterway: { | ||
| iso_3166_1: { | ||
| description: 'iso_3166_1 field', | ||
| values: [ |
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.
[nit] The iso_3166_1 list could be the same for each layer, consider puting them in one place, and referring to it, instead of listing it duplicate times.
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.
made a solution so that there one shared constant for all - reducing a lot of lines
| sections.push('**LineString layers:**'); | ||
| sections.push('- `road` - All roads, paths, railways'); | ||
| sections.push('- `admin` - Administrative boundaries'); | ||
| sections.push('- `waterway` - Rivers, streams, canals as lines'); | ||
| sections.push('- `aeroway` - Airport runways and taxiways'); | ||
| sections.push('- `structure` - Bridges, tunnels, fences'); | ||
| sections.push('- `natural_label` - Natural feature label placement paths'); | ||
| sections.push(''); | ||
| sections.push('**Point layers:**'); | ||
| sections.push('- `place_label` - City, state, country labels'); | ||
| sections.push('- `poi_label` - Points of interest'); | ||
| sections.push('- `airport_label` - Airport labels'); | ||
| sections.push('- `transit_stop_label` - Transit stops'); | ||
| sections.push('- `motorway_junction` - Highway exits'); | ||
| sections.push('- `housenum_label` - House numbers'); | ||
| sections.push(''); | ||
| sections.push('## Layer Types and Properties'); | ||
| sections.push(''); |
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.
[nit] Those push likes hard, consider a better way to add?
I don't have a better way yet, but just one example
sections.push([
'**LineString layers:**',
'- `road` - All roads, paths, railways',
'- `admin` - Administrative boundaries',
'- `waterway` - Rivers, streams, canals as lines',
'- `aeroway` - Airport runways and taxiways',
'- `structure` - Bridges, tunnels, fences',
'- `natural_label` - Natural feature label placement paths',
'',
'**Point layers:**',
'- `place_label` - City, state, country labels',
'- `poi_label` - Points of interest',
'- `airport_label` - Airport labels',
'- `transit_stop_label` - Transit stops',
'- `motorway_junction` - Highway exits',
'- `housenum_label` - House numbers',
'',
'## Layer Types and Properties',
''
].join('\n'));
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.
good point, i've done something similar now - now there are less push statements, one per "section"


Description
Summary
maritimeanddisputedas strings)Changes
New Features
Standard Style Support: StyleBuilderTool now creates modern Mapbox Standard styles by default
importsto inherit frommapbox://styles/mapbox/standardmapbox:uiParadigm: 'imports'slotproperty to layers for Standard stylesStyle Type Options: Three base style options available:
standard(default): Modern style with imports and slotsclassic: Traditional style with direct sources (being deprecated)blank: Minimal style with basic sources, no importsBug Fixes
Admin Layer Filters: Fixed filter generation for country/state boundaries
maritimeanddisputedare now correctly treated as strings ("true"/"false") not booleansImprovements
Response Size Optimization: Added
filterExpandedMapboxStylesutility to remove expanded style data from APIresponses
Enhanced Layer Configuration:
Testing
Added unit tests + test cases in the style builder tool doc
Checklist
Additional Notes