Skip to content
generic map explorer for CartoDB
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples
lib
src
.gitignore
README.md

README.md

MapDig - generic map explorer for CartoDB

Generate a simple map explorer for CartoDB public tables using the awesome dat.gui.js by Google.

Requirements

  • The cartodb-gmapsv3 map library
  • A CartoDB user name.
  • A public table name.

Example

var carto_user = prompt("Please enter your CartoDB username");
var table      = prompt("Please enter the table to explore");
var ignore     = [];          // columns you don't want to include in your GUI
var width      = 300;         // width of your GUI in pixels
var mapdig     = new MAPDIG.create(carto_user, table, ignore, width);

// initialise the google map
var map = new google.maps.Map(document.getElementById('map_canvas'), {
  center: new google.maps.LatLng(20,0),
  zoom: 3,
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  mapTypeControl: false
});

// initialize the CartoDB layer (see: https://github.com/Vizzuality/cartodb-gmapsv3)
var cartodb1_gmapsv3 = new google.maps.CartoDBLayer({
  map_canvas: 'map_canvas',
  map: map,
  user_name: mapdig.carto_user,
  table_name: mapdig.table,
  query: mapdig.SQL,
  auto_bound: true,
  map_style: true,
});

// initialize the generic GUI
mapdig.init(cartodb1_gmapsv3);

Credits

Something went wrong with that request. Please try again.