Skip to content

Non-Mapbox styles in StylesControl #57

@beard7

Description

@beard7

Hi,

Thanks for the packages.

It may be worth documenting the fact that you can also use the StylesControl with non-Mapbox styles by adding the style definition to the styleUrl property. For example:

        {
            label: 'Other',
            styleName: 'Some Other Tile Source',
            styleUrl: {
                'version': 8,
                'name': 'Other',
                'sources': {
                    'other': {
                        'type': 'raster',
                        'tiles': [`https://url`],
                        'tileSize': 512,
                        'attribution': '© Some other source'
                    }
                },
                'layers': [
                    {
                        'id': 'other-tiles',
                        'type': 'raster',
                        'source': 'other',
                        'minzoom': 0,
                        'maxzoom': 22
                    }
                ]
            }
        }

as long as the object assigned to the styleUrl has a name property that matches the label, all is good.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions