var NYCAPIURL = 'https://data.cityofnewyork.us/resource/43nn-pn8j.json';
var GEOCODEURL = 'https://www.mapquestapi.com/geocoding/v1/batch?key=rDz5dqQpjbkQxzs1ktmvT3qcaw0QTxNf&inFormat=kvp&outFormat=json&thumbMaps=false';
NYCAPIURL+='?$limit='+NUMRECORDS;
thestuff = loadJSON(NYCAPIURL, goforit);
createCanvas(windowWidth, windowHeight);
translate(width/2,height/2);
for(let i =0;i<NUMRECORDS;i++)
x = map(thestuff[i].lng, thestuff.lngmin, thestuff.lngmax, -width/2, width/2);
y = map(thestuff[i].lat, thestuff.latmin, thestuff.latmax, height/2, -height/2);
ellipse(x, y, 20+(d*cos(t)), 20+(d*sin(t)));
str2=thestuff[i].cuisine_description;
str3=thestuff[i].violation_description;
text(str1, x+5+(d*cos(t)), y-fontsize+(d*sin(t)));
text(str2, x+5+(d*cos(t)), y+(d*sin(t)));
text(str3, x+5+(d*cos(t)), y+fontsize+(d*sin(t)));
text(str1, x+5, y-fontsize);
text(str3, x+5, y+fontsize);
if(keyIsDown(187)) s+=1.1;
if(keyIsDown(189)) s/=1.1;
if(keyIsDown(LEFT_ARROW)) tx+=20/s;
if(keyIsDown(RIGHT_ARROW)) tx-=20/s;
if(keyIsDown(UP_ARROW)) ty+=20/s;
if(keyIsDown(DOWN_ARROW)) ty-=20/s;
for(let i =0;i<NUMRECORDS;i++)
let a = thestuff[i].building + ' ' + thestuff[i].street + ' ' + thestuff[i].boro + ' ' + thestuff[i].zipcode;
GEOCODEURL+='&location='+a;
locationdata = loadJSON(GEOCODEURL, geocoded);
for(let i = 0;i<NUMRECORDS;i++)
thestuff[i].lat = locationdata.results[i].locations[0].latLng.lat;
thestuff[i].lng = locationdata.results[i].locations[0].latLng.lng;
thestuff.latmin = 40.7527 - 0.2;
thestuff.latmax = 40.7527 + 0.2;
thestuff.lngmin = -73.9772 - 0.2;
thestuff.lngmax = -73.9772 + 0.2;