Giter Site home page Giter Site logo

googmap_zipcodebounds's Introduction

ZIP PLOTTER LIBRARY

Alt text This is the source code for a JS library that will allow you to plot zip code boundaries on a google map. There are three main components that you must consider - the application, the zipPlotter library and the server

  1. Application

There is a sample application in the 'app' directory. The files are:

/app

---lib ---- zipPlotter.js

---index.html ---index.js ---style.css

The application is pretty simple. It creates a zipPlotter object, and then draws zip code boundaries based on the inputs provided by the user using the HTML form.

  1. The ZipPlotter JS Library

You can find the entire source code for this library in the "src" folder in the project. This folder contains:

/src

---lr-maps/

    ---zipPlotter.js		
    ---helpers.js			
    ---customMarker.js		

---makeLib.js

Note: The "makelib.js" file is really just used by the npm build script in package.json

  1. App Server

This is a simple nodeJS server (in server.js) that does these things:

a. When you launch the server, it deserializes "data/data.json" (which is a huge json file containing all the zipcode data) and caches it in the RAM. This will now act like our database b. It serves the static pages of the app, so basically when you hit "http://localhost:3000", it serves up the 'app' directory c. It responds to requests that the application makes to get zip code boundary data

RUNNING THE APP

Since github doesn't allow me to upload large files, you can grab the "data" directory here: https://www.dropbox.com/sh/t1xbyvbzneq0jfh/AABrClgy44q4Xix23PKGaChGa?dl=0

Download this directory, put it in the project root and follow the instructions below. If you're simply looking to run the app, switch to the root directory at the terminal. Then type

  $> node server.js

You'll then see the server running on localhost (port 3000). Simply type in "http://localhost:3000" in your browser and you'll get the application

EDITING THE SOURCE

If you're looking to build the zip plotter library or make changes to the source code, focus your attention to the "lr-maps" folder. Once you've made your changes, switch to the project root directory at the terminal, then type:

  $> npm run build

This will launch the build script in package.json, which will in turn browserify the whole "src" folder and dump a fresh instance of "zipPlotter.js" in the app/lib directory

googmap_zipcodebounds's People

Contributors

asimmittal avatar

Watchers

 avatar  avatar

Forkers

jugghayd

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.