Git Product home page Git Product logo

carto_doodle's Introduction

carto_doodle

Carto Doodle is a simple map geometry drawing and editing interface that uses CartoDB for data storage and visualization. This is a very stripped-down app, developed to achieve a basic function - to allow users to draw and edit any number and type of map geometries. I have not done any styling apart from what is minimally necessary. I am sure that there are many places that the code can be improved, but I have tried to present it here in very basic units so that others may use it and customize it as they see fit.

Working demo:
Drawing tool - http://field-set.com/carto_doodle/index.html
Editing tool - http://field-set.com/carto_doodle/admin.html

Instructions

  1. If you don't have a CartoDB account, go to https://cartodb.com and create one - you will not need anything more than the basic free account.

  2. Go to 'datasets' and create three new tables, calling them 'carto_doodle_point', 'carto_doodle_line', and 'carto_doodle_polygon'. Of course, you can actually call these tables anything you like, but this example is set up for these names.

  3. In each table, create a column called 'notes'. While you are in each table, also click on 'Edit' and change the privacy to 'With link'.

  4. In your CartoDB account tab, make note of your API key - you will need this for the PHP database connection files.

  5. In the carto_doodle_admin.js file, replace the three instances of 'YOUR_USERNAME_HERE' in the url_array variable with your CartoDB user name.

  6. In the two db_connection PHP files, set the $cartodb_username and $api_key variables to match your information.

  7. Upload these files to a directory called 'carto_doodle' on your webserver (you can't create, update, or delete data from a local development server, although you can read it) and you are good to go.

A few other thoughts

  • This tool relies on the Leaflet Draw and CartoDB APIs. For more information on how to work with these and make Carto Doodle your own, check out https://github.com/Leaflet/Leaflet.draw and http://docs.cartodb.com/cartodb-platform/sql-api/
  • When creating note content, or editing/deleting geometries or notes in either mode, be aware that your changes must be saved in order to be submitted. I've added a save button to the note popups (in both drawing and editing modes), but map geometry changes and deletions must be saved by clicking the save tab that extends from the drawing tools after changes have been made.

Update - 5/16/16 The data insert/update/delete process has been greatly simplified. In the earlier version of Carto Doodle, every new, updated, and deleted map geometry was sent to CartoDB as a separate cURL; this updated version greatly simplifies that process. On submitting new map geometries, only one cURL is sent to each destination with one insert statement containing all of the new geometries to be inserted; similarly, from the admin page, there is one cURL per destination for updates and one cURL per destination for deletions.

Update - 7/21/16 See my repo 'GeoJSON Doodler' - https://github.com/darrenklein/geojson_doodler - for a simplified (but probably more useful) tool that allows users to draw and export GeoJSONs to .csv.

carto_doodle's People

Contributors

darrenklein avatar

Stargazers

Anurag Saxena avatar Will Skora avatar Eric Brelsford avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.