All Projects → miguelcobain → Ember Leaflet

miguelcobain / Ember Leaflet

Licence: mit
🔥 🍃 Easy and declarative mapping for ember

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ember Leaflet

Offlinemap
基于MySQL + Node.js + Leaflet的离线地图展示,支持百度、谷歌、高德、腾讯地图
Stars: ✭ 343 (+70.65%)
Mutual labels:  maps, leaflet
Agentmaps
Make social simulations on interactive maps with Javascript! Agent-based modeling for the web.
Stars: ✭ 822 (+308.96%)
Mutual labels:  maps, leaflet
Prunecluster
Fast and realtime marker clustering for Leaflet
Stars: ✭ 473 (+135.32%)
Mutual labels:  maps, leaflet
roataway-web
Roataway web site
Stars: ✭ 15 (-92.54%)
Mutual labels:  maps, leaflet
Khartis
Khartis - thematic mapping
Stars: ✭ 49 (-75.62%)
Mutual labels:  maps, ember
Ui Leaflet
AngularJS directive to embed an interact with maps managed by Leaflet library
Stars: ✭ 315 (+56.72%)
Mutual labels:  maps, leaflet
Leaflet Dvf
Leaflet Data Visualization Framework
Stars: ✭ 678 (+237.31%)
Mutual labels:  maps, leaflet
vaguely-rude-places
The map of Vaguely Rude Place Names
Stars: ✭ 19 (-90.55%)
Mutual labels:  maps, leaflet
Ngx.leaflet.component
angular 2+ / leaflet 1.x component collection
Stars: ✭ 46 (-77.11%)
Mutual labels:  maps, leaflet
Mapboard
A framework for data-rich web mapping 🌎📊✨
Stars: ✭ 29 (-85.57%)
Mutual labels:  maps, leaflet
o.map
Open Street Map app - KaiOS
Stars: ✭ 51 (-74.63%)
Mutual labels:  maps, leaflet
Making Maps With React
🌐 Example React components for React-Leaflet, Pigeon Maps, React MapGL and more
Stars: ✭ 66 (-67.16%)
Mutual labels:  maps, leaflet
mapus
A map tool with real-time collaboration 🗺️
Stars: ✭ 2,687 (+1236.82%)
Mutual labels:  maps, leaflet
Leaflet.timedimension
Add time dimension capabilities on a Leaflet map.
Stars: ✭ 329 (+63.68%)
Mutual labels:  maps, leaflet
crisis-news-mapper
日本の災害関連ニュースをTwitterから収集して地図上にマッピングするFirebaseプロジェクト crisis.yuiseki.net
Stars: ✭ 13 (-93.53%)
Mutual labels:  maps, leaflet
Django Leaflet
Use Leaflet in your Django projects
Stars: ✭ 563 (+180.1%)
Mutual labels:  maps, leaflet
leaflet.minichart
Leaflet.minichart is a leaflet plugin for adding to a leaflet map small animated charts
Stars: ✭ 27 (-86.57%)
Mutual labels:  maps, leaflet
leaflet-draw-toolbar
Leaflet.toolbar for Leaflet.draw. Example: https://justinmanley.github.io/leaflet-draw-toolbar/examples/popup.html.
Stars: ✭ 55 (-72.64%)
Mutual labels:  maps, leaflet
Leaflet
🍃 JavaScript library for mobile-friendly interactive maps
Stars: ✭ 32,591 (+16114.43%)
Mutual labels:  maps, leaflet
Leaflet Swoopy
⤵️ Swoopy Arrow Plugin for Leaflet
Stars: ✭ 52 (-74.13%)
Mutual labels:  maps, leaflet

ember-leaflet CI Ember Observer Score npm version

Ember-Leaflet aims to make working with Leaflet layers in your Ember app as easy, declarative and composable as templates make working with DOM.

Installation

Ember Leaflet works in Ember 3.16+ with no deprecations.

To install it run:

ember install ember-leaflet

This will also add the leaflet package to your project.

ember-leaflet is compatible with leaflet 0.7+. If you need to use a legacy version, you can just install it via npm / yarn:

npm install --save-dev [email protected]
yarn add -D [email protected]

Support, Questions, Collaboration

Discord Join Ember on Discord

Usage

Documentation and examples are hosted at https://miguelcobain.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:

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

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

Linting

  • npm run lint:js
  • npm run lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].