Select to view content in your preferred language

Export image from query

864
4
10-25-2011 09:02 AM
spencermartin
Emerging 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
Frequent 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?


esri.graphicsExtent(featureSet.features).
0 Kudos
spencermartin
Emerging 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
Frequent 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.


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