1

I tried to make a map with selectable layers using the tutorial at http://developers.cartodb.com/tutorials/toggle_map_view.html, but was not successful. I really like this map by the LA Times http://graphics.latimes.com/responsivemap-pollution-burdens/ with selectable layers. I tried working off from this http://bl.ocks.org/andrewxhill/10506396, but when I load my map it appears with just the buttons and a black basemap (nothing displayed). My attempt is here https://dl.dropboxusercontent.com/u/253185126/index.html. Any tips or solutions would be helpful.

  • Thanks, Andrew for the HTTPS guidance. I've made the updates and can get it to work, but it only works after unblocking the unencrypted content (i.e., disabling the browser's security warnings). What can I do to encrypt all my content so that it loads up without warnings? The updated code/page: dl.dropboxusercontent.com/u/253185126/CrainMapHTTPS.html – Dave Jun 16 '14 at 15:34
1

It is a bit hard to debug your issue because of the dropbox public folder hosting. The problem is that Dropbox Public URLs are served over HTTPs. To use the CartoDB.js library with HTTPs you need to make a few changes to your code.

First is to change the way you load the cartodb.css and cartodb.js libraries,

https://github.com/CartoDB/cartodb.js#quick-start

You can see the HTTPs URLs commented out in the Quick Start guide, use them instead of the normal HTTP URLs.

Second is to ensure that however you are loading tiles or sql api responses, you tell it to use HTTPS. See,

https://github.com/CartoDB/cartodb.js/blob/develop/doc/API.md#https-support

for more info about parameters in each section,

https://github.com/CartoDB/cartodb.js/blob/develop/doc/API.md#arguments https://github.com/CartoDB/cartodb.js/blob/develop/doc/API.md#arguments-2

If that turns out to solve your problem, consider changing the title of the question to reflect it so other people can find this. Something like, How to use CartoDB.js over Dropbox Public Folder (HTTPs).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.