I am working on a map that i'd like to toggle 1 layer off/on. I followed this http://academy.cartodb.com/courses/03-cartodbjs-ground-up/lesson-2.html tutorial and it worked fine(w/ their data) and i started to add my own to it. My data worked fine w/ their base map but i'd like to use my original base map from the cartodb UI (Nokia Satellite Day) but i'm not sure how to get that done, here's the current working state of the code. My attempt causes the button to stop working..
Lesson 2 | CartoDB.js | CartoDB html, body { height: 100%; padding: 0; margin: 0; } #map { height: 70%; padding: 0; margin: 0; } #dashboard { height: 30%; padding: 25px; margin: 0; border-top: 5px solid #333; } #dash { margin: 25px 0; width: 400px; } button { margin-right: 10px; font-family: "Proxima Nova W01", "Helvetica Neue", Helvetica, Arial, sans-serif; background: transparent; } p { font-size: 17px; margin-bottom: 10px; }
testing...
Layer controls
Areas of Interest
I tried adding:
var vizjson_url = 'https://shane-mccoy-design.cartodb.com/api/v2/viz/40df9536-ef52-11e4-af32-0e0c41326911/viz.json'; cartodb.createVis('map', vizjson_url) below the window onload function,
window.onload = function() { var vizjson_url = 'https://shane-mccoy-design.cartodb.com/api/v2/viz/40df9536-ef52-11e4-af32-0e0c41326911/viz.json'; cartodb.createVis('map', vizjson_url) // Instantiate new map object, place it in 'map' elementvar map_object = new L.Map('map', { center: [26.512424, -77.140892], // Bahamas zoom: 10 }); which gets the base map but causes the button to not work. I'm not great w/ javascript so i feel i'm missing something simple. i've searched around and can't quite figure it out. any help would be great!!
أكثر...
Lesson 2 | CartoDB.js | CartoDB html, body { height: 100%; padding: 0; margin: 0; } #map { height: 70%; padding: 0; margin: 0; } #dashboard { height: 30%; padding: 25px; margin: 0; border-top: 5px solid #333; } #dash { margin: 25px 0; width: 400px; } button { margin-right: 10px; font-family: "Proxima Nova W01", "Helvetica Neue", Helvetica, Arial, sans-serif; background: transparent; } p { font-size: 17px; margin-bottom: 10px; }
testing...
Layer controls
Areas of Interest
I tried adding:
var vizjson_url = 'https://shane-mccoy-design.cartodb.com/api/v2/viz/40df9536-ef52-11e4-af32-0e0c41326911/viz.json'; cartodb.createVis('map', vizjson_url) below the window onload function,
window.onload = function() { var vizjson_url = 'https://shane-mccoy-design.cartodb.com/api/v2/viz/40df9536-ef52-11e4-af32-0e0c41326911/viz.json'; cartodb.createVis('map', vizjson_url) // Instantiate new map object, place it in 'map' elementvar map_object = new L.Map('map', { center: [26.512424, -77.140892], // Bahamas zoom: 10 }); which gets the base map but causes the button to not work. I'm not great w/ javascript so i feel i'm missing something simple. i've searched around and can't quite figure it out. any help would be great!!
أكثر...