Popularity
4.1
Stable
Activity
0.0
Stable
1,524
87
237

Description

This project is not maintained anymore. The original author decided to move on with his life.

Here are a few reasons why I stopped working on kartograph.js:

Monthly Downloads: 0
Programming language: CoffeeScript
License: GNU Lesser General Public License v3.0 only
Tags: Maps     SVG     Raphael     Map    
Latest version: v0.8.7

kartograph.js alternatives and similar libraries

Based on the "Maps" category.
Alternatively, view kartograph.js alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of kartograph.js or a related project?

Add another 'Maps' Library

README

This project is not maintained anymore.

Here are a few reasons why I stopped working on kartograph.js:

  • there's no need to support non-SVG browsers anymore, so if I would touch kartograph.js again I would through out the Raphael.js dependency, which would result in a complete re-write which I don't want to spend my time on, because...
  • d3.js is an amazing library that can do all the vector mapping that you need! Also d3.js has much more map projections and is more fun to work with.
  • Finally, TopoJSON beats SVG as vector geo data format.

So, thanks for the good time we had!

Of course, if you still want to take over from here, kartograph.js is all yours. Just send me an email.


Kartograph.js

Kartograph.js is a JavaScript library that renders SVG maps in web browsers. It is built on top of jQuery and RaphaelJS. Please have a look at the API docs for more details.

Initializing a new map

map = $K.map('#map', 600, 400);
map.loadMap('world.svg', function() {
    map.addLayer('countries', {
        styles: {
            fill: '#ee9900'
        },
        title: function(d) {
            return d.countryName;
        }
    });
});

Choropleth maps (aka coloring map polygons based on data):

pop_density = { 'USA': 123455, 'CAN': 232323, ... };

colorscale = new chroma.ColorScale({
    colors: chroma.brewer.YlOrRd,
    limits: chroma.limits(chroma.analyze(pop_density), 'k-means', 9)
});

map.getLayer('countries').style('fill', function(data) {
    return colorscale.get(pop_density[data.iso]);
});

Adding symbols is easy, too:

cities = [{ lat: 43, lon: -75, label: 'New York', population: 19465197 }];

map.addSymbols({
    data: cities,
    location: function(d) {
        return [d.lon, d.lat];
    },
    type: Kartograph.Bubble,
    radius: function(d) {
        return Math.sqrt(d.population) * 0.001;
    }
})

Author

Kartograph was created by Gregor Aisch. It is supported by Piwik Web Analytics and the Open Knowledge Foundation.

License

Kartograph.js is licensed under LGPL


*Note that all licence references and agreements mentioned in the kartograph.js README section above are relevant to that project's source code only.