| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Basemap Example</title> | |
| <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
| <link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" /> | |
| <link rel="stylesheet" href="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/themes/css/cartodb.css" /> | |
| <style> | |
| html, body, #map { | |
| height: 100%; | |
| padding: 0; | |
| margin: 0; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div id="map"></div> | |
| <script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/cartodb.js"></script> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
| <script> | |
| function main() { | |
| var map = L.map('map', { | |
| center: [40.742216, -74.20655], | |
| zoom: 11, | |
| zoomControl: true | |
| }); | |
| L.tileLayer('http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png', { | |
| attribution: 'Stamen' | |
| }).addTo(map); | |
| cartodb.createLayer(map, 'https://team.cartodb.com/u/chandra/api/v2/viz/fd5891d6-7db4-11e5-84fe-0e31c9be1b51/viz.json') | |
| .addTo(map) | |
| .on('done', function(layer) { | |
| }).on('error', function() { | |
| console.log("some error occurred"); | |
| }); | |
| } | |
| window.onload = main; | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment