Export image from query

631
4
10-25-2011 09:02 AM
spencermartin
New Contributor
Using rest api I need the bbox values from a query in order to export an image.  What is the easiest way from rest to query a field from a MapService and return the extent to then export that image?
0 Kudos
4 Replies
HemingZhu
Occasional Contributor III
Using rest api I need the bbox values from a query in order to export an image.  What is the easiest way from rest to query a field from a MapService and return the extent to then export that image?


esri.graphicsExtent(featureSet.features).
0 Kudos
spencermartin
New Contributor
Ok, that was helpful. Using the find feature I've retrieved the graphic and passed it to graphicsExtent.  Question I have now is how to make graphic extent zoom to extent of the found object.  This is without a map since I only want min max to create export image.
0 Kudos
HemingZhu
Occasional Contributor III
Ok, that was helpful. Using the find feature I've retrieved the graphic and passed it to graphicsExtent.  Question I have now is how to make graphic extent zoom to extent of the found object.  This is without a map since I only want min max to create export image.


extent =esri.graphicsExtent(featureSet.features).
var src ="http://yourMapService/export?bbox="+extent.xmin+","+extent.ymin+","+extent.xmax+","+extent.ymax+"&f=image"
0 Kudos
spencermartin
New Contributor
Thanks for your quick and helpful solutions. Works perfectly.
0 Kudos