Skip to main content
All CollectionsCapra content creation
Embed code troubleshooting
Embed code troubleshooting

Tips to get Capra embed codes working smoothly

Henry Talbot avatar
Written by Henry Talbot
Updated over a year ago

Capra maps can be loaded into <iframe> elements for embedding on websites. This is usually done by pasting in embed code into a Code or Embed block in website content management systems.

Given the massive variety in website content management systems out there you may bump into a couple of stumbling blocks when first embedding. Here's an example of the embed code for the Spit to Manly track in Sydney.

<iframe src="https://my.capra.app/embeded/route?routeId=2tlDGYhJYyoiYVVyHFt9&lat=-33.8049&log=151.2662&unit=metric&hiddenInfo=true" style=" min-width: 300px; background: transparent !important; overflow: hidden !important; margin: 0px !important; padding: 0px !important; border: none !important; width: 100% !important; display: block !important; min-height: 300px; height: 100%; user-select: none !important;" frameborder="0" />

You'll see in the code above that height and width of the map are set to 100% of the container size into which you're pasting the code. Commonly this means you may need to manually adjust the height and width of the container. This can be done in your CMS if you have the option, or you can manually edit the code.

If it suits your website use 1280 wide x 750px high dimensions.

Here's an example of a Squarespace website where the dimensions had to be changed manually in the code block.

Capra embeds on Squarespace websites

Mobile screen sizes

Remember, if a user looks at the web page that has a Capra map on their mobile device they will automatically get a message providing the option to open the map directly in the Capra app. When you are adding website embed code the default embed block may be sized to trigger this mobile screen size message so you need to enlarge the block size.

Capra maps mobile screen size message for website visitors

Something to be aware of. One of our customers had to remove this dash to stop the code causing issues on their page.

Adding rounded corners to the embed

If you want rounded corners for your embed add the following code after border: none; in the embed code

border-radius: 10px;

Map distance/elevation units of measure

Embed maps can be set to show in imperial or metric units of measure.

Did this answer your question?