# ember-leaflet

> Easy and declarative mapping for ember.

Latest version **6.0.0** (published 2026-08-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-leaflet
pnpm add ember-leaflet
yarn add ember-leaflet
bun add ember-leaflet
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2026-08-14 |
| First published | 2015-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 22 \|\| 24 \|\| >= 26 |
| Dependencies | 12 |
| Unpacked size | 113.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 210 |
| Author | Miguel Andrade <jmandrade0@gmail.com> |
| Maintainers | melsumner, jelhan, knownasilya, miguelcobain |
| Keywords | ember-addon, leaflet, ember, ember-leaflet, mapping, maps |

## Links

- npm: https://www.npmjs.com/package/ember-leaflet
- Repository: https://github.com/adopted-ember-addons/ember-leaflet
- Homepage: https://adopted-ember-addons.github.io/ember-leaflet/
- npm.io page: https://npm.io/package/ember-leaflet

## Dependencies (12)

- [resolve](https://npm.io/package/resolve.md) ^1.21.0
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.29.0
- [broccoli-funnel](https://npm.io/package/broccoli-funnel.md) ^3.0.8
- [ember-cli-babel](https://npm.io/package/ember-cli-babel.md) ^8.3.1
- [ember-auto-import](https://npm.io/package/ember-auto-import.md) ^2.13.1
- [ember-cli-htmlbars](https://npm.io/package/ember-cli-htmlbars.md) ^7.0.1
- [fastboot-transform](https://npm.io/package/fastboot-transform.md) ^0.1.3
- [broccoli-merge-trees](https://npm.io/package/broccoli-merge-trees.md) ^4.2.0
- [ember-render-helpers](https://npm.io/package/ember-render-helpers.md) ^0.2.1 || ^1.0.0 || ^3.0.0
- [ember-template-imports](https://npm.io/package/ember-template-imports.md) ^4.4.0
- [ember-composability-tools](https://npm.io/package/ember-composability-tools.md) ^2.0.0
- [@babel/plugin-transform-class-static-block](https://npm.io/package/@babel/plugin-transform-class-static-block.md) ^7.29.7

## Recent versions

- 6.0.0 (latest) — 2026-08-14
- 5.0.0-beta.4 (beta) — 2021-04-01
- 5.1.3 — 2023-09-12
- 5.1.2 — 2023-09-11
- 5.1.1 — 2023-04-24
- 5.1.0 — 2023-04-24
- 5.0.2 — 2022-12-13
- 5.0.1 — 2022-04-08
- 5.0.0 — 2021-10-17
- 5.0.0-beta.7 — 2021-09-09
- 5.0.0-beta.6 — 2021-09-09
- 5.0.0-beta.5 — 2021-09-09
- 5.0.0-beta.3 — 2021-01-24
- 5.0.0-beta.2 — 2021-01-24
- 5.0.0-beta.1 — 2021-01-23
- … 57 more at https://npm.io/package/ember-leaflet/versions

## README

# ember-leaflet [![CI](https://github.com/adopted-ember-addons/ember-leaflet/workflows/CI/badge.svg)](https://github.com/adopted-ember-addons/ember-leaflet/actions?query=workflow%3ACI) [![Ember Observer Score](http://emberobserver.com/badges/ember-leaflet.svg)](http://emberobserver.com/addons/ember-leaflet) [![npm version](https://badge.fury.io/js/ember-leaflet.svg)](https://badge.fury.io/js/ember-leaflet)

## Compatibility

- Ember.js v4.12 or above
- Ember CLI v4.12 or above
- Leaflet v1
- Node.js v22 or above

## Installation

To install Ember Leaflet run:

```
ember install ember-leaflet
```

This will also add the `leaflet` package to your project.

## Support, Questions, Collaboration

![Discord](https://img.shields.io/discord/480462759797063690.svg?logo=discord) Join Ember on [Discord](https://discord.gg/zT3asNS)

## Usage

Documentation and examples are hosted at [https://adopted-ember-addons.github.io/ember-leaflet/](https://adopted-ember-addons.github.io/ember-leaflet/).
Please file any issues if you see that something can be improved.

#### Production Builds

In your `ember-cli-build.js` add the following snippet:

```js
let app = new EmberApp(defaults, {
  // Add options here
  fingerprint: {
    exclude: [
      'images/layers-2x.png',
      'images/layers.png',
      'images/marker-icon-2x.png',
      'images/marker-icon.png',
      'images/marker-shadow.png'
    ]
  }
});
```

ember-cli does fingerprinting (appending an md5 checksum to the end of every file) for production builds by default (http://ember-cli.com/user-guide/#fingerprinting-and-cdn-urls). Exclude the leaflet assets so that your production build produces them correctly.

## Overview

Web apps frequently need to display geographic data, especially if it has a direct relationship with the real world. That isn't new, and has been done previously in all kinds of formats, particularly with raster and vector data.

Ember apps naturally may have the same requirements and until now, devs have been either using mapping libraries outside of ember scope, or using previous versions of ember-leaflet.

The problem was that both approaches were hard. Frequently existing libraries have regular javascript imperative APIs and html in mind. We all know and love how ember makes us flow the data in our app. Previous approaches simply didn't fit where ember really shines: templates, actions, routing, and above all, expressiveness.

**Ember-leaflet allows you to express your maps right in your templates.** Also, it is streamlined for ember in general. You have things like actions, components and the ability to use regular handlebars helpers like `{{#if` or `{{#each`.

We can't go wrong with delegating the mapping part to the battle tested, performant and lightweight [Leaflet](http://leafletjs.com/) library.

So, let the mapping begin.

## Examples

Think of your map as a set of layers inside a container. Your main container will be the `<LeafletMap>` component. This component creates the map container where your tiles, vectors and markers will be added to. Let's see an example of how it looks:

```hbs
<LeafletMap @lat={{this.lat}} @lng={{this.lng}} @zoom={{this.zoom}} as |layers|>

  <layers.tile @url='http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png' />

  <layers.marker @location={{this.emberConfLocation}} as |marker|>
    <marker.popup>
      <h3>The Oregon Convention Center</h3>
      777 NE Martin Luther King Jr Blvd<br />
      Portland, OR 97232
    </marker.popup>
  </layers.marker>

  <layers.marker @location={{this.hotel}} as |marker|>
    <marker.popup>
      <h3>Hotel</h3>
    </marker.popup>
  </layers.marker>

</LeafletMap>
```

## Contributing

See the [Contributing](CONTRIBUTING.md) guide for details.

## License

This project is licensed under the [MIT License](LICENSE.md).

---
_Source: https://npm.io/package/ember-leaflet · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
