Solved! Go to Solution.
Knightdo,
To understand what's happening try this simple exercise.. Publish a mxd document as map service and use it in SLViewer. Now, open the mxd document in ArcMap and pan, zoom the layer. Will the zoom/pan change reflect in SLViewer? No.
That's exactly what's happening here as well. The gpservice is updating the layer extent in the map document. But, it will not affect the map service.
The SLviewer communicates to MapService and GPService and brings together their functionality at the web browser. In other words, GPService is unaware of map service and vice versa.
You have started out in the right direction, but we need to tweak our logic a bit to accomplish what you are trying to do here.
1. The GPService need to communicate the selected features to SLViewer.
2. The SLViewer should update the map service extent accordingly.
To accomplish Step 1:
Update your python code to create a output parameter.
#uncomment Select_Analysis
arcpy.AddMessage (where_clause)
arcpy.Select_analysis(in_features, out_features, where_clause)
arcpy.SetParameterAsText(1,out_features)
To accomplish Step 2:
The SLViewer will draw the output features as a layer.
Use the Zoom To Layer tool in SLViewer to zoom to gp output feature layer.
Hope that helps!