Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cartodb/labs-multilayer
https://github.com/cartodb/labs-multilayer
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cartodb/labs-multilayer
- Owner: CartoDB
- Created: 2015-02-06T11:18:31.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-11T18:36:53.000Z (over 9 years ago)
- Last Synced: 2024-04-09T20:58:17.589Z (7 months ago)
- Language: HTML
- Size: 236 KB
- Stars: 12
- Watchers: 15
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Toggle layers in CartoDB
Multilayer is achieved through an angularjs-based selector (to keep HTML as clean and self-contained as possible) and a basemap-agnostic (i.e. it works with Leaflet, Google maps or whatever) logic.
One layer per visualization and one visualization per layer.
Example URL:
http://multilayer.cartodb.io/multilayer.html?u=dcarrion&t=multilayer&v=9c5ed27c-ad4f-11e4-ae79-0e853d047bba&tt=Multilayer%20map&d=Description%20test
URL params:
* u: username
* t: table with the layers
* v: viz.json UUID for the basemap (this visualization may contain data as well, but please remember this layer is *not* included in the selector and can't be hidden)
* tt: Title of the map
* d: Description - Keep it short!Required row fields in the layer table:
* cartodb_id: not used
* the_geom: not_used
* name: name to appear in the selector
* show: true if layer is to be displayed initially
* viz_json: URL for the viz.json that corresponds to the visualization (takes precedence over sql and cartocss)
* sql: SQL query for the data in the layer (used if viz_json is not present)
* sql_user: user name for the SQL query (used if viz_json is not present)
* cartocss: CartoCSS for the layer (used if viz_json is not present)
* interactivity: Fields to interact with for the layer (used if viz_json is not present)
* created_at: not used
* modified_at: not used