Giter Site home page Giter Site logo

leaflet-airtable's Introduction

description

This is a proof-of-concept that shows how an Airtable "base" can be used as the data backend for a web map built with LeafletJS.

For security reasons, a caching layer is implemented. A python script is used to download the airtable content into a .json file, and leaflet reads that file directly. This keeps your airtable api key out of the Leaflet request, and also gives you control over how frequently your app hits the airtable api.

Suggested implementation of this caching is to make a cronjob/scheduled task that runs update_table_data.py frequently, creating a close-to-realtime link between your table and your map.

view the example

  1. Create a new airtable base, and make a table that has the following headers:

     name,address,hours,latitude,longitude
    

    There is no geocoding implmented; you must fill out the latitude and longitude fields.

  2. Publish the table to the web

  3. Clone/download this repo contents

  4. Go to https://airtable.com/api and view the api for your new base

  5. In update_table_data.py, insert the necessary credentials from the api page

  6. Run python update_table_data.py

  7. Open index.html in a browser

Be careful not to commit your api key to version control.

leaflet-airtable's People

Contributors

mradamcox 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.