1001Ferramentas
🗺️Utilities

OpenStreetMap Embed Builder

Builds an OpenStreetMap <iframe> from a bounding box (lat/lng) and optional marker.



  

OpenStreetMap iframe without an API key

All you want is a small map on the contact page showing where the office is, and the Google route asks for an API key, a billing card and a pile of terms to accept. OpenStreetMap does it with a plain iframe and no account at all, but it wants a bounding box rather than an address, and that is exactly where most people stall.

The bounding box is the visible rectangle, written as left, bottom, right, top: minimum longitude, minimum latitude, maximum longitude, maximum latitude. Note the trap: longitude comes first there, while the marker field takes latitude first. In the defaults, the box reads -46.66,-23.57,-46.64,-23.56 and the marker reads -23.5614,-46.6559, both pointing at central Sao Paulo.

A tighter box means more zoom. Leave the marker field empty and the pin parameter drops out of the URL. The iframe comes out on the standard OSM layer; for another one, append layer=cyclemap to the copied address. Adding loading=lazy is worth it, and so is a View larger map link beside the frame, which is what openstreetmap.org puts under its own embed. Nothing leaves your browser while you build it.

Frequently asked questions

How do I find the bounding box for my area?
On openstreetmap.org, frame the spot, open Share and pick HTML. The bbox= part of the suggested snippet hands you the four numbers.
Do I need an API key or an account?
No. The OpenStreetMap embed is open. For heavy traffic the project asks that you run your own tile server or use a commercial provider.
Can I change the map style?
The generated code uses the default layer. Append layer=cyclemap or layer=transportmap to the iframe address after copying.

Related Tools