vector tile render on the client using cartodb
JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 13 commits behind Vizzuality:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
README.md
canvas_tile_layer.js
cartodb_vector.js
cartoshader.js
example.html
example2.html
example_editable.html
example_shader.html
gmaps_mercator.js
tyler.html
world_shader.html

README.md

cartodb vector render on canvas with css support

this code tries to show how to render vector tiles on HTML5 canvas over google maps with some css. The style is applied on client side so you don't need mapnik on the server side.

take it as a prototype: there is no error checking, no performance/memory optimization... you know, enjoy.

This demo uses cartodb as tile server

** demo **

http://javisantana.github.com/cartodb_tile_render/example.html

** quickstart **

    map = new google.maps.Map(document.getElementById('map_canvas'),
            mapOptions);

    var cartodb = new CartoDB({
            user: 'jatorre',
            table: 'ny_districts',
            columns: ['num_stops_normalized'],
            css: "{ $c: Math.min(255, 255*$num_stops_normalized/10.0).toFixed(0); polygon-fill: rgb($c, $c, $c); line-color: #F0F; }"
    });

    map.overlayMapTypes.insertAt(0, cartodb.layer);