Embeds
An embed puts one of your maps inside a page on your own site. Your site carries a short snippet; everything else, including the basemap, loads from Sarkoa. There is no DNS setup, nothing to install, and no build step.
Getting the snippet
- Build the map. Its layers do not need to be public: a public map shows every layer on it to your visitors, without that alone granting permission to download the source files.
- Set the map's access to public, and check the list of layers it will show.
- On the Custom Maps page, open the map's menu and choose Copy embed code.
Paste that into your page. It is an iframe, so it works in a CMS block, a static site, a React component, or a plain HTML file.
From a script or an agent, ask for the snippet rather than assembling it:
sarkoa map embed MAP_ID --height 520 --title "Site survey, March 2026"
sarkoa map embed MAP_ID --url-only
MCP exposes the same thing as get_embed_code, which also warns you when the map is not public yet.
<iframe
src="https://maps.sarkoa.com/map/embed/<map-id>"
width="100%"
height="520"
style="border:0"
loading="lazy"
allow="fullscreen; clipboard-write; geolocation"
title="Site survey, March 2026"
></iframe>
Two things to set yourself, because they depend on your page rather than on the map:
- A
title. Screen readers announce it, and an untitled iframe is announced as nothing useful. loading="lazy"if the map is below the fold. A map is a real application, and there is no reason to boot it before someone scrolls to it.
Keep the allow attribute. It lets visitors copy links and coordinates from inside the map, and lets the locate button ask for their position. The browser shows that request as coming from your site, and the map only asks when someone presses the button. Without the attribute the map still works, though some browsers block copying inside it and the locate button cannot find anyone.
Leave the rest of the URL alone. The embed path is /map/embed/<map-id>. A bare maps.sarkoa.com/<map-id> is the address for sharing a map, not for embedding one: it opens the full map page, header and comments included, which crowds a frame on your page.
Embed a map in WordPress
- Edit the WordPress page where you want the map. Open the block inserter (+), search for Custom HTML and select the block.
- Choose Edit HTML. In the HTML tab, paste the complete iframe from Copy embed code, then choose Update.
- Add a link to the full map beside the block so visitors can open it on its own. Publish the page, or save your changes to an existing page.
- Open the published page in a private browser window. Check that the map fits on a phone and that you can open Layers and toggle a layer.
This workflow was tested on self-hosted WordPress 7.1.4 using a single-site administrator account. WordPress can remove an iframe when the person saving the page lacks the unfiltered_html permission. If the map disappears after publishing, ask your site administrator to check that permission. WordPress Custom HTML block documentation
Sizing
Give the iframe a height. An iframe with no height collapses to almost nothing, which is the most common reason an embed looks broken on first paste.
For a fixed banner, a pixel height is fine. For a responsive block, wrap it in an element with an aspect ratio:
<div style="position:relative;aspect-ratio:16/9">
<iframe
src="https://maps.sarkoa.com/map/embed/<map-id>"
style="position:absolute;inset:0;width:100%;height:100%;border:0"
loading="lazy"
allow="fullscreen; clipboard-write; geolocation"
title="Site survey, March 2026"
></iframe>
</div>
On phones, a 16:9 map is short. Something nearer 4:3 or 1:1 usually reads better on a narrow screen.
What visitors can do
By default an embedded map pans, zooms, and shows the legend and layer list you configured. Visitors do not need a Sarkoa account and are never asked to sign in.
What they see is what you set in the map builder: the opening camera position, zoom limits, pan bounds, and whether the layers panel and legend start open. If an embed opens somewhere unexpected, that is the map's default view, not the embed.
Filters you added to the map work inside the embed too, which is what makes an embedded map worth more than a screenshot.
Right-clicking the map, or pressing and holding it on a phone, opens a small menu at that spot. Inside an embed it offers the spot's coordinates, the values of any measurement or categorical rasters drawn there, a link to the spot on the full map, Open full map (or Open in Sarkoa on maps with Sarkoa branding), which opens the whole map in a new tab at the same spot, and a measure tool for distances and areas. Comments are not part of an embed. The rows are described in Map menu and measuring.
If your page puts the iframe in a sandbox, include allow-popups in it. Without it the browser silently refuses to open Open full map, and nothing inside the frame can tell that it happened.
To open the embed on one feature, add its popup link to the iframe URL: https://maps.sarkoa.com/map/embed/<map-id>?popup=layer-cities/Toronto. The quickest way to get the value is to open the popup on the hosted map and copy it from the address bar. Add t=2020-01-01 as well to open a time slider on that date, or pin=-75.69721,45.42153 (longitude first) to mark a spot with a pin. The embed reads these but never changes its own URL.
If the map has a tour, your page can drive it as the reader scrolls: send {type: 'sarkoa:tour', action: 'goToStop', stop: n} to the iframe with postMessage, and the map flies to that stop.
Branding
- Free: the map carries Sarkoa attribution.
- Community: add your own theme, accent colour, and attribution alongside Sarkoa's.
- Essential: white-label embeds, with Sarkoa branding removed.
On the Pro plan, your organization can serve published maps on its own HTTPS hostname. In your profile, open Domains, add the hostname under Custom map domains, and copy the DNS records to your DNS provider. Once the hostname and certificate are active, select the published maps to serve there. You can also embed a Sarkoa-hosted map on your website.
Cost
Every tile an embed loads counts against the organization that hosts the data, which is yours. Visitors are never billed.
That matters most when the same map is embedded across many pages, or when a page auto-refreshes. Both raise tile volume without raising visitor count. See Tile requests for how to estimate the traffic, and the Fair Use Policy for the guidelines on paid unlimited plans.
Updating a published embed
Edit the map and the change is live. The snippet on your site points at the map, not at a copy of it, so you never re-paste anything.
The same is true of the data. Replacing a file updates every map and every embed that uses it.
When it does not work
The map is blank. Its access is probably still set to organization. Set it to public.
The frame shows the full map page, with its header. The URL is a bare map id rather than /map/embed/<map-id>. Older snippets copied from the Custom Maps page use that form. They still show your map; copy the snippet again from the app, sarkoa map embed, or get_embed_code to get the compact embed. Until you do, visitors can still read the map's comments in that frame, and choosing Sign in opens the full map in a new tab, because a sign-in cannot stick inside another site's frame.
Some layers are missing. A public map shows every layer on it to visitors, whatever each file's own access, so the files do not need to be public. Check that the layer is not set to hidden in the map, that its file has finished processing, and that the file belongs to the same organization as the map, since a file from another organization is not shown to visitors. See Sharing and access.
The iframe is a thin strip. No height is set. See Sizing above.
It works for you but not for a colleague. You are signed in and they are not. Open the embed URL in a private window to see what a visitor sees.
Related
- Custom maps: building the map first
- Sharing and access: who can open a map and what a public map shows
- Map menu and measuring: the right-click menu visitors get inside the embed
- Tile requests: what an embed costs
- Troubleshooting: other things that go wrong