<!DOCTYPE html>
<meta charset="utf-8" />
<title>Add style control</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://tiles.locationiq.com/v3/libs/maplibre-gl/1.15.2/maplibre-gl.js"></script>
<link href="https://tiles.locationiq.com/v3/libs/maplibre-gl/1.15.2/maplibre-gl.css" rel="stylesheet" />

<script src="https://tiles.locationiq.com/v3/js/liq-styles-ctrl-libre-gl.js?v=0.1.8"></script>
<link href="https://tiles.locationiq.com/v3/css/liq-styles-ctrl-libre-gl.css?v=0.1.8" rel="stylesheet" />
            body { margin:0px; padding:0px; }
            #map { position:absolute; top:0px; bottom:0px; width:100%; }
<div id="map"></div>
            //Add your LocationIQ Maps Access Token here (not the API token!)
            locationiq.key = 'pk.a5c3fbf2119bfb2275b62eddbccd76b3';
            //Define the map and configure the map's theme
            var map = new maplibregl.Map({
                container: 'map',
                attributionControl: false, //need this to show a compact attribution icon (i) instead of the whole text
                zoom: 12,
                center: [-122.42, 37.779]
            //Define layers you want to add to the layer controls; the first element will be the default layer
            var layerStyles = {
                "Streets": "streets/vector",
                "Dark": "dark/vector",
                "Light": "light/vector"
            map.addControl(new locationiqLayerControl({
                key: locationiq.key,
                layerStyles: layerStyles
            }), 'top-left');