var url = 'someurl'; var country_response; var points_response; function goAjaxCountry(){ restURL = url+'2/query'; restParm = { where:"ISO3='MDG'", f:'pjson' }; $.post(restURL, restParm, function(data, textStatus) { console.log('goAjaxCountry - ' + textStatus); console.log(data); $('#country_json').html('done'); country_response = data; goAjaxPoints(data) }, "json"); } function goAjaxPoints(geo_country){ restURL = restURL = url+ '0/query'; restParm = { where:"acq_date='2013-08-20'", f:'pjson', geometry: geo_country.features[0].geometry, geometryType: geo_country.geometryType, spatialRel: 'esriSpatialRelIntersects' }; $.post(restURL, restParm, function(data, textStatus) { console.log('goAjaxPoints - ' + textStatus); console.log(data); console.log(data.features.length) points_response = data; }, "json"); }
Solved! Go to Solution.
geometry: JSON.stringify(geo_countries.features[0].geometry)
geometry: JSON.stringify(geo_countries.features[0].geometry)