# <map>

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

Category: Media.

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

```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>
```

How Hype Apps draws it on a phone: [light](https://hypeapps.dev/img/tags/map-light.webp), [dark](https://hypeapps.dev/img/tags/map-dark.webp).

## Attributes

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

## Readings

| Name | What 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.

## Related tags

- [`<pin>`](https://hypeapps.dev/docs/reference/pin.md): A marker on a map at a latitude and longitude, in a color, with a label.
- [`<audio>`](https://hypeapps.dev/docs/reference/audio.md): A compact audio player bar with play, a progress track and the track's title and artist.
- [`<camera>`](https://hypeapps.dev/docs/reference/camera.md): A live camera viewfinder with a shutter; the photo's path goes into a variable.
- [`<canvas>`](https://hypeapps.dev/docs/reference/canvas.md): A drawing surface for finger or stylus, with a pen, eraser and color toolbar; it saves as a PNG.
- [`<file-picker>`](https://hypeapps.dev/docs/reference/file-picker.md): Opens the device's photo, video or file picker (or the camera) and puts the chosen file in a variable.
- [`<img>`](https://hypeapps.dev/docs/reference/img.md): Shows a picture from a URL or the app's files, sized and cropped by its style.
- [`<layer>`](https://hypeapps.dev/docs/reference/layer.md): Declares one layer of a drawing surface: a locked picture to trace over, and a layer to paint on.
- [`<lottie>`](https://hypeapps.dev/docs/reference/lottie.md): Plays a Lottie vector animation from a JSON file; taps and media commands control it.

All tags: https://hypeapps.dev/docs/reference.md · The full reference: https://hypeapps.dev/llms.txt
