Code Monkey home page Code Monkey logo

raphaellayer's Introduction

RaphaelLayer

RaphaelLayer is the combination of Leaflet and Raphael to allow a Raphael's paper object to overlay a Leaflet's map object.

Why? Leaflet already has an SVG layer.

Raphael is great for handling SVG animations. Leaflet is great for custom mapping. By combining Raphael's animations with Leaflet's mapping, you can produce some powerful visualisations.

Leaflet's Path SVG layer is good, however it is difficult to do advanced animations with it.

Dependencies

RaphaelLayer has two dependencies:

  1. Raphael
  2. Leaflet

Using

If you don't need to modify/build any changes into RaphaelLayer, just download and include the dist/rlayer.js.

We've followed the naming convention of Leaflet by using the prefix R.. For example, to use RaphaelLayer's Marker just add a new layer as you would normally:

map.addLayer(new R.Marker(latlng));

To modify the marker's attributes, such as fill, stroke etc, just pass regular Raphael style attributes through like this:

map.addLayer(new R.Marker(latlng, {'fill': '#fff', 'stroke': '#000'));

Examples

There are some examples in the debug folder.

Building

The build system borrows the same method from Leaflet and is powered by Node.js, Jake, JSHint and UglifyJS. The easiest way to install it:

  1. Download and install Node
  2. Run the following commands in the command line:
npm install

Once this has completed, just run jake inside the RaphaelLayer directory. This will check the source files for Javascript errors and inconsistencies, and then combine and compress it to the dist folder.

raphaellayer's People

Contributors

dbhowell avatar

Stargazers

 avatar

Watchers

 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.