Git Product home page Git Product logo

google-maps-plotting-by-zip-code's Introduction

EXAMPLE
=======================================================================================
A working example can be seen here: 
http://jonathanwkelly.com/Google-Maps-Plotting-by-Zip-Code/example.php


REQUIREMENTS
=======================================================================================
[1] Google Maps API key: this code will not work until you generate your own and replace 
    it in the code. Get a key here: http://code.google.com/apis/loader/signup.html
	
[2] MySQL & PHP running on your server: these are just the tools being used to generate 
    the lat & long JS objects. You could just as easily use another language & DB.


IMPLEMENTATION
=======================================================================================
There are two components to making this work. The first is the server-side code that 
takes a zip code, does a lookup to get the latitude and longitude. The second is the 
client-side code that initializes the Google map and does the plotting. In the example
file, the PHP code is embedded within JS script tags, so that the echo'd output is
rendered as a JS object. The map.js file then uses this object to plot its points.


MYSQL TABLE
=======================================================================================
Regarding the us_zip_codes.sql file, it contains the queries to build a zip -> lat/long 
reference table. I have scrubbed the table of the lower zip codes (those under 1000). 
First, because doing a cursory look I couldn't seem to validate those zip codes, and 
secondly I was getting duplications in the zip codes that they were being mapped to. 
When I dropped all zip codes under 1,000, the duplicates were all gone. If you'd like 
to get the table containing the duplicates, then use the corresponding 
us_zip_codes.with_duplicates.sql file. 

google-maps-plotting-by-zip-code's People

Contributors

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