1. Reference
  2. Media

<map>

An OpenStreetMap map you can pan and zoom, centered on a place, with pins on it.

Media

This tag needs a map tile service, so try it on your phone.

map.ham
<map lat="51.5074"
     lng="-0.1278"
     zoom="13"
     height="320"
     style="rounded-xl">
    <pin lat="51.5081"
         lng="-0.0759"
         label="Tower of London"/>
    <pin lat="51.5007"
         lng="-0.1246"
         label="Big Ben"
         color="blue"/>
</map>
The snippet drawn by Hype Apps on a phone, in light mode The snippet drawn by Hype Apps on a phone, in dark mode
This snippet as Hype Apps draws it on a phone. It follows this page's light or dark theme.

Attributes

NameWhat it doesDefault
attribution Show tile attribution
boolean
true
attribution-text Custom attribution text
string
height Explicit height (fills parent if null)
number
interactive Enable pan/zoom gestures
boolean
true
lat
also latitude
Center latitude
number
0.0
lng
also longitude
Center longitude
number
0.0
markers JSON marker array (merged with <pin> children)
string
tile-url Custom tile URL template
string
type Map type
standard, satellite, terrain
standard
user-agent App identifier for tile servers
string
com.hypeapps.map
zoom Zoom level (2-18)
number
13.0

Readings

NameWhat it does
lat The latitude at the center, after the person pans.
lng The longitude at the center.
zoom The zoom level.

Any tag also takes gestures: @on.tap, @on.longpress, @on.doubletap and @on.swipeleft (and right, up and down). @click runs on a tap too.

This page is also Markdown, and all of HAM is in llms.txt.