Friday, January 11, 2013

Farmer's Market Map

We've created a Google Map of Farmer's Markets using data in FlatMerge. This post shows how FlatMerge makes it simple.

1. Grab the csv data from and upload it to FlatMerge.

2. See what's in the data. X, Y (longitude and latitude coordinates, cool!), and website are good for now.

2. Browse Google Maps API examples for some cool ways to make maps.

3. Create a lean OData query to get the fields I need.$select=x,y,website

Load markers on the map using the x/y coordinates from the JSON returned by FlatMerge query:
$.getJSON("$select=x,y,website", function (data) {
for (var i = 0; i < data.length; i++) {
var market = data[i];
var myLatLng = new google.maps.LatLng(market.y, market.x); 

4. Check it out! View the source code to see how simple it is. (Note that the code won't work using a local .html file, it must be on a real web server or localhost.)

Mobile app and how-to post coming soon...

No comments:

Post a Comment