This example pulls data live from this State of Connecticut directory of schools via the SODA API.
To start, we’ll build our SoQL query. Our query filters our results by the
organization_type column to only
Public School Districts:
Then we initialize our map and center it on Trenton, CT:
To retrieve our records from Socrata, we’ll use jQuery’s
$.getJSON. We’ll then iterate through the records one by one by using the
$.each utility function:
Finally, for each entry we’ll create a new Google Maps Marker on our map:
To finish it up, we wrap the whole thing in jQuery’s
$(window).load function so that it gets run when the DOM is done loading. The full code listing is below:
That’s all it takes! If you’ve got a walk-through of your own that you’d like to share, we’ll gladly accept your contribution.