Embed the map

Show Sogudo’s mobile coverage map on your own website with a single line of HTML. Around it, your page keeps its own interface — operators, address search, speeds — and drives the map in JavaScript. No key, no server.

How it works

It works like an embedded YouTube video: you paste one line where the map should appear, and app.sogudo.com serves the map itself — the coverage of an operator, the pin of the tested point, the zoom controls and the credits. Updates of the map reach your site on their own.

The map is only the map. The choice of operator, the address search and the speeds belong to your page: you build them with your own design and your own geocoder, and drive the map with the JavaScript API. Your page sends the point to test; the map tests it and sends the speeds back to your page, which shows them. See the complete example.

Your domain is your badge. The page holds no key. When the map loads, app.sogudo.com checks which website displays it. If that domain is declared for your organisation, the map opens with your countries; otherwise it is refused.

Displaying the map costs nothing. Each address tested by the map uses your organisation’s tokens, with the same rule as the speed API: see Getting started.

Before you start

Sogudo sets up your organisation in its admin. Check with your contact that you have:

  • Map access, and the countries you want to show.
  • Your domains declared, following these rules:
    • https:// and no path: https://www.example.com, not https://www.example.com/coverage.
    • www.example.com and example.com are two domains: declare both if your site answers on both. Test or preview sites count too.
    • https://*.example.com covers every subdomain of example.com, at any depth, but not example.com itself.
    • http:// is accepted only to test on your computer: localhost, and local domains ending in .test or .localhost, wildcard included, for example http://*.example.test.
    • localhost needs no declaration: every organisation can test there, in http or https, on localhost or 127.0.0.1, on every port. It is everyone’s computer, so it cannot tell who you are: name your organisation in the tag with data-organisation="your-identifier". The attribute is ignored on your real domains, so the same tag works everywhere. Your identifier is the name shown in the live demo (“Map of your-identifier”).
    • No wildcard on a shared domain where anyone can create a subdomain, such as vercel.app, github.io or co.uk. A domain belongs to one organisation only.
  • API access and tokens, for the address test. Without them the map still displays, but every test fails: your page receives the failed event with the reason unavailable.

Add the map in 3 steps

  1. Send your domains to Sogudo, exactly as they appear in your browser’s address bar.
  2. Paste this line in your page, where the map should appear:
HTML
<script src="https://app.sogudo.com/embed.js" data-country="FR" data-operator="orange" data-lang="en" async></script>
  1. Adjust the settings if needed: country, operator, language, height, legend (table below).

This line shows the coverage of one operator. To let your visitors choose the operator, test an address and see the speeds, add your own controls around the map: see the complete example.

Live demo

With your API key, your organisation’s real map shows below, loaded exactly as on your website. The buttons above it are not part of the map: they are this page’s own interface, built with the JavaScript API, as yours will be. Choose an operator, then place a point on the map: the result event your page would receive shows below the map, as is.

Try the map with your key

Enter your API key to display your organisation’s real map here. Each address you test uses your tokens, like on your website.

Checked once by app.sogudo.com, never kept by this page. The demo lasts one hour at most.

Settings

AttributeWhat it doesValuesIf missing
data-countryCountry shown when the map opens.A country code from Countries and operators: FR, GP, BE…France if it is open to you, otherwise your first country. A country that is not open to you, or not in the list, is never replaced: the map shows “Sogudo map: country not available”.
data-operatorOperator whose coverage is shown when the map opens. Your page changes it with map.set({ operator }). With none, no coverage is shown, and no address is tested, until your page shows an operator.A map code: orange, sfr…, or noneThe first operator of the country. An unknown code is replaced the same way.
data-langLanguage of the texts of the map: legend and credits.en, fr, de, nl, es, pt, pl, hr, sl, sr, ko, da or el (en-GB and FR also work).French. Any other language also gives French.
data-heightHeight of the map. Its width is always 100% of its container.Pixels (600) or any CSS height (70vh, 100%).600 pixels.
data-legendShows the speed legend, in Mbit/s, in the bottom-left corner of the map.No value: add data-legend to the line. In JavaScript, legend: true.No legend. Show your own around the map if you need one.
data-targetWhere to put the map: an element of your page, placed before the line.A CSS selector: #sogudo-map.Right after the line. Also if the selector finds nothing.
data-organisationNames your organisation when you test on localhost, which is open to every organisation. Ignored on your real domains.Your organisation identifier: your-identifier.None. Without it, the map does not open on localhost.

Example with a target element, a height and the legend:

HTML
<div id="sogudo-map"></div>
<script src="https://app.sogudo.com/embed.js" data-country="FR" data-lang="en" data-height="70vh" data-legend data-target="#sogudo-map" async></script>

Tool by tool

Hand-coded website

Paste the line in the HTML of the page, where the map should appear.

WordPress

In the block editor, add a Custom HTML block and paste the line. If the editor removes the <script> tag, your account may not be allowed to publish scripts: ask your site administrator.

Webflow

Add an Embed (code embed) element and paste the line. Custom code usually only runs on the published site, not in the Designer.

Shopify

In the theme editor, add a Custom Liquid section, available in most recent themes, and paste the line.

Wix, Google Sites, Notion and similar builders

These tools often display pasted code inside their own frame, on their own domain. The map then sees the tool’s domain instead of yours, and may refuse to open. If that happens, contact Sogudo before going further.

What your visitors see

In the map:

  • The coverage of the operator your page shows, coloured by speed, in the country shown.
  • The pin of the tested point, once your page sends an address or the visitor places a point.
  • The zoom controls.
  • An i button in the bottom-right corner, always there: where the coverage data comes from, and the map credits.
  • The speed legend in Mbit/s, in the bottom-left corner, only with data-legend.

Nothing else: no list of operators, no address search and no speeds inside the map. Your page shows them around it, with the JavaScript API. Visitors cannot change the country or the operator from inside the map; your page can.

Troubleshooting

What you seeLikely causeWhat to do
“404” or “page not found” inside the mapThe domain of your page is not declared (often www or a test site), or map access is off for your organisation.Send Sogudo the exact domain shown in your browser’s address bar.
“Sogudo map: country not available” inside the mapThe country asked for is not enabled for your organisation, or it is not in Countries and operators.Check data-country (or the country given to map.set). If the country is in the list, ask Sogudo to enable it for your organisation.
“Sogudo map: local test” inside the map, on localhostThe tag does not name your organisation, the identifier is misspelled, or map access is off for your organisation.Add data-organisation="your-identifier" to the tag, spelled exactly. If the map still does not open, ask Sogudo to check that map access is enabled for your organisation.
Nothing displays at allThe line has no data-country, data-operator or data-target, or your site’s security policy blocks app.sogudo.com.Add data-country="FR". If your site sends a Content-Security-Policy, allow https://app.sogudo.com in script-src and frame-src.
The map shows no coverageNo operator is shown: operator: 'none', and the tiles event says idle.Show an operator: map.set({ operator: 'orange' }).
No result after map.set({ address })No operator is shown: no test runs without one.Show an operator first.
failed event, reason unavailableYour token balance is empty, API access is off for your organisation, or a temporary error.Check your balance (Getting started), then contact Sogudo.
failed event, reason outside_countryThe point is in another country than the map’s.Send a point inside the country shown, or change the country with map.set({ country }).
tiles event in error, reason deniedThe country is not open to your organisation.Ask Sogudo to add it.
tiles event in error, reason unavailableThe coverage of this operator could not be loaded: the map code is not one of the country’s, or a temporary error.Check the map code in Countries and operators. Otherwise try again later, and contact Sogudo if it lasts.

For developers

JavaScript API

Load the script without any data- attribute, then create the map yourself and drive it:

HTML
<div id="sogudo-map"></div>
<script src="https://app.sogudo.com/embed.js"></script>
<script>
  // Display the map in #sogudo-map, with the speed legend
  var map = Sogudo.embed('#sogudo-map', { country: 'FR', operator: 'orange', lang: 'en', height: 600, legend: true })

  // Show the coverage of another operator, without reloading the map
  map.set({ operator: 'sfr' })

  // Pin a point found by YOUR address search: the map moves to it and tests it
  map.set({ address: { lat: 48.8556, lon: 2.3574, label: '10 Rue de Rivoli 75004 Paris', kind: 'address', zoom: 16 } })

  // Remove the point
  map.set({ address: null })

  // "Place a point": the visitor's next click on the map becomes the tested point
  map.set({ selecting: true })

  // No coverage, and no test, until you show an operator again
  map.set({ operator: 'none' })

  // Change the country: the map is recreated, without the point
  map.set({ country: 'BE' })

  // Receive the speeds of the tested point, or why the test failed
  map.on('result', function (detail) {
    console.log(detail.address.label, detail.result)
  })
  map.on('failed', function (detail) {
    console.log(detail.address.label, detail.reason) // 'outside_country' or 'unavailable'
  })
</script>
CallWhat it does
Sogudo.embed(target, options)Creates a map in target (a CSS selector or an element) and returns it. Options: country, operator, lang, height, legend (true to show the legend), organisation, as in the settings above. Throws an error if the element is not found.
map.set({ operator })Shows the coverage of another operator, without reloading the map. Use a map code of the country shown (Countries and operators). 'none' shows no coverage, and no point is tested until you show an operator again. A value already shown changes nothing.
map.set({ address }){ lat, lon, label, kind, zoom }: pins the point, moves the map to it and tests it. Your page then receives result or failed. lat and lon are required. Optional: label, the text of the point, sent back in the events; kind, 'address' for a result of your address search or 'gps' (default) for coordinates; zoom, the zoom to arrive at, for example the one your geocoder suggests. address: null removes the point.
map.set({ selecting })true: “place a point” mode. The cursor becomes a cross, and the visitor’s next click on the map becomes the tested point: your page receives address, then result or failed. false cancels the mode.
map.set({ country })Changes the country, for example 'BE'. The map is recreated, so the point shown is forgotten. A country not open to your organisation shows “Sogudo map: country not available”, as with data-country.
map.on(type, callback)Listens to the events of this map only, as callback(detail, map). Returns a function that stops listening.
Sogudo.on(type, callback)Listens to the events of every map on the page, as callback(detail, map). Returns a function that stops listening.
map.destroy()Removes the map from the page.

A map.set called before the map is ready is applied as soon as it is. Several maps on one page: one container and one Sogudo.embed per map.

Events

EventWhendetail
readyThe map is displayed. Sent again each time the map is recreated (new country, renewal of its pass).{ country, operator }: the country code actually shown and the map code of the operator (operator is empty when no operator is shown).
addressThe visitor placed a point on the map, in “place a point” mode. Not sent for a point your page sends with map.set({ address }).{ address: { label, lon, lat }, country, operator }
resultThe test of the point is done: the speeds, for your page to show.{ address, country, operator, result }, where result has the format of the Speed API response.
failedThe test of the point failed.{ address, country, operator, reason }, where reason is outside_country (the point is outside the country shown) or unavailable.
tilesThe state of the coverage changed: to show your own loading indicator or error message around the map.{ state, reason, country, operator }, where state is idle (no operator shown), loading, loaded or error. In error only, reason is denied (country not open to your organisation) or unavailable.
expiredThe map’s 12-hour pass has expired.{ country, operator }. The map reloads by itself, on the same country and operator, at most once a minute.

Example of detail for result (illustrative values). The keys of result are the operators’ API result keys, listed in Countries and operators:

JSON
{
  "address": { "label": "10 Rue de Rivoli 75004 Paris", "lon": 2.3574, "lat": 48.8556 },
  "country": "FR",
  "operator": "orange",
  "result": {
    "orange": {
      "5g": { "download": 412.5, "upload": 48.2, "antenna": { "anfr_id": "…", "coordinates": [2.3561, 48.8549], "distance": 120, "frequency": 3500 } },
      "4g": { "download": 128.7, "upload": 21.4, "antenna": { "…": "…" } },
      "3g": null
    },
    "sfr": { "…": "…" }
  }
}

Automatic renewal. The map receives a pass valid for 12 hours when it opens. When it expires, embed.js recreates the map by itself. There is nothing to do on your side.

Complete example: your page provides the operators and the address search

A ready-to-adapt page: your own operator buttons, your address search with your geocoder, a “Place a point” button, and a table of the speeds. The map shows the coverage and the pin, and tests the point; everything else is your HTML, styled like the rest of your site.

  • Operators: each button calls map.set({ operator }) with a map code of the country.
  • Address search: your geocoder turns the text into a latitude and a longitude, sent with map.set({ address }). The example uses the French national address base, for France only: replace geocode() with the address search your website already uses.
  • Place a point: map.set({ selecting: true }); the address event tells your page the visitor clicked.
  • Speeds: shown when result arrives; failed gives the message instead.
HTML
<!-- Your interface: your operators, your address search, your speeds -->
<div id="operators" role="group" aria-label="Operator">
  <button type="button" data-operator="orange" aria-pressed="true">Orange</button>
  <button type="button" data-operator="sfr" aria-pressed="false">SFR</button>
  <button type="button" data-operator="bouygues" aria-pressed="false">Bouygues</button>
  <button type="button" data-operator="free" aria-pressed="false">Free</button>
</div>

<form id="search">
  <label for="address">Address</label>
  <input id="address" type="search" autocomplete="street-address" required>
  <button type="submit">Test this address</button>
  <button type="button" id="place">Place a point on the map</button>
</form>

<!-- The Sogudo map: coverage, pin, zoom and credits -->
<div id="sogudo-map"></div>

<p id="test-status" role="status"></p>
<table id="speeds" hidden>
  <thead>
    <tr><th scope="col">Operator</th><th scope="col">Technology</th><th scope="col">Download</th><th scope="col">Upload</th></tr>
  </thead>
  <tbody></tbody>
</table>

<script src="https://app.sogudo.com/embed.js"></script>
<script>
  var map = Sogudo.embed('#sogudo-map', { country: 'FR', operator: 'orange', lang: 'en', height: 500, legend: true })
  var testStatus = document.getElementById('test-status')
  var speeds = document.getElementById('speeds')

  // 1. Your operator buttons: the map shows the coverage of the operator chosen
  var operatorButtons = document.querySelectorAll('#operators button')
  operatorButtons.forEach(function (button) {
    button.addEventListener('click', function () {
      map.set({ operator: button.dataset.operator })
      operatorButtons.forEach(function (other) {
        other.setAttribute('aria-pressed', String(other === button))
      })
    })
  })

  // 2. "Place a point": the visitor's next click on the map becomes the tested point
  var placeButton = document.getElementById('place')
  var placing = false
  function showPlacing(value) {
    placing = value
    placeButton.textContent = value ? 'Cancel' : 'Place a point on the map'
  }
  placeButton.addEventListener('click', function () {
    map.set({ selecting: !placing })
    showPlacing(!placing)
  })
  map.on('address', function (detail) {
    showPlacing(false)
    testStatus.textContent = 'Testing ' + detail.address.label + '…'
  })

  // 3. Your address search: YOUR geocoder finds the point, the map pins it and tests it
  document.getElementById('search').addEventListener('submit', function (event) {
    event.preventDefault()
    if (placing) {
      map.set({ selecting: false })
      showPlacing(false)
    }
    testStatus.textContent = 'Searching…'
    geocode(document.getElementById('address').value)
      .then(function (place) {
        if (!place) {
          testStatus.textContent = 'Address not found.'
          return
        }
        testStatus.textContent = 'Testing ' + place.label + '…'
        map.set({
          address: { lat: place.lat, lon: place.lon, label: place.label, kind: 'address', zoom: 16 },
        })
      })
      .catch(function () {
        testStatus.textContent = 'Address search unavailable. Try again in a moment.'
      })
  })

  // 4. Your page shows the speeds, or why there are none
  map.on('result', function (detail) {
    testStatus.textContent = 'Estimated speeds at ' + detail.address.label
    var body = speeds.tBodies[0]
    body.textContent = ''
    speedRows(detail.result).forEach(function (cells) {
      var row = body.insertRow()
      cells.forEach(function (text) {
        row.insertCell().textContent = text
      })
    })
    speeds.hidden = false
  })
  map.on('failed', function (detail) {
    speeds.hidden = true
    testStatus.textContent =
      detail.reason === 'outside_country'
        ? 'This point is outside the country shown.'
        : 'Test unavailable right now. Try again later.'
  })

  // One row per operator and technology covered: [operator, technology, download, upload]
  function speedRows(result) {
    var rows = []
    Object.keys(result).forEach(function (operator) {
      ['5g', '4g', '3g'].forEach(function (technology) {
        var speed = result[operator] && result[operator][technology]
        if (speed) rows.push([operator, technology.toUpperCase(), speed.download + ' Mbit/s', speed.upload + ' Mbit/s'])
      })
    })
    return rows
  }

  // YOUR geocoder. Here, for France, the national address base (BAN), which needs no key.
  // Replace it with the address search your website already uses.
  function geocode(text) {
    var url = 'https://data.geopf.fr/geocodage/search?limit=1&q=' + encodeURIComponent(text)
    return fetch(url)
      .then(function (response) {
        if (!response.ok) throw new Error('Geocoder error ' + response.status)
        return response.json()
      })
      .then(function (data) {
        var place = data.features && data.features[0]
        if (!place) return null
        var coordinates = place.geometry.coordinates // [longitude, latitude]
        return { lat: coordinates[1], lon: coordinates[0], label: place.properties.label }
      })
  }
</script>

Every point tested, whether your page sent it or the visitor placed it, uses your organisation’s tokens, with the same rule as the speed API: see Getting started.

Advanced: coverage layers on your own map

If you already run your own map, for example with MapLibre GL JS, and only want Sogudo’s coverage layers, your server can relay them with your key. This needs a developer: the embedded map above is simpler.

  1. Map description: GET https://app.sogudo.com/api/maps/{country}/{operator} with the header X-API-Key: your key. The JSON contains dataset (country, operator, version, update date), source (a MapLibre vector source: tiles, minzoom, maxzoom, bounds, attribution), an optional center and layers.
  2. Tiles: GET https://app.sogudo.com/api/tiles/{country}/{operator}/{z}/{x}/{y}.pbf with the same header. The path in source.tiles is relative to app.sogudo.com: your server serves it under its own address.
  3. Display: one fill layer per entry of layers, with its sourceLayer and its color. minMbps is the lowest speed of the layer; is5G marks the 5G layers.
JavaScript · server
// Node.js 18+ and Express. The key stays in an environment variable of YOUR server.
const SOGUDO = 'https://app.sogudo.com'
const CHECKS = { iso: /^[a-z]{2}$/i, operator: /^[a-z0-9_-]+$/, z: /^\d{1,2}$/, x: /^\d{1,7}$/, y: /^\d{1,7}\.pbf$/ }

// Only checked parameters build the path: no query string, no other app.sogudo.com route gets your key.
function upstreamPath(params) {
  for (const [name, value] of Object.entries(params)) if (!CHECKS[name]?.test(value)) return null
  const { iso, operator, z, x, y } = params
  return z === undefined ? `/api/maps/${iso}/${operator}` : `/api/tiles/${iso}/${operator}/${z}/${x}/${y}`
}

async function relay(req, res) {
  const path = upstreamPath(req.params)
  if (!path) return res.sendStatus(400)
  const upstream = await fetch(SOGUDO + path, { headers: { 'X-API-Key': process.env.SOGUDO_API_KEY } })
  res.status(upstream.status)
  res.set('Content-Type', upstream.headers.get('content-type') || 'application/octet-stream')
  res.set('Cache-Control', upstream.headers.get('cache-control') || 'no-store')
  res.send(Buffer.from(await upstream.arrayBuffer()))
}

// The map description, then its tiles: the paths of app.sogudo.com, under /sogudo
app.get('/sogudo/api/maps/:iso/:operator', relay)
app.get('/sogudo/api/tiles/:iso/:operator/:z/:x/:y', relay)
JavaScript · browser
// In the browser: no key, only your own server
const descriptor = await fetch('/sogudo/api/maps/fr/orange').then((response) => response.json())

map.addSource('sogudo', {
  ...descriptor.source,
  tiles: [location.origin + '/sogudo' + descriptor.source.tiles[0]],
})
for (const layer of descriptor.layers) {
  map.addLayer({
    id: 'sogudo-' + layer.id,
    type: 'fill',
    source: 'sogudo',
    'source-layer': layer.sourceLayer,
    paint: { 'fill-color': layer.color, 'fill-opacity': 0.6 },
  })
}

Your key needs map access and the countries you display; no token is used, the tiles are counted in your organisation’s usage. Country and operator codes: Countries and operators.

StatusMessageMeaning
204—Empty tile: no coverage data there.
400Invalid tile coordinatesz, x or y outside the tile grid.
401Missing or invalid credentialsKey missing, unknown or revoked.
403Maps access not enabled for this key, Country not allowed for this key: XXMap access off, or country not open to your organisation.
404No coverage map for this country/operator, Tile not foundUnknown country or operator code, or missing tile.
502, 503Maps gateway unavailable, Service unavailableTemporary error: try again later.

The description may be cached for 5 minutes and the tiles for 1 day, privately (Cache-Control: private).