All integrations MapLibre Leaflet OpenLayers React Vue Svelte Angular React Native WordPress Webflow Squarespace Wix Shopify API docs
Wix does not put your code straight into the page. It saves it as a small separate page on Wix's own file domain, filesusr.com, and shows that page inside a frame (an iframe). Each site gets its own address there, built from the site's domain with the dots turned into dashes, for example www-yourbusiness-com.filesusr.com.
This has two effects:
filesusr.com address, so that is the domain the key restriction must allow. Adding only yourbusiness.com will block your own map.This differs from our usual snippet only in the first few lines, which make the map fill the Wix frame edge to edge. Replace YOUR_API_KEY and the two sets of numbers. The order is longitude, then latitude: [-0.1276, 51.5072] is London.
<style>
html, body { margin: 0; height: 100%; }
#map { width: 100%; height: 100%; }
</style>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.css">
<script src="https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.js"></script>
<div id="map"></div>
<script>
var map = new maplibregl.Map({
container: "map",
style: "https://tiles.expressmaps.com/styles/standard.json?key=YOUR_API_KEY",
center: [-0.1276, 51.5072],
zoom: 13
});
map.addControl(new maplibregl.NavigationControl());
new maplibregl.Marker()
.setLngLat([-0.1276, 51.5072])
.setPopup(new maplibregl.Popup().setText("Our shop"))
.addTo(map);
</script> Using the embed generator? Pick your style and position there, then copy the style address and the numbers into the snippet above, which is made to fill the Wix frame.
In the Wix Editor:
In Wix Studio the steps are the same, but the element is listed as Embed code under the Embed code section of the Add menu.
Check the result on the published site. Embeds can behave differently in the editor and in Preview.
First find the exact filesusr.com address Wix uses for your site:
view-source:https://www-yourbusiness-com.filesusr.com/html/....https:// and the next / is your embed domain, here www-yourbusiness-com.filesusr.com.In Firefox, right-click the map and choose This Frame → Open Frame in New Tab instead, then read the address bar.
Then restrict the key:
https:// or anything after it) and click Add Restriction.Add the embed domain exactly as you found it. Do not add plain filesusr.com: every Wix site's embeds live under that domain, so it would not protect your key. If you later connect a new domain to your Wix site, the embed address changes too, so check it again and update the key.
Using the same key on another website as well? Add that site's own domains to the same list, or better, create a separate key for each site so you can see their usage apart in the console.
filesusr.com embed domain from Step 3 is on the key's list, not just your own domain. To confirm, remove all restrictions for a minute: if the map appears, the restriction list is the problem.<style> lines at the top of the snippet, and resize the Embed HTML element itself; the map grows to fill it.[longitude, latitude].standard in the style address with basic, enhanced, darklands, greyscale, navigator, subtle, autobahn, lithium or mulberry.new maplibregl.Marker() lines and change the numbers and popup text.cooperativeGestures: true, after zoom: 13, so visitors move the map with two fingers and scroll the page with one.