Hi, i have created some code which does the following:
1) user clicks on the map (red pin)
2) a circle is created, based on the point in step 1, and queries the feature layer for items within the radius (50 meters (?))
3) results are displayed on map (blue pins)
<SPAN class="keyword token">var</SPAN> x <SPAN class="operator token">=</SPAN> e<SPAN class="punctuation token">.</SPAN>mapPoint<SPAN class="punctuation token">.</SPAN>x<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> y <SPAN class="operator token">=</SPAN> e<SPAN class="punctuation token">.</SPAN>mapPoint<SPAN class="punctuation token">.</SPAN>y<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> spatial <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SpatialReference</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN> wkid<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">102100</SPAN><SPAN class="punctuation token">,</SPAN> latestWkid<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">3857</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> point <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Point</SPAN><SPAN class="punctuation token">(</SPAN>x<SPAN class="punctuation token">,</SPAN> y<SPAN class="punctuation token">,</SPAN> spatial<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
qGeom <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Circle</SPAN><SPAN class="punctuation token">(</SPAN>point<SPAN class="punctuation token">,</SPAN><SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"radius"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">50</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"spatialReference"</SPAN><SPAN class="punctuation token">:</SPAN>point<SPAN class="punctuation token">.</SPAN>spatialReference
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// use the circle for the query geometry </SPAN>
qParcels<SPAN class="punctuation token">.</SPAN>geometry <SPAN class="operator token">=</SPAN> qGeom<SPAN class="punctuation token">;</SPAN>
qParcels<SPAN class="punctuation token">.</SPAN>outFields <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">"UFRM_BLPU_POINT_ADDRESS"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN>
qParcels<SPAN class="punctuation token">.</SPAN>returnGeometry <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">;</SPAN>
parcels <SPAN class="operator token">=</SPAN> queryTask<SPAN class="punctuation token">.</SPAN><SPAN class="token function">execute</SPAN><SPAN class="punctuation token">(</SPAN>qParcels<SPAN class="punctuation token">,</SPAN> showResults<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Ok, so all of the above works perfectly client side using the jsapi 3.29.
I now want to take the above functionality and replicate it in the Query Builder. I've used Chrome developer tools to try and mimic the request, but i don't have the full picture.
Here is what i have so far. I'm getting an error when setting the Geometry to 'esriGeometryPolygon' 'geometry' parameter is invalid (I assume esriGeometryPolygon is what i should be using as that's what i located in dev tools). I'm also not sure how i set the circle.
Can someone help me with the combination of settings?
thanks
