GithubHelp home page GithubHelp logo

willcode2surf / ember-leaflet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gabesmed/ember-leaflet

0.0 2.0 0.0 2.37 MB

Ember + Leaflet = Fun with maps

Home Page: gabesmed.github.io/ember-leaflet

License: MIT License

ember-leaflet's Introduction

Ember + Leaflet = Fun with maps! Build Status

EmberLeaflet aims to make working with Leaflet layers in your Ember app as easy, declarative and composable as Ember's View classes make working with DOM elements.

Wherever possible, the design is analogous to Ember's View, CollectionView and ContainerView architecture. EmberLeaflet provides functionality for maps, tile layers, markers, polylines and geometry, and popups. It provides hooks wherever possible for easy extensibility into more custom Leaflet behavior.

Resources:

Usage

Creating a map is just one line of code!

App.AMapView = EmberLeaflet.MapView.extend({});

Create layers and bind content declaratively in idiomatic Ember.

App.AnotherMapView = EmberLeaflet.MapView.extend({
    childLayers: [
        App.TileLayer,
        EmberLeaflet.MarkerCollectionLayer.extend({
            contentBinding: 'controller'
        })]
});

Handle events by adding functions: listeners are added and removed automatically.

App.MarkerLayer = EmberLeaflet.MarkerLayer.extend({
    click: function(e) { alert('hi!'); },
    dblclick: function(e) { alert('hi again!'); }
});

Functionality is added to classes with mixins.

App.DraggableMarker = EmberLeaflet.MarkerLayer.extend(
    EmberLeaflet.DraggableMixin, {});

More examples at gabesmed.github.io/ember-leaflet

Roadmap

  • Better documentation
  • EmberLeaflet.GeojsonLayer for automatic parsing of geojson.
  • popupViewClass for including Ember Views in popups.
  • Icon and DivIcon classes for easy bindings to icon properties like className and innerHTML.

PRs welcome! To contribute, get in touch with @gabesmed.

Build It

  1. git clone https://github.com/gabesmed/ember-leaflet.git
  2. bundle
  3. bundle exec rake dist
  4. cp dist/modules/ember-leaflet.js myapp/

Running unit tests

Run bundle exec rackup and open http://localhost:9292 in a browser.

Thanks

  • Thanks to the contributors to emberjs/list-view, from whom I cribbed this project skeleton.
  • Thanks to everyone who makes Ember a joy to work with!
  • Thanks to the makers of Leaflet, hooray for maps!

Install notes

For linux installs, the most common missing dependencies are libsxlt-dev, libxml2-dev, and ruby1.9.1-dev or ruby1.8-dev. If something goes wrong, first make sure you have these installed.

ember-leaflet's People

Contributors

gabesmed avatar miguelcobain avatar nickiaconis avatar wuher avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.