Skip to content

A sample starter kit for using the Google Geocode API and plotting those points on a map, complete with caching of results.

License

Notifications You must be signed in to change notification settings

theothermattm/maps-geocode-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Geocoder and Point Plotter for Google Maps Javascript API

Intended to get you going fast when you need to plot points on a map based on address. I found Google Maps' samples didn't quite nail this, especially since if you have a long list of points you quickly hit usage limits with Google's Geocoding API's

This sample is based on samples from: https://github.com/googlemaps/js-samples.

It will take in a set of US addresses in data.js, geocode them, then plot them on a map of the US.

The project is intelligent enough to avoid Geocoding if you already have points in the data.js file and will store the geocoded information in localstorage to avoid many calls to the Google Geocoding API which has some pretty strict API usage limits.

To get started

Register an API key for Google Maps.
Your ID will need permissions for the Maps Javascript API and Geocoding API

Put your API at the bottom of index.html in the <script> tag which pulls in the Google Maps API.

Then cp data/data.js.template data/data.js populate your data in data/data.js.

Then load it up in your browser.

About

A sample starter kit for using the Google Geocode API and plotting those points on a map, complete with caching of results.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published