The Style Builder tool is a powerful utility for creating and modifying Mapbox styles programmatically. It provides a conversational interface to build complex map styles with various customizations for layers, labels, boundaries, roads, POIs, and more.
To start building a style, you can initiate the conversation with prompts like:
- "Can you help me building a style, what customizations can I make?"
- "Create a new Mapbox style with specific features"
- "Modify my existing style to add/remove layers"
The tool can be used for both creating new styles and modifying existing styles.
Prompt: "Create a style with all possible labels enabled, make every label have a different look so that they can be distinguished. Include also all boundaries (countries, provinces). And all roads with different colors and opacities. POIs with icons."
This creates a maximally detailed style where:
- Every label type has distinct visual properties
- All administrative boundaries are visible
- Roads are color-coded by type
- POIs display with appropriate icons
Prompt: "Create a style with only administrative boundaries having admin_level 0 or 1, and roads with class motorway and oneway true"
This creates a minimalist style focusing on:
- Country and state/province boundaries only
- Motorways that are one-way streets
- Clean, uncluttered appearance
Prompt: "Create a style with minor roads only visible above zoom 14, service roads only above zoom 16, with zoom-based width increase"
This creates a progressive detail style where:
- Road visibility depends on zoom level
- Road widths increase smoothly with zoom
- Performance optimized for different zoom ranges
Prompt: "Create a style with only POIs showing maki icons for restaurants, cafes, and bars, each in different colors"
This creates a food & beverage focused style with:
- Selective POI display
- Color-coded categories
- Clear maki icon representation
Prompt: "Create a style with international boundaries (admin_level 0) that are not maritime and not disputed in solid black, disputed ones in red dashed"
This creates a politically-aware style with:
- Different styling for disputed boundaries
- Maritime boundary filtering
- Visual hierarchy for boundary types
The Style Builder supports extensive customizations including:
- Add/remove specific layer types
- Modify layer ordering
- Apply filters and conditions
- Control text size, font, and color
- Set visibility by zoom level
- Adjust label density and overlap behavior
- Customize by road class (motorway, trunk, primary, secondary, etc.)
- Apply different styles for bridges and tunnels
- Control casing and width properties
- Filter by administrative level
- Style disputed boundaries differently
- Control maritime boundary display
- Filter by category or specific types
- Customize icons and colors
- Control density and zoom-based visibility
- 3D extrusion settings
- Color by height or type
- Opacity and visibility controls
- Add terrain layers
- Adjust hillshade intensity
- Control exaggeration factors
The tool can modify existing Mapbox styles:
- Import a style by ID or URL
- Make targeted modifications
- Preserve existing customizations while adding new features
The builder can optimize styles for:
- Mobile devices (reduced layer count)
- High-density displays
- Specific zoom ranges
Create multiple versions of a style:
- Light and dark modes
- Seasonal variations
- Brand-specific color schemes
- Start Simple: Begin with basic requirements and iteratively add complexity
- Test at Multiple Zooms: Ensure your style works well across zoom levels
- Consider Performance: More layers and complex filters can impact rendering speed
- Use Consistent Naming: When creating custom layers, use clear, descriptive IDs
- Document Your Choices: Keep notes on why certain styling decisions were made
- Resources Not Loading: Remember that sprite and glyph resources may not be accessible in Claude Desktop
- Layer Conflicts: Check layer ordering if elements appear hidden
- Performance Issues: Reduce layer count or simplify filters for better performance
- Zoom Range Problems: Verify minzoom and maxzoom settings on layers
When encountering issues, provide:
- The style configuration you're trying to achieve
- Any error messages received
- The platform/client you're using
The Style Builder tool:
- Generates Mapbox GL JS compatible style specifications
- Follows the Mapbox Style Specification v8
- Supports all standard Mapbox layer types
- Can output styles for use in Mapbox GL JS, native SDKs, and Mapbox Studio
- Some advanced Studio-only features may not be available
- Custom data sources need to be added separately
- Sprite and font resources must be hosted and accessible
- Complex expressions may need manual refinement
Once you've built or modified a style using the Style Builder:
Use the CreateStyleTool to save your generated style to your Mapbox account:
- The tool will create a new style with your specifications
- Returns a style ID that you can use for further modifications
Use the UpdateStyleTool to apply modifications to an existing style:
- Provide the style ID or name of the style you want to update (if the name uniquely identifies it)
- The tool will update the style with your new specifications
Use the PreviewStyleTool to generate a preview URL:
- Instantly view your style in a browser
- Test different zoom levels and locations
- Share the preview link with team members
Example workflow for new style:
- "Build a style with only roads and labels"
- "Now create this style in my account" → Uses CreateStyleTool
- "Generate a preview link for this style" → Uses PreviewStyleTool
Example workflow for modifying existing style:
- "Modify my 'Winter Theme' style to add POIs with restaurant icons"
- "Update the style in my account" → Uses UpdateStyleTool (finds style by name)
- "Generate a preview link for this style" → Uses PreviewStyleTool
Alternative with style ID:
- "Modify style clxyz123... to add building extrusions"
- "Update the style in my account" → Uses UpdateStyleTool (uses style ID)
- "Generate a preview link for this style" → Uses PreviewStyleTool
After creating or modifying your style:
- Test in your target environment using the preview URL
- Use the style in your applications with the style ID
- Optimize for your specific use case
- Consider creating variations for different contexts
- Your styles are also viewable and editable in Mapbox Studio if needed
For more information on Mapbox styles, refer to the Mapbox Style Specification.