Following this GIS SE answer, on this example I remove all interaction on the map so the zoom, panning and any other events are not fired.
On this example we add and remove a layer from a Google Maps Instance.
The thing is you need to explicitely disable the interaction and then execute the off()
method in order to completely detach the layer from the map object, otherwise events will still be triggered and you'll have more than one infowindows and several log lines on the console.
On this style example we load a Torque layer that uses a SVG marker. This option is at this moment not available at the CartoDB editor so you need to edit the layer CartoCSS after selecting your options.
Small utility to geocode using the nice Mapzen Search geocoder.
This tool simply encodes the first argument and passes it to curl. The result is passed to jq to extract the first result and then using json2csv converts the array result into a couple of coordinates.
So using it is as easy as:
% geocode.sh "valencia"
"Valencia, Municipio Valencia, Venezuela",-68.00765,10.16202,0.947
% geocode.sh "valencia,spain"
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Named Maps Tutorial | CartoDB</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" /> | |
<style> | |
html, body, #map { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Named Maps Tutorial | CartoDB</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" /> | |
<style> | |
html, body, #map { |
Default CartoDB infowindows are rendered using moustache.js templates. The variables you can pass are normally used to render data on the infowindow but you can also use them on other parts of the markup, like using them as CSS property styles to apply to element sizes or colours.
On this map, the infowindow show the percentage of votes of the three most voted parties by municipality. Apart from showing the result as a number, and thanks to some SQL juggling (check the complete query on this cdb-fiddle) you can also have a bar with the representative color of the party and a proper width.
See below the details of the infowindow templat
En este taller se describe el proceso de creación de diversos mapas electorales con CartoDB, enfocado sobre todo al tratamient o de los datos y las reglas de simbolización cartográfica.
http://bit.ly/cdb-elecciones-151203
Contacto:
With Jorge Sanz (@xurxosanz - [email protected]), materials from Mamata Akella (@mamataakella) and Andy Eschbacher (@MrEPhysics)
Slides here
We are going to be using a dataset of 2012 Presidential Election Results from Data.gov. To make it easier tonight, we made a simplified version.
Thi session is oriented for unexperienced users on CartoDB. It will also present a short introduction to the platform as well as their main components and principal use cases.
- Upload and data management
- Editing and querying data on the platform