One Map logo

One Map

15M+ views a month

New map every day · 6 am CT

Is it banned in your country?

🌍Check my country→
Change country ▾
(function () { var ISO = ('AF AL DZ AD AO AG AR AM AU AT AZ BS BH BD BB BY BE BZ BJ BT BO BA BW BR BN BG BF BI CV KH CM CA CF TD CL CN CO KM CG CD CR CI HR CU CY CZ DK DJ DM DO EC EG SV GQ ER EE SZ ET FJ FI FR GA GM GE DE GH GR GD GT GN GW GY HT HN HK HU IS IN ID IR IQ IE IL IT JM JP JO KZ KE KI XK KW KG LA LV LB LS LR LY LI LT LU MO MG MW MY MV ML MT MH MR MU MX FM MD MC MN ME MA MZ MM NA NR NP NL NZ NI NE NG KP MK NO OM PK PW PS PA PG PY PE PH PL PT PR QA RO RU RW KN LC VC WS SM ST SA SN RS SC SL SG SK SI SB SO ZA KR SS ES LK SD SR SE CH SY TW TJ TZ TH TL TG TO TT TN TR TM TV UG UA AE GB US UY UZ VU VA VE VN YE ZM ZW').split(' '); var root = document.getElementById('om-hero'); var cta = root.querySelector('.omh-cta'); var ico = root.querySelector('.omh-ico'); var label = root.querySelector('.omh-label'); var sel = root.querySelector('.omh-sel'); var iso = null; var names = (window.Intl && Intl.DisplayNames) ? new Intl.DisplayNames(['en'], { type: 'region' }) : null; function nameOf(c) { try { return (names && names.of(c)) || c; } catch (e) { return c; } } function track(n, p) { if (window.gtag) gtag('event', n, p); } ISO.map(function (c) { return [c, nameOf(c)]; }) .sort(function (a, b) { return a[1].localeCompare(b[1]); }) .forEach(function (p) { var o = document.createElement('option'); o.value = p[0]; o.textContent = p[1]; sel.appendChild(o); }); function reveal() { label.classList.remove('wait'); } function setCountry(c) { if (!c || ISO.indexOf(c) < 0) { reveal(); return; } iso = c; sel.value = c; var img = document.createElement('img'); img.alt = ''; img.width = 28; img.height = 20; img.src = 'https://flagcdn.com/w80/' + c.toLowerCase() + '.png'; img.onload = function () { ico.textContent = ''; ico.appendChild(img); }; label.textContent = 'Check ' + nameOf(c); reveal(); } function syncCountryPage(c) { try { localStorage.setItem('om_country', c); } catch (e) {} var s = document.querySelector('#om-country .omc-select'); if (s && s.value !== c) { s.value = c; s.dispatchEvent(new Event('change')); } } var saved = null; try { saved = localStorage.getItem('om_country'); } catch (e) {} if (saved) setCountry(saved); else { setTimeout(reveal, 1200); fetch('/cdn-cgi/trace').then(function (r) { return r.text(); }) .then(function (t) { var m = t.match(/loc=([A-Z]{2})/); setCountry(m ? m[1] : null); }).catch(reveal); } var today = root.querySelector('.omh-today'); fetch('https://gomlbjrofbhzhhjnejtw.supabase.co/rest/v1/rpc/get_latest_map', { method: 'POST', headers: { 'apikey': 'sb_publishable_b19ek7Wra-poGFk53pmb8w_dtzXchqj', 'Content-Type': 'application/json' }, body: '{}' }) .then(function (r) { return r.ok ? r.json() : null; }) .then(function (m) { var vu = m && (m.youtube_url || m.video_url || m.tiktok_url); if (!vu) return; var tt = vu.indexOf('tiktok') >= 0; today.href = vu; today.hidden = false; today.querySelector('.omh-kicker').textContent = m.is_today ? 'Today\u2019s map' : 'Latest map'; today.querySelector('.omh-today-t').textContent = m.title; today.querySelector('.omh-today-m').textContent = '\u25b6 Watch on ' + (tt ? 'TikTok' : 'YouTube'); var im = today.querySelector('img'); im.onload = function () { im.hidden = false; }; im.src = 'https://maps.thatonemap.com/img/' + m.slug + '.png'; }) .catch(function () {}); var sh = document.getElementById('btn-share-site'); var shareUrl = 'https://thatonemap.com/?utm_source=share&utm_medium=site'; if (sh) sh.addEventListener('click', function () { track('share_click', { from: 'site', how: navigator.share ? 'share' : 'copy' }); if (navigator.share) { navigator.share({ title: 'One Map', text: 'Is it banned in your country? Check every country on One Map.', url: shareUrl }).catch(function () {}); return; } var t = sh.querySelector('span'); var done = function () { t.textContent = 'Link copied'; sh.classList.add('ok'); setTimeout(function () { t.textContent = 'Share'; sh.classList.remove('ok'); }, 1800); }; if (navigator.clipboard) navigator.clipboard.writeText(shareUrl).then(done, done); else done(); }); cta.addEventListener('click', function () { if (iso) syncCountryPage(iso); }); sel.addEventListener('change', function () { setCountry(sel.value); syncCountryPage(sel.value); track('button_click', { button_id: 'hero-change-country' }); location.hash = '#country'; }); })(); (function () { var el = document.getElementById('ome-streak'), live = document.getElementById('ome-live'), go = document.getElementById('ome-go'), tile = document.getElementById('card-daily'); if (!el) return; function streakText(n, done) { return done ? '\u2705 Done today \u00b7 \ud83d\udd25 ' + n + '-day streak' : '\ud83d\udd25 ' + n + '-day streak \u00b7 keep it alive'; } try { var s = JSON.parse(localStorage.getItem('om_bon_streak') || 'null'); if (s && s.n) { var p = {}; new Intl.DateTimeFormat('en-US', { timeZone: 'America/Chicago', year: 'numeric', month: 'numeric', day: 'numeric' }) .formatToParts(new Date()).forEach(function (x) { p[x.type] = x.value; }); var today = p.year + '-' + p.month + '-' + p.day; var y = new Date(Date.UTC(+p.year, +p.month - 1, +p.day) - 864e5); var yKey = y.getUTCFullYear() + '-' + (y.getUTCMonth() + 1) + '-' + y.getUTCDate(); if (s.last === today) el.textContent = streakText(s.n, true); else if (s.last === yKey) el.textContent = streakText(s.n, false); } } catch (e) {} setTimeout(function () { var vid = ''; try { vid = localStorage.getItem('om_vid') || ''; } catch (e) {} fetch('https://gomlbjrofbhzhhjnejtw.supabase.co/rest/v1/rpc/get_daily_game', { method: 'POST', headers: { apikey: 'sb_publishable_b19ek7Wra-poGFk53pmb8w_dtzXchqj', 'Content-Type': 'application/json' }, body: JSON.stringify({ p_player: vid || 'anonymous' }) }) .then(function (r) { return r.json(); }).then(function (g) { var n = g.players_today || 0, done = !!(g.run && g.run.done), st = (g.me && g.me.streak) || 0; live.textContent = n >= 20 ? n.toLocaleString('en-US') + ' players today' : 'New cards every day'; live.hidden = false; if (done) { el.textContent = streakText(st || 1, true); go.textContent = 'My score'; tile.classList.add('done'); } else if (g.run && g.run.picks && g.run.picks.length) { el.textContent = 'You\u2019re ' + g.run.picks.length + '/5 in \u00b7 finish today\u2019s cards'; go.textContent = 'Continue'; } else if (st) el.textContent = streakText(st, false); else el.textContent = 'Guess what’s banned where · 1 minute'; }).catch(function () {}); }, 1200); })();

Vote for the next map

Voting closes Tuesday 6 pm CT.

The #1 topic goes live Wednesday at 6 am CT.

    (function () { var LIVE_H = 6, LIVE_LABEL = '6 am CT'; /* Request Wednesday slot - 6 am CT since the 20 Nov 2026 schedule (one Short a day at 6 am); the omv-when line above is edited by hand */ var API = 'https://gomlbjrofbhzhhjnejtw.supabase.co/rest/v1/rpc/'; var KEY = 'sb_publishable_b19ek7Wra-poGFk53pmb8w_dtzXchqj'; var SHOW = 5, TOP = 3; var root = document.getElementById('om-vote'); var listTop = root.querySelector('.omv-list--top'); var listRest = root.querySelector('.omv-list--rest'); var more = root.querySelector('.omv-more'); var openBtn = root.querySelector('.omv-open'); var form = root.querySelector('.omv-form'); var input = root.querySelector('.omv-input'); var submit = root.querySelector('.omv-submit'); var msg = root.querySelector('.omv-msg'); var sfol = root.querySelector('.omv-sfollow'); function askFollow(title) { sfol.querySelector('.omv-sfollow-l').textContent = 'Follow so you see if we map ' + title + '.'; sfol.hidden = false; } var clock = root.querySelector('.omv-clock'); var lastBox = root.querySelector('.omv-last'); var shared = root.querySelector('.omv-shared'); var expanded = false; var board = []; var searching = false; function el(tag, cls, text) { var n = document.createElement(tag); if (cls) n.className = cls; if (text != null) n.textContent = text; return n; } function centralNow() { var p = {}; new Intl.DateTimeFormat('en-US', { timeZone: 'America/Chicago', weekday: 'short', year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: false }) .formatToParts(new Date()).forEach(function (x) { p[x.type] = x.value; }); var wd = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].indexOf(p.weekday); return { wd: wd, ms: Date.UTC(+p.year, +p.month - 1, +p.day, +p.hour % 24, +p.minute, +p.second), y: +p.year, m: +p.month, d: +p.day, h: +p.hour % 24 }; } /* Visitor-local time for the CT drop times: next at :00 Chicago, shown in the visitor's zone. Empty string when it cannot be computed or the visitor is already on Central time. */ var localFmt = null; try { localFmt = new Intl.DateTimeFormat(undefined, { weekday: 'short', hour: 'numeric', minute: '2-digit', timeZoneName: 'short' }); } catch (e) {} function chicagoOffset(t) { var p = {}; new Intl.DateTimeFormat('en-US', { timeZone: 'America/Chicago', year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: false }) .formatToParts(new Date(t)).forEach(function (x) { p[x.type] = x.value; }); return t - Date.UTC(+p.year, +p.month - 1, +p.day, +p.hour % 24, +p.minute, +p.second); } function localAt(wd, h) { try { if (!localFmt) return ''; var tz = localFmt.resolvedOptions().timeZone || ''; if (tz === 'America/Chicago') return ''; var n = centralNow(); var wall = Date.UTC(n.y, n.m - 1, n.d + (wd - n.wd + 7) % 7, h, 0, 0); var s = localFmt.format(new Date(wall + chicagoOffset(wall + chicagoOffset(Date.now())))); return (!s || /\bC[DS]T$/.test(s)) ? '' : ' (' + s + ')'; } catch (e) { return ''; } } var champ = root.querySelector('.omv-champ'), closed = false, lastVote = null; function isClosed(n) { return n.wd === 2 && n.h >= 18; } function showChamp() { var n = centralNow(); champ.textContent = ''; if (isClosed(n)) { var open = board.filter(function (t) { return t.status === 'approved'; }); if (!open.length || !open[0].votes) { champ.hidden = true; return; } champ.appendChild(document.createTextNode('\ud83c\udfc6 This week\u2019s winner: ')); champ.appendChild(el('b', null, open[0].title)); champ.appendChild(document.createTextNode(' \u00b7 live tomorrow at ' + LIVE_LABEL + localAt(3, LIVE_H))); champ.hidden = false; return; } if (n.wd === 3 && lastVote && lastVote.title) { champ.appendChild(document.createTextNode('\ud83c\udfc6 Last week\u2019s winner: ')); champ.appendChild(el('b', null, lastVote.title)); champ.appendChild(document.createTextNode(n.h < LIVE_H ? ' \u00b7 live today at ' + LIVE_LABEL + localAt(3, LIVE_H) : ' \u00b7 out now on TikTok and YouTube')); champ.hidden = false; return; } champ.hidden = true; } function tick() { var n = centralNow(); var was = closed; closed = isClosed(n); clock.textContent = ''; if (closed) { clock.className = 'omv-clock closed'; clock.appendChild(document.createTextNode('\ud83d\udd12 Voting closed \u00b7 new voting opens at midnight')); } else { var days = (2 - n.wd + 7) % 7; var left = Date.UTC(n.y, n.m - 1, n.d + days, 18, 0, 0) - n.ms; var d = Math.floor(left / 864e5), h = Math.floor(left % 864e5 / 36e5), m = Math.floor(left % 36e5 / 6e4); clock.className = 'omv-clock' + (d === 0 ? ' urgent' : ''); clock.appendChild(document.createTextNode(d === 0 ? '\u23f0 Voting closes in ' : 'Voting closes Tue 6 pm CT' + localAt(2, 18) + ' \u00b7 ')); clock.appendChild(el('b', null, (d ? d + 'd ' : '') + h + 'h' + (d ? '' : ' ' + m + 'm') + (d === 0 ? '' : ' left'))); } if (was !== closed && board.length) render(); showChamp(); } try { tick(); setInterval(tick, 30000); } catch (e) {} try { var whenB = root.querySelector('.omv-when b'), whenL = localAt(3, LIVE_H); if (whenB && whenL) whenB.appendChild(document.createTextNode(whenL)); } catch (e) {} function showLastPick(meta) { var lp = meta && meta.last_pick; if (!lp || !lp.picks || !lp.picks.length) return; var p = lp.picks[0]; lastBox.textContent = ''; lastBox.appendChild(document.createTextNode('Last winner: ')); if (p.video_url) { var a = el('a', null, p.title + ' ▸'); a.href = p.video_url; a.target = '_blank'; a.rel = 'noopener'; a.addEventListener('click', function () { track('last_pick_click', { topic: p.title }); }); lastBox.appendChild(a); } else lastBox.appendChild(el('b', null, p.title)); lastBox.hidden = false; } var sharedFor = null; var shareText = '', shareUrl = 'https://thatonemap.com/?utm_source=share&utm_medium=vote'; function showShare(t) { shareText = 'I voted for ' + t.title + ' for One Map’s Request Wednesday. Help push it to #1 before Tuesday 6 pm:'; shared.querySelector('p').textContent = '✅ Vote counted for ' + t.title + '!'; shared.querySelector('[data-how="whatsapp"]').href = 'https://wa.me/?text=' + encodeURIComponent(shareText + ' ' + shareUrl); shared.querySelector('[data-how="share"]').hidden = !navigator.share; shared.querySelector('.omv-follow-l').textContent = 'Follow One Map to see if ' + t.title + ' wins'; sharedFor = t.id; shared.hidden = false; } shared.addEventListener('click', function (e) { var b = e.target.closest('[data-how]'); if (!b) return; var how = b.getAttribute('data-how'); track('share_click', { from: 'vote', how: how }); if (how === 'share') { navigator.share({ title: 'One Map', text: shareText, url: shareUrl }).catch(function () {}); } if (how === 'copy') { var full = shareText + ' ' + shareUrl; (navigator.clipboard ? navigator.clipboard.writeText(full) : Promise.reject()).then(function () { b.textContent = 'Copied!'; }, function () { window.prompt('Copy this:', full); }); } }); function voterId() { var id; try { id = localStorage.getItem('om_voter'); } catch (e) {} if (!id) { id = (window.crypto && crypto.randomUUID) ? crypto.randomUUID() : 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0; return (c === 'x' ? r : (r & 3 | 8)).toString(16); }); try { localStorage.setItem('om_voter', id); } catch (e) {} } return id; } var VOTER = voterId(); function rpc(fn, body) { return fetch(API + fn, { method: 'POST', headers: { 'apikey': KEY, 'Content-Type': 'application/json' }, body: JSON.stringify(body) }).then(function (r) { return r.json().then(function (data) { if (!r.ok) throw new Error((data && data.message) || 'Request failed'); return data; }); }); } function track(name, params) { if (window.gtag) gtag('event', name, params); } function say(text, kind) { msg.textContent = text || ''; msg.className = 'omv-msg' + (kind ? ' omv-msg--' + kind : ''); } function setVoteBtn(b, t) { b.setAttribute('aria-pressed', t.voted ? 'true' : 'false'); b.setAttribute('aria-label', (t.voted ? 'Remove vote for ' : 'Vote for ') + t.title + ', ' + t.votes + (t.votes === 1 ? ' vote' : ' votes')); b.textContent = (t.voted ? '✓ ' : '▲ ') + t.votes; } function row(t, i, maxVotes) { var top = i < TOP; var li = el('li', 'omv-item' + (top ? ' omv-item--top' : '')); li.appendChild(el('span', 'omv-rank', String(i + 1))); var body = el('span', 'omv-body'); var tt = el('span', 'omv-title', t.title); tt.title = t.title; body.appendChild(tt); if (top && t.requests > 0) body.appendChild(el('span', 'omv-meta', '💬 ' + t.requests + ' asked')); if (top) { var bar = el('span', 'omv-bar'); var fill = el('i'); fill.style.width = (maxVotes ? Math.max(4, Math.round(100 * t.votes / maxVotes)) : 4) + '%'; bar.appendChild(fill); body.appendChild(bar); } li.appendChild(body); var b = el('button', 'omv-vote'); b.type = 'button'; setVoteBtn(b, t); if (closed) { b.disabled = true; b.title = 'Voting is closed until midnight'; } b.addEventListener('click', function () { vote(t, b, li); }); li.appendChild(b); return li; } function render() { var open = board.filter(function (t) { return t.status === 'approved'; }); var done = board.filter(function (t) { return t.status === 'mapped' && t.video_url; }); var rows = expanded ? open : open.slice(0, SHOW); var maxVotes = open.length ? open[0].votes : 0; if (shared.parentNode !== root) root.appendChild(shared); shared.hidden = true; listTop.textContent = ''; listRest.textContent = ''; var keep = null; rows.forEach(function (t, i) { var li = row(t, i, maxVotes); (i < TOP ? listTop : listRest).appendChild(li); if (sharedFor != null && t.id === sharedFor && t.voted) keep = li; }); if (keep) { keep.parentNode.insertBefore(shared, keep.nextSibling); shared.hidden = false; } if (expanded) { done.forEach(function (t) { var li = el('li', 'omv-item omv-item--mapped'); li.appendChild(el('span', 'omv-rank', '✓')); var body = el('span', 'omv-body'); body.appendChild(el('span', 'omv-title', t.title)); li.appendChild(body); if (t.video_url) { var a = el('a', 'omv-done', 'Mapped · Watch ▸'); a.href = t.video_url; a.target = '_blank'; a.rel = 'noopener'; li.appendChild(a); } else { li.appendChild(el('span', 'omv-done', 'Mapped')); } listRest.appendChild(li); }); } var hiddenOpen = open.length - rows.length; more.hidden = searching || expanded || (hiddenOpen <= 0 && !done.length); more.textContent = hiddenOpen > 0 ? 'See all ' + open.length + ' topics' : 'See topics we already mapped'; } function sortBoard() { board.sort(function (a, b) { if (a.status !== b.status) return a.status === 'mapped' ? 1 : -1; return b.votes - a.votes || (b.requests || 0) - (a.requests || 0) || a.pos - b.pos; }); } var win = root.querySelector('.omv-win'); function seen(id) { var a = []; try { a = JSON.parse(localStorage.getItem('om_mapped_seen') || '[]'); } catch (e) {} if (id == null) return a; a.push(id); try { localStorage.setItem('om_mapped_seen', JSON.stringify(a)); } catch (e) {} } function showWin() { var s = seen(), t = board.filter(function (x) { return x.status === 'mapped' && x.voted && x.video_url && s.indexOf(x.id) < 0; })[0]; if (!t) { win.hidden = true; return; } var p = win.querySelector('p'); p.textContent = ''; p.appendChild(document.createTextNode('🎉 You voted for ')); p.appendChild(el('b', null, t.title)); p.appendChild(document.createTextNode(' and it got mapped!')); var a = win.querySelector('a'); a.href = t.video_url; a.onclick = function () { seen(t.id); win.hidden = true; }; win.querySelector('button').onclick = function () { seen(t.id); win.hidden = true; }; win.hidden = false; } function load() { return rpc('get_board', { p_voter: VOTER }).then(function (rows) { board = rows || []; board.forEach(function (t, i) { t.pos = i; }); render(); showWin(); showChamp(); if (searching) runSearch(); }).catch(function () { listTop.textContent = ''; say('Voting is taking a break. Try again in a minute.', 'err'); }); } function vote(t, btn, li) { if (closed) { say('Voting is closed. The winner goes live Wednesday at ' + LIVE_LABEL + localAt(3, LIVE_H) + ', and new voting opens at midnight.', 'err'); return; } btn.disabled = true; var was = t.voted; t.voted = !was; t.votes += was ? -1 : 1; setVoteBtn(btn, t); rpc('cast_vote', { p_topic: t.id, p_voter: VOTER }).then(function (n) { t.votes = n; setVoteBtn(btn, t); btn.disabled = false; say(''); if (!was) { track('vote_cast', { topic: t.title }); showShare(t); li.parentNode.insertBefore(shared, li.nextSibling); } else if (shared.previousSibling === li) { shared.hidden = true; sharedFor = null; } sortBoard(); }).catch(function (e) { t.voted = was; t.votes += was ? 1 : -1; setVoteBtn(btn, t); btn.disabled = false; say(e.message, 'err'); }); } var qIn = root.querySelector('.omv-q'), qX = root.querySelector('.omv-qx'); var found = root.querySelector('.omv-found'), foundL = root.querySelector('.omv-found-l'); var listFound = root.querySelector('.omv-list--found'); var none = root.querySelector('.omv-none'), addBtn = root.querySelector('.omv-add'); var qmsg = root.querySelector('.omv-qmsg'); var suggestBox = root.querySelector('.omv-suggest'); var searchTracked = false, mapsList = null, qTimer = null; var STOP = ['is', 'it', 'are', 'the', 'a', 'an', 'in', 'of', 'to', 'for', 'and', 'or', 'my', 'your', 'our', 'where', 'which', 'what', 'who', 'ban', 'bans', 'banned', 'banning', 'illegal', 'legal', 'allowed', 'country', 'countries', 'world', 'map', 'maps']; function norm(x) { x = String(x || '').toLowerCase(); try { x = x.normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(new RegExp('[^\\p{L}\\p{N}]+', 'gu'), ' '); } catch (e) { x = x.replace(/[^a-z0-9\u00c0-\uffff]+/g, ' '); } return x.replace(/\s+/g, ' ').trim(); } function stem(w) { return w.length > 4 && /ies$/.test(w) ? w.slice(0, -3) + 'y' : w.length > 3 && /[^s]s$/.test(w) ? w.slice(0, -1) : w; } function words(x) { return norm(x).split(' ').filter(Boolean).map(stem); } function qWords(x) { return norm(x).split(' ').filter(function (w) { return w && STOP.indexOf(w) < 0; }).map(stem); } function near(a, b) { if (Math.abs(a.length - b.length) > 1) return false; var i = 0, j = 0, d = 0; while (i < a.length && j < b.length) { if (a[i] === b[j]) { i++; j++; continue; } if (++d > 1) return false; if (a.length > b.length) i++; else if (b.length > a.length) j++; else { i++; j++; } } return d + (a.length - i) + (b.length - j) <= 1; } function score(q, t) { var tw = words(t), fuzzy = false, shortFuzzy = false, anyExact = false; for (var k = 0; k < q.length; k++) { var w = q[k], hit = false, m; for (m = 0; m < tw.length; m++) if (tw[m].indexOf(w) === 0) { hit = true; anyExact = true; break; } if (!hit && w.length >= 3) for (m = 0; m < tw.length; m++) if (near(w, tw[m]) || (w.length >= 5 && near(w, tw[m].slice(0, w.length)))) { hit = true; fuzzy = true; if (w.length < 5) shortFuzzy = true; break; } if (!hit) return 0; } if (shortFuzzy && !anyExact) return 0; return q.join(' ') === tw.join(' ') ? 3 : fuzzy ? 1 : 2; } function cleanTitle(x) { x = String(x || '').replace(/\s+/g, ' ').trim().replace(/\?+$/, ''); x = x.replace(/^(is|are|where (is|are)|which countries ban)\s+/i, '').replace(/\s+(banned|illegal|legal|allowed)(\s+(in|around)\s+.*)?$/i, ''); return x.trim().slice(0, 60); } function loadMaps() { if (mapsList) return; mapsList = []; rpc('get_country', { p_iso: 'US' }).then(function (rows) { mapsList = (rows || []).map(function (m) { return { title: m.title, url: m.youtube_url || m.video_url || m.tiktok_url }; }); if (searching) runSearch(); }).catch(function () {}); } function foundRow(t, rank) { var li = el('li', 'omv-item'); li.appendChild(el('span', 'omv-rank', rank ? String(rank) : '\u2713')); var body = el('span', 'omv-body'); var tt = el('span', 'omv-title', t.title); tt.title = t.title; body.appendChild(tt); if (rank && t.requests > 0) body.appendChild(el('span', 'omv-meta', '\ud83d\udcac ' + t.requests + ' asked')); li.appendChild(body); if (rank) { var b = el('button', 'omv-vote'); b.type = 'button'; setVoteBtn(b, t); if (closed) { b.disabled = true; b.title = 'Voting is closed until midnight'; } b.addEventListener('click', function () { vote(t, b, li); }); li.appendChild(b); } else { li.className = 'omv-item omv-item--mapped'; if (t.url) { var a = el('a', 'omv-done', 'Mapped \u00b7 Watch \u25b8'); a.href = t.url; a.target = '_blank'; a.rel = 'noopener'; a.id = 'search-watch'; li.appendChild(a); } else li.appendChild(el('span', 'omv-done', 'Mapped')); } return li; } function runSearch() { var raw = qIn.value, q = qWords(raw), want = cleanTitle(raw); listFound.textContent = ''; foundL.textContent = ''; if (!q.length) { none.hidden = true; foundL.textContent = 'Type a topic, like chewing gum or TikTok.'; return; } var open = board.filter(function (t) { return t.status === 'approved'; }); var hits = [], seenT = {}, mappedBy = {}; (mapsList || []).forEach(function (m) { mappedBy[norm(m.title)] = m; }); open.forEach(function (t, i) { var sc = score(q, t.title); if (sc) hits.push({ t: t, rank: i + 1, sc: sc }); seenT[norm(t.title)] = 1; }); board.forEach(function (t) { if (t.status !== 'mapped') return; var k = norm(t.title); if (seenT[k]) return; seenT[k] = 1; var sc = score(q, t.title); if (!sc) return; var m = mappedBy[k]; hits.push({ t: { title: t.title, url: (m && m.url) || t.video_url }, rank: 0, sc: sc }); }); (mapsList || []).forEach(function (m) { var k = norm(m.title); if (seenT[k]) return; seenT[k] = 1; var sc = score(q, m.title); if (sc) hits.push({ t: m, rank: 0, sc: sc }); }); hits.sort(function (a, b) { return b.sc - a.sc || (a.rank ? 0 : 1) - (b.rank ? 0 : 1) || (a.rank || 999) - (b.rank || 999); }); var exact = hits.some(function (h) { return h.sc === 3; }); var shown = hits.slice(0, 15); shown.forEach(function (h) { listFound.appendChild(foundRow(h.t, h.rank)); }); if (hits.length) { foundL.textContent = (hits.length === 1 ? '1 match' : hits.length + ' matches') + (hits.length > shown.length ? ' \u00b7 showing ' + shown.length + ', keep typing to narrow it' : ''); } if (exact || want.length < 2) { none.hidden = true; return; } none.querySelector('.omv-none-l').textContent = hits.length ? 'Not the one you meant?' : 'Nobody has asked for \u201c' + want + '\u201d yet.'; none.querySelector('.omv-none-s').textContent = hits.length ? '' : 'Add it and it goes straight onto the vote.'; addBtn.textContent = '+ Add \u201c' + want + '\u201d to the vote'; addBtn.className = 'omv-add' + (hits.length ? ' omv-add--ghost' : ''); none.hidden = false; } function setSearching(on) { if (on === searching) return; searching = on; listTop.hidden = on; listRest.hidden = on; suggestBox.hidden = on; found.hidden = !on; if (on) more.hidden = true; else { sayQ(''); if (sfol.parentNode !== suggestBox) { suggestBox.appendChild(sfol); sfol.hidden = true; } render(); } } function onQuery() { var v = qIn.value.trim(); qX.hidden = !qIn.value; clearTimeout(qTimer); if (!v) { setSearching(false); return; } loadMaps(); qTimer = setTimeout(function () { setSearching(true); sayQ(''); runSearch(); }, 120); } qIn.addEventListener('input', onQuery); qIn.addEventListener('focus', function () { loadMaps(); if (!searchTracked) { searchTracked = true; track('button_click', { button_id: 'topic-search' }); } }); qIn.addEventListener('keydown', function (e) { if (e.key === 'Escape') { qIn.value = ''; onQuery(); } if (e.key === 'Enter') { e.preventDefault(); qIn.blur(); } }); qX.addEventListener('click', function () { qIn.value = ''; onQuery(); qIn.focus(); }); function sayQ(text, kind) { qmsg.textContent = text || ''; qmsg.className = 'omv-qmsg' + (kind ? ' omv-msg--' + kind : ''); } addBtn.addEventListener('click', function () { var title = cleanTitle(qIn.value); if (title.length < 2) return; track('button_click', { button_id: 'topic-search-add' }); addBtn.disabled = true; sayQ(''); sendSuggest(title, 'search', sayQ).then(function () { addBtn.disabled = false; }); }); function sendSuggest(title, from, out) { var inSearch = from === 'search'; return rpc('suggest_topic', { p_title: title }).then(function (res) { if (inSearch && (res === 'ok' || res === 'review')) found.appendChild(sfol); if (res === 'ok') { if (!inSearch) input.value = ''; out(inSearch ? 'Added! It\u2019s on the vote now. Give it the first vote.' : "Added! It's on the board now. Give it a vote.", 'ok'); askFollow(title); track('topic_suggested', { topic: title, live: true, from: from }); if (!inSearch) expanded = true; load(); } else if (res === 'review') { if (!inSearch) input.value = ''; out("Thanks! We'll check it and add it soon.", 'ok'); askFollow(title); track('topic_suggested', { topic: title, live: false, from: from }); if (inSearch) none.hidden = true; } else if (res === 'exists') { if (inSearch) { out('Someone already suggested that one. It shows here once it\u2019s on the vote.', 'ok'); none.hidden = true; } else { out("That one's already on the list. Find it below and vote.", 'ok'); expanded = true; render(); } } else if (res === 'limited') { out("That's a lot of ideas! Try again in an hour.", 'err'); } else { out('Keep it between 2 and 60 characters.', 'err'); } }).catch(function () { out("Couldn't send that. Try again in a minute.", 'err'); }); } more.addEventListener('click', function () { expanded = true; render(); }); openBtn.addEventListener('click', function () { openBtn.hidden = true; form.hidden = false; input.focus(); track('button_click', { button_id: 'suggest-open' }); }); form.addEventListener('submit', function (e) { e.preventDefault(); e.stopPropagation(); var title = input.value.trim(); if (title.length < 2) { say('Type a topic first.', 'err'); input.focus(); return; } submit.disabled = true; sendSuggest(title, 'form', say).then(function () { submit.disabled = false; }); }); load(); rpc('get_site_meta', {}).then(function (meta) { lastVote = meta && meta.last_vote; showLastPick(meta); showChamp(); }).catch(function () {}); })();
    One Map Insiders · TikTok

    The chat behind the maps

    The googly sticker pack for your DMs.

    Subscribe on TikTok

    $2.99 a month · under our TikTok bio

    (function () { if (!/(^|[?&])insiders(=|&|$)/i.test(location.search)) return; var user = false; ['wheel', 'touchstart', 'keydown'].forEach(function (t) { window.addEventListener(t, function () { user = true; }, { once: true, passive: true }); }); var go = function () { var el = document.getElementById('insiders'); if (!el || user) return; if (Math.abs(el.getBoundingClientRect().top) > 40) el.scrollIntoView({ block: 'start' }); }; [400, 1200, 2500].forEach(function (ms) { setTimeout(go, ms); }); })();
    ← One Map home

    What's banned where you live?

    Every map we've made, checked for your country.

    (function () { var API = 'https://gomlbjrofbhzhhjnejtw.supabase.co/rest/v1/rpc/'; var KEY = 'sb_publishable_b19ek7Wra-poGFk53pmb8w_dtzXchqj'; var ISO = ('AF AL DZ AD AO AG AR AM AU AT AZ BS BH BD BB BY BE BZ BJ BT BO BA BW BR BN BG BF BI CV KH CM CA CF TD CL CN CO KM CG CD CR CI HR CU CY CZ DK DJ DM DO EC EG SV GQ ER EE SZ ET FJ FI FR GA GM GE DE GH GR GD GT GN GW GY HT HN HK HU IS IN ID IR IQ IE IL IT JM JP JO KZ KE KI XK KW KG LA LV LB LS LR LY LI LT LU MO MG MW MY MV ML MT MH MR MU MX FM MD MC MN ME MA MZ MM NA NR NP NL NZ NI NE NG KP MK NO OM PK PW PS PA PG PY PE PH PL PT PR QA RO RU RW KN LC VC WS SM ST SA SN RS SC SL SG SK SI SB SO ZA KR SS ES LK SD SR SE CH SY TW TJ TZ TH TL TG TO TT TN TR TM TV UG UA AE GB US UY UZ VU VA VE VN YE ZM ZW').split(' '); var root = document.getElementById('om-country'); var select = root.querySelector('.omc-select'); var out = root.querySelector('.omc-out'); var search = root.querySelector('.omc-search'); var datalist = root.querySelector('#omc-names'); var byName = {}; var names = (window.Intl && Intl.DisplayNames) ? new Intl.DisplayNames(['en'], { type: 'region' }) : null; function nameOf(c) { try { return (names && names.of(c)) || c; } catch (e) { return c; } } function flag(c) { return c.replace(/./g, function (ch) { return String.fromCodePoint(127397 + ch.charCodeAt(0)); }); } function flagImg(c) { var i = document.createElement('img'); i.className = 'omc-flag'; i.alt = ''; i.width = 30; i.height = 22; i.src = 'https://flagcdn.com/w80/' + c.toLowerCase() + '.png'; i.onerror = function () { i.remove(); }; return i; } function track(n, p) { if (window.gtag) gtag('event', n, p); } function el(tag, cls, text) { var n = document.createElement(tag); if (cls) n.className = cls; if (text != null) n.textContent = text; return n; } ISO.map(function (c) { return [c, nameOf(c)]; }) .sort(function (a, b) { return a[1].localeCompare(b[1]); }) .forEach(function (p) { var o = el('option', null, p[1]); o.value = p[0]; select.appendChild(o); var d = el('option'); d.value = p[1]; datalist.appendChild(d); byName[p[1].toLowerCase()] = p[0]; }); var last = null; var KINDS = fetch('https://maps.thatonemap.com/kinds.json').then(function (r) { return r.ok ? r.json() : {}; }).catch(function () { return {}; }); function show(iso) { out.textContent = ''; out.appendChild(el('div', 'omc-skel')); fetch(API + 'get_country', { method: 'POST', headers: { 'apikey': KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ p_iso: iso }) }) .then(function (r) { if (!r.ok) throw new Error(); return r.json(); }) .then(function (rows) { return KINDS.then(function (k) { render(iso, rows || [], k || {}); }); }) .catch(function () { out.textContent = ''; out.appendChild(el('p', 'omc-note', "Couldn't load the maps. Try again in a minute.")); }); } function row(m, color) { var r = el('div', 'omc-row'); var dot = el('span', 'omc-dot'); dot.style.background = color; r.appendChild(dot); var t = el('span', 'omc-txt'); t.appendChild(el('b', null, m.title)); if (m.note) t.appendChild(el('small', null, m.note)); r.appendChild(t); var yt = m.youtube_url || (/youtu/.test(m.video_url || '') ? m.video_url : ''); var tt = m.tiktok_url || (/tiktok/.test(m.video_url || '') ? m.video_url : ''); var vid = (yt.match(/(?:shorts[/]|youtu[.]be[/]|v=)([A-Za-z0-9_-]{11})/) || [])[1]; if (vid) { var th = el('a', 'omc-th'); th.href = yt; th.target = '_blank'; th.rel = 'noopener'; th.id = 'cw-yt'; th.setAttribute('aria-label', 'Watch the ' + m.title + ' map on YouTube'); var ti = el('img'); ti.src = 'https://i.ytimg.com/vi/' + vid + '/hqdefault.jpg'; ti.alt = ''; ti.loading = 'lazy'; th.appendChild(ti); th.addEventListener('click', function () { track('country_watch', { topic: m.title, platform: 'yt' }); }); r.insertBefore(th, r.firstChild.nextSibling); } if (yt || tt) { var vs = el('span', 'omc-vids'); [['yt', yt, '▶ YouTube'], ['tt', tt, 'TikTok']].forEach(function (x) { if (!x[1] || (x[0] === 'yt' && vid)) return; var a = el('a', 'omc-v ' + x[0], x[2]); a.href = x[1]; a.target = '_blank'; a.rel = 'noopener'; a.id = 'cw-' + x[0]; a.setAttribute('aria-label', 'Watch the ' + m.title + ' map on ' + (x[0] === 'yt' ? 'YouTube' : 'TikTok')); a.addEventListener('click', function () { track('country_watch', { topic: m.title, platform: x[0] }); }); vs.appendChild(a); }); r.appendChild(vs); } return r; } function storyCard(iso, cname, banned, limited, total, btn, note) { track('share_click', { from: 'country_story', country: iso }); var label = btn.textContent; btn.textContent = 'Making your card…'; btn.disabled = true; function done(t) { btn.textContent = t || label; btn.disabled = false; if (t) setTimeout(function () { btn.textContent = label; }, 3000); } var W = 1080, H = 1920, c = document.createElement('canvas'); c.width = W; c.height = H; var g = c.getContext('2d'); var NAVY = '#0D1823', GOLD = '#FFD23F', RED = '#FF3D68', AMBER = '#FFB020', TEXT = '#eef4fa', MUTED = '#a9bccf', CARD = '#12233a'; function wrap(t, x, y, maxW, lh) { var w = String(t).split(' '), line = ''; w.forEach(function (s) { var tt = line ? line + ' ' + s : s; if (g.measureText(tt).width > maxW && line) { g.fillText(line, x, y); y += lh; line = s; } else line = tt; }); if (line) g.fillText(line, x, y); return y + lh; } function fit(t, maxW) { t = String(t); while (g.measureText(t).width > maxW && t.length > 3) t = t.slice(0, -2); return t; } function draw(flagImg) { g.fillStyle = NAVY; g.fillRect(0, 0, W, H); g.textAlign = 'center'; g.fillStyle = GOLD; g.font = '800 36px Inter, Arial, sans-serif'; g.fillText('ONE MAP \u00b7 ' + new Date().getFullYear(), W / 2, 150); var y = 210; if (flagImg) { var fh = 170, fw = Math.round(flagImg.width / flagImg.height * fh); g.drawImage(flagImg, (W - fw) / 2, y, fw, fh); y += fh + 40; } else { y += 40; } g.fillStyle = TEXT; g.font = '96px Anton, Impact, sans-serif'; g.fillText("WHAT'S BANNED IN", W / 2, y + 80); g.fillStyle = GOLD; var fs = 130; g.font = fs + 'px Anton, Impact, sans-serif'; var nm = (/^(United States|United Kingdom|United Arab Emirates|Philippines|Netherlands|Bahamas|Gambia|Maldives)$/.test(cname) ? 'the ' + cname : cname).toUpperCase(); while (g.measureText(nm).width > 960 && fs > 60) { fs -= 6; g.font = fs + 'px Anton, Impact, sans-serif'; } g.fillText(nm + '?', W / 2, y + 80 + fs + 20); y += 80 + fs + 90; g.fillStyle = RED; g.font = '170px Anton, Impact, sans-serif'; g.textAlign = 'right'; g.fillText(String(banned.length), W / 2 - 30, y + 150); g.textAlign = 'left'; g.fillStyle = TEXT; g.font = '800 52px Inter, Arial, sans-serif'; g.fillText(banned.length === 1 ? 'ban' : 'bans', W / 2, y + 85); g.fillStyle = MUTED; g.font = '700 36px Inter, Arial, sans-serif'; g.fillText(limited.length + ' restricted \u00b7 of ' + total + ' maps', W / 2, y + 140); y += 230; var room = Math.max(1, Math.floor((H - 250 - y) / 120)), all = banned.map(function (m) { return [m.title, RED]; }).concat(limited.map(function (m) { return [m.title, AMBER]; })); var items = all.slice(0, all.length > room ? room - 1 : room); g.textAlign = 'left'; items.forEach(function (it) { g.fillStyle = CARD; g.fillRect(90, y, W - 180, 104); g.fillStyle = it[1]; g.beginPath(); g.arc(140, y + 52, 16, 0, Math.PI * 2); g.fill(); g.fillStyle = TEXT; g.font = '700 44px Inter, Arial, sans-serif'; g.fillText(fit(it[0], W - 330), 180, y + 68); y += 120; }); if (banned.length + limited.length > items.length) { g.fillStyle = MUTED; g.font = '700 36px Inter, Arial, sans-serif'; g.textAlign = 'center'; g.fillText('+ ' + (banned.length + limited.length - items.length) + ' more', W / 2, y + 30); } g.fillStyle = GOLD; g.fillRect(90, H - 230, W - 180, 130); g.fillStyle = NAVY; g.textAlign = 'center'; g.font = '800 50px Inter, Arial, sans-serif'; g.fillText('Check yours: thatonemap.com', W / 2, H - 148); c.toBlob(function (blob) { if (!blob) { done('Couldn\u2019t make the card'); return; } var name = 'one-map-' + iso.toLowerCase() + '.png', file = new File([blob], name, { type: 'image/png' }); var text = cname + ' bans ' + banned.length + ' of the ' + total + ' things One Map has mapped. Check yours: thatonemap.com'; if (navigator.canShare && navigator.canShare({ files: [file] })) { navigator.share({ files: [file], text: text }).then(function () { done('Shared! \ud83d\udd25'); }).catch(function () { done(); }); return; } var a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = name; document.body.appendChild(a); a.click(); a.remove(); note.textContent = 'Saved your Story card. Post it to TikTok or WhatsApp.'; done('Saved \u2713'); }, 'image/png'); } var fi = new Image(); fi.crossOrigin = 'anonymous'; fi.onload = function () { try { draw(fi); } catch (e) { draw(null); } }; fi.onerror = function () { draw(null); }; fi.src = 'https://flagcdn.com/w320/' + iso.toLowerCase() + '.png'; if (document.fonts && document.fonts.load) { document.fonts.load('96px Anton'); } } function render(iso, rows, K) { function kind(m) { return K[m.title] || (/^(MANDATORY|MEN \+ WOMEN)$/.test(m.label || '') ? 'mandatory' : m.label === 'FREE' ? 'free' : 'banned'); } var hit = function (m) { return m.state === 'negative' || m.state === 'caution'; }; var req = rows.filter(function (m) { return kind(m) === 'mandatory' && hit(m); }); var free = rows.filter(function (m) { return kind(m) === 'free' && hit(m); }); rows = rows.filter(function (m) { return kind(m) === 'banned'; }); var banned = rows.filter(function (m) { return m.state === 'negative'; }); var limited = rows.filter(function (m) { return m.state === 'caution'; }); var ok = rows.filter(function (m) { return m.state !== 'negative' && m.state !== 'caution'; }); var cname = nameOf(iso); last = { iso: iso, name: cname, banned: banned.length, total: rows.length }; out.textContent = ''; var sum = el('div', 'omc-sum'); var big = el('span', 'omc-big'); big.appendChild(flagImg(iso)); big.appendChild(document.createTextNode(cname)); sum.appendChild(big); var counts = el('span', 'omc-counts'); counts.appendChild(el('span', 'r', banned.length + ' banned')); counts.appendChild(document.createTextNode(' · ')); counts.appendChild(el('span', 'a', limited.length + ' restricted')); sum.appendChild(counts); sum.appendChild(el('span', 'omc-small', 'out of ' + rows.length + ' maps')); search.value = cname; out.appendChild(sum); var share = el('button', 'omc-share', '⚖️ Who lives in a stricter country? Challenge a friend'); share.type = 'button'; var note = el('p', 'omc-note'); share.addEventListener('click', function () { var url = 'https://maps.thatonemap.com/compare/?a=' + iso.toLowerCase() + '&utm_source=share&utm_medium=country'; var text = flag(iso) + ' ' + cname + ' bans ' + banned.length + ' of the ' + rows.length + ' things One Map has mapped. Who lives in a stricter country, you or me?'; track('share_click', { from: 'country', country: iso }); if (navigator.share) { navigator.share({ title: 'One Map', text: text, url: url }).catch(function () {}); return; } var full = text + ' ' + url; (navigator.clipboard ? navigator.clipboard.writeText(full) : Promise.reject()).then(function () { note.textContent = 'Copied! Paste it anywhere.'; }, function () { window.prompt('Copy this:', full); }); }); var story = el('button', 'omc-story', '📸 Share as a Story'); story.type = 'button'; story.addEventListener('click', function () { storyCard(iso, cname, banned, limited, rows.length, story, note); }); out.appendChild(share); out.appendChild(story); out.appendChild(note); function group(label, color, list) { if (!list.length) return; var g = el('div', 'omc-group'); var l = el('div', 'omc-label'); var d = el('span', 'omc-dot'); d.style.background = color; l.appendChild(d); l.appendChild(document.createTextNode(label + ' · ' + list.length)); g.appendChild(l); list.forEach(function (m) { g.appendChild(row(m, color)); }); out.appendChild(g); } group('Banned', 'var(--red)', banned); var f = el('div', 'omc-follow'); var ft = el('span'); ft.appendChild(el('b', null, cname + ' bans ' + banned.length + ' of ' + rows.length + ' maps so far')); ft.appendChild(el('small', null, 'A new map every day at 6 am CT. Follow so you see if ' + cname + ' is on the next one.')); f.appendChild(ft); f.appendChild(opPair('country')); out.appendChild(f); group('Restricted', 'var(--amber)', limited); group('Required by law', 'var(--cyan)', req); group('Free', 'var(--green)', free); var v = el('a', 'omc-vote'); v.href = '#home'; v.appendChild(document.createTextNode('What should we map next?')); v.appendChild(el('span', null, 'Vote ▸')); v.addEventListener('click', function () { track('button_click', { button_id: 'country-vote' }); }); out.appendChild(v); if (ok.length) { var g = el('div', 'omc-group'); var l = el('div', 'omc-label'); var d = el('span', 'omc-dot'); d.style.background = 'var(--green)'; l.appendChild(d); l.appendChild(document.createTextNode('Allowed · ' + ok.length)); g.appendChild(l); var chips = el('div', 'omc-chips'); chips.hidden = true; ok.forEach(function (m) { chips.appendChild(el('span', 'omc-chip', m.title)); }); var more = el('button', 'omc-more', 'Show the ' + ok.length + ' things that are legal here'); more.type = 'button'; more.addEventListener('click', function () { chips.hidden = false; more.remove(); }); g.appendChild(chips); g.appendChild(more); out.appendChild(g); } if (location.hash.indexOf('country') >= 0) track('country_view', { country: iso, banned: banned.length }); } function opPair(pre) { var NS = 'http://www.w3.org/2000/svg'; function btn(cls, id, href, label, big, small, path) { var a = document.createElement('a'); a.className = 'op-btn ' + cls; a.id = id; a.href = href; a.target = '_blank'; a.rel = 'noopener'; a.setAttribute('aria-label', label); var sv = document.createElementNS(NS, 'svg'); sv.setAttribute('viewBox', '0 0 24 24'); sv.setAttribute('fill', 'currentColor'); sv.setAttribute('aria-hidden', 'true'); var p = document.createElementNS(NS, 'path'); p.setAttribute('d', path); sv.appendChild(p); a.appendChild(sv); var l = document.createElement('span'); l.className = 'op-l'; var b = document.createElement('b'); b.textContent = big; var s = document.createElement('small'); s.textContent = small; l.appendChild(b); l.appendChild(s); a.appendChild(l); return a; } var d = document.createElement('div'); d.className = 'op-pair'; d.appendChild(btn('op-tt', pre + '-follow', 'https://www.tiktok.com/@onemap_tt', 'Follow One Map on TikTok', 'Follow', 'on TikTok', 'M19.6 6.7a4.8 4.8 0 0 1-3.8-4.2V2h-3.4v13.7a2.9 2.9 0 1 1-2-2.8V9.4a6.3 6.3 0 1 0 5.4 6.3V8.7a8.2 8.2 0 0 0 4.8 1.5V6.8z')); d.appendChild(btn('op-yt', pre + '-subscribe', 'https://www.youtube.com/@one_map?sub_confirmation=1', 'Subscribe to One Map on YouTube', 'Subscribe', 'on YouTube', 'M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.6 12 3.6 12 3.6s-7.5 0-9.4.5A3 3 0 0 0 .5 6.2 31 31 0 0 0 0 12a31 31 0 0 0 .5 5.8 3 3 0 0 0 2.1 2.1c1.9.5 9.4.5 9.4.5s7.5 0 9.4-.5a3 3 0 0 0 2.1-2.1A31 31 0 0 0 24 12a31 31 0 0 0-.5-5.8zM9.6 15.6V8.4l6.2 3.6-6.2 3.6z')); return d; } function pickFromSearch() { var c = byName[search.value.trim().toLowerCase()]; if (c && c !== select.value) { select.value = c; select.dispatchEvent(new Event('change')); search.blur(); } } search.addEventListener('input', pickFromSearch); search.addEventListener('change', pickFromSearch); search.addEventListener('focus', function () { search.select(); }); select.addEventListener('change', function () { try { localStorage.setItem('om_country', select.value); } catch (e) {} show(select.value); }); function start(iso) { if (ISO.indexOf(iso) < 0) iso = 'US'; select.value = iso; show(iso); } var saved = null; try { saved = localStorage.getItem('om_country'); } catch (e) {} if (saved) start(saved); else fetch('/cdn-cgi/trace').then(function (r) { return r.text(); }) .then(function (t) { var m = t.match(/loc=([A-Z]{2})/); start(m ? m[1] : 'US'); }) .catch(function () { start('US'); }); })();
    ← One Map home

    Banned or not?

    (function () { var API = 'https://gomlbjrofbhzhhjnejtw.supabase.co/rest/v1/rpc/'; var KEY = 'sb_publishable_b19ek7Wra-poGFk53pmb8w_dtzXchqj'; var TIKTOK = 'https://www.tiktok.com/@onemap_tt'; var root = document.getElementById('om-daily'); var body = root.querySelector('.bon-body'); var sub = root.querySelector('.bon-sub'); var names = (window.Intl && Intl.DisplayNames) ? new Intl.DisplayNames(['en'], { type: 'region' }) : null; var G = null, picks = [], idx = 0, score = 0, combo = 0, bestCombo = 0, correctN = 0, started = 0, busy = false, loaded = false; function el(tag, cls, text) { var n = document.createElement(tag); if (cls) n.className = cls; if (text != null) n.textContent = text; return n; } function cname(c) { try { return (names && names.of(c)) || c; } catch (e) { return c; } } function flag(c, w) { var i = document.createElement('img'); i.alt = ''; i.src = 'https://flagcdn.com/w' + (w || 160) + '/' + String(c).toLowerCase() + '.png'; return i; } function track(n, p) { if (window.gtag) gtag('event', n, p); } function buzz(p) { try { if (navigator.vibrate) navigator.vibrate(p); } catch (e) {} } function num(n) { return Number(n || 0).toLocaleString('en-US'); } function rpc(fn, b) { return fetch(API + fn, { method: 'POST', headers: { 'apikey': KEY, 'Content-Type': 'application/json' }, body: JSON.stringify(b) }) .then(function (r) { return r.json().then(function (j) { if (!r.ok) throw new Error((j && j.message) || 'error'); return j; }); }); } function player() { var id; try { id = localStorage.getItem('om_vid'); } catch (e) {} if (!id || id.length < 8) { id = (window.crypto && crypto.randomUUID) ? crypto.randomUUID() : (String(Math.random()).slice(2) + Date.now()); try { localStorage.setItem('om_vid', id); } catch (e) {} } return id; } var ME = player(); function dayKey() { var p = {}; new Intl.DateTimeFormat('en-US', { timeZone: 'America/Chicago', year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', hour12: false }) .formatToParts(new Date()).forEach(function (x) { p[x.type] = x.value; }); return { key: p.year + '-' + p.month + '-' + p.day, mins: 1440 - ((+p.hour % 24) * 60 + (+p.minute)) }; } function saveStreak(n) { try { localStorage.setItem('om_bon_streak', JSON.stringify({ last: dayKey().key, n: n })); } catch (e) {} } function countUp(node, to, ms) { var from = 0, t0 = Date.now(); (function step() { var k = Math.min(1, (Date.now() - t0) / ms); node.textContent = num(Math.round(from + (to - from) * (1 - Math.pow(1 - k, 3)))); if (k < 1) setTimeout(step, 16); })(); } function lbBox(lb, title, limit) { var box = el('div', 'bon-lb'); var h = el('h3', null, title); if (lb.players >= 20) h.appendChild(el('small', null, num(lb.players) + ' players today')); box.appendChild(h); var top = (lb.top || []).slice(0, limit || 10); if (!top.length) box.appendChild(el('p', 'bon-empty', 'Nobody on the board yet. Be the first!')); top.forEach(function (r) { var row = el('div', 'bon-row' + (r.me ? ' me' : '') + (r.rank === 1 ? ' g1' : '')); row.appendChild(el('span', 'r', r.rank === 1 ? '🥇' : r.rank === 2 ? '🥈' : r.rank === 3 ? '🥉' : String(r.rank))); row.appendChild(el('span', 'n', r.name + (r.me ? ' (you)' : ''))); row.appendChild(el('span', 's', num(r.score))); box.appendChild(row); }); return box; } function streakBox(lb) { if (!lb.streaks || !lb.streaks.length) return null; var box = el('div', 'bon-lb'); box.appendChild(el('h3', null, '🔥 Longest streaks')); lb.streaks.forEach(function (r, i) { var row = el('div', 'bon-row'); row.appendChild(el('span', 'r', String(i + 1))); row.appendChild(el('span', 'n', r.name)); row.appendChild(el('span', 's', r.streak + ' days')); box.appendChild(row); }); return box; } function intro() { body.textContent = ''; var me = G.me || {}, run = G.run; var chips = el('div'); var st = me.streak || 0; chips.appendChild(el('span', 'bon-chip' + (st ? ' hot' : ''), st ? '🔥 ' + st + '-day streak' : '🔥 Start a streak today')); if (me.name) chips.appendChild(el('span', 'bon-chip', '🏷️ ' + me.name)); body.appendChild(chips); var rules = el('div', 'bon-rules'); [['5', 'cards, same for everyone'], ['⚡', 'faster = more points'], ['🔥', 'combos multiply']].forEach(function (x) { var r = el('div', 'bon-rule'); r.appendChild(el('b', null, x[0])); r.appendChild(document.createTextNode(x[1])); rules.appendChild(r); }); body.appendChild(rules); var go = el('button', 'bon-play', run && run.picks && run.picks.length ? 'Continue (' + run.picks.length + '/5) →' : '▶ Play today’s 5'); go.type = 'button'; go.addEventListener('click', function () { buzz(15); card(); }); body.appendChild(go); var lbWrap = el('div'); body.appendChild(lbWrap); rpc('get_leaderboard', { p_player: ME }).then(function (lb) { if (lb.players) { lbWrap.appendChild(lbBox(lb, '🏆 Today’s top 3', 3)); } }).catch(function () {}); } function dots() { var d = el('div', 'bon-dots'); for (var i = 0; i < 5; i++) { var x = el('i'); var p = picks[i]; if (p) x.className = p.c ? 'ok' : 'no'; else if (i === idx) x.className = 'on'; d.appendChild(x); } return d; } function card() { if (idx >= G.cards.length) { results(); return; } var c = G.cards[idx]; body.textContent = ''; var top = el('div', 'bon-top'); top.appendChild(el('span', 'bon-prog', (idx + 1) + ' / 5')); var sc = el('span', 'bon-score', num(score)); top.appendChild(sc); var cb = el('span', 'bon-combo', combo >= 2 ? '🔥 x' + combo : ''); top.appendChild(cb); body.appendChild(top); body.appendChild(dots()); var box = el('div', 'bon-card'); var f = flag(c.iso, 160); f.className = 'bon-flag'; f.width = 96; f.height = 64; box.appendChild(f); box.appendChild(el('div', 'bon-country', cname(c.iso))); box.appendChild(el('p', 'bon-q', 'Is this banned here?')); box.appendChild(el('div', 'bon-thing', c.title)); var tm = el('div', 'bon-timer'); var bar = el('i'); tm.appendChild(bar); box.appendChild(tm); var btns = el('div', 'bon-btns'); var bBan = el('button', 'bon-btn ban', '🚫 BANNED'); bBan.type = 'button'; var bOk = el('button', 'bon-btn legal', '✅ LEGAL'); bOk.type = 'button'; btns.appendChild(bBan); btns.appendChild(bOk); box.appendChild(btns); body.appendChild(box); started = Date.now(); setTimeout(function () { bar.style.transform = 'scaleX(0)'; }, 30); if (idx === 0 && !picks.length) track('game_start', { day: G.num }); function answer(pick, btn) { if (busy) return; busy = true; var ms = Date.now() - started; buzz(8); bBan.disabled = true; bOk.disabled = true; btn.classList.add('pick'); var frozen = getComputedStyle(bar).transform; bar.style.transition = 'none'; bar.style.transform = frozen; var label = btn.textContent, slow = setTimeout(function () { btn.textContent = 'Checking…'; }, 700); function unslow() { clearTimeout(slow); btn.textContent = label; } rpc('play_card', { p_player: ME, p_idx: idx, p_pick: pick, p_ms: ms }).then(function (r) { busy = false; unslow(); if (r.error) { if (r.error === 'done' || r.error === 'order') { load(); } else { showErr(box, r.error === 'limited' ? 'Too many games from this network today.' : 'Something went wrong. Try again.'); } return; } picks.push({ c: r.correct, p: r.points }); score = r.score; combo = r.combo; correctN = r.correct_n; bestCombo = Math.max(bestCombo, combo); (r.banned ? bOk : bBan).classList.add('dim'); box.classList.add(r.correct ? 'win' : 'lose'); if (r.correct) { buzz(25); var pts = el('div', 'bon-pts', '+' + r.points); box.appendChild(pts); countUp(sc, score, 500); if (combo >= 2) { cb.textContent = '🔥 x' + combo; cb.classList.remove('pop'); void cb.offsetWidth; cb.classList.add('pop'); } } else { buzz([60, 40, 60]); box.classList.add('shake'); cb.textContent = ''; } var fact = el('div', 'bon-fact'); var nm = cname(c.iso); fact.appendChild(el('b', null, (r.correct ? '✅ Right! ' : '❌ Nope. ') + c.title + ' is ' + (r.banned ? 'banned' : 'legal') + ' in ' + nm + '.')); var ex = (r.examples || []).filter(function (x) { return x !== c.iso; }).slice(0, 2).map(cname); var line = r.banned ? (r.fact || '') : (r.n_banned + (r.n_banned === 1 ? ' country bans' : ' countries ban') + ' it' + (ex.length ? ', like ' + ex.join(' and ') : '') + '.'); fact.appendChild(document.createTextNode(line + ' ')); var lk = el('a', null, 'See every country →'); lk.href = 'https://maps.thatonemap.com/' + r.slug + '/?utm_source=site&utm_medium=game'; lk.target = '_blank'; lk.rel = 'noopener'; var vy = r.yt || (/youtu/.test(r.video || '') ? r.video : ''), vt = r.tt || (/tiktok/.test(r.video || '') ? r.video : ''); if (vy || vt) { var wr = el('div', 'bon-wrow'); [['yt', vy, '\u25b6 YouTube'], ['tt', vt, '\u25b6 TikTok']].forEach(function (x) { if (!x[1]) return; var wl = el('a', 'bon-watch ' + x[0], x[2]); wl.id = 'gw-' + x[0]; wl.href = x[1]; wl.target = '_blank'; wl.rel = 'noopener'; wl.addEventListener('click', function () { track('country_watch', { topic: c.title, platform: x[0] }); }); wr.appendChild(wl); }); fact.appendChild(wr); } fact.appendChild(lk); box.appendChild(fact); var nx = el('button', 'bon-next', r.done ? 'See my score 🏆' : 'Next card →'); nx.type = 'button'; nx.addEventListener('click', function () { idx++; buzz(10); if (r.done) results(); else card(); }); box.appendChild(nx); if (r.done) track('game_complete', { day: G.num, score: correctN }); }).catch(function () { busy = false; unslow(); showErr(box, 'Connection problem. Tap again.'); bBan.disabled = false; bOk.disabled = false; btn.classList.remove('pick'); }); } bBan.addEventListener('click', function () { answer(true, bBan); }); bOk.addEventListener('click', function () { answer(false, bOk); }); } function showErr(box, t) { var m = el('p', 'bon-msg err', t); box.appendChild(m); } function opPair(pre) { var NS = 'http://www.w3.org/2000/svg'; function btn(cls, id, href, label, big, small, path) { var a = document.createElement('a'); a.className = 'op-btn ' + cls; a.id = id; a.href = href; a.target = '_blank'; a.rel = 'noopener'; a.setAttribute('aria-label', label); var sv = document.createElementNS(NS, 'svg'); sv.setAttribute('viewBox', '0 0 24 24'); sv.setAttribute('fill', 'currentColor'); sv.setAttribute('aria-hidden', 'true'); var p = document.createElementNS(NS, 'path'); p.setAttribute('d', path); sv.appendChild(p); a.appendChild(sv); var l = document.createElement('span'); l.className = 'op-l'; var b = document.createElement('b'); b.textContent = big; var s = document.createElement('small'); s.textContent = small; l.appendChild(b); l.appendChild(s); a.appendChild(l); return a; } var d = document.createElement('div'); d.className = 'op-pair'; d.appendChild(btn('op-tt', pre + '-follow', 'https://www.tiktok.com/@onemap_tt', 'Follow One Map on TikTok', 'Follow', 'on TikTok', 'M19.6 6.7a4.8 4.8 0 0 1-3.8-4.2V2h-3.4v13.7a2.9 2.9 0 1 1-2-2.8V9.4a6.3 6.3 0 1 0 5.4 6.3V8.7a8.2 8.2 0 0 0 4.8 1.5V6.8z')); d.appendChild(btn('op-yt', pre + '-subscribe', 'https://www.youtube.com/@one_map?sub_confirmation=1', 'Subscribe to One Map on YouTube', 'Subscribe', 'on YouTube', 'M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.6 12 3.6 12 3.6s-7.5 0-9.4.5A3 3 0 0 0 .5 6.2 31 31 0 0 0 0 12a31 31 0 0 0 .5 5.8 3 3 0 0 0 2.1 2.1c1.9.5 9.4.5 9.4.5s7.5 0 9.4-.5a3 3 0 0 0 2.1-2.1A31 31 0 0 0 24 12a31 31 0 0 0-.5-5.8zM9.6 15.6V8.4l6.2 3.6-6.2 3.6z')); return d; } function results() { body.textContent = ''; var grid = picks.map(function (p) { return p.c ? '🟩' : '🟥'; }).join(''); var big = el('div', 'bon-big', '0'); body.appendChild(big); countUp(big, score, 900); body.appendChild(el('div', 'bon-muted', 'points')); body.appendChild(el('div', 'bon-grid', grid)); var stats = el('p', 'bon-muted', correctN + '/5 correct' + (bestCombo >= 2 ? ' · best combo 🔥x' + bestCombo : '')); body.appendChild(stats); var rank = el('div', 'bon-rank', ''); body.appendChild(rank); var beat = el('p', 'bon-muted', ''); body.appendChild(beat); var fw = el('div', 'bon-actions'); fw.appendChild(el('p', 'bon-fl', 'Tomorrow\u2019s cards come from the next map. Follow so you see it first:')); fw.appendChild(opPair('daily')); body.appendChild(fw); var acts = el('div', 'bon-actions'); body.appendChild(acts); var tagWrap = el('div'); body.appendChild(tagWrap); var lbWrap = el('div'); body.appendChild(lbWrap); var me = G.me || {}; var st = 0; function drawLb() { return rpc('get_leaderboard', { p_player: ME }).then(function (lb) { lbWrap.textContent = ''; if (lb.me) { rank.textContent = lb.players >= 20 ? '#' + lb.me.rank + ' of ' + num(lb.players) + ' today' : '#' + lb.me.rank + ' today'; if (lb.beat_pct != null) beat.textContent = 'You beat ' + lb.beat_pct + '% of today’s players.'; } lbWrap.appendChild(lbBox(lb, '🏆 Today’s leaderboard', 10)); var sb = streakBox(lb); if (sb) lbWrap.appendChild(sb); return lb; }).catch(function () {}); } function drawTag() { tagWrap.textContent = ''; if (me.name) { tagWrap.appendChild(el('p', 'bon-muted', 'Playing as ' + me.name)); return; } tagWrap.appendChild(el('p', 'bon-rank', 'Put your name on the board')); var f = el('form', 'bon-tag'); f.setAttribute('autocomplete', 'off'); var inp = el('input'); inp.maxLength = 16; inp.placeholder = 'Your tag (2–16 letters)'; inp.setAttribute('aria-label', 'Your leaderboard tag'); var sv = el('button', null, 'Save'); sv.type = 'submit'; f.appendChild(inp); f.appendChild(sv); tagWrap.appendChild(f); var msg = el('p', 'bon-msg'); tagWrap.appendChild(msg); f.addEventListener('submit', function (e) { e.preventDefault(); e.stopPropagation(); var v = inp.value.trim(); if (!v) { inp.focus(); return; } sv.disabled = true; rpc('set_game_name', { p_player: ME, p_name: v }).then(function (res) { sv.disabled = false; if (res === 'ok') { me.name = v; G.me = me; drawTag(); drawLb(); track('button_click', { button_id: 'game-tag' }); buzz(20); } else { msg.className = 'bon-msg err'; msg.textContent = res === 'taken' ? 'That tag is taken. Try another.' : res === 'blocked' ? 'Pick a different tag.' : 'Use 2–16 letters, numbers, spaces, _ . -'; } }).catch(function () { sv.disabled = false; msg.className = 'bon-msg err'; msg.textContent = 'Couldn’t save. Try again.'; }); }); } drawTag(); rpc('get_daily_game', { p_player: ME }).then(function (g) { st = (g.me && g.me.streak) || 1; saveStreak(st); stats.textContent = correctN + '/5 correct' + (bestCombo >= 2 ? ' · best combo 🔥x' + bestCombo : '') + ' · 🔥 ' + st + '-day streak'; }).catch(function () {}); drawLb(); var sh = el('button', 'bon-share', '\ud83d\udce4 Challenge a friend'); sh.type = 'button'; acts.appendChild(sh); acts.appendChild(el('p', 'bon-share-sub', 'Send your score and see if they can beat it')); sh.addEventListener('click', function () { var NL = String.fromCharCode(10); var miss = -1; for (var i = 0; i < picks.length; i++) { if (!picks[i].c) { miss = i; break; } } var tc = G.cards[miss >= 0 ? miss : 0], cn = cname(tc.iso); if (/^United |^(Netherlands|Philippines|Bahamas|Gambia|Maldives|Czech Republic)$/.test(cn)) cn = 'the ' + cn; var t = '\ud83c\udf0d Banned or Not? #' + G.num + NL + grid + ' ' + correctN + '/5 \u00b7 ' + num(score) + ' pts' + (st > 1 ? ' \u00b7 \ud83d\udd25' + st : '') + NL + NL + tc.title + ' in ' + cn + ': banned or not? \ud83e\udd14' + NL + 'Bet you can\u2019t beat me: thatonemap.com/#daily'; track('share_click', { from: 'daily' }); function done(msg) { sh.textContent = msg; setTimeout(function () { sh.textContent = '\ud83d\udce4 Challenge a friend'; }, 2500); } if (navigator.share) { navigator.share({ text: t }).then(function () { done('Sent! \ud83d\udd25'); }).catch(function () {}); return; } (navigator.clipboard ? navigator.clipboard.writeText(t) : Promise.reject()).then(function () { done('Copied! Paste it in a chat'); }, function () { window.prompt('Copy this:', t); }); }); var dk = dayKey(); var h = Math.floor(dk.mins / 60), m = dk.mins % 60; body.appendChild(el('p', 'bon-next-in', 'New cards in ' + h + 'h ' + m + 'm. Come back to keep your streak 🔥')); var rc = el('div', 'bon-recap'); G.cards.forEach(function (c, i) { var cv = c.yt || c.video; var a = el('a'); a.href = cv || ('https://maps.thatonemap.com/' + c.slug + '/?utm_source=site&utm_medium=game'); a.target = '_blank'; a.rel = 'noopener'; if (cv) a.addEventListener('click', function () { track('country_watch', { topic: c.title, platform: c.yt ? 'yt' : 'tt' }); }); var fi = flag(c.iso, 40); a.appendChild(fi); a.appendChild(el('span', null, ((picks[i] && picks[i].c) ? '✅ ' : '❌ ') + c.title + ' · ' + cname(c.iso))); a.appendChild(el('em', null, cv ? '\u25b6 Watch' : 'Map \u2192')); rc.appendChild(a); }); body.appendChild(rc); } function load() { loaded = true; rpc('get_daily_game', { p_player: ME }).then(function (g) { G = g; sub.textContent = 'Daily #' + g.num + ' · 5 cards · ' + (g.players_today >= 20 ? num(g.players_today) + ' played today' : 'new cards every day'); var run = g.run; picks = (run && run.picks) ? run.picks : []; idx = picks.length; score = run ? run.score : 0; combo = run ? run.combo : 0; bestCombo = run ? run.best_combo : 0; correctN = run ? run.correct : 0; if (run && run.done) { if (g.me) saveStreak(g.me.streak || 1); results(); } else intro(); }).catch(function () { body.textContent = ''; body.appendChild(el('p', 'bon-empty', 'Couldn’t load today’s game. Try again in a minute.')); loaded = false; }); } function maybe() { if (location.hash === '#daily' && !loaded) load(); } window.addEventListener('hashchange', maybe); maybe(); })();
    ← One Map home

    One Map stats

    Loading
    (function () { var API = 'https://gomlbjrofbhzhhjnejtw.supabase.co/rest/v1/rpc/get_stats'; var KEY = 'sb_publishable_b19ek7Wra-poGFk53pmb8w_dtzXchqj'; var root = document.getElementById('om-stats'); var body = root.querySelector('.oms-body'); var upd = root.querySelector('.oms-upd'); var dot = root.querySelector('.oms-dot'); var days = 7, off = 0, timer = null, lastAt = 0; var RANGES = [[1, 'Today', 'yesterday', 0], [1, 'Yesterday', 'the day before', 1], [7, '7 days', 'the 7 days before', 0], [30, '30 days', 'the 30 days before', 0], [365, 'All time', null, 0]]; var names = (window.Intl && Intl.DisplayNames) ? new Intl.DisplayNames(['en'], { type: 'region' }) : null; var BUTTONS = { 'cw-yt': 'Watch on YouTube (country page)', 'cw-tt': 'Watch on TikTok (country page)', 'gw-yt': 'Watch on YouTube (game answer)', 'gw-tt': 'Watch on TikTok (game answer)', 'btn-tiktok-follow': 'Follow on TikTok (main button)', 'btn-tiktok-sticky': 'Follow on TikTok (sticky bar)', 'country-follow': 'Follow (country page)', 'btn-subscribe': 'Subscribe on YouTube', 'btn-longform': 'New full video card', 'hero-today': 'Today\u2019s map card', 'card-daily': 'Daily game tile', 'card-country': 'Country tile', 'hero-check': 'Check my country', 'hero-change-country': 'Change country', 'hero-pick': 'Pick a different country', 'suggest-open': 'Suggest a topic', 'country-vote': 'Vote link (country page)', 'om-cookie-settings': 'Cookie settings', 'top-1': 'Most watched #1', 'top-2': 'Most watched #2', 'top-3': 'Most watched #3', 'btn-shorts': 'Watch every map', 'vote-follow': 'Follow (after voting)', 'suggest-follow': 'Follow (after suggesting)', 'suggest-subscribe': 'Subscribe (after suggesting)', 'daily-follow': 'Follow (after game)', 'btn-youtube-sticky': 'Subscribe (sticky bar)', 'country-subscribe': 'Subscribe (country page)', 'vote-subscribe': 'Subscribe (after voting)', 'daily-subscribe': 'Subscribe (after game)', 'mapped-watch': 'Watch my mapped vote', 'explore-maps': 'Every ban map tile', 'all-maps': 'All ban maps (footer)', 'hero-all-maps': 'All maps (top bar)', 'btn-tiktok': 'TikTok button' }; var PAGES = { '#home': 'Home', '#country': 'Country check', '#daily': 'Daily game', '#legal': 'Legal', '#stats': 'Stats' }; var SOURCES = { site: 'thatonemap.com', maps: 'Other map pages', direct: 'Direct or bio link', google: 'Google', youtube: 'YouTube', tiktok: 'TikTok', instagram: 'Instagram', x: 'X', bing: 'Bing', reddit: 'Reddit', pinterest: 'Pinterest', threads: 'Threads' }; var SHARES = { country: 'Country result', daily: 'Game score', 'vote:share': 'Vote (share sheet)', 'vote:whatsapp': 'Vote (WhatsApp)', 'vote:copy': 'Vote (copied link)' }; var KIND = { page_view: 'Viewed', vote_cast: 'Voted for', share_click: 'Shared', game_start: 'Started the game', game_complete: 'Finished the game', game_answer: 'Answered', topic_suggested: 'Suggested', button_click: 'Tapped', country_view: 'Checked', country_watch: 'Opened the map', last_pick_click: 'Opened last winner' }; function el(tag, cls, text) { var n = document.createElement(tag); if (cls) n.className = cls; if (text != null) n.textContent = text; return n; } function num(n) { return Number(n || 0).toLocaleString('en-US'); } function cname(c) { try { return /^[A-Z]{2}$/.test(c) ? ((names && names.of(c)) || c) : 'Unknown'; } catch (e) { return c; } } function flagImg(c) { if (!/^[A-Z]{2}$/.test(c || '')) return null; var i = document.createElement('img'); i.className = 'oms-flag'; i.alt = ''; i.width = 20; i.height = 15; i.loading = 'lazy'; i.src = 'https://flagcdn.com/w40/' + c.toLowerCase() + '.png'; i.onerror = function () { i.remove(); }; return i; } function src(s) { if (!s) return 'Direct or bio link'; var k = String(s).split('/')[0].toLowerCase(); return SOURCES[k] || (s.indexOf('share') === 0 ? 'Shared link' : s); } function getKey() { try { return localStorage.getItem('om_dash_key') || ''; } catch (e) { return ''; } } function setKey(k) { try { localStorage.setItem('om_dash_key', k); } catch (e) {} } function setOwner() { try { localStorage.setItem('om_owner', '1'); } catch (e) {} if (!document.getElementById('om-owner-maps')) { var f = document.createElement('iframe'); f.id = 'om-owner-maps'; f.src = 'https://maps.thatonemap.com/owner/'; f.title = 'owner'; f.setAttribute('aria-hidden', 'true'); f.tabIndex = -1; f.style.cssText = 'position:absolute;width:1px;height:1px;border:0;opacity:0;pointer-events:none'; document.body.appendChild(f); } } (function takeKeyFromUrl() { var q = new URLSearchParams(location.search), k = q.get('k'); if (k) { setKey(k); history.replaceState(null, '', location.pathname + location.hash); } })(); function status(text, ok) { upd.textContent = text; dot.classList.toggle('off', !ok); } function stamp() { var d = new Date(lastAt); return d.toLocaleTimeString('en-US', { timeZone: 'America/Chicago', hour: 'numeric', minute: '2-digit' }) + ' CT'; } function gate(msg) { clearInterval(timer); body.textContent = ''; status('Locked', false); var g = el('div', 'oms-gate'); g.appendChild(el('p', null, 'Enter your dashboard key to see the stats.')); var inp = el('input'); inp.type = 'password'; inp.placeholder = 'Dashboard key'; inp.id = 'oms-key'; inp.autocomplete = 'off'; inp.setAttribute('aria-label', 'Dashboard key'); var btn = el('button', null, 'Unlock'); btn.type = 'button'; var err = el('p', 'oms-err', msg || ''); btn.addEventListener('click', function () { if (inp.value.trim()) { setKey(inp.value.trim()); load(true); } }); inp.addEventListener('keydown', function (e) { if (e.key === 'Enter') btn.click(); }); g.appendChild(inp); g.appendChild(btn); g.appendChild(err); body.appendChild(g); } function card(title, hint) { var c = el('div', 'oms-card'); var h = el('h3', null, title); if (hint) h.appendChild(el('small', null, hint)); c.appendChild(h); return c; } function rows(target, list, key, labeller, opts) { opts = opts || {}; var agg = [], idx = {}; list.forEach(function (r) { var lab = labeller ? labeller(r.name) : r.name; if (idx[lab] == null) { idx[lab] = agg.length; agg.push({ name: r.name, lab: lab, v: 0 }); } agg[idx[lab]].v += (r[key] || 0); }); agg.sort(function (a, b) { return b.v - a.v; }); if (!agg.length) { target.appendChild(el('p', 'oms-empty', opts.empty || 'Nothing yet in this period.')); return; } var max = agg[0].v || 1; function draw(r, before) { var row = el('div', 'oms-row'); var n = el('div', 'n'); if (opts.flag) { var f = flagImg(r.name); if (f) n.appendChild(f); } var s = el('span', null, r.lab); s.title = r.lab; n.appendChild(s); row.appendChild(n); row.appendChild(el('b', null, num(r.v))); var tr = el('div', 'oms-track'); var fl = el('div', 'oms-fill'); fl.style.width = Math.max(3, Math.round(r.v / max * 100)) + '%'; tr.appendChild(fl); row.appendChild(tr); target.insertBefore(row, before || null); } var lim = opts.limit || agg.length; agg.slice(0, lim).forEach(function (r) { draw(r); }); if (agg.length > lim) { var mb = el('button', 'oms-more', 'Show ' + (agg.length - lim) + ' more'); mb.type = 'button'; mb.addEventListener('click', function () { agg.slice(lim).forEach(function (r) { draw(r, mb); }); mb.remove(); }); target.appendChild(mb); } } function ago(iso) { var s = Math.max(0, Math.round((Date.now() - new Date(iso).getTime()) / 1000)); if (s < 60) return 'just now'; if (s < 3600) return Math.round(s / 60) + 'm ago'; if (s < 86400) return Math.round(s / 3600) + 'h ago'; return Math.round(s / 86400) + 'd ago'; } function delta(cur, prev, firstDay, fromIso) { var label = null; RANGES.forEach(function (r) { if (r[0] === days && r[3] === off) label = r[2]; }); if (!label) return null; var started = firstDay && fromIso && firstDay >= String(fromIso).slice(0, 10); if (!prev && started) return { text: 'New since launch', cls: '' }; if (!prev && !cur) return { text: 'No change', cls: '' }; if (!prev) return { text: '▲ from 0', cls: 'oms-up' }; var p = Math.round((cur - prev) / prev * 100); if (p === 0) return { text: 'No change', cls: '' }; return { text: (p > 0 ? '▲ ' : '▼ ') + Math.abs(p) + '%', cls: p > 0 ? 'oms-up' : 'oms-down' }; } function render(d) { body.textContent = ''; var range = el('div', 'oms-range'); RANGES.forEach(function (o) { var b = el('button', 'oms-chip', o[1]); b.type = 'button'; b.setAttribute('aria-pressed', days === o[0] && off === o[3] ? 'true' : 'false'); b.addEventListener('click', function () { days = o[0]; off = o[3]; try { localStorage.setItem('om_dash_days', days); localStorage.setItem('om_dash_off', off); } catch (e) {} load(true); }); range.appendChild(b); }); body.appendChild(range); var fd = d.first_day ? new Date(d.first_day + 'T12:00:00Z').toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric', timeZone: 'UTC' }) : 'recently'; var cmp = null; RANGES.forEach(function (r) { if (r[0] === days && r[3] === off) cmp = r[2]; }); if (cmp && d.first_day && d.from && d.first_day >= String(d.from).slice(0, 10)) cmp = null; body.appendChild(el('p', 'oms-note', 'Tracking since ' + fd + '.' + (cmp ? ' ▲▼ compare with ' + cmp + '.' : '') + ' Your own visits on this device are not counted.')); var t = d.totals || {}, pv = d.prev || {}, td = d.today || {}; var kpis = el('div', 'oms-kpis'); [['People who tapped Follow', 'follows', true, td.follows], ['Visitors', 'visitors', false, td.visitors], ['Votes', 'votes', false, td.votes], ['Game plays', 'games', false, td.games], ['Shares', 'shares', false, null], ['Suggestions', 'suggestions', false, null]].forEach(function (k) { var c = el('div', 'oms-kpi' + (k[2] ? ' main' : '')); c.appendChild(el('span', 'k', k[0])); c.appendChild(el('span', 'v', num(t[k[1]]))); var dl = delta(t[k[1]] || 0, pv[k[1]] || 0, d.first_day, d.from); if (k[1] === 'visitors') c.appendChild(el('span', 's', num(t.page_views) + ' page views')); if (k[1] === 'shares' && t.visitors) c.appendChild(el('span', 's', Math.round((t.shares || 0) / t.visitors * 100) + ' per 100 visitors')); if (k[1] === 'suggestions') { var pend = (d.suggested || []).filter(function (x) { return x.status === 'pending'; }).length; c.appendChild(el('span', 's' + (pend ? ' oms-warn' : ''), pend ? pend + ' need review' : 'All reviewed')); } if (k[1] === 'follows' && t.visitors) c.appendChild(el('span', 's', (Math.round((t.follows || 0) / t.visitors * 1000) / 10) + '% of visitors')); if (k[1] === 'follows' && t.subs != null) c.appendChild(el('span', 's', num(t.subs) + ' YouTube \u00b7 ' + num(t.tt != null ? t.tt : (t.follows || 0) - t.subs) + ' TikTok')); if (dl && dl.text === 'New since launch') dl = null; if (dl) c.appendChild(el('span', 's ' + dl.cls, dl.text)); else if (k[3] != null && days > 1) c.appendChild(el('span', 's', num(k[3]) + ' today')); kpis.appendChild(c); }); body.appendChild(kpis); var daily = (d.daily || []).filter(function (x) { return !d.first_day || x.day >= d.first_day; }); if (days === 365) daily = daily.slice(-60); var chartCard = card('Visitors per day', days === 1 ? null : (daily.length + (daily.length === 1 ? ' day' : ' days'))); if (days === 1 || daily.length < 2) { chartCard.appendChild(el('p', 'oms-empty', num(td.visitors) + ' visitors today, ' + num(td.page_views) + ' page views and ' + num(td.votes) + ' votes. Pick 7 days to see the trend.')); } else { var chart = el('div', 'oms-chart'); var xs = el('div', 'oms-x'); var maxV = Math.max.apply(null, daily.map(function (x) { return x.visitors; })) || 1; var step = daily.length > 14 ? Math.ceil(daily.length / 7) : 1; daily.forEach(function (x, i) { var col = el('div', 'oms-col'); col.appendChild(el('em', null, (daily.length <= 14 && x.visitors) ? String(x.visitors) : '')); var bar = el('div', 'oms-bar' + (i === daily.length - 1 ? ' today' : '')); bar.style.height = Math.max(2, Math.round(x.visitors / maxV * 100)) + '%'; bar.title = x.day + ': ' + x.visitors + ' visitors, ' + x.page_views + ' views, ' + x.votes + ' votes'; col.appendChild(bar); chart.appendChild(col); var dt = new Date(x.day + 'T12:00:00Z'); xs.appendChild(el('i', null, (i % step === 0 || i === daily.length - 1) ? dt.toLocaleDateString('en-US', { month: 'short', day: 'numeric', timeZone: 'UTC' }) : '')); }); chartCard.appendChild(chart); chartCard.appendChild(xs); var lg = el('div', 'oms-legend'); lg.appendChild(el('span', 'c', 'Visitors')); lg.appendChild(el('span', 't', 'Today')); lg.appendChild(el('span', null, 'Peak ' + num(maxV) + ' a day')); chartCard.appendChild(lg); } if (days > 1) body.appendChild(chartCard); var mp = d.maps || {}; var mc = card('Map pages', 'maps.thatonemap.com'); mc.style.marginTop = '12px'; var mk = el('div', 'oms-mk'); [['Views', mp.views], ['Visitors', mp.visitors], ['Videos opened', mp.plays], ['Watch taps', mp.watch], ['People who tapped Follow', mp.follows], ['Sent to site', mp.to_site]].forEach(function (x) { var b = el('div', 'oms-mki'); b.appendChild(el('b', null, num(x[1]))); b.appendChild(el('span', null, x[0])); mk.appendChild(b); }); mc.appendChild(mk); if (!mp.views) mc.appendChild(el('p', 'oms-empty', 'No visits yet in this period. Google is still indexing the pages; links from video descriptions speed it up.')); else { mc.appendChild(el('p', 'oms-sub', 'Top pages')); rows(mc, mp.pages || [], 'views', function (p) { var c = p.match(/^[/]country[/]([a-z]{2})[/]$/); return c ? cname(c[1].toUpperCase()) + ' (country)' : (p === '/' ? 'All maps' : p.replace(/[/]/g, '')); }, { limit: 8 }); mc.appendChild(el('p', 'oms-sub', 'Where map visitors come from')); rows(mc, mp.sources || [], 'sessions', function (x) { return x === 'site' ? 'thatonemap.com' : x === 'maps' ? 'Other map pages' : src(x); }, { limit: 8 }); } body.appendChild(mc); var grid = el('div', 'oms-grid'); var c1 = card('Where visitors come from', 'sessions'); rows(c1, d.sources || [], 'sessions', src, { limit: 8 }); c1.appendChild(el('p', 'oms-sub', 'Pages viewed')); var pg = {}; (d.pages || []).forEach(function (x) { var n = PAGES[x.name] ? x.name : 'other'; pg[n] = (pg[n] || 0) + x.views; }); rows(c1, Object.keys(pg).map(function (k) { return { name: k, views: pg[k] }; }).sort(function (a, b) { return b.views - a.views; }), 'views', function (p) { return PAGES[p] || 'Other pages'; }); c1.appendChild(el('p', 'oms-sub', 'Devices')); rows(c1, d.devices || [], 'visitors', function (s) { return s.charAt(0).toUpperCase() + s.slice(1); }); grid.appendChild(c1); var cf = card('Follow taps by app', 'people · both sites'); var cfl = el('div'); cfl.appendChild(el('p', 'oms-empty', 'Loading…')); cf.appendChild(cfl); fetch(API.replace('get_stats', 'get_follows'), { method: 'POST', headers: { 'apikey': KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ p_key: getKey(), p_days: days, p_offset: off }) }) .then(function (r) { return r.ok ? r.json() : []; }).catch(function () { return []; }) .then(function (list) { cfl.textContent = ''; rows(cfl, (list || []).map(function (x) { return { name: x.app + ' (' + x.taps + ' taps)', people: x.people }; }), 'people', null, { empty: 'No follow taps in this period.' }); }); grid.appendChild(cf); var c2 = card('Countries', 'visitors'); rows(c2, d.countries || [], 'visitors', cname, { flag: true, limit: 12 }); grid.appendChild(c2); var btns = (d.buttons || []).filter(function (b) { return b.kind === 'button_click'; }); var maps = (d.buttons || []).filter(function (b) { return b.kind !== 'button_click'; }); var c3 = card('Buttons tapped'); rows(c3, btns, 'clicks', function (b) { return BUTTONS[b] || b; }, { limit: 10 }); grid.appendChild(c3); var c4 = card('Videos opened on the main site', 'country check, game and last winner links'); rows(c4, maps, 'clicks', null, { limit: 10, empty: 'No map videos opened yet in this period.' }); grid.appendChild(c4); var c5 = card('Votes this period', 'by topic'); rows(c5, d.topic_votes || [], 'votes', function (n) { var tv = (d.topic_votes || []).filter(function (x) { return x.name === n; })[0]; return n + (tv && tv.status && tv.status !== 'approved' ? (tv.status === 'mapped' ? ' (mapped)' : ' (hidden)') : ''); }, { empty: 'No votes yet in this period.' }); grid.appendChild(c5); var c6 = card('Latest suggestions', 'from the site'); var sug = (d.suggested || []).slice().sort(function (a, b) { return (a.status === 'pending' ? 0 : 1) - (b.status === 'pending' ? 0 : 1); }); if (!sug.length) c6.appendChild(el('p', 'oms-empty', 'No new suggestions in this period.')); sug.forEach(function (s) { var r = el('div', 'oms-sug'); r.appendChild(el('span', null, s.title)); var st = { approved: 'On the board', pending: 'Needs review', rejected: 'Hidden', mapped: 'Mapped' }[s.status] || s.status; r.appendChild(el('span', 'oms-pill ' + s.status, st)); c6.appendChild(r); }); grid.appendChild(c6); var gm = d.game || {}; var c7 = card('Daily game'); var fun = el('div', 'oms-funnel'); [[gm.starts, 'started →'], [gm.completes, 'finished']].forEach(function (x) { var pr = el('span'); pr.appendChild(el('b', null, num(x[0]))); pr.appendChild(el('i', null, x[1])); fun.appendChild(pr); }); c7.appendChild(fun); var rate = gm.starts ? Math.round(gm.completes / gm.starts * 100) : 0; c7.appendChild(el('p', 'oms-sub', (gm.starts ? rate + '% finish rate' : 'No games started yet') + (gm.avg_score != null ? ' · average ' + gm.avg_score + ' / 5 correct' : ''))); grid.appendChild(c7); var c8 = card('Shares', 'by place'); rows(c8, d.shares || [], 'shares', function (s) { return SHARES[s] || s.replace(':', ' · '); }, { empty: 'No shares yet in this period.' }); grid.appendChild(c8); body.appendChild(grid); var feedCard = card('Live activity', 'most recent first'); feedCard.style.marginTop = '12px'; var feed = el('div', 'oms-feed'); var prevKey = '', prevRow = null, rep = 1; (d.recent || []).forEach(function (e) { var key = [e.kind, e.page, e.detail, e.country, e.source].join('|'); if (key === prevKey && prevRow) { rep++; prevRow.querySelector('.x').textContent = '×' + rep; return; } prevKey = key; rep = 1; var row = el('div', 'oms-ev'); prevRow = row; var tm = el('time', null, ago(e.at)); tm.dateTime = e.at; tm.title = new Date(e.at).toLocaleString(); row.appendChild(tm); var w = el('div', 'w'); var f = flagImg(e.country); if (f) w.appendChild(f); var what = KIND[e.kind] || e.kind; if (e.kind === 'page_view') what += ' ' + (PAGES[e.page || '#home'] || 'another page'); else if (e.kind === 'button_click') what += ' ' + (BUTTONS[e.detail] || e.detail || 'a button'); else if (e.kind === 'country_view') what += ' ' + cname(e.detail); else if (e.kind === 'game_complete') what += (e.detail ? ', scored ' + e.detail + ' / 5' : ''); else if (e.kind === 'game_start') what = 'Started game' + (e.detail ? ' #' + e.detail : ''); else if (e.kind === 'share_click') what += ' ' + (SHARES[e.detail] || e.detail || ''); else if (e.detail) what += ' ' + e.detail; w.appendChild(el('span', null, what)); if (e.kind === 'page_view' && e.source && e.source !== 'direct') w.appendChild(el('span', 'm', 'from ' + src(e.source))); w.appendChild(el('span', 'm x', '')); row.appendChild(w); feed.appendChild(row); }); if (!feed.childNodes.length) feed.appendChild(el('p', 'oms-empty', 'No activity yet.')); feedCard.appendChild(feed); body.appendChild(feedCard); var foot = el('p', 'oms-foot', 'Updates every 30 seconds while this page is open. '); var lock = el('button', null, 'Lock this device'); lock.type = 'button'; lock.addEventListener('click', function () { setKey(''); gate(); }); foot.appendChild(lock); body.appendChild(foot); } var fails = 0, retryT = null; document.addEventListener('visibilitychange', function () { if (!document.hidden && location.hash === '#stats' && getKey()) load(false); }); function load(showSpinner) { var k = getKey(); if (!k) { gate(); return; } if (showSpinner) status('Loading', true); fetch(API, { method: 'POST', headers: { 'apikey': KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ p_key: k, p_days: days, p_offset: off }) }) .then(function (r) { return r.json().then(function (j) { if (!r.ok) throw new Error(j && j.message || 'error'); return j; }); }) .then(function (d) { fails = 0; clearTimeout(retryT); setOwner(); try { render(d); } catch (re) { status('Display error: ' + String(re && re.message || re).slice(0, 80), false); return; } lastAt = Date.now(); status('Live · updated ' + stamp(), true); clearInterval(timer); timer = setInterval(function () { if (location.hash === '#stats') load(false); }, 30000); }) .catch(function (e) { if (/key/.test(e.message)) { setKey(''); gate('That key didn’t work. Check it and try again.'); } else { fails++; var wait = Math.min(30, 3 * fails); status((lastAt ? 'Couldn’t refresh · showing ' + stamp() + ' data' : 'Can’t reach the stats') + ' · retrying in ' + wait + 's', false); clearTimeout(retryT); retryT = setTimeout(function () { if (location.hash === '#stats') load(!lastAt); }, wait * 1000); } }); } setInterval(function () { if (lastAt && !dot.classList.contains('off')) status('Live · updated ' + stamp() + ' · ' + ago(new Date(lastAt).toISOString()), true); }, 10000); try { days = +localStorage.getItem('om_dash_days') || 7; } catch (e) {} try { off = +localStorage.getItem('om_dash_off') || 0; } catch (e) {} if ([1, 7, 30, 365].indexOf(days) < 0) days = 7; if (days !== 1) off = 0; function maybeStart() { if (location.hash === '#stats' && !lastAt) load(true); } window.addEventListener('hashchange', maybeStart); maybeStart(); })();