couchmap displays map markers that are stored in a CouchDB. See it in action!
CouchMap uses
- CouchDB as the database storing the marker data: any JSON document with a latitude and longitude can be used.
- GeoCouch as a spatial index in order to make fast bounding box queries.
- a 2-level scheme:
- coarse: if the number of markers in the current viewport exceeds a configurable limit, then CouchMap uses a coarse view with clusters. The clusters are precomputed with a map/reduce in CouchDB and only a minimum of information is transferred. This allows you to display a global overview even with a massive amount of markers.
- fine: if the number of markers in the current viewport is small enough, then all of these markers are transferred from the CouchDB.
- Backbone models and collections: you don't need to mess around with the details. The collections even receive live updates from the CouchDB (bow to CouchDB's changes feed)!
- Backbone views for Leaflet to actually display the markers with a nice and mobile-friendly HTML5 interface.
CouchMap is split into modules that reside in separate repositories. Each repository is an npm
module that can be require
'd (for example with browserify on the client side):
- couchmap-common: code for CouchDB and code that is shared between the CouchDB and the client side.
- couchmap-backbone: backbone models/collections for retrieving the data on the client.
- couchmap-leaflet: backbone views for displaying the models/collections with leaflet.
- CouchDB with GeoCouch plugin
- npm
- bower (
npm install -g bower
) - grunt (
npm install -g grunt-cli
)
- Clone the repo
- Copy
couchconfig.json.example
tocouchconfig.json
and adapt to your CouchDB installation. - Run
npm install
andbower install
. - Either
- Run
grunt
to start a local webserver (reachable viahttp://localhost:9000
). - Run
grunt push --couch dev
to push the design doc to your couch (here it's thedev
config incouchconfig.json
).
- Run